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

Vladimir Grebenschikov vova at fbsd.ru
Mon Jan 11 21:42:43 UTC 2010


Thanks you for efforts!

I've tested it with 
ugen4.2: <USB 2.0 Camera Vimicro Corp> at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON

pwcview works fine:
$ ./pwcview/pwcview
Webcam set to: 320x240 (sif) at 5 fps

skype detects video device, but shows only black window instead of picture.

build webcamd.c with debug shows:
$ ./webcamd
Probing for 0.0.0
KrefGet: 0x483e2304 = 1
KrefGet: 0x483e2304 = 2
KrefGet: 0x483e2554 = 1
KrefGet: 0x483e2610 = 1
Added device 0x48318b04
KrefGet: 0x48318b08 = 1
Received command 1 0x00000000
KrefGet: 0x48318b08 = 2
Status = 0
Received command 5 0x40047601
Status = -22
Received command 5 0x403c7601
Status = 0
Received command 5 0x400e7606
Status = 0
Received command 5 0x800e7607
Status = -22
Received command 5 0x800e7607
Status = 0
Received command 5 0x40207609
Status = 0
Received command 5 0x8020760a
Status = 0
... and then in loop:
Status = -22
Received command 3 0x00025800
Status = -22
Received command 3 0x00025800
Status = -22
Received command 3 0x00025800
Status = -22
Received command 3 0x00025800
Status = -22
Received command 3 0x00025800

Side question, is it possible to use audio microphone of USB camera ?

-----Original Message-----
From: Hans Petter Selasky <hselasky at c2i.net>
To: freebsd-multimedia at freebsd.org, freebsd-current at freebsd.org,
freebsd-usb at freebsd.org
Subject: [FreeBSD 8/9] USB webcamd and video4bsd: Call for testing
Date: Sun, 10 Jan 2010 14:37:37 +0100


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:



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:

# 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.

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.


Support: I will be available at #bsdusb on efnet during the day.
freebsd-current at freebsd.org mailing list
To unsubscribe, send any mail to "freebsd-current-unsubscribe at freebsd.org"

Vladimir B. Grebenschikov
vova at fbsd.ru

More information about the freebsd-multimedia mailing list