view · edit · print · history

Usbvision WinTVUSB driver howto for debianslug

If someone tells me how to upload files here, I'll upload the files I built

Contact: tfroidcoeur is my handle and yahoo doot com is my mail provider.

I have: debianslug 3.10 (use the bootstrap method to get debian running on an existing slug)

Usbvision is the driver for some models of hauppauge wintv card (usb). It's possible to use these with the slug (debianslug in my case) to run something like motion and get a basic webcam with motion detection. I'd be really surprised if someone would be able to actually use it for getting video streams.

The driver is at http://usbvision.sourceforge.net/(approve sites). The website has a list of supported devices.

Anyway. What we are going to do:

  • rebuild the kernel for debianslug from the original sources
  • add usbvision to the kernel tree
  • rebuild the kernel tree with usbvision
  • install the modules on the slug
  • modprobe the required modules
  • get motion going

''There should be faster alternatives, like building the usbvision thing with the kernel headers only, but I haven't bothered to look for them. This procedure takes about 1-2 hours of compiling. If ever I am in the mood I might look into making a package out of the modules i built''

I used ubuntu dapper to get this done. I'm not quite sure about the packages i needed to install. Very likely you need build-essential

sudo apt-get install build-essential diffstat texi2html

I think the makefile will complain about missing stuff anyways.

(If you really have a lot of time to waste, you could also build it on your slug i suppose,)

Let's do this.

Get the debianslug sources


 wget http://sources.nslu2-linux.org/releases/SlugOS-3.10-beta-source.tar.gz

or get it from http://www.slug-firmware.net/s-dls.php

''wait (15 minutes?) [I'm doing this again to check if the instructions are right... my god, all that waiting. I'll write the first wikinovel if I have to wait much more]''

 tar xvzf SlugOS-3.10-beta-source.tar.gz
 cd slugos-3.10-beta

Quickly glance over the README and decide you'll just follow this wiki

 more README

Get the Intel support libraries

Read the instructions to get the Intel ipx400 libs

 head -n 30 openembedded/packages/ixp4xx/ixp4xx-csr_2.1.bb

Short form, go to http://www.intel.com/design/network/products/npfamily/ixp425swr1.htm, login (register if needed), click a few thingies ("Intel® IXP400 Software and RedBoot* Boot Loader") and get the files "Intel Hardware Access Software" and "NPE Microcode". Make sure your lawyers read all the license stuff carefully or alternatively just click agree until the files are on your hard drive.

