From owner-freebsd-usb@FreeBSD.ORG Thu Nov 1 11:40:43 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 57DA8FA7 for ; Thu, 1 Nov 2012 11:40:43 +0000 (UTC) (envelope-from toshi@ruby.ocn.ne.jp) Received: from defer115.ocn.ad.jp (defer115.ocn.ad.jp [125.206.148.13]) by mx1.freebsd.org (Postfix) with ESMTP id 06E288FC08 for ; Thu, 1 Nov 2012 11:40:42 +0000 (UTC) Received: from msgw001-04.ocn.ad.jp (msgw001-04.ocn.ad.jp [180.37.203.73]) by defer115.ocn.ad.jp (Postfix) with ESMTP id C48AE4C900A for ; Thu, 1 Nov 2012 20:39:05 +0900 (JST) Received: from localhost (p15135-ipngn100303sizuokaden.shizuoka.ocn.ne.jp [114.176.38.135]) by msgw001-04.ocn.ad.jp (Postfix) with ESMTP id 5535A833E6E; Thu, 1 Nov 2012 20:38:58 +0900 (JST) Date: Thu, 01 Nov 2012 20:38:59 +0900 (JST) Message-Id: <20121101.203859.193678837.toshi@ruby.ocn.ne.jp> To: freebsd-usb@freebsd.org Subject: Re: isochronous transfer for UVC camera From: SAITOU Toshihide In-Reply-To: <20121030.231917.104031274.toshi@ruby.ocn.ne.jp> References: <20121030.223138.71086080.toshi@ruby.ocn.ne.jp> <201210301446.43464.hselasky@c2i.net> <20121030.231917.104031274.toshi@ruby.ocn.ne.jp> X-GPG-fingerprint: 34B3 0B6A 8520 F5B0 EBC7 69F6 C055 9F8A 0D49 F8FC X-Mailer: Mew version 6.2.51 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 11:40:43 -0000 In message: <20121030.231917.104031274.toshi@ruby.ocn.ne.jp> SAITOU Toshihide writes: > In message: <201210301446.43464.hselasky@c2i.net> > Hans Petter Selasky writes: >> On Tuesday 30 October 2012 14:31:38 SAITOU Toshihide wrote: >>> Is this true about these functions below? >> >> Alternate setting is supported, though if the interface does not exist or has >> already the programmed alternate setting, it will simply do nothing. > > I have no idea... > > I will build the kernel tomorrow to remove the ugen driver which is > deactivated in the code though. Ugen is not separable and not related. Now I have got the data from UVC cam, \(^-^)/ not yet examine though. Thank you HPS for your useful information. #include #include #include #define VID 0x0458 #define PID 0x7081 #define ConfVal 1 // Configuration Value #define IfNum 1 // Interface Number #define AltIfNum 1 // Alternate Interface Number #define PKT_LEN 0xc00 #define PKTS_PER_XFER 0x80 #define TIMEOUT 10 // 10 ms static void cb(struct libusb_transfer *xfer) { printf("\nReceived.\n"); // xfer->buffer libusb_submit_transfer(xfer); // repeat } int main( int argc, char **argv) { libusb_context *ctx = NULL; libusb_device *dev = NULL; libusb_device_handle *handle; struct libusb_config_descriptor *confDesc; int numInterfaces; uint8_t buf[64]; int i; // get cam device libusb_init(&ctx); handle = libusb_open_device_with_vid_pid(ctx, VID, PID); dev = libusb_get_device(handle); // if kernel driver is active, detach a kernel driver. libusb_get_config_descriptor(dev, ConfVal, &confDesc); numInterfaces = (int)confDesc->bNumInterfaces; for (i=0; i