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
The quick launch bar so familiar to pretty much every operating system and window manager these days, is a valuable asset, simplifying the need to navigate through several menus to start up any application you use regularly. XFCE is no different. XFCE has a quick way to add applications to your launch bar but when you look through the list of applications it provides it is far from complete and in many cases may not contain the application you want to add. No worries This article will show you step by step how to add a “custom” program launcher to your bar.
First we’re going to right-click a space on the launch bar at the top or bottom of the screen as this can be done to the popup launcher as well, and were going to select “Panel” -> “Add New Items…: This will bring up an item list of objects you can add. From this list select “Launcher” and click the “Add” button and then click “Close”. You should now see a screen icon in the right side of your launcher bar. Now, right-click this icon and select “Properties.” When the dialog open there are going to be some icons to the right that allow you to manage your launcher items as each launcher can have several sub application items. Select the “+” which will bring up another Dialog with a list of applications for you to add. If you can’t find the application you want to add close this window and click the icon below the “+” and you can create a custom launcher item,
This part is pretty straight forward. You will give it a name for the launcher to have, in my case I’m adding “Gui2Py”, add comment if any “This is a GUI editor for Python”,add the full path to the command you would like to run in my case it’s “python -m gui.tools.designer”,the working directory is going to be the directory it loads by default using your home directory by either using “~” or “$home” should work as a default. Otherwise provide the full path, you can then set a custom icon either from their list or one you provide, when startup notification is set, the panel and cursor notifies the user that the application has started. When the application appears onscreen, the panel and cursor return to normal. This enables the desktop to use whatever startup notification is built in to either your applicationMost modern toolkits work transparently with the startup notification system. And finally “Run In Termial” will launch a terminal window and then execute the program, This is particularly useful if the program has verbose output in addition to a GUI. With all of that done all you gotta do is click create and your done. Remember this can also be one for the lower popup launcher as well.
To move the launcher icon elsewhere in the “Quick Launch Bar” simply right-click and select “Move” then move your cursor where you would like it and left-click and it will be placed where your cursor is.
Johnny February 27th, 2014
A lot of people have used the recent jailbreak tool RedSn0w to unlock their devices. Most have found that this is causing iBooks to no longer open or crash when opening after the jailbreak is done. Thanks Apple. Luckily, some tools have been created to fix this, however not everyone is getting the results they want with it. The issue with the tools looks to be that they are not fixing the permissions correctly when the iBooks files are moved to /var/stash. We found that with an extra step, you can get that working correctly.
First off, you will want to download SBSettings for the BigBoss repo. This repo have came installed with Cydia, so you shouldn’t need to add anything new. Once SBSettings is installed, your device should respring and take you back to the lockscreen.
Now, you will want to install iBooks by using the iBooks Fix for iOS 5 app found in the xsellize repo. To add this, you will need to go to Cydia > Sources > edit > add, then add http://cydia.xsellize.com/. You will get a warning and can just click ok. You can then search for iBooks fix for iOS 5 and install it. Once it has finished installing, it should respring once more.
Now, you should be back at your lockscreen once more. You will now want to go into the SBSettings app, then to System options, which is towards the bottom. Once you are there, just click the “fix user dir permissions.”. It will then fix the permissions of all your files. Your device should respring one more time.
Now, you should be able to open up and use iBooks without a problem. Let us know if this works for you in the comments!
Chris January 2nd, 2012
Posted In: Uncategorized
New addition to the site! Find the country, city, state and ISP of any IP address. Check it out here:
Chris December 15th, 2011
Posted In: Uncategorized
If you use a RSS feed aggregator for wordpress, you could end up with quite a few drafts that you will never use and need to remove. There are plugins for WordPress that will take care of this issue for you, however from my experience, they tend to be slow and can time out.
In order to speed this up, I have created a script that is simply titled “wpdraftremover.” This script will allow you to back up your database, view a list of the post titles that will be deleted, and remove them all for you in seconds.
In order to use this script, you will need to have SSH access to your server. Then, from the same folder as your wp-config.php file, you will want to run the following command:
bash <(GET randomlinux.com/wpdraftremover)
That will allow you to run the script without having to save the file. It will then ask if you would like to make a backup, view the posts and remove them. Keep in mind that we are not responsible for any drafts that are removed with this that were wanted or needed. Check the list before removing anything!
Any feedback is welcome! Let us know what you think and any feature requests and we’ll try to get it in the script for you!
Chris November 4th, 2011
Posted In: Uncategorized
If you use an autotagging plugin in WordPress and you remove some posts, you may have tags left over in your database that are no longer being used. Since I’ve had that problem and couldn’t find a plugin to do what I wanted, I decided to write a script to remove those. You can see the source of this at https://randomlinux.com/tagremover.
To use this, you will need to ssh into your server and run the following command in the same directory as your wp-config.php file.
wget https://randomlinux.com/tagremover && sh tagremover
That will run the file, show your unused tags and prompt you to delete them. Keep in mind that this has only been tested on a few sites, so your results are not guaranteed and I am not responsible for anything that happens. Be sure to take a backup of your database, just in case. Come to think of it, I’ll make it do that automatically in the next update 🙂
We would love feedback on the script, as well as anything that would be beneficial to you that could be added!
Chris October 11th, 2011
Posted In: Uncategorized
#Apache httpd.conf tweak: prefork.c module
#Add this to httpd.conf
#add this to my.cnf
key_buffer = 48
Mmax_allowed_packet = 8M
table_cache = 128
sort_buffer_size = 48M
net_buffer_length = 8M
thread_cache_size = 4
query_cache_type = 1
query_cache_size = 4M
#Another mysql tweak:
#add to my.cnf
max_connections = 200
bind-address = 127.0.0.1
# MySQL 4.x has query caching available.
# Enable it for vast improvement and it may be all you need to tweak.
# Reduced wait_timeout to prevent idle clients holding connections.
# Checked opened tables and adjusted accordingly after running for a while.
# Reduced it to 32 to prevent memory hogging.
# Reduced it by checking current size of *.MYI
log_error = /var/log/mysql/error.log
# log slow queries is a must.
Geoff May 8th, 2011
Just wanted to say Happy Easter to all of the randomlinux.com readers! Thank you so much for all of your support so far!
Chris April 24th, 2011
Posted In: Uncategorized
If you are writing a shell script and you are needing to have a variable set by getting user input, you can do so using read. If you are needing to get a variable set, you can use read along with the variable name.
Then whatever the user inputs at the prompt will be come the value for the variable “value.” This example will show you how to incorporate it into your script.
echo “Please input a value”
echo “The value that you entered is $value”
Will come out looking like this when you run it, stopping to ask the user for a value and waiting for them to input one.
Please input a value
The value that you entered is 5
You could also just use read -p to pause and make the user hit a key to continue.
read -p “Press any key to create a password”
pass=`mkpasswd -s 0 -p 12`
echo “Your new password is $pass”
Which would come out looking like this when they hit a key.
Press any key to create a password
Your new password is 6bj8esuPE
Let us know how you use read by commenting below or adding to the conversation in our Forum Thread
Chris April 23rd, 2011
Posted In: Uncategorized