lkml.org 
[lkml]   [2000]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: RFC: big ac97_codec audio update
On Thu, 19 Oct 2000, Jeff Garzik wrote:

> It's a big update, but I think it is necessary.
> We need the new codec-specific init functions.
> We need the new ac97-valid-reg checking.
> We need the dynamic bit resolution detection.

Isn't this producing noise/pops? (since you maximize the volume).

>
> Full change description, and tested patch against 2.4.0-test10-pre4,
> follows. This includes some interface changes that may be
> objectionable, but I consider it to be fixing up an interface before
> final 2.4.0 release...
>
> Comments and feedback very much appreciated. This code is tested on via
> audio.
>
> Judging from comments already received, it looks like we need to do
> logarithmic instead of linear scaling for the OSS mixer values (0 -
> 100).

? The scale (AC97 and OSS) is linear in dB units which is,I believe, how
we perceive sound.

> This change affects a bunch of drivers, and needs lots of testing:
> maestro (when patched to use ac97_codec), trident, via, ymfpci, nm256
> (when patched), and others I am probably forgetting.

Could you include this macro (it gives you perfect accuracy and
prevents mistakes):

/* scales the range a:b to min:max rounding to the nearest integer */
#define scale_range(val, a, b, min, max) \
((((val) - a) * ((max) - (min)) + (min) * (b - a)) *
1000 + (b - a) * 500) / (1000 * (b - a))

and then calculate the volumes as:

left = scale_range(left, 1, 100, mh->scale, 0);

instead of

((100 - left) * scale) / 100);

I will provide a patch if you agree.


Everything else looks ok but I still need to test it.

Rui Sousa

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:41    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog