This article aims to be a more updated and clear instructional on how to install the Easycap video capture device in Ubuntu and it’s variants . Given the price of these capture devices and there relatively good video quality they are fairly popular devices, at an average cost of $10-$15 how can you not pick one up to at least check it out. Until not to recently there wasn’t a great deal of support for the devices and what support and drivers there were weren’t always the greatest for all of the Easycap versions and hardware.
The old driver had bad video quality and compatibility for all hardware types is pretty low and finicky. Additionally you had to use their capture software piped through Mplayer to capture video unless you installed the slightly more finicky kernel patch. And that is what I will be guiding you through now is installing the current stable kernel module you will need to properly install and use your Easycap device in ubuntu.
Linux kernel module driver for the Somagic Easycap capture device.
It is hard to identify the chipset of any EasyCAP device before buying because most onlineshops (ebay, amazon) do not mention in the provided technical data the chipset of the device. Example from logilik.de where the chipset is declared
If the chipset is not mentioned in device specifications on the website, one way to figure out the chipset inside the EaysCAP is to read through the installation instructions for Windows (if provided for download).
Screenshots of the windowsinstaller often reveal the devicename.
It is assumed that the stk1160 based “EasyCAP DC60” ist the “originally” EasyCAP device. This device is sold in different varieties (models) and even under different names like: EzCap, LogiLink, Mumbi, Weltbild, and some more.
# lsusb Bus 001 Device 003: ID 05e1:0408 Syntek Semiconductor Co., Ltd STK1160 Video Capture Device
STK1160 based devices are supported (video and audio) under Linux by the easycap kernel module (kernel 2.6.38 and later) and further on by the stk1160 kernel module (kernel 3.7). More information on this wiki: Stk1160
More information on this wiki: Stk1160#Drivers
The Empia EasyCAP is based on the EM2860 chip from Empia.
# lsusb Bus XXX Device XXX: ID eb1a:2861 eMPIA Technology, Inc.
EM2860 (EM2861) based devices are supported in Linux by the em28xx kernle module. More information on this wiki: Em28xx_devices
The em28xx kernel module should create a Em28xx Audio ALSA soundcard which can be used for sound capturing.
The Somagic EasyCAP is based on the SMI-2021 chip from Somagic. It needs a firmware for operation.
# lsusb Bus XXX Device XXX: ID 1c88:0007 Somagic, Inc. and after loading the firmware # lsusb Bus XXX Device XXX: ID 1c88:003c Somagic, Inc. or Bus XXX Device XXX: ID 1c88:003f Somagic, Inc.
For SMI-2021 based devices exists a proceeding Linux-driver project: easycap-somagic-linux which this tutorial explains the installation process for Ubuntu. Continue to the installation portion of this instructional
More information on this wiki: Somagic
Audio support is provided by the easycap-somagic-linux driver at an unknown stage.
This EasyCAP is based on a single UTV007 labeled chip.
This device is sold as “USB video capture QS702” from SHENZHEN FUSHICAI ELECTRONIC CO.,LTD
# lsusb Bus XXX Device XXX: ID 1b71:3002
Linux kernel driver, enable CONFIG_VIDEO_USBTV: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/media/usb/usbtv
Also, a very experimental (for testing purposes only) userspace driver is available on github: http://github.com/memeruiz/usbtv007
A work in progress on the audio support can be found at: https://github.com/simon3z/usbtv
Status: tested and working for composite input (48Khz 2ch 16bit).
The Windows driver shipped with the device was for another model. Here’s the correct one: http://v3.sk/~lkundrak/usbtv/usbtv-wxp32.zip
Slides from talk describing setup for reverse-engineering what does the hardware do are available: http://www.slideshare.net/LubomirRintel/usb-reversing
List of known Easycap capture devices Identify your USB device from this list and continue to the kernel module only installation
All developement and testing of this driver has been done on a computer running Xubuntu 13.10 but should be no different for any other Ubuntu distribution or version provided you are using Kernel 3.11 or newer. If you are running another distribution, you’ll should visit http://code.google.com/p/easycap-somagic-linux/wiki/BuildingKernelModule and read their installation instructions as they apply to a generic linux in general.
You will of course also need:
Firstly we will need to update our packages and download and install the following dependencies
sudo apt-get update
Were first going to download the current kernel header source code.
All of the Ubuntu Kernel source is maintained under git. The source for each release is maintained in its own git repository on kernel.ubuntu.com. To obtain a local copy you can simply git clone the repository for the release you are interested in as shown below.
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-<release>.git
For example to obtain the precise tree:
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-precise.git kernel-source
change into the kernel source directory and use the following command to update the drivers for the kernel git remote add linuxtv git://linuxtv.org/media_tree.git git remote update git checkout -b media-master remotes/linuxtv/master
This will download the whole kernel, and also the media-tree into a directory called “kernel-source” under your current directory.
All commands from here on should be typed while you are in the linux source-tree unless specified otherwise.
If you are already tracking Linus’ kernel-tree, or are using your distribution’s current kernel-tree, you don’t have to download the media-tree, but then you will need up to six additional patches to build the module (These patches should not be necessary after kernel version 3.12)
To determine your kernel version run “uname -r” this should return something like “3.14.0-rc1-custom”
Here we’re going to install the needed dependencies. (The following is meant to be entered as one line)
sudo apt-get install libncurses5-dev fakeroot wget bzip2 libusb-1.0-0 libusb-1.0-0-dev libgcrypt11 libgcrypt11-dev mplayer usbutils libgcrypt11 wine make gcc mplayer git build-essential
sudo apt-get build-dep linux-image-$(uname -r)
Then you will need to download either somagic-easycap-tools_1.1_i386.deb or somagic-easycap-tools_1.1_amd64.deb and somagic-easycap_1.1_i386.deb or somagic-easycap_1.1_amd64.deb depending on your architecture from the original drivers site because we will need the firmware extractor for the Somagic-EasyCap hardware to work.
This test is to ensure the device is functioning properly before continuing to install the kernel module.
The smi2021 driver is depending on the saa7115 module. Some changes had to be made to that module to make the driver work. We will have to download and install 3 or 6 more patches before we can build the kernel Module.
From here we will change to our kernel headers directory to download the updated saa7115 module and patches
cd /usr/src/linux-headers-$(uname -r) (or where ever you have downloaded your kernels headers and source)
sudo wget –no-check-certificate https://patchwork.linuxtv.org/patch/20010/mbox/ -O smi2021v3.patch
git checkout -b smi2021v3 git am smi2021v3.patch
If your kernel-tree is older than 3.11, you will first need these three patches.
sudo wget –no-check-certificate https://patchwork.linuxtv.org/patch/18233/mbox/ -O saa7115-0001.patch
sudo wget –no-check-certificate https://patchwork.linuxtv.org/patch/18232/mbox/ -O saa7115-0002.patch
sudo wget –no-check-certificate https://patchwork.linuxtv.org/patch/18368/mbox/ -O saa7115-0003.patch
If your kernel-tree is older than 3.12 – and you didn’t download the media-master tree – you will need these three patches.
sudo wget –no-check-certificate https://patchwork.linuxtv.org/patch/19535/mbox/ -O saa7115-0004.patch
sudo wget –no-check-certificate https://patchwork.linuxtv.org/patch/19536/mbox/ -O saa7115-0005.patch
sudo wget –no-check-certificate https://patchwork.linuxtv.org/patch/19537/mbox/ -O saa7115-0006.patch
This is how you just compile the module, without having to compile the whole kernel. If your kernel is older than 3.11 continue to the “Compiling Kernel” section.
This will only work if the kernel source-tree is the same version as the kernel you are currently running
First you will need to patch your kernel tree with the smi2021v3.patch, and the three or six saa7115 patches as described above.
Then you will have to build both the saa7115 module and the smi2021 module. These commands are typed when you are in the root of the kernel-source tree.
make M=drivers/media/i2c modules make M=drivers/media/usb/smi2021 modules
Then we install the modules.
sudo /sbin/insmod drivers/media/i2c/saa7115.ko sudo /sbin/insmod drivers/media/usb/smi2021/smi2021.ko
If you get errors about missing symbols when trying to insmod the saa7115 module, this is probably because the saa7115 module needs some other modules that aren’t loaded yet. We can force them to be loaded if do this before the insmod saa7115 command:
sudo /sbin/modprobe saa7115 sudo /sbin/rmmod saa7115
You should now be able to insert your EasyCap, and you will see this line in your kernel log:
smi2021 2-1.1:1.0: Somagic Easy-Cap Video Grabber
change directory to the root of where your kernel headers are located
First, we copy the configuration of your current kernel.
sudo cp /boot/.config$(name -r)* > .config
Then we check that we can compile the smi2021 module
This step can be skipped if no configuration changes are wanted. The build process will use a configuration that is put together from various sub-config files. The simplest way to modify anything here is to run:
chmod a+x debian/scripts/*
chmod a+x debian/scripts/misc/*
fakeroot debian/rules clean fakeroot debian/rules editconfigs
This takes the current configuration for each architecture/flavour supported and calls menuconfig for that. The chmod is needed because the way the source package is created loses the executable bits on the scripts.
Device drivers --->
Multimedia support --->
Media USB Adapters --->
Find the entry called “Somagic SMI2021 USB video/audio capture support“. Check that it’s marked with <M>, if not, press m to mark it as a module or y to compile it into the kernel.
Check the config for other options you would like, exit and save the config.
Building the kernel is quite easy. Change your working directory to the root of the kernel source tree and then type the following commands:
fakeroot debian/rules clean fakeroot debian/rules binary-headers binary-generic
Now, just wait, and hope you’ve done everything correct (and that I didn’t forget anything).
If the build is successful, a set of three .deb binary package files will be produced in the directory above the build root directory. For example after building a kernel with version “2.6.38-7.37” on an amd64 system, these three .deb packages would be produced:
cd .. ls *.deb linux-headers-2.6.38-7_2.6.38-7.37_all.deb linux-headers-2.6.38-7-generic_2.6.38-7.37_amd64.deb linux-image-2.6.38-7-generic_2.6.38-7.37_amd64.deb
When the compile ends, and there are no errors, we install the modules.
sudo make modules_install
This should complete in a few minutes, and then we are ready to install the kernel.
Install all packages that were created except the tools-generic package as this sometimes doesn’t have the dependency to properly install. Once that is done you can restart your computer and when it loads up you should see another video device in /dev likely video1
Insert your device, and type this:
vlc v4l2:///dev/videoX :v4l2-standard= :input-slave=alsa://plughw:X,0
In /dev/videoX, the X is the number of the device, on my computer it’s 1, because my web_cam is 0, but it might be any number.
You can get a list of video devices by typing
You can figure out the value of plughw:X,X by typing:
This should give you a list like this:
**** List of CAPTURE Hardware Devices **** card 0: MID [HDA Intel MID], device 0: 92HD73C1X5 Analog [92HD73C1X5 Analog] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: MID [HDA Intel MID], device 2: 92HD73C1X5 Alt Analog [92HD73C1X5 Alt Analog] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: smi2021Audio [smi2021 Audio], device 0: smi2021 Audio [Somagic smi2021 Capture] Subdevices: 1/1 Subdevice #0: subdevice #0
Where you see that card2 is smi2021Audio, so the audio-device is plughw:2,0.
Johnny March 7th, 2014
Posted In: Uncategorized