[pulseaudio-discuss] using pulseaudio to implement audio policies

Lennart Poettering lennart at poettering.net
Wed Mar 26 12:40:22 PDT 2008


On Wed, 13.02.08 07:23, Turner, Todd (Todd.Turner at windriver.com) wrote:

> Hi,
>  
> I'm new to PulseAudio and I have a question.   I am designing a system
> that needs to implement audio priorities.   Each application will be
> able to write to a certain virtual sound device,  and I need to
> implement this sort of thing:
>  
> virtual audio device A - high priority
> virtual audio device B - normal priority
> virtual audio device C - low priority
>  
>  
> What needs to happen is when device A is written to, device B and device
> C are muted, when device B is written to C is muted, etc.
>  
> How would I go about doing this with PulseAudio?  Can someone point me
> in the right direction?   Originally these devices were going to be
> virtual ALSA devices, not sure exactly if PulseAudio handles virtual
> ALSA devices?

If the virtual ALSA device is properly implemented, than PA should be
fine accessing them. Unfortunately, the fewest virtual ALSA devices
*are* implemented properly.

You probably should write a small module PA which hooks into the
creation fo streams in PA. And everytime a stream is created or
removed you do you muting/unmuting logic based on the current
state. Should be reasonably easy to do. Unfortunetly however, we don't
have much of a documentation of these internals of PA. Hence: read the
source, luke.

The "glitch-free" brnach in PA SVN now has some basic code to attach
prio info to streams. This might be useful to do proper prio based
audio routing.

Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net         ICQ# 11060553
http://0pointer.net/lennart/           GnuPG 0x1A015CC4



More information about the pulseaudio-discuss mailing list