Subject: re: About CS4231 sound driver output control
To: None <mrg@eterna.com.au>
From: Sung-Won Chung <swchung7@hotmail.com>
List: tech-kern
Date: 08/23/2002 11:06:42
>    FWIW, I experimented a bit and found that renaming monitor -> outputs 
>breaks
>    "audioctl -w play.gain=X" (again). I now commited a slightly different
>    version, that allows you to turn off the internal (mono) speaker via
>
>      mixerctl -w monitor.mono=off
>
>ah!! that would be why i never commited a similar change i had in
>my tree for a couple of years (and removed earlier this year.)

Hi, here is late morning. :)

The reason is because general audio(9) driver

	1. only accepts a mixer device whose class is MONITOR_CLASS
	   class and name is audioNmaster as a master port.

	   (audioattach() & au_check_port() in audio.c do this.)

	2. If audio program such as 'audioctl' requests an ioctl()
	   to control volume, without specifying a certain part of
	   mixer device, general audio driver attempt to use a master port.
	   If there are not a registered master port, then the general
	   audio driver cancel the ioctl() request.

	   (au_set_gain() in audio.c do this.)

	3. monitor.mute only decide whether to do digital loopback or not.
	   That is, when monitor.mute is off and input such as microphone
	   is used, output would have sum of play and record signal.
	   When monitor.mute is on, loopback doesn't occur and output is
	   composed of only play signal.

	   Also, according to CS4231 chip documentation, monitor
	   volume controls how much input signal from DAC is feed back
	   to output signal, not the general volume.

So, by the general audio driver, overall volume control mixer device
should have its name as 'monitor.master'. Otherwise, 'audioctl -w play.gain'
becomes ineffective. But the other functionalities, naming is not 
restrictive,
since class_type and mixer device name are separate things.

Considering that, to fully exploit cs4231 including digital feedback and
overall volume control, I think one of a possible mixer configuration
about output may be

	monitor=0,0 volume
	monitor.mute=on [on off]
	output.master=220,220 volume
	output.headphones.mute=off [on off]
	output.speaker.mute=on [on off]
	output.line.mute=on [on off].

And to do so, I think tiny modification of general audio driver in
au_check_port() to permit a mixer device whose class is OUTPUT_CLASS
to be a master port is reasonable.

Sung-Won

_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com