Linux-kernel mailing list archive 1997-49,: Re: Sound driver changes

# Re: Sound driver changes

C. Scott Ananian (cananian@lcs.mit.edu)
Sun, 7 Dec 1997 22:38:11 -0500 (EST)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Drago: "Routing"
- Previous message: AndroSyn: "Command line patch for ide-dma.c"

On Sun, 7 Dec 1997 linux kernel account <linker@nightshade.z.ml.org> wrote:

> Okay now, whats with the kernel now setting my awe32s volume setting
> WEIRD?

I find that a user mode utility is more useful than depending on
proper setup in the kernel. After all, everyone's mappings and
preferences are different, and a volume-set utility in rc.local takes
very little effort. Here is code to get you started -- this just
turns off the microphone volume on bootup. Obviously someone could
expand this to take command line arguments and setup any mixer channel
the kernel knows about -- hopefully they'd post the code back to the
list in that case.

------------ begin mute.c ----------
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <linux/soundcard.h>

int main(int argc, char **argv) {
int n = 0;
int mixer = open("/dev/mixer", O_RDWR);
if (!(mixer<0)) {
ioctl(mixer, SOUND_MIXER_WRITE_MIC, &n);
close(mixer);
return 0;
} else return 1;
}
------------ end mute.c ------------
--Scott
@ @
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-oOO-(_)-OOo-=-=-=-=-=
C. Scott Ananian: cananian@lcs.mit.edu / Declare the Truth boldly and
Laboratory for Computer Science/Crypto / without hindrance.
Massachusetts Institute of Technology /META-PARRESIAS AKOLUTOS:Acts 28:31
-.-. .-.. .. ..-. ..-. --- .-. -.. ... -.-. --- - - .- -. .- -. .. .- -.
PGP key available via finger and from http://www.pdos.lcs.mit.edu/~cananian

- Next message: Drago: "Routing"
- Previous message: AndroSyn: "Command line patch for ide-dma.c"