Bug 477896

Summary: Spectacle freezes when I try to finish a screen recording
Product: [Frameworks and Libraries] KPipeWire Reporter: Patrick Silva <bugseforuns>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: CONFIRMED ---    
Severity: normal CC: aleixpol, antti.savo, correosinuso23, fanzhuyifan, kde.eardrum612, kde, nate, noahadvs, opensource, yuntaz
Priority: NOR Keywords: qt6
Version: unspecified   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=478162
https://bugs.kde.org/show_bug.cgi?id=489434
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Noah's backtrace

Description Patrick Silva 2023-12-02 08:21:17 UTC
STEPS TO REPRODUCE
1. use Wayland
2. record in full screen mode
3. try to finish the screen recording

OBSERVED RESULT
Spectacle freezes

EXPECTED RESULT
screen recording is finished

SOFTWARE/OS VERSIONS
Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.81.80
KDE Frameworks Version: 5.245.0
Qt Version: 6.6.0
Graphics Platform: Wayland
Comment 1 Nate Graham 2023-12-05 21:23:23 UTC
Cannot reproduce.
Comment 2 Tupac 2023-12-12 21:49:51 UTC
I can reproduce this in fedora rawhide and opensuse krypton, recording either fullscreen or window has this problem, rectangular region seems to work.
I though this could be a nvidia problem but it happens on proprietary and free nvidia drivers and also on a VM
Comment 3 Noah Davis 2023-12-13 16:36:15 UTC
I can reproduce this.
Comment 4 Noah Davis 2023-12-13 16:38:32 UTC
Oddly, I can record the screen without freezing if I start the screen recording after doing a different type of recording.
Comment 5 Noah Davis 2023-12-13 17:06:01 UTC
Created attachment 164143 [details]
Noah's backtrace

Based in the fact that no Spectacle C++ files are mentioned in the backtrace and I do see KPipeWire C++ files, I think this might be a KPipeWire bug.
Comment 6 Noah Davis 2023-12-15 17:22:23 UTC
It didn't used to happen, but now I'm sometimes getting this bug with all recording modes. I think it's the same bug as this because the backtraces look the same.
Comment 7 yuntaz 2024-01-14 03:21:11 UTC
I also encounter this issue with Spectacle's full-screen recording that began with Fedora Kinoite Rawhide.20231224.n.0 and persists in later versions. This problem only occurs when attempting to record in full-screen mode.

Packages Downgraded from Rawhide.20231224.n.0 to Rawhide.20231223.n.0:
  libssh 0.10.6-2.fc40 -> 0.10.6-1.fc40
  libssh-config 0.10.6-2.fc40 -> 0.10.6-1.fc40
  nspr 4.35.0-17.fc40 -> 4.35.0-16.fc40
  nss 3.96.1-1.fc40 -> 3.95.0-1.fc40
  nss-softokn 3.96.1-1.fc40 -> 3.95.0-1.fc40
  nss-softokn-freebl 3.96.1-1.fc40 -> 3.95.0-1.fc40
  nss-sysinit 3.96.1-1.fc40 -> 3.95.0-1.fc40
  nss-util 3.96.1-1.fc40 -> 3.95.0-1.fc40
Comment 8 Antti Savolainen 2024-02-05 14:53:05 UTC
Is this a correct repro of this?: https://www.youtube.com/watch?v=kT56-uTEqwE

The trick is that you need to record a screen twice in a row. I have replicated this with Rectangular Region and Full Screen.

Or are these two different freezes?
Comment 9 Kacper Koniuszy 2024-07-14 10:21:32 UTC
I have this problem and it affects all types of recording - full screen, window, region.

I have spectacle set up to record h264 videos in the .mp4 container. 
When recording is stopped, these entries appear in its log and it freezes completely:
spectacle[461481]: *** impl_ext_end_proxy called from wrong context, check thread and locking: Not in loop
spectacle[461481]: *** pw_stream_destroy called from wrong context, check thread and locking: Not in loop

The recording can be seen in /tmp/Spectacle.xxxxxx/Screencast_yymmdd_hhmmss.mp4 and it plays back fine with no errors/warnings at all in the mpv output. It looks as if it's saved correctly, but Spectacle hangs when trying to stop the Pipewire screen capture and it doesn't get to move the screencast from the temp dir to the target.
Comment 10 Kacper Koniuszy 2024-07-14 10:24:20 UTC
I forgot to mention my versions:

* Spectacle 24.05.2
* KDE Frameworks 6.3.0
* KPipeWire 6.1.2
* Qt 6.7.2
* Pipewire 1.2.0
Comment 11 Kacper Koniuszy 2024-07-14 10:30:09 UTC
(In reply to Kacper Koniuszy from comment #10)
> * Pipewire 1.2.0

Ah, it's bug 489434 and a patch is mentioned there. Sorry for sending three comments in a row. Anyways, if you stumbled upon this bug report, you might want to check if you have pipewire 1.2.0 – if so, it's probably that bug and not this one, the symptoms are basically the same though. I'll add it to "See Also".
Comment 12 Ferdinand 2024-07-15 08:46:20 UTC Comment hidden (spam)