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. > 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. > (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 ] 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. > > Note: I can't code C this is why I try to describe my thoughts.. > > >> I think another way would be if azalia could sense a plugged cable, > >> like it can do with headphones, that signal could then be used to > >> toggle on/off. > > > > jack sense capability isn't a mandatory feature, so it's not a > > reliable method. > > > > Ok. > -- jake...@sdf.lonestar.org SDF Public Access UNIX System - http://sdf.lonestar.org