[alsa-devel] Changing the sample rate/channels of an already opened PCM stream

Ed Schouten ed at fxq.nl
Mon Jun 18 20:47:58 CEST 2007


I am the author of the command line music player Herrie
(http://herrie.info/). For a long time folks have asked me to add
support for OSS to Herrie, so this morning I decided to install Linux on
a spare disk of mine (Ubuntu 7.04, FWIW) to hack on ALSA support for

After (a real lot of) hours of reading code, reading the Doxygen stuff,
etc. I now have a functional ALSA output module for Herrie. It was quite
hard to get it working, so I guess I owe myself a beer! ;-)

Anyway, there still is one disadvantage to my module; each time I detect
that a new track is going to be started that needs a different amount of
channels or sample rate, I reopen the ALSA device, something that is
just impossible. The reason why it's impossible: Herrie has a nifty
chroot() functionality that allows users to trap the application in a
certain directory.

I have been trying to get the device to reset so I can change the sample
rate, but for some reason, it just gets ignored. Can someone explain me
how it's possible to reset the sample rate after preparing the handle?

For your information, here's a link to the latest version of the source
code of my ALSA module:


 Ed Schouten <ed at fxq.nl>
 WWW: http://g-rave.nl/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20070618/55f832c4/attachment-0001.sig 

More information about the Alsa-devel mailing list