Move both zip files to downloads

 mv ~/Desktop/*ixp* downloads

One of the files had the wrong name for the makefile, so rename it

 mv downloads/BSD_ixp400AccessLibrary-2_1.zip downloads/IPL_ixp400AccessLibrary-2_1.zip

Make the md5sum for both files

 md5sum -b downloads/IPL_ixp400AccessLibrary-2_1.zip | awk '{print $1}' > downloads/IPL_ixp400AccessLibrary-2_1.zip.md5
 md5sum -b downloads/IPL_ixp400NpeLibrary-2_1.zip | awk '{print $1}' > downloads/IPL_ixp400NpeLibrary-2_1.zip.md5

Build the debianslug sources

 make debianslug-image

(you need internet connection, because the long download did not contain everything (gcc toolchain i think is missing))

more waiting

lots of it

hours (>1) and gigabytes

Get the Usbvision sources from cvs and shove them in the kernel

(you can also patch em for 2.6.16 kernel from the 9.8.3 version like I originally did, it's only an extra include and the removal of some unused usb struct entries)

if necessary, first

 sudo apt-get install cvs

then get the sources from cvs

 cvs -d:pserver:anonymous@usbvision.cvs.sourceforge.net:/cvsroot/usbvision login 
 cvs -z3 -d:pserver:anonymous@usbvision.cvs.sourceforge.net:/cvsroot/usbvision co -P usbvision

now open the 2.6.16 kernel readme

 gedit usbvision/readme.2.6.x\ kernels

and follow the second way (path of the Jedi)

only do steps a, c, e and f

a) copy the required sources in (you don't need saa7113.c, it's already in the kernel as saa711x module)

 cp usbvision/src/usbvision.c usbvision/src/usbvision.h usbvision/src/i2c-algo-usb.c usbvision/src/i2c-algo-usb.h usbvision/src/usbvision_ioctl.h debianslug-nslu2.tmp/work/ixp4xx-kernel-2.6.16-r6.4/linux-2.6.16/drivers/usb/media

c) modify the makefile ...linux-2.6.16/drivers/usb/Makefile

 gedit debianslug-nslu2.tmp/work/ixp4xx-kernel-2.6.16-r6.4/linux-2.6.16/drivers/usb/Makefile 

and add the line

 obj-$(CONFIG_USB_USBVISION)	+= media/

e) modify the makefile ...linux-2.6.16/drivers/usb/media/Makefile

 gedit debianslug-nslu2.tmp/work/ixp4xx-kernel-2.6.16-r6.4/linux-2.6.16/drivers/usb/media/Makefile 

and add the line

 obj-$(CONFIG_USB_USBVISION)     += usbvision.o i2c-algo-usb.o

(no need for saa7113)

f) add the block of configuration text to the Kconfig file

 gedit debianslug-nslu2.tmp/work/ixp4xx-kernel-2.6.16-r6.4/linux-2.6.16/drivers/usb/media/Kconfig

extra) you need the saa711x module that is in the kernel. Make usbvision depend on it and then you're fine, like I do here. Alternatively, select a device that uses saa711x (EM... something under media --> video).

 gedit debianslug-nslu2.tmp/work/ixp4xx-kernel-2.6.16-r6.4/linux-2.6.16/drivers/media/video/Makefile


 obj-$(CONFIG_USB_USBVISION)     += saa711x.o

and then

 gedit debianslug-nslu2.tmp/work/ixp4xx-kernel-2.6.16-r6.4/linux-2.6.16/drivers/media/Makefile


 obj-$(CONFIG_USB_USBVISION)     += video/

	tristate "USB Zoran/Nogatech USBVision Video Grabber Support"
	depends on USB && VIDEO_DEV && I2C && VIDEO_BT848 && VIDEO_DPC
  	  Say Y here if you want to connect a Nogatech NT100x, or a Zoran
  	  ZR36504/ZR36505 chipset based video/tv/radio grabber, to your
  	  computer's USB port.

  	  For more information, read <file:Documentation/usb/usbvision.txt>.

  	  This driver needs the following support: Please enable (Y or M in config)
	  	Video For Linux API 
		I2C API.  
		BT484 Device Support
		DPC7146 demonstration board Device Support

  	  This code is also available as a module ( = code which can be
  	  inserted in and removed from the running kernel whenever you want).
  	  The module will be called usbvision.o.  If you want to compile it as a
  	  module, say M here and read <file:Documentation/modules.txt>. This
  	  video grabber has several configuration options which can be specified
  	  when you load the module.  Read <file:Documentation/usb/usbvision.txt> to
  	  learn more.

Now, configure the kernel:

 pushd .
 cd debianslug-nslu2.tmp/work/ixp4xx-kernel-2.6.16-r6.4/linux-2.6.16/
 make menuconfig ARCH=arm

and select the USB Zoran/Nogatech USBVision Video Grabber Support module. It's under Device drivers --> USB, somewhere down few pages, under the Multimedia devices heading.

Build that kernel again

remove the stamps file for compiling the kernel

 rm debianslug-nslu2.tmp/stamps/ixp4xx-kernel-2.6.16-r6.4.do_compile 

Build the kernel again

 make debianslug-image

The nice thing is, it doesn't take that long anymore.

copy the module packages to the slug

 scp debianslug-nslu2.tmp/deploy/ipk/kernel-module-usbvision_2.6.16-r6.4_ixp4xxle.ipk debianslug-nslu2.tmp/deploy/ipk/kernel-module-saa711x_2.6.16-r6.4_ixp4xxle.ipk debianslug-nslu2.tmp/deploy/ipk/kernel-module-i2c-algo-usb_2.6.16-r6.4_ixp4xxle.ipk debianslug-nslu2.tmp/deploy/ipk/kernel-module-videodev_2.6.16-r6.4_ixp4xxle.ipk slug:~

install the modules

Log into the slug and

 sudo dpkg -i --force-architecture kernel-module-i2c-algo-usb_2.6.16-r6.4_ixp4xxle.ipk
 sudo dpkg -i --force-architecture kernel-module-videodev_2.6.16-r6.4_ixp4xxle.ipk
 sudo dpkg -i --force-architecture kernel-module-saa711x_2.6.16-r6.4_ixp4xxle.ipk
 sudo dpkg -i --force-architecture kernel-module-usbvision_2.6.16-r6.4_ixp4xxle.ipk

you can ignore the warnings and errors, the modules get installed nontheless

 sudo depmod -a
 sudo modprobe saa711x
 sudo modprobe usbvision


see! There is your precious usbvision.

You can now also add both modules to /etc/modules.

And make sure your account has access to /dev/video0

I did a

 usermod -G video username

I seem to remember that worked.


Install motion

 sudo apt-get install motion

here's my /etc/motion/motion.conf

# Minimal motion example config file provided by the
# Debian motion package - for basic webcam operation.
# You most certainly want to investigate
# /usr/share/doc/motion/examples/motion-dist.conf.gz
# for further configuration options. Also, refer to the
# motion man page and /usr/share/doc/motion/motion_guide.html
# for detailed information on configuration options.

daemon on
quiet on
threshold_tune on
threshold 20
noise_tune on
noise_level 32
night_compensate on
despeckle EedDl
#mask_file /etc/motion/motion_mask.pgm
low_cpu 10
jpeg_filename %Y%m%d%H%M%S-%v-%q
ffmpeg_filename %Y%m%d%H%M%S-%v-%q
pre_capture 2
post_capture 25
# You may very well need to change this (check with 'dmesg'
# after plugging in your webcam)
videodevice /dev/video0
input 2
# Image size in pixels (valid range is camera dependent)
width 320
height 240

framerate 25
quality 85
auto_brightness off

# Initial brightness, contrast, hue (NTSC), and saturation
# 0 = disabled (valid range 0-255)
brightness 0
contrast 0
saturation 0
hue 0

#despeckle EedDl

# Encode movies in real-time (install ffmpeg before enabling)
ffmpeg_cap_new off

# Target base directory for pictures and films
# You should probably change this (create dir beforehand)
target_dir /public/webcam

# Define a port number (e.g. 8000) to enable the mini-http server
# 0 = disabled
webcam_port 1234

# Set to 'off' to allow anybody (not just localhost) to view the
# webcam via the mini-http server (http://hostname:port)
webcam_localhost off

webcam_quality 50
webcam_maxrate 8
webcam_motion on
view · edit · print · history · Last edited by Tim Froidcoeur.
Originally by Tim Froidcoeur.
Page last modified on July 30, 2006, at 09:05 AM