You are not logged in.

#1 2015-10-11 19:55:50

Utini
Member
Registered: 2015-09-28
Posts: 452
Website

Pulseaudio/Pavucontrol automatic switch to HDMI audio when connected?

Hey there,

is there a way to automatically switch the audio output to/over HDMI when connected? I couldn't find anything with google. Doing the manual way isn't much of a deal but having an automatic way would be more comfortable wink

If there is no option for that, a simply script should do it?


Setup 1: Thinkpad T14s G3, 14" FHD - R7 6850U - 32GB RAM - 2TB Solidigm P44 Pro NVME
Setup 2: Thinkpad X1E G1, 15.6" FHD - i7-8850H - 32GB RAM - NVIDIA GTX 1050Ti - 2x 1TB Samsung 970 Pro NVME
Accessories: Filco Majestouch TKL MX-Brown Mini Otaku, Benq XL2420T (144Hz), Lo(w)gitech G400, Puretrak Talent, Sennheiser HD800S + Meier Daccord FF + Meier Classic FF

Offline

#2 2015-10-11 21:25:29

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,659

Re: Pulseaudio/Pavucontrol automatic switch to HDMI audio when connected?

Add

load-module module-switch-on-connect

before the if... udev-detect - block in your /etc/pulse/default.pa

Last edited by V1del (2015-10-12 11:36:37)

Offline

#3 2015-10-12 07:14:10

Utini
Member
Registered: 2015-09-28
Posts: 452
Website

Re: Pulseaudio/Pavucontrol automatic switch to HDMI audio when connected?

V1del wrote:

Add

load-module module-switch-on-connect

before the if... udev-detect - block in your /etc/default.pa

Mhh that file is empty, according to the wiki to load modules per user/system wide I just have to enter that line into the file. I did it in

~/.config/pulse/default.pa:

load-module module-switch-on-connect

Thanks for helping !


Setup 1: Thinkpad T14s G3, 14" FHD - R7 6850U - 32GB RAM - 2TB Solidigm P44 Pro NVME
Setup 2: Thinkpad X1E G1, 15.6" FHD - i7-8850H - 32GB RAM - NVIDIA GTX 1050Ti - 2x 1TB Samsung 970 Pro NVME
Accessories: Filco Majestouch TKL MX-Brown Mini Otaku, Benq XL2420T (144Hz), Lo(w)gitech G400, Puretrak Talent, Sennheiser HD800S + Meier Daccord FF + Meier Classic FF

Offline

#4 2015-10-12 11:36:23

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,659

Re: Pulseaudio/Pavucontrol automatic switch to HDMI audio when connected?

/etc/pulse/default.pa my bad, and it is pretty important that it is at the position I've mentioned otherwise it won't work

Offline

#5 2015-10-12 12:37:03

Utini
Member
Registered: 2015-09-28
Posts: 452
Website

Re: Pulseaudio/Pavucontrol automatic switch to HDMI audio when connected?

V1del wrote:

/etc/pulse/default.pa my bad, and it is pretty important that it is at the position I've mentioned otherwise it won't work

Oh okay thanks again. The wiki said it is recommended to loda modules in the user-specific config file and not system wide.


Setup 1: Thinkpad T14s G3, 14" FHD - R7 6850U - 32GB RAM - 2TB Solidigm P44 Pro NVME
Setup 2: Thinkpad X1E G1, 15.6" FHD - i7-8850H - 32GB RAM - NVIDIA GTX 1050Ti - 2x 1TB Samsung 970 Pro NVME
Accessories: Filco Majestouch TKL MX-Brown Mini Otaku, Benq XL2420T (144Hz), Lo(w)gitech G400, Puretrak Talent, Sennheiser HD800S + Meier Daccord FF + Meier Classic FF

Offline

#6 2015-10-12 13:20:09

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,659

Re: Pulseaudio/Pavucontrol automatic switch to HDMI audio when connected?

You can do that if you want, but be sure to copy the whole file from the system and not just create a new file with just that in there, iirc pulseaudio simply doesn't look into the system wide file if it finds one in the home dir. Which would lead to it not starting.

If you are the only user of the system it doesn't matter anyway. Do the config wherever

Last edited by V1del (2015-10-12 13:20:30)

Offline

#7 2018-06-14 06:31:31

wolvieh
Member
From: Austria
Registered: 2008-04-01
Posts: 44

Re: Pulseaudio/Pavucontrol automatic switch to HDMI audio when connected?

Whats the current way to do this? I don't have an /etc/default.pa

Is there an article in the wiki about this topic?

Offline

#8 2018-06-14 07:37:31

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,659

Re: Pulseaudio/Pavucontrol automatic switch to HDMI audio when connected?

As mentioned three times over the course of this thread, the correct place is /etc/pulse/default.pa and this method and option haven't changed. However depending on your setup the solution might not be applicable (it won't work if your HDMI is not a dedicated card)

However if you still want help with this you are advised to open up your own thread about it, include the output of

pacmd list-cards
pacmd list-sinks
pulseaudio --dump-conf

Don't necrobump: https://wiki.archlinux.org/index.php/Co … bumping.22

Closing.

Offline

Board footer

Powered by FluxBB