You are not logged in.
I have 3 monitors and only one is connected to the sound system, so I want this monitor to be the default output, which I was able to achieve by setting
load-module module-alsa-sink device=hw:0,6In my default.pa file, but whenever I exit sleep it uses the wrong profile again. Is it possible to disable the profile or maybe prevent it from choosing the wrong profile?
Last edited by Awlex (2020-12-17 19:28:39)
Offline
Try adding a script to set the module parameters under /lib/systemd/system-sleep/.
For example:
#!/bin/sh
case "$1" in
post) pactl load-module module-alsa-sink device=hw:0,6;;
esac(Untested.)
Jin, Jîyan, Azadî
Offline
It would be better if you used the actual profile instead of allocating a new sink that's completely outside of the profile logic.
Check through pavucontrols config tab or
pacmd list-cardsand select the proper preallocated profile, that should generally ensure that the proper profile is remembered.
Offline
Try adding a script to set the module parameters under /lib/systemd/system-sleep/.
For example:
#!/bin/sh case "$1" in post) pactl load-module module-alsa-sink device=hw:0,6;; esac(Untested.)
Didn't work, unfortunatelly.
It would be better if you used the actual profile instead of allocating a new sink that's completely outside of the profile logic.
Check through pavucontrols config tab or
pacmd list-cardsand select the proper preallocated profile, that should generally ensure that the proper profile is remembered.
I always use pavucontrol or pactl to set the profile, but always end up with the wrong profile after a sleep/reboot.
Offline
Didn't work
https://bbs.archlinux.org/viewtopic.php?id=57855
Check the journal to see why it's failing. Does the pactl(1) command work if you run it in isolation?
Having said that I would defer to V1del on this one, they really know their audio (and pretty much everything else).
Jin, Jîyan, Azadî
Offline
Well are you actually setting the profile or selecting the sink you've allocated?
In any case what's likely to help is unloading module-switch-on-port-available (... and uncommenting/removing it from your /etc/pulse/default.pa) if you really want to disable all auto-detected profiles you could also just comment module-udev-detect in that same file and use your allocated standalone sink.
For HoaS' suggestion to work you'd need to do some more in that script (... I don't think your sink is inherently unloaded and you'd instead need to set it as the default again or so) but you need to provide access to your user's DBUS session to the pactl command, so you'd rather do something like
#!/bin/sh
case "$1" in
post) sudo -u $USER DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$UID/bus pactl set-default-sink alsa_output_hw:0.6 ;;
esacreplace $USER and $UID as appropriate for your situation, as well as the sink name according to the relevant outputs.
Last edited by V1del (2020-12-14 15:06:05)
Offline
Sorry for the delayed response I tried a couple of things using the with the script you suggested, but I don't think it ever got executed.
Code used to send device trigger sleep
sleep 1; xset dpms force offSo I tried a different aproach and found this answer on how to prevent the switch after sleep, which seems to work for me. Note that I modified ~/.config/pulse/default.pa instead of the mentioned file. Thank you for your help!
Offline