Update of /cvsroot/alsa/alsa-kernel/usb
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8502
Modified Files:
usbaudio.h usbmixer.c usbmixer_maps.c
Log Message:
added fix and workaround for the mixer problem on SB Extigy.
Index: usbaudio.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/usb/usbaudio.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- usbaudio.h 19 Jan 2004 19:33:46 -0000 1.23
+++ usbaudio.h 9 Mar 2004 16:57:34 -0000 1.24
@@ -136,6 +136,8 @@
struct list_head midi_list; /* list of midi interfaces */
int next_midi_device;
+
+ unsigned int ignore_ctl_error; /* for mixer */
};
/*
Index: usbmixer.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/usb/usbmixer.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- usbmixer.c 26 Sep 2003 14:29:05 -0000 1.24
+++ usbmixer.c 9 Mar 2004 16:57:36 -0000 1.25
@@ -667,13 +667,11 @@
for (c = 0; c < MAX_CHANNELS; c++) {
if (cval->cmask & (1 << c)) {
err = get_cur_mix_value(cval, c + 1, &val);
-#ifdef IGNORE_CTL_ERROR
- if (err < 0) {
- ucontrol->value.integer.value[0] = cval->min;
- return 0;
- }
-#endif
if (err < 0) {
+ if (cval->chip->ignore_ctl_error) {
+ ucontrol->value.integer.value[0] =
cval->min;
+ return 0;
+ }
snd_printd(KERN_ERR "cannot get current value
for control %d ch %d: err = %d\n", cval->control, c + 1, err);
return err;
}
@@ -685,13 +683,11 @@
} else {
/* master channel */
err = get_cur_mix_value(cval, 0, &val);
-#ifdef IGNORE_CTL_ERROR
- if (err < 0) {
- ucontrol->value.integer.value[0] = cval->min;
- return 0;
- }
-#endif
if (err < 0) {
+ if (cval->chip->ignore_ctl_error) {
+ ucontrol->value.integer.value[0] = cval->min;
+ return 0;
+ }
snd_printd(KERN_ERR "cannot get current value for control %d
master ch: err = %d\n", cval->control, err);
return err;
}
@@ -713,12 +709,11 @@
for (c = 0; c < MAX_CHANNELS; c++) {
if (cval->cmask & (1 << c)) {
err = get_cur_mix_value(cval, c + 1, &oval);
-#ifdef IGNORE_CTL_ERROR
- if (err < 0)
- return 0;
-#endif
- if (err < 0)
+ if (err < 0) {
+ if (cval->chip->ignore_ctl_error)
+ return 0;
return err;
+ }
val = ucontrol->value.integer.value[cnt];
val = get_abs_value(cval, val);
if (oval != val) {
@@ -732,10 +727,8 @@
} else {
/* master channel */
err = get_cur_mix_value(cval, 0, &oval);
-#ifdef IGNORE_CTL_ERROR
- if (err < 0)
+ if (err < 0 && cval->chip->ignore_ctl_error)
return 0;
-#endif
if (err < 0)
return err;
val = ucontrol->value.integer.value[0];
@@ -1025,12 +1018,10 @@
int err, val;
err = get_cur_ctl_value(cval, cval->control << 8, &val);
-#ifdef IGNORE_CTL_ERROR
- if (err < 0) {
+ if (err < 0 && cval->chip->ignore_ctl_error) {
ucontrol->value.integer.value[0] = cval->min;
return 0;
}
-#endif
if (err < 0)
return err;
val = get_relative_value(cval, val);
@@ -1045,12 +1036,11 @@
int val, oval, err;
err = get_cur_ctl_value(cval, cval->control << 8, &oval);
-#ifdef IGNORE_CTL_ERROR
- if (err < 0)
- return 0;
-#endif
- if (err < 0)
+ if (err < 0) {
+ if (cval->chip->ignore_ctl_error)
+ return 0;
return err;
+ }
val = ucontrol->value.integer.value[0];
val = get_abs_value(cval, val);
if (val != oval) {
@@ -1274,14 +1264,13 @@
int val, err;
err = get_cur_ctl_value(cval, 0, &val);
-#ifdef IGNORE_CTL_ERROR
if (err < 0) {
- ucontrol->value.enumerated.item[0] = 0;
- return 0;
- }
-#endif
- if (err < 0)
+ if (cval->chip->ignore_ctl_error) {
+ ucontrol->value.enumerated.item[0] = 0;
+ return 0;
+ }
return err;
+ }
val = get_relative_value(cval, val);
ucontrol->value.enumerated.item[0] = val;
return 0;
@@ -1294,12 +1283,11 @@
int val, oval, err;
err = get_cur_ctl_value(cval, 0, &oval);
-#ifdef IGNORE_CTL_ERROR
- if (err < 0)
- return 0;
-#endif
- if (err < 0)
+ if (err < 0) {
+ if (cval->chip->ignore_ctl_error)
+ return 0;
return err;
+ }
val = ucontrol->value.enumerated.item[0];
val = get_abs_value(cval, val);
if (val != oval) {
@@ -1509,9 +1497,13 @@
for (map = usbmix_ctl_maps; map->vendor; map++) {
if (map->vendor == dev->idVendor && map->product == dev->idProduct) {
state.map = map->map;
+ chip->ignore_ctl_error = map->ignore_ctl_error;
break;
}
}
+#ifdef IGNORE_CTL_ERROR
+ chip->ignore_ctl_error = 1;
+#endif
desc = NULL;
while ((desc = snd_usb_find_csint_desc(hostif->extra, hostif->extralen, desc,
OUTPUT_TERMINAL)) != NULL) {
Index: usbmixer_maps.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/usb/usbmixer_maps.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- usbmixer_maps.c 16 Jul 2003 11:38:05 -0000 1.5
+++ usbmixer_maps.c 9 Mar 2004 16:57:36 -0000 1.6
@@ -30,6 +30,7 @@
int vendor;
int product;
const struct usbmix_name_map *map;
+ int ignore_ctl_error;
};
/*
@@ -86,6 +87,7 @@
{ 26, "IEC958 Optical Playback" }, /* OT */
{ 27, NULL }, /* DISABLED: EU (for what?) */
/* 28: FU speaker (mute) */
+ { 29, NULL }, /* Digital Input Playback Source? */
{ 0 } /* terminator */
};
@@ -117,8 +119,8 @@
*/
static struct usbmix_ctl_map usbmix_ctl_maps[] = {
- { 0x41e, 0x3000, extigy_map },
- { 0xc45, 0x1158, justlink_map },
+ { 0x41e, 0x3000, extigy_map, 1 },
+ { 0xc45, 0x1158, justlink_map, 0 },
{ 0 } /* terminator */
};
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog