SUMMARY Libtaskmanager's buffer for spa_builder (see https://invent.kde.org/plasma/plasma-workspace/-/blob/master/libtaskmanager/declarative/pipewiresourcestream.cpp#L187) is too small on certain configurations. Because podBuilder->state.offset is never reset (https://gitlab.freedesktop.org/pipewire/pipewire/-/blob/master/spa/include/spa/pod/builder.h), the buffer space can run out when EGL returns a long list of dma_buf modifiers, causing PipeWire negotiation to fail. An example is when EGL returns 20 modifiers. There are 6 formats defined in pipewiresourcestream.cpp, for each format it will construct 2 frames, one with 21*8=168 bytes long of modifiers. The modifier lists for all frames will be 6*168=1008 bytes (only 16 bytes left of 1024 bytes), let alone other frames. This seems to be the root cause for Bug 445461, but does not resolve Bug 444107 completely. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Debian testing KDE Plasma Version: 5.23.3 KDE Frameworks Version: 5.86.0 Qt Version: 5.15.2
The actual offending line is https://invent.kde.org/plasma/plasma-workspace/-/blob/master/libtaskmanager/declarative/pipewiresourcestream.cpp#L263, not line 187.
*** Bug 446553 has been marked as a duplicate of this bug. ***
*** Bug 443719 has been marked as a duplicate of this bug. ***
I can confirm oiiu19's findings. My bugreport https://bugs.kde.org/show_bug.cgi?id=446553 states the details. I've modified the source code as suggested by oiiu19 to increase the buffer size from 1024 to 4096 and that restored the ability to view task manager previews in a wayland session. I'm not saying 4096 buffer size is the optimal value here, it was the just first value that I tried and it worked.
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1262
oiiu19 if you give me your full name, I'll put you as the commit author.
I would like to stay anonymous due to personal reasons.
*** Bug 446709 has been marked as a duplicate of this bug. ***
Guess this didn't get merged in time for 5.23.5?
Git commit 926f864756e5586f38574c166abdb5befa3dc771 by Nate Graham, on behalf of David Edmundson. Committed on 06/01/2022 at 17:38. Pushed by ngraham into branch 'master'. [libtaskmanager] Increase buffer for pipewire format negotiation Libtaskmanager's buffer for spa_builder is too small on certain configurations. Because podBuilder->state.offset is never reset, the buffer space can run out when EGL returns a long list of dma_buf modifiers, causing PipeWire negotiation to fail. An example is when EGL returns 20 modifiers. There are 6 formats defined in pipewiresourcestream.cpp, for each format it will construct 2 frames, one with 21*8=168 bytes long of modifiers. The modifier lists for all frames will be 6*168=1008 bytes (only 16 bytes left of 1024 bytes), let alone other frames. M +1 -1 libtaskmanager/declarative/pipewiresourcestream.cpp https://invent.kde.org/plasma/plasma-workspace/commit/926f864756e5586f38574c166abdb5befa3dc771