Contributed by weerd on from the mix-a-lot dept.
For the request for dmesgs, Jacob has built a set of kernels to test on i386 and amd64, both UP and MP (i386 UP, i386 MP, amd64 UP, amd64 MP) to make helping him even easier. Please download these kernels, boot them once and send the dmesg plus the output of mixerctl -v to jakemsr@ (please don't send your mail to misc@).
azalia(4), the driver for Intel HD audio, is the "problem child" of OpenBSD's audio(4). Intel's specification allows the codecs to be highly configurable. Even BIOSes can configure the codecs. The specification defines numerous widgets (converters, mixers, selectors, etc) which have numerous capabilities (direction, connection, etc).
To create a usable driver, the programmer has to get all the widgets configured correctly, and make it possible for the user to configure the device to his preference.
For OpenBSD, this means the mixer item names have to be meaningful.
For some codecs, we have static mixer definitions. Those completely ignore configuration information the BIOS may have set, and often leave out many controls. So while these may give a useful control like 'outputs.master', they are usually wrong in the big picture. Not to mention, creating and maintaining static mixer definitions for all BIOS/codec combinations would be entirely ridiculous. So these static definitiotns are to be removed in favor of using the generic mixer definition code.
Currently, the generic mixer item names generally refer to the type of widget they control (mix == mixer, sel == selector, etc). While these names tell us what kind of widget we can control, they tell us nothing about what they actually affect. Using my ALC883 codec as an example, 'outputs.mix2' controls the volume on the first two playback channels, 'outputs.mix3' the next two, then 'outputs.mix4', then 'outputs.mix5', then, uh, 'outputs.mix8'. This is not at all intuitive.
Now if instead those mixer items were named for the channels they affect, such as 'outputs.ch01', 'outputs.ch23', 'outputs.ch45', etc, then it is much more clear what these control do. Granted, this does seem a little odd at first glance, but this is straight-forward to document. 'ch01' is channels 0 and 1, or the first stereo output. 'ch23' is channels 2 and 3, or the second stereo output, 'ch45' is channels 4 and 5, or the third stereo output, etc. This naming cascades down to other controls as well. Using my ALC883 again as a example, the options for 'outputs.hp_source' change from '[ mix2 mix3 mix4 mix5 mix8 ]' to '[ ch01 ch23 ch45 ch67 ch89 ]'.
But there is a problem with these names. They are unknown to current audio(4) software. So for that, we can expand on our knowledge of channel controls and create "virtual" (cloned, actually) controls like 'outputs.master' to control the output volume on the first two stereo channles and 'record.volume' to control the volume on the first two recording channels. This also helps to avoid alienating long time OpenBSD users who just happen to have gotten an azalia in their new laptop ;)
So, that is basically the plan for azalia. I have diffs to implement this on my machine, and I'm happy with the outcome. I think if the user reads azalia(4) where the chXY names and other common controls will be documented, the user will be able to configure the device as intended without having to go through any trial and error.
But because there are so many codecs with so many possible configurations, the changes will come in pieces, to make sure that possible issues with the implementation of the plan can be fixed at their core, and not pasted over.
So I ask that anyone who would like to see improvements in their azalia's usefulness to please subscribe to tech@ and test patches as they are made available. I will try to make the process as streamlined and easy as possible.
Update (Wed Nov 26 00:32:16 CET 2008): Jacob has put up a website where you can find patches for more of the work on azalia he describes above. If you want to help out even further, please visit his site to find out what else needs testing.
(Comments are closed)