Update of /cvsroot/alsa/alsa-kernel/usb
In directory sc8-pr-cvs1:/tmp/cvs-serv13649

Modified Files:
        usbaudio.c usbmixer.c 
Log Message:
- don't create controls from selector units with a single content.
- suppress the error if async-out or adaptive-in has only one EP.
  don't create a sync pipe in this case.



Index: usbaudio.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/usb/usbaudio.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -r1.64 -r1.65
--- usbaudio.c  16 Sep 2003 06:55:18 -0000      1.64
+++ usbaudio.c  24 Sep 2003 13:12:50 -0000      1.65
@@ -1095,12 +1095,16 @@
        subs->fill_max = 0;
 
        /* we need a sync pipe in async OUT or adaptive IN mode */
+       /* check the number of EP, since some devices have broken
+        * descriptors which fool us.  if it has only one EP,
+        * assume it as adaptive-out or sync-in.
+        */
        attr = fmt->ep_attr & EP_ATTR_MASK;
-       if ((is_playback && attr == EP_ATTR_ASYNC) ||
-           (! is_playback && attr == EP_ATTR_ADAPTIVE)) {
-               /* check endpoint */
-               if (altsd->bNumEndpoints < 2 ||
-                   get_endpoint(alts, 1)->bmAttributes != 0x01 ||
+       if (((is_playback && attr == EP_ATTR_ASYNC) ||
+            (! is_playback && attr == EP_ATTR_ADAPTIVE)) &&
+           altsd->bNumEndpoints >= 2) {
+               /* check sync-pipe endpoint */
+               if (get_endpoint(alts, 1)->bmAttributes != 0x01 ||
                    get_endpoint(alts, 1)->bSynchAddress != 0) {
                        snd_printk(KERN_ERR "%d:%d:%d : invalid synch pipe\n",
                                   dev->devnum, fmt->iface, fmt->altsetting);

Index: usbmixer.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/usb/usbmixer.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- usbmixer.c  20 Aug 2003 09:59:59 -0000      1.22
+++ usbmixer.c  24 Sep 2003 13:12:50 -0000      1.23
@@ -1358,6 +1358,9 @@
                return -EINVAL;
        }
 
+       if (num_ins == 1) /* only one ? nonsense! */
+               return 0;
+
        if (check_ignored_ctl(state, unitid, 0))
                return 0;
 



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to