[pulseaudio-discuss] Automatic selection of an audio sink depending on value of ENV variable

Colin Guthrie gmane at colin.guthr.ie
Wed Oct 28 23:54:59 PDT 2009


'Twas brillig, and Ng Oon-Ee at 29/10/09 04:47 did gyre and gimble:
> On Thu, 2009-10-29 at 12:03 +0800, Leszek Koltunski wrote:
>> Well, the patch is there; you can go apply it, then load two
>> 'module-x11-publish' :
>>
>> load-module module-x11-publish display=":0.0" sink=foo
>> load-module module-x11-publish display=":0.1" sink=bar
>>
>> and voilla! It's working automagically. 
>>
>> ( BTW, what is the best way to load the modules? I put the above two
>> lines in /etc/pulse/default.pa, and it's working, but there's a
>> comment there 'X11 modules should not be started from default.pa so
>> that one daemon can be shared by multiple sessions' . So how? )
> 
> Not sure on the mechanics of it, but if not through default.pa you could
> always script a `pactl load-module module-x11....`
> 
> However, I'm sure there's reasons for the warning, so my suggestion is
> probably just another way of doing what's not a very good idea.

Look at pulseaudio.desktop and start-pulseaudio-x11. These do exactly 
that just now.

The script would need modified for this use case (as it registers X 
session handler too, not just the publication) but in theory, just 
running start-pulseaudio-x11 on each display should get you the 
necessary gubbins loaded (albeit one of session modules will fail to 
load, but you can probably just ignore that - the error is suppressed 
anyway).

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