`trigger_done` callback does not get called sometimes
- PipeWire version (
pipewire --version
): 1.0.0 - Distribution and distribution version (
PRETTY_NAME
from/etc/os-release
):Fedora Linux 38 (Thirty Eight)
- Desktop Environment: Qubes OS
- Kernel version (
uname -r
):6.1.62-1.qubes.fc37.x86_64
Description of Problem:
The trigger_done
callback does not always get called, especially if a client exits abnormally.
How Reproducible:
Usually reproduces within 5 or less attempts.
Steps to Reproduce:
- Write a custom audio sink drives the graph, and which depends on
trigger_done
being called before it will trigger the graph again. - Run
while pw-play /usr/share/sounds/alsa/Front_Right.wav; do :; done
. - Press Ctrl-C.
- Go back to step 2.
Eventually audio will stop playing. Logging reveals that .trigger_done
is never called.
The only in-tree uses of .trigger_done
appear to be two video examples and a test that offsetof(struct pw_stream_events, trigger_done)
is correct. I suspect this is why nobody has found this bug before. However, the code I am currently working requires that .trigger_done
be called — if it isn’t, the graph deadlocks.
The problem seems to only reproduce if the module is loaded outside of the PipeWire Daemon. If it is loaded in the PipeWire daemon, the bug doesn’t trigger. The bug still triggers with PIPEWIRE_DEBUG=E,mod.qubes-audio:T
, where mod.qubes-audio
is the module I am working on. Since it is impacted by logging levels I suspect it is highly sensitive to timing.
Actual Results:
.trigger_done
is not called all of the time.
Expected Results:
.trigger_done
is always called, even if a client unexpectedly terminates.
Additional Info (as attachments):
-
pw-dump > pw-dump.log
: