Pipewire switching audio output on screen lock
Since a recent update to pipewire whenever my desktop locks (in i3 and sway) the sound output is switched from the headphone jack (my external speakers) to my laptop speakers. I've had a read through the wiki page on pipewire and I'm still not sure how to stop this behaviour from occurring. Can anyone help?
journalctl -xe shows nothing which is what I expected, so I tried pactl subscribe to monitor the changes but I'm not familiar with pipewire and I don't know what the output means:
❯ pactl subscribe
Event 'change' on card #39
Event 'change' on sink #42
Event 'change' on card #39
Event 'change' on server #4294967295
Event 'change' on card #39
Edited 30 Mar 2021. We only hold this version.
About this post
- Posted
- Archived
- Edited
- Score
- 5 · 100% up
- Kind
- Text
- ID
- mdrrap
1 comment
This will be bumping a dead thread just wanted to make sure it has an answer as I also encountered this page upon searching hopefully to help anyone who encountered the same issue. On my situation the issue stems on pipewire-media-session.service it resets sink to default when light-locker kicks in but works fine when restarting and logout. The workaround I did was I stopped that service before lightlocker-command -l in xflock4 then right after ran a daemon that will watch for login event upon detecting will start the service again. I used this script found on this link and modified it to fit my needs https://newbedev.com/light-locker-run-script-on-screen-lock-unlock. Make sure to also add a delay before starting the service back again. Hopefully this helps.