Jacob Meuser wrote: > On Thu, Apr 09, 2009 at 12:07:37PM +0200, Dirk Mast wrote: >> > there are now at most 2 choices. analog or digital. and yes, there >> > are some codecs that only do analog and some that only to digital. >> >> Yeah, that makes it more complicated. >> >> Is the following if-construction too vague? >> >> if (dacs.ngroups = 1) { >> -- create the normal inputs.usingdac as it's done now >> -- we don't care if it's analog or digital > > actually in this case we don't create any knob, since it wouldn't > do anything.
This one should have been obvious ;) > >> elsif (dacs.ngroups = 2) { >> -- create a knob outputs.spdif (or something similar) >> -- problem is how to wire it: >> -- clean choice would of course to check the i/o pins >> -- maybe some other rules would apply? >> >> -- like first dac is always analog and second one digital? >> -- or maybe the longer dac group is analog and the shorter >> digital? -- I doubt there are azalia devices with more digital >> sections -- than analog sections >> } >> >> >> Personally I think reading the i/o pins would be much safer, >> but if it's really the case that those upper assumptions are >> always right, perhaps that would be another solution. > > I haven't yet seen multiple digital output transmitters in a single > codec. but that doesn't mean there aren't/won't be such codecs, though. Ok. >> (Otherwise this could bring big problems if there would be a >> non-"standard" azalia device sometimes...) > > heh. they all follow the standard, which allows many things. > > probably the best would be something more like: > > $ mixerctl -v outputs.mode > outputs.mode=analog [ analog digital ] > I _really_ like this one. > the problem with checking i/o pins and/or using 'spdif' is that there > may be both hdmi and s/pdif connections. this control only affects > which "dac group" is currently being used. it really has nothing to > do with the i/o pins. > I didn't know azalia also comes with hdmi. Since I can't help with any code, I'd be glad to test any patches.