On 07/29/14 17:15, Bradley Conroy wrote: > /* mix.c - A very basic mixer. > * > * Copyright 2014 Brad Conroy, dedicated to the Public Domain. > *
I redid mix.c because it segfaulted when I tried it. It still doesn't _work_ for me, but neither does aumix or the xfce volume control knob on this netbook. (I have to pull up pavucontrol, go to tab #3 "output devices", scroll down to "Built-in Analog Stero" (which you can't see unless you know to scroll down), and then adjust the volume there. And every time I plug/unplug headphones I have to go there to unmute it, which is a separate button from the volume slider. If you wonder why I upgrade infrastructure slowly, it's because working out each new giant stack of workarounds for whatever they broke this time is extremely time consuming.) Anyway, mix.c: Add help text to describe what the options do. I renamed the options because -m specifying the device in /dev and -d specifying the "device" that's a data channel name was mondo confusing. So now there's "-d" for device node and "-c" for channel. (Except is it ever _not_ /dev/mixer? If that's not there you probably need to modprobe snd-mixer-oss.) Style: I tend to #include toys.h and then have any #include <linux/blah.h> afterwards. Just trying to be consistent. And the usual whitespace stuff. The GLOBALS block: # entries fill out longs, not ints. This is probably why it was segfaulting for me, -d was filling out the slot for -m and the slot for -d was null even when the flag was set. The two i=0; i<NRDEVICES loops got merged, and they do more now: if you specify -l but not -c it uses the first channel it finds. If you specify -c but not -l it shows volume for that channel. If you specify neither, it lists available channels. The close(fd) at the end only happens with CFG_TOYBOX_FREE. (And it's fd, not "mixer". I'm reluctant to promote this without being able to test it, but it's making the syscall (which is returning success for me even though it didn't DO anything, thank you ubuntu 12.04). If anybody with appropriate hardware could test this, I'd appreciate it. (Possibly I should add alsa support to this, but I dunno the API.) Rob _______________________________________________ Toybox mailing list [email protected] http://lists.landley.net/listinfo.cgi/toybox-landley.net
