Created attachment 164356 [details] Recording output if H264 is selected in Spectacle SUMMARY My laptop has both an integrated AMD GPU as well as a discrete AMD GPU, and the display is connected to the integrated GPU. Both GPUs support VAAPI, and use the same driver, however the discrete GPU is listed first in lspci, and the discrete GPU is both /dev/dri/card1 and /dev/dri/renderD128, while the integrated/primary GPU is /dev/dri/card2 as well as /dev/dri/renderD129. This means that KPipeWire will see the discrete GPU first and use that for hardware encoding, and not only does that result in higher power usage as well as slowing down startup of apps using KPipeWire to record video (like Spectacle, see bug 476866), it also seems to cause the video output to be corrupt, with nothing from the original source visible in the recording. If I modify KPipeWire's code to instead select the integrated GPU, the output recording is slightly better in that I can make out some bits of the original source, but it is still unusably corrupt. I am filing this under KPipeWire since krdp is also affected when I tried it (the video on the client looks the same as the Spectacle recordings), and in that case it is a bigger problem since krdp only supports H.264. STEPS TO REPRODUCE 1. Have a laptop with both an AMD integrated GPU and an AMD discrete GPU 2. Open Spectacle 3. Change its output format to H.264 4. Try to record the screen/region OBSERVED RESULT The output recording appears corrupt. EXPECTED RESULT The output recording matches what was recorded. SOFTWARE/OS VERSIONS Operating System: Arch Linux KDE Plasma Version: 5.91.90 KDE Frameworks Version: 5.248.0 Qt Version: 6.6.1 Kernel Version: 6.6.7-arch1-1 (64-bit) Graphics Platform: Wayland Processors: 16 × AMD Ryzen 7 6800H with Radeon Graphics Memory: 30.6 GiB of RAM Graphics Processor: AMD Radeon 680M + AMD Radeon RX 6650M Graphics Driver: Mesa 23.3.1 ADDITIONAL INFORMATION When recording with either GPU, Spectacle shows this message in its terminal output: [h264_vaapi @ 0x7fc31824cac0] Driver does not support some wanted packed headers (wanted 0xd, found 0x1). When recording with the integrated GPU, additional messages like these appear: EE ../mesa-23.3.1/src/gallium/drivers/radeonsi/radeon_vcn_enc_1_2.c:1224 radeon_enc_encode_params UVD - DCC surfaces not supported.
Created attachment 164357 [details] Recording output if KPipeWire is patched to use the integrated GPU With the integrated GPU I can make out bits of Konsole as well as my wallpaper in the recording, all I'm doing in the recording is switching virtual desktops. Also, the way I made KPipeWire use the integrated GPU is just by making it select the second device it sees instead of the first one, so definitely a hack and not upstreamable.
Just retested this with KWin at commit ef41fa8e8fd869ddfc511264a5bfbf4384fad12a and KPipeWire at commit 2c1b2e3d21c338c77d990156a3b25d8f9bbe9fb3, and the recordings look fine now, both when using the discrete GPU as KPipeWire does out of the box and when KPipeWire is patched to always use my integrated GPU, so looks like this bug is fixed now!