From owner-freebsd-current@FreeBSD.ORG Tue Jan 12 09:39:19 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D57C1065693 for ; Tue, 12 Jan 2010 09:39:19 +0000 (UTC) (envelope-from hlh@restart.be) Received: from tignes.restart.be (tignes.restart.be [IPv6:2001:41d0:2:2d29:0:1::]) by mx1.freebsd.org (Postfix) with ESMTP id 97FF48FC17 for ; Tue, 12 Jan 2010 09:39:18 +0000 (UTC) Received: from restart.be (avoriaz.tunnel.bel [IPv6:2001:41d0:2:2d29:1:ffff::]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "smtp.restart.be", Issuer "CA master" (verified OK)) by tignes.restart.be (Postfix) with ESMTPS id EF6999675; Tue, 12 Jan 2010 10:39:16 +0100 (CET) Received: from meribel.restart.bel (meribel.restart.bel [IPv6:2001:41d0:2:2d29:1:8::]) (authenticated bits=0) by restart.be (8.14.4/8.14.4) with ESMTP id o0C97e0i046016 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 12 Jan 2010 10:07:40 +0100 (CET) (envelope-from hlh@restart.be) X-DKIM: Sendmail DKIM Filter v2.8.3 restart.be o0C97e0i046016 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=restart.be; s=avoriaz; t=1263287270; bh=H+CzE65+aSlfLikt0qoCIkU2hCc0e4mAQg7P0uxbZx4=; h=Message-ID:Date:From:MIME-Version:To:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=nLUVoMOuGAOKmXyX939wBCGvJbiKhV/OcBXBRg8EUv0E0kN6/+gZJtp0P8O4cor7c jU4sGkrztr9356lmbts/w== X-DomainKeys: Sendmail DomainKeys Filter v1.0.2 restart.be o0C97e0i046016 DomainKey-Signature: a=rsa-sha1; s=avoriaz; d=restart.be; c=nofws; q=dns; h=message-id:date:from:user-agent:mime-version:to:subject: references:in-reply-to:content-type: content-transfer-encoding:x-scanned-by; b=qDlqcGo9zJJpbOcYa2UhRQTdVbrypTwxPxUwcuA4br1aqwTOGPpU/ZIylY7S6WvS5 GZglCe7jCQMtrAmIMiJIg== Message-ID: <4B4C3BDC.4000104@restart.be> Date: Tue, 12 Jan 2010 10:07:40 +0100 From: Henri Hennebert User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.5) Gecko/20091220 Thunderbird/3.0 MIME-Version: 1.0 To: Hans Petter Selasky , freebsd-current@freebsd.org References: <201001101437.37269.hselasky@c2i.net> <4B4B7523.6060409@restart.be> In-Reply-To: <4B4B7523.6060409@restart.be> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on IPv6:2001:41d0:2:2d29:1:1:: Cc: Subject: Re: [FreeBSD 8/9] USB webcamd and video4bsd: Call for testing X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 09:39:19 -0000 On 01/11/2010 19:59, Henri Hennebert wrote: > On 01/10/2010 14:37, Hans Petter Selasky wrote: >> 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. >> > I try on a Fujitsu M2010: > > FreeBSD meribel.restart.bel 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0 > r201748M: Thu Jan 7 16:23:56 CET 2010 > root@meribel.restart.bel:/usr/obj/usr/src/sys/MERIBEL i386 > > [root@meribel ~]# usbconfig > ugen0.1: at usbus0, cfg=0 md=HOST spd=FULL > (12Mbps) pwr=ON > ugen1.1: at usbus1, cfg=0 md=HOST spd=FULL > (12Mbps) pwr=ON > ugen2.1: at usbus2, cfg=0 md=HOST spd=FULL > (12Mbps) pwr=ON > ugen3.1: at usbus3, cfg=0 md=HOST spd=HIGH > (480Mbps) pwr=ON > ugen3.2: at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps) > pwr=ON > ugen0.2: at usbus0, cfg=0 md=HOST spd=LOW > (1.5Mbps) pwr=ON > ugen1.2: at usbus1, cfg=0 md=HOST > spd=FULL (12Mbps) pwr=ON > ugen3.3: at usbus3, cfg=0 md=HOST spd=HIGH > (480Mbps) pwr=ON > [root@meribel ~]# /home/meribel/webcam/ulinux/webcamd -d ugen3.2 -i 0 -v 0 > KrefGet: 0x34028404 = 1 > KrefGet: 0x34028404 = 2 > KrefGet: 0x3402860c = 1 > KrefGet: 0x340286c8 = 1 > Added device 0x33f18b04 > KrefGet: 0x33f18b08 = 1 > KrefGet: 0x33f18b08 = 2 > > [root@meribel ~]# chmod 666 /dev/video* /dev/usb/* > > [hlh@meribel ~]$ pwcview > Webcam set to: 320x240 (sif) at 5 fps > > Give me a green window for some time and then this picture: > > http://verbier.restart.be/xfer/Screenshot-pwcview.png > > which stay still. > > I can't kill pwcview window. > Better news... I try on the same config an external webcam (Logitech QuickCam Messenger) [root@meribel ulinux]# usbconfig ugen0.1: at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen1.1: at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen2.1: at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen3.1: at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON ugen3.2: at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON ugen0.2: at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON ugen1.2: at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen3.3: at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON ugen0.3: at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON [root@meribel ulinux]# ./webcamd -d ugen0.3 -i 0 -v 0 KrefGet: 0x34028904 = 1 Added device 0x33fdf304 KrefGet: 0x33fdf308 = 1 KrefGet: 0x33fdf308 = 2 KrefPut: 0x33fdf308 = 2 And pwcview work perfectly :-) Henri