You are not logged in.
Up until yesterday, I used the HDMI out on my GPU into a AV Receiver to do Dolby/DTS passthrough from jellyfin (and/or mpv) and SPDIF into a different input for normal desktop audio. This meant pipewire could happily lock the SPDIF device, and I still had surround sound for the media watching.
Sadly for me, the HDMI input on my AV receiver seems to have given up the ghost.
I got Dolby/DTS passthough working over SPDIF, but only if pipewire hasn't already locked the device. If I log out and back in, I can use passthrough, but if I open spotify or play a video in firefox, then the audio device becomes locked and I need to log out and back in to get passthrough working again.
I've tried killing the pipewire server, but as soon as it comes back up it locks the audio device again.
Is there some way of telling pipewire to kick out all of the clients and release the audio device without logging out/in?
Offline
What research have you done so far regarding this issue?
Offline
I'll be honest, I don't know a huge amount about PipeWire, it seems that every few years someone comes along and declares that *this time* they've solved Linux Audio lol
I've done enough research to know that i need pipewire to get out of the way to allow mpv to tell alsa to take over the card so it can put a untouched audio signal on the cable so the AVR can decode it, and that I need to ask someone else for advice about how to make this happen.
Offline
Normally there's an idle timeout after which a sink gets released (assuming no audio is playing), iirc 10 secs by default, is that not happening for you? you basically want the opposite/give a specific timeout value for https://wiki.archlinux.org/title/PipeWi … g_playback
You can technically also enable passthrough even with pipewire running, it should have an explicit passthrough mode, afaik the easist to configure that is in pavucontrol on the spdif sink you can toggle which formats are eligible for passthrough and if those are set then any client wanting to play one of these formats will automatically suspend the sink.
See e.g. https://gitlab.freedesktop.org/pipewire … ide-IEC958
Edit: On another check if you don't want to wait for the suspension to happen automatically you can also force it with
pactl suspend-sink $SINKNAME
, https://gitlab.freedesktop.org/pipewire … io#suspend
Last edited by V1del (2025-01-14 10:05:33)
Offline
Thanks mate! armed with this new knowledge, I've had a play.
Timeouts work exactly as you describe, sometimes.
I wasn't able to suspend the connections with
pactl
, I just got "Invalid suspend specification" constantly.
If I pause a Youtube video, it will stay in pavucontrol and passthrough will be locked out. If I refresh the tab (and do not press play) or the video ends, it will remove itself from pavucontrol and passthrough will work again.
Spotify does the same thing, except there's no real way of pressing stop in spotify (it's just a pause button) - however if I select a different device to play on (phone, work computer, etc) that will force spotify to tear down it's connection to PipeWire correctly. However, quitting Spotify is quicker.
While I was typing these, something else held onto the sound card (It wasn't in pavucontrol), and all of this was invalidated. I ended up having to log out and back in again. So close!
Offline
check
sudo fuser -v /dev/snd/*
if something occupies a pcmXp device then that device is locked by said application.
As for how specific clients handle this that's up to the client, pausing something doesn't necessarily mean it releases the connection. I know chromium will drop audio sources that are paused after a couple seconds, pretty sure firefox doesn't.
Last edited by V1del (2025-01-15 00:39:28)
Offline