Re: i810_audio bug (?)
From: Alan Cox
Date: Wed Sep 17 2003 - 08:24:20 EST
On Mer, 2003-09-17 at 11:42, Reza Naima wrote:
> 1) first, the original rate (32000) is converted to a new rate ..
> rate = (rate * clocking)/48000
> where clocking, in my case, is 48566.
We measure the bitrate of the codec, because a lot of them are clocked
at odd frequencies not the official 48000 (I gather it saves parts). We
then adjust the rate to get what should be the right one.
> 3) This results in the value 31627 that I'm seeing. Now, is this the
> actual sample rate, or some internal value used to generate a 32000kbps
> sample rate? If so, is it perhaps a bug that dmabuf->rate is being
> returned rather than newrate?
We take the rate you want, shift it for the 48Khz clock offset then ask
the codec to do that rate. ac97_set_dac_rate returns the value the codec
actually used (which may be quite different), and we then bend that back
the other way for the clocking.
So in your case it is going
I want 32000
I need to ask the codec for an adjusted value
Codec replies 32000 (ie it doesnt do a full range of clocking)
We realise it means you get 31627
Btw - from my experience with video playback audio clocks are +/- 5%
some of the time even when you ask for a rate it can do so software
needs to be fairly adaptive to such things.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/