Subject: Re: eap(4) and ess(4) and mixer volume values
To: <>
From: Ignatios Souvatzis <is@beverly.kleinbus.org>
List: tech-kern
Date: 08/16/2000 07:46:27
On Tue, Aug 15, 2000 at 09:51:12PM +0000, Matthias Scheler wrote:
> 	Hello,
> 
> eap(4) and ess(4) both strip bits from the volume value passed to them
> by audio(4). eap(4) e.g. strips 3 bits from the volume value:
> 
> tron@lyssa:~>mixerctl -w outputs.master=42,77
> outputs.master: 224,224 -> 40,72
> 
> As a result of set applications the continously get and set the volume
> value (e.g. "fxtv" or the "realplayer-7.0nb2" package) slowly reduce the
> volume. In theory they should use the stripped value but because of some
> rounding error - maybe caused by the OSS audio layer - they don't.
> 
> So far I know two ways to fix eap(4):
> 
> (a) Always set the 3 lower bits in the volume value returned by a get
>     operation. That fixes the problem with "fxtv" completely for me.

a2) the X server porting guide suggests something like this for rounding
    color values when switching between HI and the 16 bit HD values:

    round to hardware:	hd = hi >> 3;
    expand to 16bits:	hi = hd << 3 + hd >> (16-3);

(replace 3 with your hardwares scaling value)

This way, 31 is translated to 255.

Regards,
	-is