Fushicai USBTV007 - yet another Easycap clone
Posted: Sun Aug 11, 2013 11:33 pm
Some of the latest Easycap clones (originally with STK1160 chip) now come with the Fushicai USBTV007 chip, lsusb lists it as 1b71:3002. This must be the 4th or 5th different model sold in the same exact packaging that at first glance promises you the widely supported STK1160 aka Easycap/DC60 model.
Thanks to Lubomir Rintel's work on reverse engineering the windows driver there's already a preliminary driver/module available to compile and use this capture pen with zoneminder for example! So far only NTSC capture through the RCA connector is supported, but PAL will already "work" with some glitches.
I'm new to Linux so I had a hard time making this work. I'm reproducing here the steps I took so that every other linux challenged person that has this device can make it work without much trouble.
As I'm a new forum user I can't post off-site URL's , you'll need to replace the d0ts until that gets sorted out
Starting with a Ubuntu 12.04 server install, update to the latest kernel.
You can browse kernel d0t ubuntu d0t com/~kernel-ppa/mainline to check the latest version and update links accordingly. At the time of this writing it's 3.11 rc4.
If you have a 32bit install:
or 64bit:
Rebooting here will not hurt.
make a dir and download the drivers (module) source code inside it:
Get programs to compile the driver's (module) source code together with your brand spanking new kernel.
To compile we need to edit the Makefile
edit the file with this text:
Make sure there is a TAB before the "make" lines, if it's spaces instead of a TAB it won't run the batch command and will return a "nothing to do" error.
Press Ctrl+O and [Enter] to output changes to the file. Ctrl+X to exit nano text editor.
Going super user here might be needed.
Run the compile command
If all goes well you'll get a usbtv.ko file.
copy .ko to modules dir
update module dependency:
now it's possible to load the module:
Connect the Easycap USB pen.
list loaded modules:
There should be a usbtv module listed. If not, try rebooting.
Check if there's a new /dev/video folder:
In zoneminder configure as 30fps, NTSC, YUYV, even if the camera is PAL, it's the only way of getting it working right now.
Other observations:
If you have more than one capture device, like a bttv based capture card you have to define/fixate it's /dev/videoX path otherwise a reboot will change this in an arbitrary manner and you'll have to reconfigure the ZM device paths of your capture devices.
To see if you can pass this parameter to your capture card run
or whatever the name of the driver/module of your card like modinfo saa7134.
If it has the following parameter listed:
You can add it to the /etc/modprobe.d/whatever.conf file
For example in a bttv card
Will make the bttv card always list as /dev/video1
Another way is introducing in ZM the "Device Path" by its link inside the /dev/v4l/ folder instead of /dev/video#
returns:
In this case the link is:
instead of /dev/video0 which might change with a reboot or removing/adding other capture devices.
This worked with the Easycap's device "by-id" link. It's useful since the driver still doesn't have a video_nr parameter at this stage. I had mixed results with the capture cards, it's best to just use the video_nr parameter.
Next steps:
Get this working in Android
Thanks to Lubomir Rintel's work on reverse engineering the windows driver there's already a preliminary driver/module available to compile and use this capture pen with zoneminder for example! So far only NTSC capture through the RCA connector is supported, but PAL will already "work" with some glitches.
I'm new to Linux so I had a hard time making this work. I'm reproducing here the steps I took so that every other linux challenged person that has this device can make it work without much trouble.
As I'm a new forum user I can't post off-site URL's , you'll need to replace the d0ts until that gets sorted out
Starting with a Ubuntu 12.04 server install, update to the latest kernel.
You can browse kernel d0t ubuntu d0t com/~kernel-ppa/mainline to check the latest version and update links accordingly. At the time of this writing it's 3.11 rc4.
If you have a 32bit install:
Code: Select all
wget -c kernel d0t ubuntu d0t com /~kernel-ppa/mainline/v3.11-rc4-saucy/linux-headers-3.11.0-031100rc4_3.11.0-031100rc4.201308041735_all.deb
wget -c kernel d0t ubuntu d0t com /~kernel-ppa/mainline/v3.11-rc4-saucy/linux-headers-3.11.0-031100rc4-generic_3.11.0-031100rc4.201308041735_i386.deb
wget -c kernel d0t ubuntu d0t com /~kernel-ppa/mainline/v3.11-rc4-saucy/linux-image-3.11.0-031100rc4-generic_3.11.0-031100rc4.201308041735_i386.deb
sudo dpkg -i *.deb
Code: Select all
wget -c kernel d0t ubuntu d0t com /~kernel-ppa/mainline/v3.11-rc4-saucy/linux-headers-3.11.0-031100rc4_3.11.0-031100rc4.201308041735_all.deb
wget -c kernel d0t ubuntu d0t com /~kernel-ppa/mainline/v3.11-rc4-saucy/linux-headers-3.11.0-031100rc4-generic_3.11.0-031100rc4.201308041735_amd64.deb
wget -c kernel d0t ubuntu d0t com /~kernel-ppa/mainline/v3.11-rc4-saucy/linux-image-3.11.0-031100rc4-generic_3.11.0-031100rc4.201308041735_amd64.deb
sudo dpkg -i *.deb
Code: Select all
shutdown -r now
Code: Select all
mkdir usbtv
cd usbtv
wget git d0t kernel d0t org/cgit/linux/kernel/git/torvalds/linux.git/plain/drivers/media/usb/usbtv/Kconfig
wget git d0t kernel d0t org/cgit/linux/kernel/git/torvalds/linux.git/plain/drivers/media/usb/usbtv/Makefile
wget git d0t kernel d0t org/cgit/linux/kernel/git/torvalds/linux.git/plain/drivers/media/usb/usbtv/usbtv.c
Code: Select all
apt-get install make
apt-get install gcc
Code: Select all
nano Makefile
Code: Select all
obj-m += usbtv.o
KVERSION = $(shell uname -r)
all:
make -C /lib/modules/$(KVERSION)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(KVERSION)/build M=$(PWD) clean
Press Ctrl+O and [Enter] to output changes to the file. Ctrl+X to exit nano text editor.
Going super user here might be needed.
Code: Select all
sudo su
Code: Select all
make
copy .ko to modules dir
Code: Select all
mkdir -p /lib/modules/$(uname -r)/kernel/drivers/media/usb/usbtv
cp usbtv.ko /lib/modules/$(uname -r)/kernel/drivers/media/usb/usbtv
Code: Select all
depmod -a
Code: Select all
modprobe usbtv
list loaded modules:
Code: Select all
lsmod
Check if there's a new /dev/video folder:
Code: Select all
ls /dev/
Other observations:
If you have more than one capture device, like a bttv based capture card you have to define/fixate it's /dev/videoX path otherwise a reboot will change this in an arbitrary manner and you'll have to reconfigure the ZM device paths of your capture devices.
To see if you can pass this parameter to your capture card run
Code: Select all
modinfo bttv
If it has the following parameter listed:
Code: Select all
parm: video_nr:video device number (array of int)
For example in a bttv card
Code: Select all
options bttv video_nr=1
Another way is introducing in ZM the "Device Path" by its link inside the /dev/v4l/ folder instead of /dev/video#
Code: Select all
udevadm info -n /dev/video0 -qall | grep DEVLINKS
Code: Select all
E: DEVLINKS=/dev/v4l/by-id/usb-fushicai_usbtv007_300000000002-video-index0 /dev/v4l/by-path/pci-0000:00:02.2-usb-0:2:1.0-video-index0
Code: Select all
/dev/v4l/by-id/usb-fushicai_usbtv007_300000000002-video-index0
This worked with the Easycap's device "by-id" link. It's useful since the driver still doesn't have a video_nr parameter at this stage. I had mixed results with the capture cards, it's best to just use the video_nr parameter.
Next steps:
Get this working in Android