sound - Ubuntu changing default audio output after suspend - Ask Ubuntu
on laptop i'm running kodi connected tv hdmi.
after suspending , resuming audio doesn't come out of tv anymore out of laptops speakers. i've read multiple posts on how set default audio output after wakeup doesn't seem work. knows how fix this?
fixing pulseaudio switching tv laptop on suspend
this "undocumented feature" appeared ubuntu 16.04 , new version of pulseaudio 8. according websites bug fixed in version 9, whenever comes out. in meantime fix open terminal
using ctrl+alt+t , type following commands:
cd /lib/systemd/system-sleep sudo cp hdparm sound gksu gedit sound
this copy existing file suitable permissions our new script titled tv-sound
. use gedit
change new file this:
#!/bin/sh # name: sound # path: /lib/systemd/system-sleep # call: called systemd automatically # desc: pulseaudo 8 sets sound laptop when going sleep. # script sets sound tv. # date: sep 23 2016 # note: test psmouse askubuntu.com "touchpad not working after suspending laptop" case $1/$2 in pre/*) echo "going $2..." # place pre suspend commands here, or `exit 0` if no pre suspend action required # modprobe -r psmouse sleep 1 ;; post/*) echo "waking $2..." # place post suspend (resume) commands here, or `exit 0` if no post suspend action required sleep 2 # modprobe psmouse export pulse_runtime_path="/run/user/1000/pulse/" sudo -u rick -e pacmd set-card-profile 0 output:hdmi-stereo ;; esac
copy text above on existing text inherited hdparm
file copied.
note: replace user name rick
(third line bottom) user name.
save file , close gedit. mark executable command:
sudo chmod +x sound
an additional step might required if output:hdmi-stereo
, device people, different on system.
Comments
Post a Comment