Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Jan 2010 17:40:17 +0000
From:      Brandon Gooch <jamesbrandongooch@gmail.com>
To:        Hans Petter Selasky <hselasky@c2i.net>
Cc:        freebsd-multimedia@freebsd.org, freebsd-current@freebsd.org, freebsd-usb@freebsd.org
Subject:   Re: [FreeBSD 8/9] USB webcamd and video4bsd: Call for testing
Message-ID:  <179b97fb1001100940o74d5f42arcba36098dd0bdd34@mail.gmail.com>
In-Reply-To: <201001101437.37269.hselasky@c2i.net>
References:  <201001101437.37269.hselasky@c2i.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jan 10, 2010 at 1:37 PM, Hans Petter Selasky <hselasky@c2i.net> wro=
te:
> 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 w=
hich
> 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 betw=
een
> 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=3D172876
>
> http://perforce.freebsd.org/chv.cgi?CH=3D172876
>
> 3) Compile ulinux (webcamd + libv4l + pwcview) and video4bsd (must be che=
cked
> out in the same folder due to dependencies)
>
> svn --username anonsvn --password anonsvn \
> =A0 =A0 =A0checkout svn://svn.turbocat.net/i4b/trunk/usbcam/video4bsd
>
> make all install
> kldload video4bsd
>
> svn --username anonsvn --password anonsvn \
> =A0 =A0 =A0checkout 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.

Seems to work for just a second or two (I see my ugly mug on-screen),
and then this:

# ./pwcview/pwcview
Webcam set to: 320x240 (sif) at 5 fps
libv4lconvert: Error decompressing JPEG: fill_nbits error: need 8 more bits
libv4l2: error converting / decoding frame data: v4l-convert: error
parsing JPEG header: Not a JPG file ?

>From another xterm:

# ./webcamd -d ugen6.2 -v 0 -i 0
KrefGet: 0x800c90304 =3D 1
KrefGet: 0x800c90304 =3D 2
KrefGet: 0x800c9083c =3D 1
KrefGet: 0x800c9092c =3D 1
Added device 0x800ca4d08
KrefGet: 0x800ca4d0c =3D 1
KrefGet: 0x800ca4d0c =3D 2
size =3D 622592
alloc_nr =3D 0
KrefPut: 0x800ca4d0c =3D 2

>From dmesg:

ugen6.2: <vendor 0x17ef> at usbus6



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?179b97fb1001100940o74d5f42arcba36098dd0bdd34>