[alsa-devel] Pulseaudio alsa configure hook
Hi,
The attached patch extends the alsa pulse plugin set with a alsa configuration hook. Allowing one to specify some configuration parameters that only come into effect when pulseaudio is running.
For example a configution file like:
@hooks [ { func on_pulse_is_running pcm.!default { type pulse } ctl.!default { type pulse } } ]
will redirect the default alsa pcm and ctl to pulse iff pulse is running. (Assuming you defined the hook function correctly ofcourse)
This is usefull for distributions that don't want to force their users to switch completely to pulseaudio, but have things a bit more dynamic :)
The solutions isn't optimal though. It will mean that every program loading accessing alsa will try to make an (extra) connection to pulse to decide what to do. But i think it's the best we can do for now (or at least that i can do with my minimal knowledge of alsa).
A nicer solution would be a way to always specify the pulse plugin as default and have a sort of fallback for when that fails.
Comments on the patch appreciated :)
Sjoerd PS: I'm not on alsa-devel, so please keep me in the CC
At Sun, 27 Apr 2008 22:37:09 +0200, Sjoerd Simons wrote:
Hi,
The attached patch extends the alsa pulse plugin set with a alsa configuration hook. Allowing one to specify some configuration parameters that only come into effect when pulseaudio is running.
For example a configution file like:
@hooks [ { func on_pulse_is_running pcm.!default { type pulse } ctl.!default { type pulse } }
]
will redirect the default alsa pcm and ctl to pulse iff pulse is running. (Assuming you defined the hook function correctly ofcourse)
This is usefull for distributions that don't want to force their users to switch completely to pulseaudio, but have things a bit more dynamic :)
The solutions isn't optimal though. It will mean that every program loading accessing alsa will try to make an (extra) connection to pulse to decide what to do. But i think it's the best we can do for now (or at least that i can do with my minimal knowledge of alsa).
A nicer solution would be a way to always specify the pulse plugin as default and have a sort of fallback for when that fails.
Comments on the patch appreciated :)
This looks pretty interesting. I forgot that this kind of stuff can be also a plugin :)
Applied to HG tree now.
Thanks!
Takashi
On Wed, Apr 30, 2008 at 06:20:40PM +0200, Takashi Iwai wrote:
At Sun, 27 Apr 2008 22:37:09 +0200,
The attached patch extends the alsa pulse plugin set with a alsa configuration hook. Allowing one to specify some configuration parameters that only come into effect when pulseaudio is running.
For example a configution file like:
@hooks [ { func on_pulse_is_running pcm.!default { type pulse } ctl.!default { type pulse } }
]
will redirect the default alsa pcm and ctl to pulse iff pulse is running. (Assuming you defined the hook function correctly ofcourse)
This looks pretty interesting. I forgot that this kind of stuff can be also a plugin :)
Applied to HG tree now.
Thanks :).. Unfortunately some more testing revealed some issues with it, specifically if pulse is running your complete config is replaced the bits in the on_pulse_is_running directive. Which might not be what one actually wants :)
I couldn't find a proper solution for this. So i've changed the code to optionally load config files. Just like the load hook does. Actually i just optionally call the snd_config_hook_load function, but that's not actually in the alsa API....
Also it now decides pulse is running as soon as the authorizing step begins (just after the actually connection is setup), which should save some round-trips and overhead.
Updated patch attached :)
Sjoerd
At Sat, 10 May 2008 21:46:25 +0200, Sjoerd Simons wrote:
On Wed, Apr 30, 2008 at 06:20:40PM +0200, Takashi Iwai wrote:
At Sun, 27 Apr 2008 22:37:09 +0200,
The attached patch extends the alsa pulse plugin set with a alsa configuration hook. Allowing one to specify some configuration parameters that only come into effect when pulseaudio is running.
For example a configution file like:
@hooks [ { func on_pulse_is_running pcm.!default { type pulse } ctl.!default { type pulse } }
]
will redirect the default alsa pcm and ctl to pulse iff pulse is running. (Assuming you defined the hook function correctly ofcourse)
This looks pretty interesting. I forgot that this kind of stuff can be also a plugin :)
Applied to HG tree now.
Thanks :).. Unfortunately some more testing revealed some issues with it, specifically if pulse is running your complete config is replaced the bits in the on_pulse_is_running directive. Which might not be what one actually wants :)
I couldn't find a proper solution for this. So i've changed the code to optionally load config files. Just like the load hook does. Actually i just optionally call the snd_config_hook_load function, but that's not actually in the alsa API....
Also it now decides pulse is running as soon as the authorizing step begins (just after the actually connection is setup), which should save some round-trips and overhead.
Updated patch attached :)
Thanks. Applied to ALSA tree again.
Takashi
participants (2)
-
Sjoerd Simons
-
Takashi Iwai