Sergei Steshenko wrote: > Hello All, > > as already known, I am one of those who advocate the possibility to mandate sample rate and not let applications to change it. > > I think a possible, though ugly, solution is like this: > > 1) to locate pieces of ALSA code responsible for setting sample rate; > 2) to change (in my own copy) the pieces so they would know only one sample rate; > 3) to compile and install the modified code. > > I also think that I would like to have an ALSA snapshot per sample rate and will uninstall/install the snapshot I need > - most likely the two most used will be for 44100Hz and 48000Hz sample rates. > > So, which are the pieces ? > > Thanks, > Sergei. > > Why not write a small program that calls the alsa interface and sets the rate to whatever you want. This must be how the applications you are concerned about are doing it. The api call is snd_pcm_hw_params_set_rate. From the alsa-project api int snd_pcm_hw_params_set_rate ( snd_pcm_t <http://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html#gb5676348e7618b444e28907607660cef> * /pcm/, snd_pcm_hw_params_t <http://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html#g232a2e2b6bb7bb2dca2885eec2e095b3> * /params/, unsigned int /val/, int /dir/ ) Restrict a configuration space to contain only one rate. *Parameters:* /pcm/ PCM handle /params/ Configuration space /val/ approximate rate /dir/ Sub unit direction *Returns:* 0 otherwise a negative error code if configuration space would become empty Wanted exact value is <,=,> val following dir (-1,0,1) ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Alsa-user mailing list Alsa-user@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/alsa-user