Hi,

> I have a built-in iSight camera and I succeed to make it work with
> the kernel 2.6.20 and the experimental iSight driver that were there
> at this time.
> 
> But now it is with uvc, i can't make it work again. The problem I
> have is that there is no device like /dev/video0.
> 
> So here is my dmesg when I load the uvc driver:
> 
> --- Linux video capture interface: v2.00 usbcore: registered new
> interface driver uvcvideo USB Video Class driver (v0.1.0) ---
> 
> This is some part of my modprobe.conf:
> 
> --- install uvcvideo /opt/macbook/uvc/extract
> /opt/macbook/iSight.firmware && /sbin/modprobe --ignore-install
> uvcvideo $CMDLINE_OPTS ---
> 
> And this is the output when I modprobe uvcvideo:
> 
> --- Apple iSight with firmware already loaded found Apple iSight with
> firmware already loaded found ---
> 
> Currently I'm using the kernel 2.6.22 packaged by ArchLinux and 
> uvcvideo svn revision 126.
I do not really know what is wrong with your setup, but I attached the
patch that makes rev 126 work with my 2.6.22 kernel on openSUSE.

This patch is from Ivan. N. Zlatev
http://i-nz.net/projects/linux-kernel/. This great patch includes kernel
firmware loading therefore you do not have to load the firmware by hand.
I extracted it from the openSUSE uvcvideo.src.rpm and applied it to
current SVN.

The camera works for me now with mplayer
(mplayer tv:// -tv driver=v4l2:device=/dev/video0 -fps 30)
and kopete and ekiga.

HTH
Felix Möller
Index: uvc_video.c
===================================================================
--- uvc_video.c	(Revision 126)
+++ uvc_video.c	(Arbeitskopie)
@@ -22,6 +22,7 @@
 #include <asm/atomic.h>
 
 #include "uvcvideo.h"
+#include "isight.h"
 
 /* ------------------------------------------------------------------------
  * UVC Controls
@@ -460,7 +461,21 @@
 				"lost (%d).\n", urb->iso_frame_desc[i].status);
 			continue;
 		}
+	    if (is_isight(urb->dev) == 0) {
+		do {
+			ret = isight_decode_video(queue, buf,
+				urb->transfer_buffer + urb->iso_frame_desc[i].offset,
+				urb->iso_frame_desc[i].actual_length);
 
+			if (buf == NULL)
+				break;
+
+			if (buf->state == UVC_BUF_STATE_DONE ||
+			    buf->state == UVC_BUF_STATE_ERROR)
+				buf = uvc_queue_next_buffer(queue, buf);
+		} while (ret == -EAGAIN);
+	    } else {
+
 		/* Decode the payload header. */
 		mem = urb->transfer_buffer + urb->iso_frame_desc[i].offset;
 		do {
@@ -483,6 +498,7 @@
 		if (buf->state == UVC_BUF_STATE_DONE ||
 		    buf->state == UVC_BUF_STATE_ERROR)
 			buf = uvc_queue_next_buffer(queue, buf);
+	    }
 	}
 }
 
@@ -492,6 +508,19 @@
 	u8 *mem;
 	int len, ret;
 
+    if (is_isight(urb->dev) == 0) {
+	do {
+		ret = isight_decode_video(queue, buf,
+			urb->transfer_buffer, urb->actual_length);
+
+		if (buf == NULL)
+			break;
+
+		if (buf->state == UVC_BUF_STATE_DONE ||
+		    buf->state == UVC_BUF_STATE_ERROR)
+			buf = uvc_queue_next_buffer(queue, buf);
+	} while (ret == -EAGAIN);
+    } else {
 	mem = urb->transfer_buffer;
 	len = urb->actual_length;
 	queue->bulk.payload_size += len;
@@ -545,6 +574,7 @@
 		queue->bulk.skip_payload = 0;
 		queue->bulk.payload_size = 0;
 	}
+    }
 }
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
Index: uvc_driver.c
===================================================================
--- uvc_driver.c	(Revision 126)
+++ uvc_driver.c	(Arbeitskopie)
@@ -43,6 +43,7 @@
 #endif
 
 #include "uvcvideo.h"
+#include "isight.h"
 
 #define DRIVER_AUTHOR		"Laurent Pinchart <[EMAIL PROTECTED]>"
 #define DRIVER_DESC		"USB Video Class driver"
@@ -89,6 +90,12 @@
 		.fcc		= V4L2_PIX_FMT_UYVY,
 		.flags		= 0,
 	},
+	{
+		.name		= "YUV 4:2:2 (MACOSX)",
+		.guid		= UVC_GUID_FORMAT_YUY2_MACOSX,
+		.fcc		= V4L2_PIX_FMT_UYVY,
+		.flags		= 0,
+	},
 };
 
 #if 0
@@ -838,14 +845,15 @@
 						udev->devnum, i);
 					continue;
 				}
-
+			
+				printk(KERN_DEBUG "intf->cur_altsetting->desc.bInterfaceSubClass %d \nSC_VIDEOSTREAMING %d \nudev->devnum %d\ni %d\n", dev->intf->cur_altsetting->desc.bInterfaceSubClass, SC_VIDEOSTREAMING, udev->devnum, i);
 				if (intf->cur_altsetting->desc.bInterfaceSubClass
 					!= SC_VIDEOSTREAMING) {
 					uvc_trace(UVC_TRACE_DESCR, "device %d "
 						"interface %d isn't a video "
 						"streaming interface\n",
 						udev->devnum, i);
-					continue;
+		//			continue;
 				}
 
 				if (usb_interface_claimed(intf)) {
@@ -1503,6 +1511,16 @@
 	kfree(dev);
 }
 
+static int uvc_load_firmware (struct usb_device *dev)
+{
+	int success = 0;
+
+	if (is_isight (dev) == 0) {
+		success = isight_load_firmware (dev);
+	}
+	return success;
+}
+
 static int uvc_probe(struct usb_interface *intf,
 		     const struct usb_device_id *id)
 {
@@ -1522,6 +1540,9 @@
 	if ((dev = kzalloc(sizeof *dev, GFP_KERNEL)) == NULL)
 		return -ENOMEM;
 
+	if (uvc_load_firmware (udev) < 0)
+		return -ENODEV;
+
 	INIT_LIST_HEAD(&dev->entities);
 	INIT_LIST_HEAD(&dev->streaming);
 	kref_init(&dev->kref);
@@ -1578,7 +1599,7 @@
 	 */
 	usb_set_intfdata(intf, NULL);
 
-	if (intf->cur_altsetting->desc.bInterfaceSubClass == SC_VIDEOSTREAMING)
+//	if (intf->cur_altsetting->desc.bInterfaceSubClass == SC_VIDEOSTREAMING)
 		return;
 
 	/* uvc_v4l2_open() might race uvc_disconnect(). A static driver-wide
@@ -1605,9 +1626,11 @@
 
 	uvc_trace(UVC_TRACE_SUSPEND, "Suspending interface %u\n",
 		intf->cur_altsetting->desc.bInterfaceNumber);
-
+	printk ("Suspending interface %u\n",
+                intf->cur_altsetting->desc.bInterfaceNumber);
+	printk ("intf->cur_altsetting->desc.bInterfaceSubClass %d, SC_VIDEOCONTROL %d", intf->cur_altsetting->desc.bInterfaceSubClass,  SC_VIDEOCONTROL); 
 	/* Controls are cached on the fly so they don't need to be saved. */
-	if (intf->cur_altsetting->desc.bInterfaceSubClass == SC_VIDEOCONTROL)
+	if (intf->cur_altsetting->desc.bInterfaceSubClass |= SC_VIDEOCONTROL | 1)
 		return 0;
 
 	if (dev->video.streaming->intf != intf) {
@@ -1626,7 +1649,7 @@
 	uvc_trace(UVC_TRACE_SUSPEND, "Resuming interface %u\n",
 		intf->cur_altsetting->desc.bInterfaceNumber);
 
-	if (intf->cur_altsetting->desc.bInterfaceSubClass == SC_VIDEOCONTROL)
+	if (intf->cur_altsetting->desc.bInterfaceSubClass |= SC_VIDEOCONTROL | 1)
 		return uvc_ctrl_resume_device(dev);
 
 	if (dev->video.streaming->intf != intf) {
@@ -1755,6 +1778,22 @@
 	  .bInterfaceProtocol	= 0,
 	  .driver_info		= UVC_QUIRK_PROBE_MINMAX
 	},
+	/* Apple Built-In iSight - with firmware loaded */
+	{ .match_flags          = USB_DEVICE_ID_MATCH_DEVICE,
+	  .idVendor             = 0x05ac,
+	  .idProduct            = 0x8501,
+	  .driver_info          = UVC_QUIRK_PROBE_MINMAX
+	},
+	/* Apple Built-In iSight - no firmware loaded */
+	{ .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
+				  | USB_DEVICE_ID_MATCH_INT_INFO,
+	  .idVendor             = 0x05ac,
+	  .idProduct            = 0x8300,
+	  .bInterfaceClass      = USB_CLASS_VENDOR_SPEC,
+	  .bInterfaceSubClass   = 0xff,
+	  .bInterfaceProtocol   = 0xff,
+	  .driver_info          = UVC_QUIRK_PROBE_MINMAX
+	},
 	/* Generic USB Video Class */
 	{ USB_INTERFACE_INFO(USB_CLASS_VIDEO, 1, 0) },
 	{}
Index: uvcvideo.h
===================================================================
--- uvcvideo.h	(Revision 126)
+++ uvcvideo.h	(Arbeitskopie)
@@ -224,6 +224,8 @@
 				 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
 #define UVC_GUID_FORMAT_UYVY	{ 'U',  'Y',  'V',  'Y', 0x00, 0x00, 0x10, 0x00, \
 				 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
+#define UVC_GUID_FORMAT_YUY2_MACOSX	{ 'Y',  'U',  'Y',  '2', 0x00, 0x00, 0x10, 0x00, \
+				 0x00, 0x80, 0x71, 0x9b, 0x38, 0x00, 0xaa, 0x00}
 
 
 /* ------------------------------------------------------------------------
Index: Makefile
===================================================================
--- Makefile	(Revision 126)
+++ Makefile	(Arbeitskopie)
@@ -5,7 +5,7 @@
 PWD		:= $(shell pwd)
 
 obj-m		:= uvcvideo.o
-uvcvideo-objs   := uvc_driver.o uvc_queue.o uvc_v4l2.o uvc_video.o uvc_ctrl.o
+uvcvideo-objs   := uvc_driver.o uvc_queue.o uvc_v4l2.o uvc_video.o uvc_ctrl.o isight.o
 
 all: uvcvideo
 
_______________________________________________
Linux-uvc-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel

Reply via email to