SAlsa |
2008-08-02
|
I'm sure the ALSA guys aren't doing this deliberately, but boy, is it ever not a painful exercise to set your mixer levels and controls correctly ?
Ok, arguably I have a quite complex onboard soundcard, but it's still an onboard soundcard. When you open up alsamixer and see all those labels that don't give you much information, you just get lost. Would it have been that hard for the ALSA guys to make it easier for driver developers to document their stuff ?
My particular onboard card is a VIA 8237 Realtek ALC850, and has coax and SPDIF output. It has controls like Center/LFE (but do they control analog or digital output ? who knows), IEC958 (how many people know that this is SPDIF ?) and IEC958 Output (though it is the former that controls SPDIF output, not the latter, go figure), there's Duplicate Front (I enabled it but strangely enough my computer did not pop out another computer front plate as I expected), and then there is VIA DXS, VIA DXS1, VIA DXS2, and VIA DXS3. And I left out at least two times more controls.
Today I finally figured out how to get my digital output to directly take the PCM data (the actual digital samples) instead of having the digital output take in the Analog Output. But it probably was the most non-obvious ALSA thing I've ever had the non-pleasure of having to do.
There is one control labeled IEC958 Playback AC97-SPSA, which is a level control with only 4 steps (0, 33, 66, 100%). Much like the Mic Input on some webcams I have. Strangely enough, that setting didn't ever seem to affect any volume in my experimentation, but hey, so don't most of the other level controls anyway, so I never looked into it further.
Today, upgrading my media machine from F8 to F9, my obtained-through-careful-random-experimentation asound.state didn't work on F9. So I set out to experiment again and this time, document my settings. Which is when I, completely by accident, tweaked this level control.
And, apparently, setting it to 0% makes the PCM setting on the following switch (IEC958 Playback Source) work and give me completely digital PCM output. Completely puzzled, I started Googling for this card and this setting, and found a close-enough wiki page documenting a previous model and saying this about the setting I tweaked:
f the playback device indicates a link is present, but makes no sound, check the mixer 'IEC958 Playback AC97-SPSA'. The S/PDIF always outputs at full volume - even muting the master or PCM mixers does not affect the S/PDIF volume. The meanings of the settings for 'IEC958 Playback AC97-SPSA' are
0. PCM1
1. PCM2,PCM1 (rear)
2. Centre and LFE
3. PCM3,Modem,Dedicated S/PDIFMost users will want it set to 0 (PCM1). Some of the 82xx chips have a dedicated S/PDIF port, which is (I assume) accessed by setting it to 3 (Dedicated S/PDIF). The default appears to be 3.
I don't claim to understand much of that explanation, apart from the fact that this is obviously a switch between inputs or outputs and thus affects internal routing.
If I lost you by now, here's the one-line summary: this driver implements a four-state switch with a slider control. And it's not because he wasn't able to figure out switches either - the driver has 6 or more switches for other settings.
This is a control that is labeled such that you can't understand it, with a control that hides what it actually does and suggest it does something else, and controls whether your card works at all. Well done, driver developer guy.
I wish it were me, but hey, I'm an audio engineer, and I set up technical infrastructure for two actual radio stations. That complex 75k euro mixing desk was easier to figure out and program than this simple onboard sound card - and the mixing desk was only programmable in assembler!
I filed this bug - yet another notch on my totem of bugtracker accounts.