From owner-freebsd-usb@FreeBSD.ORG Sun Jan 10 13:39:01 2010 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 792FE1065676; Sun, 10 Jan 2010 13:39:01 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe14.tele2.se [212.247.155.161]) by mx1.freebsd.org (Postfix) with ESMTP id 7B6668FC15; Sun, 10 Jan 2010 13:39:00 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=p0TwAfwpPXgA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:17 a=6I5d2MoRAAAA:8 a=OdR5sfXFAAAA:8 a=yii_e_M_R1lv0RMgNxMA:9 a=AKsT8VVSzWy0iFj9e78A:7 a=7n0J_6GuWXPTFV8-VojJBdtb8KAA:4 Received: from [188.126.201.140] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe14.swip.net (CommuniGate Pro SMTP 5.2.16) with ESMTPA id 591294738; Sun, 10 Jan 2010 14:38:58 +0100 From: Hans Petter Selasky To: freebsd-multimedia@freebsd.org, freebsd-current@freebsd.org, freebsd-usb@freebsd.org Date: Sun, 10 Jan 2010 14:37:37 +0100 User-Agent: KMail/1.12.4 (FreeBSD/8.0-STABLE; KDE/4.3.4; amd64; ; ) X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'(; _IjlA: hGE..Ew, XAQ*o#\/M~SC=S1-f9{EzRfT'|Hhll5Q]ha5Bt-s|oTlKMusi:1e[wJl}kd}GR Z0adGx-x_0zGbZj'e(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201001101437.37269.hselasky@c2i.net> Cc: Subject: [FreeBSD 8/9] USB webcamd and video4bsd: Call for testing X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 13:39:01 -0000 Hi, During the last couple of days I've spent some time to finish my webcam daemon. My webcam daemon is basically an application which consists of userspace Video4Linux USB webcam drivers and some uLinux glue code which links with libc, pthreads and libusb. The webcamd talks to /dev/video_daemonX which is provided by the video4bsd kernel module. There is full support for mmap/read/write/open/close. poll is not supported. Basic operation and idea: /dev/video_daemonX is the interface for the webcamd. /dev/videoX is the interface for the V4L application. The video4bsd transports all data between these two devices. In the case the V4L application is using mmap, no data is copied due to shared kernel memory buffer! Licensing issues: Effectivly the webcamd userland program becomes GPL'ed due to the V4L USB drivers which are GPL licensed. Some files inside the webcamd remains BSD licensed which allows for building similar BSD licensed daemons. The rest of the code is BSD licensed. Source code: 1) FreeBSD 8-stable 2) Apply the patch below and re-install libusb in /usr/src/lib/libusb: http://p4web.freebsd.org/chv.cgi?CH=172876 http://perforce.freebsd.org/chv.cgi?CH=172876 3) Compile ulinux (webcamd + libv4l + pwcview) and video4bsd (must be checked out in the same folder due to dependencies) svn --username anonsvn --password anonsvn \ checkout svn://svn.turbocat.net/i4b/trunk/usbcam/video4bsd make all install kldload video4bsd svn --username anonsvn --password anonsvn \ checkout svn://svn.turbocat.net/i4b/trunk/usbcam/ulinux make fetch make patch make all make install # this will attach to the first detected webcam: ./webcamd # this will try to attach to the given USB unit, interface and V4B unit. ./webcamd -d ugen4.1 -i 0 -v 0 # this will display webcam contents from /dev/video0 by default. ./pwcview/pwcview Feedback and bug reports are welcome. Yes, I am working on getting this into ports! Known issues: 1) If you detach the USB webcam you need to manually restart the webcamd. --HPS Support: I will be available at #bsdusb on efnet during the day.