summaryrefslogtreecommitdiff
path: root/recipes/setmixer
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/setmixer
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/setmixer')
-rw-r--r--recipes/setmixer/devfs.patch25
-rw-r--r--recipes/setmixer/setmixer.patch78
-rw-r--r--recipes/setmixer/setmixer_27DEC94.bb15
3 files changed, 118 insertions, 0 deletions
diff --git a/recipes/setmixer/devfs.patch b/recipes/setmixer/devfs.patch
new file mode 100644
index 0000000000..d2b5c82df8
--- /dev/null
+++ b/recipes/setmixer/devfs.patch
@@ -0,0 +1,25 @@
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+--- setmixer-27DEC94.orig/setmixer.c~devfs
++++ setmixer-27DEC94.orig/setmixer.c
+@@ -27,7 +27,7 @@
+ #include <sys/ioctl.h>
+ #include <sys/soundcard.h>
+
+-#define MIXER "/dev/mixer"
++#define MIXER "/dev/sound/mixer"
+
+ const char * dname[] = SOUND_DEVICE_NAMES;
+
+@@ -65,7 +65,7 @@
+ }
+
+ if ((mixer_fd = open(MIXER, O_RDWR)) < 0) {
+- fprintf(stderr, "Error opening /dev/mixer.");
++ fprintf(stderr, "Error opening /dev/sound/mixer.");
+ exit(1);
+ }
+ if (ioctl(mixer_fd, SOUND_MIXER_READ_DEVMASK, &devmask) == -1) {
diff --git a/recipes/setmixer/setmixer.patch b/recipes/setmixer/setmixer.patch
new file mode 100644
index 0000000000..535ba3b082
--- /dev/null
+++ b/recipes/setmixer/setmixer.patch
@@ -0,0 +1,78 @@
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+--- setmixer-27DEC94.orig/Makefile~setmixer
++++ setmixer-27DEC94.orig/Makefile
+@@ -1,8 +1,8 @@
+ DESTDIR =
+ INSTALL = install
+ CC=gcc
+-CFLAGS= -O6 -fomit-frame-pointer -Wall -pipe -m486
+-LDFLAGS= -Xlinker -N -s
++CFLAGS= -O2 -fomit-frame-pointer -Wall -pipe
++#LDFLAGS= -Xlinker -N -s
+ PROG=setmixer
+
+ $(PROG): setmixer.o
+--- setmixer-27DEC94.orig/setmixer.c~setmixer
++++ setmixer-27DEC94.orig/setmixer.c
+@@ -36,7 +36,7 @@
+
+ int devmask, stereod, i, d;
+ int mixer_fd;
+- int lcval,rcval;
++ int lcval,rcval,oldlcval,oldrcval,val;
+ int verbose = 0;
+ size_t len;
+ char *endptr;
+@@ -52,9 +52,9 @@
+ }
+ }
+
+- if (!verbose && ((argc <= 0) || (argc & 1))) {
++ if ((!verbose && ((argc <= 0) || (argc & 1))) || (verbose && argc % 2)) {
+ fprintf(stderr, "usage: %s [-V] cntrl val [cntrl val ....]\n"
+- "where val is in 0-100 range and 'cntrl' is one of the following:\n\t",
++ "where val is in [+-]0-100 range and 'cntrl' is one of the following:\n\t",
+ prog);
+ for (i = 0; i < SOUND_MIXER_NRDEVICES; i++)
+ fprintf(stderr, "%s ", dname[i]);
+@@ -84,16 +84,36 @@
+
+ while (argc) {
+ cntrl = *argv++;
++ oldlcval = (('+' == **argv) || ('-' == **argv));
+ lcval = strtol(*argv++, &endptr, 0);
+ if (',' == *endptr) {
+ endptr += 1;
++ oldrcval = (('+' == *endptr) || ('-' == *endptr));
+ rcval = strtol((const char *)endptr, 0, 0);
+ }
+ else {
+ rcval = lcval;
++ oldrcval = oldlcval;
+ }
+ argc -= 2;
+ len = strlen(cntrl);
++ if (oldlcval || oldrcval) {
++ for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) {
++ if (0 == strncmp(dname[i], cntrl, len)) {
++ d = (1 << i);
++ if (0 != (devmask & d)) {
++ if (-1 == ioctl(mixer_fd, MIXER_READ(i), &val)) {
++ perror("MIXER_READ");
++ }
++ else {
++ lcval += oldlcval ? (val & 0x7f) : 0;
++ rcval += oldrcval ? ((val >> 8) & 0x7f) : 0;
++ }
++ }
++ break;
++ }
++ }
++ }
+ for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) {
+ if (0 == strncmp(dname[i], cntrl, len)) {
+ d = (1 << i);
diff --git a/recipes/setmixer/setmixer_27DEC94.bb b/recipes/setmixer/setmixer_27DEC94.bb
new file mode 100644
index 0000000000..25a07ce8ab
--- /dev/null
+++ b/recipes/setmixer/setmixer_27DEC94.bb
@@ -0,0 +1,15 @@
+DESCRIPTION = "A text mode OSS soundmixer"
+LICENSE = "GPL"
+SECTION = "console/utils"
+PRIORITY = "optional"
+SRC_URI = "${DEBIAN_MIRROR}/main/s/setmixer/setmixer_${PV}.orig.tar.gz \
+ file://setmixer.patch;patch=1"
+SRC_URI_append_mnci = " file://devfs.patch;patch=1"
+
+S = "${WORKDIR}/${PN}-${PV}.orig"
+
+
+do_install() {
+ mkdir -p ${D}${sbindir}
+ install -m 755 setmixer ${D}${sbindir}
+}