Subject: Re: kern/29178: confusing behaviour because mixer classes in eap driver are misnamed
To: None <,,>
From: Frederick Bruckman <>
List: netbsd-bugs
Date: 02/12/2005 00:31:01
The following reply was made to PR kern/29178; it has been noted by GNATS.

From: (Frederick Bruckman)
To: Joachim Kuebart <>
Subject: Re: kern/29178: confusing behaviour because mixer classes in eap driver are misnamed
Date: Fri, 11 Feb 2005 18:29:59 -0600 (CST)

 In article <>,
 	Joachim Kuebart <> writes:
 > 	There are two problems with this: firstly, a study of
 > 	<> reveals
 > 	that the mixers addressed by the inputs.* volume settings actually
 > 	affect both the play-through as well as the recording volume. This
 > 	means that they should be in the record.* class rather than the
 > 	inputs.* class according to my understanding of the following section
 > 	of audio(9):
 > 		Each of the named sources for which the recording level can
 > 		be set should have a control in the AudioCrecord class of
 > 		type AUDIO_MIXER_VALUE...
 > 		Controls for various sources that affect only the playback
 > 		output, as opposed to recording, should be in the
 > 		AudioCinputs class.
 I wrote that text, but I'm not so sure now it make sense. I thought all
 the underlying hardware would like this this:
         INPUT \
         RECORD /
 ...but it sounds like yours, at least, goes like this:
 If that's the case, "input" seems like a a better name for a mixer node
 that controls *both* playback and record, doesn't it?  (If you agree, I
 could change that man page.)
 > 	Note that the AK4531 does not have any volume controls that affect
 > 	only playback (except for outputs.master, obviously).
 > 	Secondly, the control is apparently wrong as it is
 > 	supposed to refer to output destinations, cf. again audio(9):
 > 		If the play mixer is capable of output to more than one
 > 		destination, it should define AudioNselect in class
 > 		AudioCoutputs. This mixer control should be of type
 > 		AUDIO_MIXER_ENUM or AUDIO_MIXER_SET and enumerate the
 > 		possible destinations.
 > 	Instead, the channel names in the above example as well as the
 > 	circuitry inside the AK4531 show that these controls actually control
 > 	which inputs are switched through to the output mixer. The sentence
 > 		...various sources in class AudioCrecord will be combined and
 > 		presented to the single recording output, in the same fashion
 > 		that the sources of class AudioCinputs are combined and
 > 		presented to the playback output(s).
 > 	in audio(9) suggests that this is what the control is
 > 	supposed to do.
 Yes, I agree completely. (I wrote that text, too.)
 > 	Note again that the AK4531 has only one output and thus does not
 > 	offer the functionality described for
 The idea behind my last change to the audio layer, was for the volume
 setter to prefer the mixer and the detail control if available, else to
 go with the master. I didn't get to test with anything that had an
 "", so I guessed as best I could. It sounds like this is
 a bug in the underlying driver, though. 
 > 	The described problem appears to be one of nomenclature at first
 > 	sight, but it actually has a greater effect on how the "port" value
 > 	in AUDIO_SET and AUDIO_GET ioctls is treated. With the current
 > 	implementation, one has the problem that an audio program that
 > 	selects "speaker" output (as, for example, libmikmod) will instead
 > 	deactivate output alltogether because the control gets
 > 	set to zero for want of a mixer labelled "speaker" on the AK4531.
 > 	This is clearly not the intended behaviour.
 If you trim your patch to only change the to,
 does that still fix your problem with "mikmod"?
 I have an "eap", which however doesn't even have an "":
 	# grep eap /var/run/dmesg.boot 
 	eap0 at pci4 dev 6 function 0: Ensoniq AudioPCI 97 ES1371-B (rev. 0x09)
 	eap0: interrupting at ioapic0 pin 20 (irq 5)
 	eap0: ac97: Crystal CS4297A codec; headphone, 20 bit DAC, 18 bit ADC, Crystal Semi 3D
 	eap0: ac97: ext id 200<AMAP>
 	audio0 at eap0: full duplex, mmap, independent
 	midi0 at eap0: AudioPCI MIDI UART
 	# mixerctl -a | grep outputs  
 I suppose many don't, so that one change should be "safe".
 Kind regards,