[alsa-devel] nforce ac97 plays too fast

Lee Revell rlrevell at joe-job.com
Sun Sep 30 03:51:54 CEST 2007


On 9/29/07, Stas Sergeev <stsp at 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.html#ga3602c3c8912acf66c4db29f96608021

For example:

http://www.alsa-project.org/alsa-doc/alsa-lib/_2test_2pcm_8c-example.html#a18
http://www.alsa-project.org/alsa-doc/alsa-lib/_2test_2latency_8c-example.html#a12
http://www.suse.de/~mana/alsa090_howto.html

Lee


More information about the Alsa-devel mailing list