[pulseaudio-discuss] Moving streams without pavuontrol

Colin Guthrie gmane at colin.guthr.ie
Fri Feb 19 03:32:39 PST 2010


'Twas brillig, and Vegard Vesterheim at 19/02/10 11:23 did gyre and gimble:
> On Fri, 19 Feb 2010 10:18:42 +0000 Colin Guthrie <gmane at colin.guthr.ie> wrote:
> 
>> 'Twas brillig, and Vegard Vesterheim at 19/02/10 09:36 did gyre and gimble:
>>> The ability to use programs like pavucontrol to move streams between
>>> sound cards dynamically is very nice. But if the sound is very short
>>> it can be a bit cumbersome to do this directly via the gui. I wanted
>>> to move an alert sound from my IM-client from the headphones to the
>>> external speakers, but the sound entry appears and disappears too
>>> quickly for me to catch it in the gui. To work around this, I simply
>>> temporarily changed the sound to a longer one, giving me enough time
>>> to click in the gui ;-) 
>>>
>>> Surely there must be a better way to do this?
>>
>> Yes. Event sounds should be tagged in their proplist as
>> media.role=event
> 
> Hmm. This answers the specific use case that I used to describe the
> problem. But it doesn't really solve the more generic use case about
> being able to manipulate sound routing without using the gui.

Well in short, yes you can move live streams via pactl/pacmd, but there
is no application you can use to edit the stream restore database (hence
why I talked about writing a C program)

> I understand the mechanism about tagging sounds, I think it is a good
> idea, and I agree that this will solve many problems related to
> sound routing.  But this requires cooperation from each and every
> application itself, using the relevant standardised mechanisms. But this
> is not common yet, and even if I we eventually get there, I think
> there will still be a need to have an alternative mechanism for doing
> sound routing.

It *helps* if the applications support it, but there are numerous ways
we can do it for them. All gnome apps now use libcanberra for event
sounds which means the tagging is done there. For other apps we will
parse the .desktop file and try and work out which role is most
appropriate. We also look for and honour environment variables that are
set so even if an app does not support PA directly if they want to be
"PA friendly" they can just call setenv() before opening their sound
stream and it will integrate nicely.

So we do our best to cope and this is ultimately what we should encourage.

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