impl-node: Since commit f085a1fa (0.3.71-0.3.72), the driver nodes don't get triggered on xrun.
- PipeWire version (
pipewire --version
): pipewire compiled and linked with libpipewire 1.0.4 - Distribution and distribution version (
PRETTY_NAME
from/etc/os-release
): Manjaro Linux (Arch Linux) - Desktop Environment: XFCE
- Kernel version (
uname -r
): 6.8.1-273-tkg-eevdf
Description of Problem:
EDIT:
Part of commit f085a1fa is the omission of "node_trigger" at the end of the xrun detection block. As this call was used to directly trigger the driver node for a last time on xrun, it seems now the node stays un-triggered. While there is a call to "trigger_targets" at the end of the "node_ready" function, it only triggers nodes with (--state->pending==0), which probably doesn't include those with xrun.
The result is sound distortion and crackling with apps that cause xruns. One such app seems to be CrewChief (Wine/Proton). Below follows the original description.
ORIGINAL DESCRIPTION:
CrewChief (Wine/Proton) is an utility that emulates the speech of a race engineer (or crew chief) in various sim racing games. It reads game telemetry through shared memory or network packets, etc, so speech is context sensitive (pre-recorded, not synthesized).
The problem usually happens after 2-3 minutes of game play, leaving the "crew chief" say different things. It usually appears as a 1-2 sec. "shhhhhhhh" sound at words ending with "sh", etc. It seems like a prolonged word end, but very distorted and with a lot of crackling.
I couldn't find the time to do a regression test till now, but after Wireplumber 0.5.0 couldn't resolve some symbols with Pipewire 0.3.71, realized it was time to report this, and try to help resolve it.
After doing a bisect, found out that commit f085a1fa was responsible for this. To confirm it is the only commit causing the issue, compiled pipewire as further as the commit can be cleanly reverted (de788302), and the app sound played without issues.
Seeing as there are a lot of changes made to the impl-node.c "node_ready" function since 0.3.71, and the issue is still present, there must be something introduced by that very first commit, that persists throughout all the changes. At first glance the condition of the "if" statement has been changed from "if (SPA_UNLIKELY(state->pending > 0))" to "if (SPA_UNLIKELY(a->status != PW_NODE_ACTIVATION_FINISHED))" and the entire "else" block has been removed, which changes the logic somewhat. Also the "node_trigger(node)" call has been omitted. I plan to do some testing with "node_trigger" or it's current replacement, when time permits.
Also I feel there are some pops and cracks in game sound (Wine mostly) since 0.3.72. This is purely subjective of course.
How Reproducible:
It's always reproducible, but takes some time ~2-3 minutes for the issue to appear.
Steps to Reproduce:
- Install CrewChief in a Wine prefix (needs dotnet48).
- Install a racing game that is supported - Automobilista 2, rFactor 2, etc.
- Start the CrewChief app followed by the game.
- Start playing the game, doing some laps and letting the "crew chief" say various things.
Actual Results:
After 2-3 minutes the CrewChief audio becomes distorted with a lot of crackling.
Expected Results:
The CrewChief audio plays without distortion or crackling through the entire game session.
Additional Info (as attachments):
-
pw-dump > pw-dump.log
: pw-dump.log - pw-top: