Subject: mixer oddities
To: None <current-users@netbsd.org>
From: Martijn van Buul <martijnb@atlas.ipv6.stack.nl>
List: current-users
Date: 04/24/2006 20:38:49
Hi. I finally found some time to investigate some minor mystery I've been
experiencing the last while: my master volume keeps resetting.

I can *set* the master volume just fine, using any random mixer program,
including "mixerctl -w outputs.master=200" or any other value. This will
work just great - but whenever a program *opens* the mixer device, 
outputs.master will revert to 127,127. This *only* happens to outputs.master,
and "mixerctl some.random.output" will do the trick. Further reading from the
mixer device will work as expected. 

I'll take 'nmixer' (part of audio/mp3blaster) as an example, as I'm familiar
with its internals. nmixer opens the mixer device once, and keeps it open
for the duration of the program. On every keypress, the current mixer
settings are read, the desired offset is added/subtracted, and written
back. (The rationale behind this is that another program could've modified
the mixer settings between keypresses, so nmixer doesn't keep an internal
state).

The program works as expected. I can easily modify the master volume settings -
but it resets to "127" at program start. This tells me that the actual
act of reading and writing to the master volume works as expected - if the
read would fail, the output would remain stuck, but it doesn't.

Any ideas? I'm quite sure this *used* to work normally a while ago.

Relevant bits of dmesg:
 
NetBSD 3.99.17 (ATLAS) #2: Tue Mar 21 19:50:15 CET 2006
        martijnb@atlas.ipv6.stack.nl:/usr/obj/sys/arch/amd64/compile/ATLAS
[...]
auich0 at pci0 dev 4 function 0: nForce4 AC-97 Audio
auich0: interrupting at ioapic0 pin 3 (irq 3)
auich0: ac97: Avance Logic ALC850 codec; no 3D stereo
auich0: ac97: ext id 9c6<AC97_23,LDAC,SDAC,CDAC,SPDIF,DRA>
[...]
audio0 at auich0: full duplex, independent