[pulseaudio-discuss] how to change default sound card using a command line ?

Colin Guthrie gmane at colin.guthr.ie
Sat Nov 14 02:04:02 PST 2009


'Twas brillig, and mierdatutis mi at 13/11/09 22:05 did gyre and gimble:
> Hi,
> 
> I'm trying to change Pulseaudio default audio card start in a shell 
> script, but I don't know what I must do.

There is not really such a thing as a "default" audio card in PA. The 
term we use is usually "fallback" as this more accurately represents 
what it means. PA remembers each application's preferred device. Thus if 
you play something in e.g. mplayer and we've never seen an mplayer 
stream before, we will use the "fallback" device and then save that 
choice in a little database. The next time mplayer tries to play 
something, we first look to see if we've got a preferred device for 
mplayer and if so, we use it. In this second case the "fallback" device 
is not consulted.

So, from the command line you can indeed set the fallback sink via the 
command:
pacmd set-default-sink index|name

But this will only really change the "fallback", e.g. all apps that have 
played before will continue using that device. If you want to change 
these previously stored preferences, the only tool that supports that 
currently is the gnome-volume-control. pavucontol does not update the 
individual application preferences either.

Hope that clarifies things.

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
   Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
   Mandriva Linux Contributor [http://www.mandriva.com/]
   PulseAudio Hacker [http://www.pulseaudio.org/]
   Trac Hacker [http://trac.edgewall.org/]




More information about the pulseaudio-discuss mailing list