Hi Adrian,

here's a patch that might fix the problem. It includes the previous patch. Let 
me know if it helps.

Cheers,

Laurent Pinchart
Index: uvc_video.c
===================================================================
--- uvc_video.c	(revision 75)
+++ uvc_video.c	(working copy)
@@ -168,11 +168,13 @@
 		goto done;
 
 	/* Get the minimum and maximum values for compression settings. */
-	if ((ret = uvc_get_video_ctrl(video, &probe_min, 1, GET_MIN)) < 0 ||
-	    (ret = uvc_get_video_ctrl(video, &probe_max, 1, GET_MAX)) < 0)
-		goto done;
+	if (!(video->dev->quirks & UVC_QUIRK_STATUS_INTERVAL)) {
+		if ((ret = uvc_get_video_ctrl(video, &probe_min, 1, GET_MIN)) < 0 ||
+		    (ret = uvc_get_video_ctrl(video, &probe_max, 1, GET_MAX)) < 0)
+			goto done;
 
-	probe->wCompQuality = probe_max.wCompQuality;
+		probe->wCompQuality = probe_max.wCompQuality;
+	}
 
 	for (i = 0; i < 2; ++i) {
 		if ((ret = uvc_set_video_ctrl(video, probe, 1)) < 0 ||
@@ -183,6 +185,11 @@
 		if (bandwidth <= video->streaming->maxpsize)
 			break;
 
+		if (video->dev->quirks & UVC_QUIRK_PROBE_MINMAX) {
+			ret = -ENOSPC;
+			goto done;
+		}
+
 		/* TODO: negotiate compression parameters */
 		probe->wKeyFrameRate = probe_min.wKeyFrameRate;
 		probe->wPFrameRate = probe_min.wPFrameRate;
Index: uvc_driver.c
===================================================================
--- uvc_driver.c	(revision 75)
+++ uvc_driver.c	(working copy)
@@ -14,7 +14,8 @@
 /*
  * WARNING: This driver is definitely *NOT* complete. It will (hopefully)
  * support UVC devices with a camera sensors, a processing unit and several
- * optional extension units. Everything else is unsupported.
+ * optional extension units. Single-input selector units are ignored.
+ * Everything else is unsupported.
  *
  * The driver doesn't support the deprecated v4l1 interface. It implements the
  * mmap capture method only, and doesn't do any image format conversion in
@@ -994,9 +995,16 @@
 
 /*
  * Scan the UVC descriptors to locate a chain starting at an Output Terminal
- * and containing only a Processing Unit, optional Extension Units and an
- * Input Terminal. A side forward scan is made on each detected entity to
- * check for additional extension units.
+ * and containing the following units:
+ *
+ * - a USB Streaming Output Terminal
+ * - zero or one Processing Unit
+ * - zero, one or mode single-input Selector Units
+ * - zero, one or mode single-input Extension Units
+ * - one Camera Input Terminal, or one or more External terminals.
+ *
+ * A side forward scan is made on each detected entity to check for additional
+ * extension units.
  */
 static int uvc_scan_chain(struct uvc_video_device *video)
 {
@@ -1069,10 +1077,16 @@
 			break;
 
 		case VC_SELECTOR_UNIT:
-			uvc_trace(UVC_TRACE_DESCR, "Selector units are not "
-				"supported yet.\n");
-			return -1;
+			if (entity->selector.bNrInPins != 1) {
+				uvc_trace(UVC_TRACE_DESCR, "Multiple-input "
+					"selector units are not supported "
+					"yet.\n");
+				return -1;
+			}
 
+			id = entity->selector.baSourceID[0];
+			break;
+
 		default:
 			uvc_trace(UVC_TRACE_DESCR, "Unsupported unit type "
 				"0x%04x found in chain.n", entity->type);
@@ -1407,6 +1421,16 @@
 	  .bInterfaceProtocol	= 0,
 	  .driver_info		= UVC_QUIRK_STATUS_INTERVAL
 	},
+	/* Creative Live! Optia */
+	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
+				| USB_DEVICE_ID_MATCH_INT_INFO,
+	  .idVendor		= 0x041e,
+	  .idProduct		= 0x4057,
+	  .bInterfaceClass	= USB_CLASS_VIDEO,
+	  .bInterfaceSubClass	= 1,
+	  .bInterfaceProtocol	= 0,
+	  .driver_info		= UVC_QUIRK_PROBE_MINMAX
+	},
 	/* Generic USB Video Class */
 	{ USB_INTERFACE_INFO(USB_CLASS_VIDEO, 1, 0) },
 	{}
Index: uvcvideo.h
===================================================================
--- uvcvideo.h	(revision 75)
+++ uvcvideo.h	(working copy)
@@ -236,6 +236,7 @@
 
 /* Devices quirks */
 #define UVC_QUIRK_STATUS_INTERVAL	0x00000001
+#define UVC_QUIRK_PROBE_MINMAX		0x00000002
 
 /* ------------------------------------------------------------------------
  * Structures.
_______________________________________________
Linux-uvc-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel

Reply via email to