On 9/29/07, Stas Sergeev stsp@aknet.ru wrote:
Hello.
Trying to get a software amplification to work with NForce CK804 AC'97, I've found out that whatever the asound.conf I write, the sound starts playing much faster than it should. After some debugging, I've found out the following:
- The card (or the driver) only supports
48000KHz.
- The program (any, because libao and artsd
suffer from that) is trying to set some rate with snd_pcm_hw_params_set_rate_near(), and that succeeds, but the returned rate is 48000, while the requested is, say, 22050. No wonder it then plays with the wrong speed. Of course the program can check the returned rate, but it sets the "direction" parameter to 0, which should mean "take exactly that value". I've looked into an alsa-tutorial, and the examples there do not check the returned rate too - dir==0 should be enough.
What ALSA tutorial are you looking at? All the ones I am familiar with state that you must check the returned rate. Direction is just a hint.
http://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m___h_w___params.h...
For example:
http://www.alsa-project.org/alsa-doc/alsa-lib/_2test_2pcm_8c-example.html#a1... http://www.alsa-project.org/alsa-doc/alsa-lib/_2test_2latency_8c-example.htm... http://www.suse.de/~mana/alsa090_howto.html
Lee