Re: [FreeBSD 8/9] USB webcamd and video4bsd: Call for testing

From: Henri Hennebert <hlh_at_restart.be>
Date: Tue, 12 Jan 2010 10:07:40 +0100
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_at_meribel.restart.bel:/usr/obj/usr/src/sys/MERIBEL i386
>
> [root_at_meribel ~]# usbconfig
> ugen0.1: <UHCI root HUB Intel> at usbus0, cfg=0 md=HOST spd=FULL
> (12Mbps) pwr=ON
> ugen1.1: <UHCI root HUB Intel> at usbus1, cfg=0 md=HOST spd=FULL
> (12Mbps) pwr=ON
> ugen2.1: <UHCI root HUB Intel> at usbus2, cfg=0 md=HOST spd=FULL
> (12Mbps) pwr=ON
> ugen3.1: <EHCI root HUB Intel> at usbus3, cfg=0 md=HOST spd=HIGH
> (480Mbps) pwr=ON
> ugen3.2: <USB Webcam QCM> at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps)
> pwr=ON
> ugen0.2: <product 0x1133 vendor 0x04d9> at usbus0, cfg=0 md=HOST spd=LOW
> (1.5Mbps) pwr=ON
> ugen1.2: <product 0x6216 vendor 0x18e8> at usbus1, cfg=0 md=HOST
> spd=FULL (12Mbps) pwr=ON
> ugen3.3: <USB2.0-CRW Generic> at usbus3, cfg=0 md=HOST spd=HIGH
> (480Mbps) pwr=ON
> [root_at_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_at_meribel ~]# chmod 666 /dev/video* /dev/usb/*
>
> [hlh_at_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_at_meribel ulinux]# usbconfig
ugen0.1: <UHCI root HUB Intel> at usbus0, cfg=0 md=HOST spd=FULL 
(12Mbps) pwr=ON
ugen1.1: <UHCI root HUB Intel> at usbus1, cfg=0 md=HOST spd=FULL 
(12Mbps) pwr=ON
ugen2.1: <UHCI root HUB Intel> at usbus2, cfg=0 md=HOST spd=FULL 
(12Mbps) pwr=ON
ugen3.1: <EHCI root HUB Intel> at usbus3, cfg=0 md=HOST spd=HIGH 
(480Mbps) pwr=ON
ugen3.2: <USB Webcam QCM> at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON
ugen0.2: <product 0x1133 vendor 0x04d9> at usbus0, cfg=0 md=HOST spd=LOW 
(1.5Mbps) pwr=ON
ugen1.2: <product 0x6216 vendor 0x18e8> at usbus1, cfg=0 md=HOST 
spd=FULL (12Mbps) pwr=ON
ugen3.3: <USB2.0-CRW Generic> at usbus3, cfg=0 md=HOST spd=HIGH 
(480Mbps) pwr=ON
ugen0.3: <Camera vendor 0x046d> at usbus0, cfg=0 md=HOST spd=FULL 
(12Mbps) pwr=ON
[root_at_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
Received on Tue Jan 12 2010 - 08:39:19 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:00 UTC