Soundcard tweaking: `mixer' v. `sysctl' ?

Barry Bouwsma freebsd-misuser at remove-NOSPAM-to-reply.NOSPAM.dyndns.dk
Tue Nov 30 12:33:26 PST 2004


[drop me from replies and I'll catch up from the archives RSN]


I seek guidance in my hideous hacking.

I have multiple sound cards based on the CMI8738 chip with spdif
input in one machine, for which I was using hacked kernel modules
to select either optical or coaxial spdif input from both cards.

The cmpci driver under NetBSD has far more functionality, allowing
one to use mixerctl/audioctl to access much more than FreeBSD's
mixer or sysctl can give me.  Now that I'm wanting to record from
different sources on the two cards, as well as having been spoilt
by what NetBSD is able to offer in monitoring and whatnot, I'm
wanting to hack comparable functionality into my FreeBSD kernel
modules.

My first ugly hack makes use of two added mixer inputs to allow
me to select one of the two spdif inputs independently of the
other card, with `mixer', whee.  After I had had no luck with my
wish to use a sysctl to select recording source like the NetBSD
mixerctl program.

First question, am I missing anything that gives sysctl-like
control over sound devices, under my FreeBSD4?


Secondly, after another attempt to whup the sysctl into
submission, I had success.  Yow.  So I was able to duplicate
my `mixer' input source selection hack as a `sysctl' input
source selection hack, as well as introduce a handful of
other sysctl knobs to be used to tweak things important to
me, leaving the door open for others.

So, should I give up on `mixer' in favour of `sysctl' to
select recording source (the spdif inputs are exclusive),
or is it still reasonable/preferable to use `mixer =rec dig1'
as my earlier hacks allow (haven't tried to make those
disappear from the mixer itself, as the level cannot
be adjusted) ?


In addition, for something like enabling spdif monitor to the
analog outputs (which NetBSD's mixerctl spdif.monitor allows
me to do), should this be done with a sysctl, as my later
hack does, or by something else?  There's already one sysctl
for this sound driver to enable spdif playback output, so I
would imagine this is the way to go.


Apologies for my stupidity.  And I'll submit (ugly) patches,
when I'm happy with my hacks.  If desired.


thanks
barry bouwsma



More information about the freebsd-hackers mailing list