Bug 492283 - Spectacle under Wayland can pagefault, crashing KDE while recording video
Summary: Spectacle under Wayland can pagefault, crashing KDE while recording video
Status: RESOLVED DUPLICATE of bug 488896
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 24.08.0
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: Noah Davis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-27 19:37 UTC by ase1590
Modified: 2025-03-07 14:52 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ase1590 2024-08-27 19:37:29 UTC
When attempting to record a screen region with spectacle the following will happen, depending on the encoder:

- Webm: upon selecting a screen region to record, spectacle will quickly begin dropping frames, see htqtps://gist.github.com/ase1590/9f8db82e1991359e8e99cdf8dc9eb1a2

- MP4: This one is worse, as attempting to record in this mode leads to an amdgpu page fault and will cause KDE as a whole under wayland to crash/freeze.
https://gist.github.com/ase1590/0d22ca342a412d025411e6d320797468

OS: Arch Linux
Kernel: 6.10-6-arch1-1
KDE Plasma version: 6.1.4
KDE Framework version: 6.5.0
Qt Version: 6.7.2
Platform: Wayland
CPU: Ryzen 5 3600X
GPU: AMD Radeon RX 7900 XTX
Comment 1 ase1590 2024-08-27 19:41:31 UTC
The gist link seems to have gotten mangled. 

Here they are for clarity: 

- webm: https://gist.github.com/ase1590/9f8db82e1991359e8e99cdf8dc9eb1a2
- mp4: https://gist.github.com/ase1590/0d22ca342a412d025411e6d320797468
Comment 2 ase1590 2024-08-27 20:26:50 UTC
looking into this a bit, I see that 24.08.0 was released, which has wayland specific commits.

After updating to that version, it appears that the MP4 output now works as expected instead of page faulting the GPU. 
However, the Webm output is still showing the same frame dropping behavior, leading to a near unusable output when using webm.
Comment 3 ase1590 2024-08-27 20:34:43 UTC
Seems I spoke to soon for
Comment 4 ase1590 2024-08-27 20:39:30 UTC
Seems I spoke too hastily for 24.08. However I have discovered a further quirk of the MP4 output.

MP4 output will only work if the output resolution of the rectangle select is an even number. If it is not, it will page fault the AMD driver, leading to a total KDE crash. 

Tests resolutions:
- 960h,720w: works fine, and continues working fine after three tests. 
- 961h, 721w: will cause the AMD driver to pagefault, crashing the system. 


as stated earlier, the webm format drops frames making it unusable, but does not crash the system like MP4 output does.
Comment 5 Cherkah 2024-09-03 11:25:30 UTC
i have nvidia as gpu but:

`` - Webm: upon selecting a screen region to record, spectacle will quickly begin dropping frames, ``

i've also observed this issue when i was recorded about a bug related with plasmashell (@ 492585) .
thus i changed the codec in spectacl from Webm to Mp4 so as to experienced a better record, and boom:

`` - MP4: This one is worse, as attempting to record in this mode leads to an amdgpu page fault and will cause KDE as a whole under wayland to crash/freeze.
``
Kcrash & drkonqi waked up and you know the rest of the story.

Operating System: EndeavourOS 
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.10.7-arch1-1 (64-bit)
Graphics Platform: Wayland
double screens
Comment 6 Cherkah 2024-09-03 11:37:20 UTC
(In reply to ase1590 from comment #0)
> When attempting to record a screen region with spectacle the following will
> happen, depending on the encoder:
> 
> - Webm: upon selecting a screen region to record, spectacle will quickly
> begin dropping frames, see
> htqtps://gist.github.com/ase1590/9f8db82e1991359e8e99cdf8dc9eb1a2
> 
> - MP4: This one is worse, as attempting to record in this mode leads to an
> amdgpu page fault and will cause KDE as a whole under wayland to
> crash/freeze.
> https://gist.github.com/ase1590/0d22ca342a412d025411e6d320797468
> 
> OS: Arch Linux
> Kernel: 6.10-6-arch1-1
> KDE Plasma version: 6.1.4
> KDE Framework version: 6.5.0
> Qt Version: 6.7.2
> Platform: Wayland
> CPU: Ryzen 5 3600X
> GPU: AMD Radeon RX 7900 XTX

I just made a recording via Spectacl in MP4 and this time things went well: no show crash, no frame loss, lag and other problems of the kind.

the only problem observed is the absence of the "recording icon" which should normally appear in the thumbnail box.
So I open another bug concerning the absence of a Spectacle icon in the thumbnail box during a screen recording.
Comment 7 Ben 2024-10-14 10:38:53 UTC
Spectacle Version: 24.08.2

Condition of KDE Plasma Crash: MP4 Output is selected with either Rectangular Region or Window Selected
Tested Under: Wayland


DATE: Monday the 14th of October, 2024

KDE INFO:

Operating System: openSUSE Tumbleweed 20241012
KDE Plasma Version: 6.2.0
KDE Frameworks Version: 6.7.0
Qt Version: 6.7.3
Kernel Version: 6.11.2-1-default (64-bit)
Graphics Platform: Wayland
Processors: 12 × 11th Gen Intel® Core™ i5-11500 @ 2.70GHz
Memory: 31.2 GiB of RAM
Graphics Processor: AMD Radeon RX 6600
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: H510M DS2V

NOTE: Recording Full Screen works perfectly fine
Comment 8 ase1590 2024-11-12 17:56:51 UTC
Spectacle Version: 24.08.3

KDE Plasma Version: 6.23
KDE Frameworks Version: 6.8.0
Qtversion: 6.8.0
Kernel Version: 6.11.6-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: Ryzen 5 3600X
Memory: 31.3 GiB of RAM
Graphics Processor: AMD Radeon RX 7900 XTX


MP4 at least seems to be working now on wayland without any crashes.
WebM  however still drops frames after a few seconds when recording with a rectangular frame at 966x721
This results in the following repeated error:

`kpipewire_record_logging: Filter queue is full, dropping frame`
Comment 9 ase1590 2024-11-12 17:59:31 UTC
Spectacle Version: 24.08.3
KDE Plasma Version: 6.23
KDE Frameworks Version: 6.8.0
Qtversion: 6.8.0
Kernel Version: 6.11.6-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: Ryzen 5 3600X
Memory: 31.3 GiB of RAM
Graphics Processor: AMD Radeon RX 7900 XTX


WebM  still drops frames after a few seconds when recording with a rectangular frame at 966x721
This results in the following repeated error with kpipewire:

`kpipewire_record_logging: Filter queue is full, dropping frame`
Comment 10 ase1590 2024-11-12 18:00:52 UTC
Based on other info, I think this webm bug is now in the related to the following item:

https://bugs.kde.org/show_bug.cgi?id=488896
Comment 11 Nate Graham 2025-03-07 14:52:38 UTC
The WebM/VP9 frame drop issue is indeed Bug 488896. Marking as a duplicate of it.

The issue with MP4 not recording with certain dimensions was Bug 485733, which is now fixed.

*** This bug has been marked as a duplicate of bug 488896 ***