Links between nodes randomly fail to get created or are created incorrectly
- PipeWire version (
pipewire --version
): 0.3.42 master from this nightly COPR with WirePlumber 0.4.5. Have also tried 0.3.40. - Distribution and distribution version (
PRETTY_NAME
from/etc/os-release
): Fedora Linux 35 (KDE Plasma) - Desktop Environment: KDE Plasma 5.23.4
- Kernel version (
uname -r
): 5.15.11-200.fc35.x86_64
Description of Problem:
When an application starts playing sound, the links between the nodes are sometimes created incorrectly or not at all. Sometimes only one channel is linked, resulting in audio on only one side, and sometimes neither channel gets linked. I have noticed this with:
- Firefox playing videos from YouTube, where sometimes only one channel gets linked, resulting in audio on only one channel. There is also a possibly related issue where sometimes the audio is muted until I touch the volume control of the video.
- The KDE Plasma audio mixer playing the "pop" sound using Canberra when adjusting the volume of a device. Seems to also happen with other KDE notifications.
- Audacity when monitoring the microphone with EasyEffects doing some filtering.
- Possibly EasyEffects every time it starts up, but that could be a separate issue.
Error 1
The following error is frequently printed in the system journal when links are being created; sometimes when looking at Catia as this happens, I can see them get linked to the wrong device at first before linking to the right device:
Jan 01 03:39:29 pipewire[2239]: pw.link: 0x55fde2e3c3c0: port 0x55fde2e3b8f0 can't set io:1 (Spa:Enum:IO:Buffers): Invalid argument
Jan 01 03:39:29 pipewire[2239]: pw.link: 0x55fde2e3c3c0: port 0x55fde2e3b8f0 can't set io:1 (Spa:Enum:IO:Buffers): Invalid argument
Error 2
When one or more links fail to be created, a different error is printed in the journal:
Jan 01 04:56:56 wireplumber[2091]: <WpSiStandardLink:0x7f6298004e80> link-factory: unknown input port 146
Jan 01 04:56:56 wireplumber[2091]: <WpSiStandardLink:0x7f6298004e80> failed to activate si-standard-link: link-factory: unknown input port 146
Error 3
A third issue may occur when links are created to the wrong device:
Jan 01 05:57:49 pipewire-pulse[2235]: spa.audioadapter: was started
Jan 01 05:57:49 pipewire-pulse[2235]: mod.client-node: node 0x55dd35fd4b60: set_param Spa:Enum:ParamId:PortConfig (11) 0x55dd35ebcb18: Input/output error
Jan 01 05:57:49 pipewire[2233]: pw.core: 0x55f95c302510: error -5 for resource 61: node_set_param(Spa:Enum:ParamId:PortConfig) failed: Input/output error
Jan 01 05:57:49 pipewire[2233]: mod.client-node: 0x55f95e140a40: error seq:8113 -5 (node_set_param(Spa:Enum:ParamId:PortConfig) failed: Input/output error)
Occasionally PipeWire may crash as a result of this issue; I have been having strange, occasional segfaults and they seem to be occurring at the same times this issue presents itself, only far more rarely. However, I have not found a repro for the segfault(s). A backtrace is attached.
I've recorded a couple of videos demonstrating the issue. Please see the attachments.
How Reproducible:
Occurs at random, but can be triggered with enough repetition.
Steps to Reproduce:
- Monitor journal with
journalctl -f
- (Optional) Monitor the created links using Catia or some other patchbay tool
- Open a YouTube video in Firefox
- Refresh the page repeatedly
Actual Results:
One of multiple possible outcomes:
- Audio plays as expected, no error in journal.
- Audio plays as expected, error 1 is output in journal.
- Audio plays only on one channel, error 2 is output in journal.
- Audio does not play at all, error 2 is output in journal.
- Audio does not play at all, error 3 is output in journal.
- Rarely PipeWire may crash.
If Catia is running, links can be seen assigned to the wrong device for a split-second whenever playback begins before being reassigned to the correct device. Unsure if this is a Catia bug/feature or part of the issue. This can be seen on the videos below.
Expected Results:
Audio always plays as expected, PipeWire never crashes, no errors end up in the journal.
Additional Info (as attachments):
-
pw-dump > pw-dump.log
: pw-dump.log - Backtrace of a possibly related segfault: pipewire_backtrace.txt
- Journal output from boot to occurrence of problem (
journalctl --no-hostname --user-unit=pipewire --user-unit=pipewire-media-session --user-unit=pipewire-pulse --user-unit=wireplumber -b --no-pager > pwlinkerrors2.txt
): pwlinkerrors2.txt - Video of the problem occurring while toggling microphone monitoring on/off in Audacity. Problem first occurs at 00:12 and then again at 00:33. audacity_issue
- Video of the problem occurring while playing a video in Firefox. One example of the problem (both channels link to the wrong device, resulting in no audio) occurs at 00:25. Another example (only one channel gets linked, and it's a FL->FR link) occurs at 01:07. firefox_issue