pulseaudio default sink

Everything about X, Gnome, KDE, ... and everything running on it

pulseaudio default sink

Postby morgon » 2020-10-12 20:44

Hi,

I have (as many, many times before alas) a problem with pulseaudio that I just cannot figure out...

There are 2 sets of speakers hooked up to my pc.

One set corresponds to the pulseaudio-sink alsa_output.pci-0000_01_00.1.hdmi-stereo ("hdmi-sink" in the following), the other to alsa_output.pci-0000_00_14.2.analog-stereo ("analog-sink" in the following).

I have a script that moves all output from one set of speakers to the other which works.

When I move the output from one set of speakers to the other I also set the default sink to the new target sink via e.g.

pactl set-default-sink alsa_output.pci-0000_00_14.2.analog-stereo

and my problem is that I maybe don't understand what a "default sink" in pulseaudio really is, but this is what happens:

I do "mpc play" and music starts to play via the hdmi-sink. I call my script which moves the output to the analog-sink (sucessfully) and sets the default-sink to the analog-sink.

Now I do "mpc stop" and "mpc play" again. Result: Music plays again on the hdmi-sink - but I want the former selection of the analog-sink to persist....

So why is it that I set the default sink to a new sink, stop and restart mpd playback and the sound is routed again via the old sink?

How can I move e.g. mpd-output to another sink and have it stay there?

I hope that was understandable and someone here understands pulseaudio better than I do.

Many thanks!
morgon
 
Posts: 152
Joined: 2010-08-28 03:04

Re: pulseaudio default sink

Postby sgosnell » 2020-10-12 23:04

The default sink is the one that gets the output if no sink is specified. If you specify the sink to be used, you don't need to change the default.
Take my advice, I'm not using it.
sgosnell
 
Posts: 864
Joined: 2011-03-14 01:49

Re: pulseaudio default sink

Postby morgon » 2020-10-13 14:16

I don't unterstand what you are trying to say.

You never specify a sink with mpd, that is a concept that mpd knows nothing about. All mpd knows is that the output should go to pulseaudio (configured in mpd.conf).

My problem is now this:

I do "mpc play". It plays via the hdmi-sink. I move the output to the analog-sink and set the default sink to the analog-sink.
Then I do "mpc stop" and "mpc play" again.

I would expect that it continues to play on the previous (and now default sink), but it does not. It plays again on the hdmi-sink.

Why?
morgon
 
Posts: 152
Joined: 2010-08-28 03:04

Re: pulseaudio default sink

Postby sgosnell » 2020-10-14 00:37

How are you changing the playback device in pusleaudio, and supposedly changing the default?
Take my advice, I'm not using it.
sgosnell
 
Posts: 864
Joined: 2011-03-14 01:49

Re: pulseaudio default sink

Postby morgon » 2020-10-14 13:18

The pactl call from my first post.
morgon
 
Posts: 152
Joined: 2010-08-28 03:04

Re: pulseaudio default sink

Postby sgosnell » 2020-10-14 19:35

I'm not really proficient with pact, or any of pulseaudio commandline options. I do it via the GUI because it's more convenient to click on an icon in the task tray than to run the terminal and type. For me, some things are easier via a GUI and some easier via the terminal. I also have only one set of speakers connected to an external amp, so it would be hard to try to troubleshoot your problem for you. There is also /etc/pulse/default.pa. I suspect, however that the change in default sink only takes effect when pulseaudio is restarted. You might need to change your script to restart it when you change the default.
Take my advice, I'm not using it.
sgosnell
 
Posts: 864
Joined: 2011-03-14 01:49


Return to Desktop & Multimedia

Who is online

Users browsing this forum: No registered users and 9 guests

fashionable