On Sat, 5 Jan 2002, Uros Bizjak wrote:

> Hello!
>
>   I have noticed, that fm801.c calculates wrong timeout for some of its
> timeout values.
> This is actual line from fm801.c source:
>
> timeout = jiffies + (4 * HZ) / 3;             /* 75ms */
>
> Actually, this timeouts after 1.33 second!! If HZ = 100, then every
> jiffie takes 10ms. Proper timeout would be:
>
> timeout = jiffies + 0.075 * HZ ----> jiffies + 7 (better, 8)
>
> Because of this, I would suggest new macro called for example snd_mwait,
> defined as:
>
> snd_mwait(x)  (((int)(x) * HZ + 999) / 1000)          /* x[ms] */
>
> Timeouts would then be written as:
>
> timeout = jiffies + snd_mwait(75);

I would prefer to correct wrong expressions rather creating a new macro.

                                                Jaroslav

-----
Jaroslav Kysela <[EMAIL PROTECTED]>
SuSE Linux    http://www.suse.com
ALSA Project  http://www.alsa-project.org


_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to