Subject: Re: CVS commit: src/sys/dev/ic
To: David Young <dyoung@pobox.com>
From: Quentin Garnier <cube@cubidou.net>
List: source-changes
Date: 09/30/2003 06:19:09
Le Mon, 29 Sep 2003 18:30:51 -0500
David Young a ecrit :
> On Sun, Sep 28, 2003 at 10:24:09PM +0000, Quentin Garnier wrote:
[...]
> > Log Message:
> > Change the way of setting a port value so that a change too small to
> > fit in the number of bits used for the port still does something.
> > 
> > This fixes PR pkg/18741 for ac97-based hardware. Other audio drivers
> > might need a similar fix.
[...]
> I do not think that the kernel should second-guess the application this
> way. I think that most apps are (or will be) written with the
> expectation that the mixer settings are stateless. I.e., if I write
> volume=1 when the volume=0, then it should produce the same volume as
> when volume=1 and I write volume=1, namely volume=1.

But volume will never be at 1. The application will never read such value
from the mixer, if the delta is not 1.

[...]
> I think that to fix pkg/18741, mp3blaster should be changed so that
> it uses mixer ioctls to find out the width of the volume registers,
> and adjusts the granularity of its audio adjustments to suit. So that
> mp3blaster does not have to make a bunch of assumptions about the volume
> register, maybe there should be a mixer ioctl that tells its numeric
> range and/or least significant adjustment?

As Lennart said, this ioctl already exists. Both kind of applications can
use it. It's mostly a matter of knowing which we want to fix.

I'm ready to back this out, I'm not sure I'm ready to fix mp3blaster,
mplayer and all the other loosily programmed mixers.

I have yet to see an application that really minds my change, but I think
it would mean it suffers from the same limitation as mp3blaster: it just
assumes something about the delta of the mixer and is plain wrong.

We could also directly implement a '++/--' ioctl, that would do the job
correctly and leave the mixer stateless.

-- 
Quentin Garnier - cube@cubidou.net - cube@NetBSD.org
"Feels like I'm fiddling while Rome is burning down.
Should I lay my fiddle down and take a rifle from the ground ?"
Leigh Nash/Sixpence None The Richer, Paralyzed, Divine Discontents, 2002.