Skip to contentSkip to conversation

Switching sound cards on the fly

DISCUSSION Lee Revell 2 participants 2 messages Mar 16, 2007

lore
Share & tools
lore

Lee Revell

author
#0 lore raw

How difficult would it be to add to alsa-lib a mechanism where applications can register an "ALSA config changed" callback that would be invoked when an app like gnome-sound-properties changes the default sound device by updating .asoundrc? Changes to ALSA config files could be detected via inotify.

I think this could allow for relatively seamless switching of the audio output device.

Lee

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

#1 lore raw

At Thu, 15 Mar 2007 21:29:32 -0400,

Quoted 9 lines · Lee Revell

How difficult would it be to add to alsa-lib a mechanism where applications can register an "ALSA config changed" callback that would be invoked when an app like gnome-sound-properties changes the default sound device by updating .asoundrc? Changes to ALSA config files could be detected via inotify.

I think this could allow for relatively seamless switching of the audio output device.

It's an interesting idea.

I don't think alsa-lib would do any dynamic configuration change by itself because it can result in inconsistency. Instead, when the config-change is notified, the app should do the following procedure by itself:

- finish jobs, close handles
- reset the config
- restart jobs

Anyway, the implementation of such a callback is almost independent from the rest of alsa-lib code. It would simply invoke inotify with a set of config file names. So, even an API returning a set of config file names should suffice in theory...

Takashi

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV