Experiences with the easycap DC60 audio and video capture adapter on Linux

This Blog is dedicated to all owners of the STK1160 chip based EasyCAP (or identical) devices, who want to use it under Linux.

Activating audio for the STK1160 device: read the this post

German speaking users: read my article on ubuntuusers.de

The EasyCAP DC60 and its clones are cheap little USB analogue capturing devices which can be used for viewing and recording video under Linux from different sources like VHS tape recorders, satellitereceivers, camcorders ...

Friday, March 29, 2013

Features of the stk1160 driver in the kernel

Updated August 6 2014

The stk1160 driver in the kernel (3.7 and upward) supports:
  • video capturing
    • PAL at 25 fps at 720x576
    • NTFS at 30 fps at 720x480
    • S-Video from input Nr. 4
    • the CVBS + S-Video model and 
    • the four CVBS model (all four channels) 
  • audio capturing
    • must be enabled in the mixer settings (read more on this post)
    • audio capturing only from the CVBS + S-Video model with built in AC'97 chip (3 chip Easycap; 48000Hz model) is supported
Good to know
  • The Easycap works even if it is connected to an USB 2.0 hub.
  • Use a powered hub if you get a crampy picture.
    Some performance issues are caused by too low power provided by some small boards (like Raspberry PI).
  • Some USB 3.0 hosts may have bandwith limitation, then it can cause problems with stk1160.

Supported features
  • Two (or more) stk1160 devices working side by side on one system
    (If this is not possible, it's not a driver issue, but rather about USB bandwidth)
  • Switching channels/ inputs while capturing (with the v4l2-ctl tool - read more on this post.).
Not supported: (but supported by the legacy easycapdriver)
  • Famescaling
    Only full PAL or NTFS frames can be captured
    (this is important e.g. for settings in Zoneminder)
  • audio capturing from the 8000Hz Easycap
    The stk1160 driver doesn't support audio on
    the four CVBS model and on
    the the CVBS + S-Video model where the AC'97 chip is missing.
    (Adding support for the 8 bit ADC in the stk1160 chip is planned in the future.)
Known issues
  • Some  stk1160 based Easycaps don't work on the stk1160 driver but on the legacy easycap driver. (will be solved in kernel 3.12 !)
    Read more on this post:
  • Easycap device issues on the Raspberry Pi
    Read more on this post:

The stk1160 regression problem

Update Feb 13 2014

This issue described below is solved in kernel 3.12 (not 3.11). It affects Easycap devices with gm7113 chip, which is a clone of the Philips saa7113 chip.

I cannot verify by myself, so please report, if this problem is solved in kernel 3.12.
Thanks
_______________________________________________________________________

Ezequiel Garcia wrote:(28. 03. 13)

"There are a batch of stk1160 Easycaps that don't work on stk1160 but do work
on the legacy easycap driver. This is a known issue since Nov. 2012."

Saturday, March 23, 2013

Raspberry Pi and Easycap devices

Update Feb 13 2014


Some hints for checking:
  • Use a powered USB hub to conntect the STK1160 device to the RPI because Raspberry pi is not strong enough to power usb easycap directly.
  • Try the -zoom option in your mplayer command.
    The stk1160 driver in the kernel doesn't support (hardware-) framescaling.
    from mplayers manpage:
    −zoom  

    Allow software scaling, where available. This will allow scaling with output drivers (like x11, fbdev) that do not support hardware scaling where MPlayer disables scaling by default for performance reasons.
    Example:
    mplayer tv:// -tv driver=v4l2:device=/dev/video0 -vf scale=400:300 -zoom
  •  You can try mplayer2 instead of mplayer.
It would be nice, if someone could report if these hints are useful/ working.
Thanks


____________________________________________________________________________
legacy Information:

Summing up all the comments below this post and some forum posts I've read about that issue, I can say that many USB video capture devices and webcams are not working at all (or only at a very low resolution) on the raspberry pi because of a rpi related USB issue.

These USB problems on the rpi are still pending and I couldn't find any report that the stk1160 device or any other Easycap device is working acceptably on the RPI.

Mainly USB webcams which are supported by the uvcvideo driver (many but not all) are working on the pi. List of pi verified USB webcams

More information about the rpi USB issue
In this thread on the raspberrypi.org forum  (page 12 to 16)
In this thread on raspberrypi.stackexchange.com 
success with a modified em28xx driver

_________________________________________________________________

more legacy information:

Easycap devices (stk1160, empia, somagic) currently are causing some problems with standard Linux disributions on the Raspberry Pi because of some RPI related USB issues.
However, enhancements are in progress.

The Easycap device registers properly like under any other Linux system (when the driver is in the kernel), but the video data transport through the RPIs USB system doesn't work.
I suppose this issue affects many other v4l2 devices plugged into the RPIs USB.


Ezequiel Garcia reported to me the following:

"The problem with the RPI is that it has a crappy USB driver and USB hardware.
When that is solved, stk1160 will work. Probably will take a long time
because synopsis USB datasheet is not public."


Note: The RPI branch on Ezequiels github https://github.com/ezequielgarcia/stk1160-standalone/tree/rpi is broken and doesn't work at all!


Andrew 

Tuesday, October 16, 2012

STK1160 News

Asking for Linux support from Syntek

Ezequiel is asking every EasyCAP stk1160 user to send an email to Syntek
asking them to support Linux drivers and provide a datasheet for their chips.

sales@stk.com.tw

STK1160 driver in kernel 3.7.

The stk1160 driver will replace the easycapdriver in the 3.7.x kernel release.
So, the spring releases of all major distros (Ubuntu 13.04 ...) will have the stk1160 driver onboard. :-)

STK1160 S-video support

Ezequiel is continuously working on the driver and has recently added s-video support.
If you want to use the s-video input you must download the svideo2_for_v3.2 branch from https://github.com/ezequielgarcia/stk1160-standalone/tree/svideo2_for_v3.2 (hit the ZIP button on top left).
Install the driver as described below.

Before you can use the s-video input with the stk1160 driver you need to run (while the STK1160 device is plugged in):
sudo rmmod stk1160
sudo modprobe stk1160 svideo_input=9
Now s-video is available from input number 4.

Monday, July 9, 2012

Summary before summer - Part 2

Summer is here now. Since I planned this post some great things concerning the EasyCAP happened.
A new driver for the EasyCAP DC60 has been published and the program mtvcgui has been updated. (See previous posts).

Some other news I want to mention:
  • Lavc - avconv
    In Ubunt 12.04 there is a new versin of libav (ffmepg branch) which now supports v4l2 capturing again. The ffmpeg and ffplay command in libav are deprecated and soon will be entirely replaced by 'avconv' and 'avplay'.
  • Puppylinux (Racy Puppy) and EasyCAP
    On my other EasyCAP related site I published an article, how Puppylinux can be installed besides of Ubuntu and how the EasyCAP can be used with Puppylinux. 
    https://sites.google.com/site/viewandrecordwithlinux/install-puppy-beside-ubuntu
  • After these evolutions a widely rewrite of some pages of this blog is pending.
  • By the way, I changed my blogname for not to cause some confusion.
Andrew

Sunday, July 8, 2012

New driver for the EasyCAP DC60 - stk1160

Great news!

Some time ago Ezequiel Garcia informed me:
"I just wanted you to know I've re-worked the old easycap driver
from scratch. Now it's called stk1160, because it's the correct name
for such driver. "
Inbetween the driver has been succesfully tested on Ubuntu 12.04 and Bodhilinux 1.4.0 with kernel 3.2. So it should work even on most systems which have the 3.2.0 kernel.

Although some enhancements have to be done, the driver already can be used as a replacement of the easycapdriver. It is expexted that the driver soon will get into the mainline kernel.

The great improvements compared to the easycapdriver are:
- there is no framedropping anymore
- the snd_usb_audio issue is solved
- the driver loads and registers quicker than the easycapdriver

Installation and usage (tested on Ubuntu 12.04)


Note: Although the driver is tested on Ubuntu, you do the installation at your own risk!

Download the driver from here:
https://github.com/ezequielgarcia/stk1160-standalone/zipball/for_v3.2

Unpack the content into your homedir and open a terminal.

At first we blacklist the easycap module (driver), so it cannot conflict with the new driver.

echo "blacklist easycap" | sudo tee -a /etc/modprobe.d/blacklist.conf 
If you want to reuse the easycap module, simply run
sudo modprobe easycap
or delete the entry
blacklist easycap 
in /etc/modprobe.d/blacklist.conf

Enter the unpacked directory with the driversource inside
cd ezequielgarcia-stk1160-standalone-...(the exact name)
and run
make
sudo make install
sudo depmod -a
With the next command you can check if the module has been correctly installed:
modinfo stk1160

After plugging in the EasyCAP test it with mplayer:
mplayer tv://

Configure sound 


The stk1160 module registers a control-only alsa soundcard. This sound card is called 'stk1160-mixer'.
The real sound capture is done through the 'Controlle' soundcard which is also created after plugging in the EasyCAP.
To get a list of the registerd ALSA soundcards, run the following command:
cat /proc/asound/cards
Sample output:
  0 [Intel          ]: HDA-Intel - HDA Intel
                      HDA Intel at 0xf0580000 irq 43
 1 [Controlle      ]: USB-Audio - USB 2.0 Video Capture Controlle
                      Syntek Semiconductor USB 2.0 Video Capture Controlle at usb-0000:00:1d.7-2, hig
 2 [stk1160mixer   ]: stk1160 - stk1160-mixer
                      stk1160 ac97 codec mixer control
To enable sound capture you have to open alsamixer when the EasyCAP is plugged in and select the 'Line' item on the capture menu for stk1160-mixer device:
1. start alsamixer
2. select stk1160-mixer sound card (with F6)
3. select capture controls (with F4)
4. select "Line" output (with space key) 

You can do this on the commandline as well with this line:
amixer -c stk1160mixer sset Line unmute cap 

Note! In the viewing- or capturing program you must then select the 'Controlle' soundcard or its number to hear sound!

Reinstallation oft the driver is required after kernel update!

If you have installed a new kernel on your system (or your update-manager did so automatically)  you need to reinstall the stk1160 driver!

 

When you do not want to use the stk1160 driver anymore


Simply blacklist the stk1160 module as described above and revert the blacklisting of the easycap module.


Thanks to Ezequiel for his work and support!

Andrew

Saturday, June 23, 2012

Mtvcgui updated

Santiago Bruno, the developer of mtvcgui, informed me about the new version (1.0.2) of his great program he has released some days ago.

"One of the new features in this release is that it queries mplayer to get the list of supported norms, so it should report the correct values," he reports.

The other great new feature is, that he provides booth a .deb and .rpm package, which installs (and adds a launcher to the menu), and runs (I've tested the .deb package with Ubuntu 12.04) without any problem.

If you want to preview or capture video, now mtvcgui and the EasyCAP DC60 work together without any adaptations,
but if you want to capture audio as well as video with the EasyCAP, you need to do the following:

On the second tab, check the "Capture audio using ALSA" checkbox,
then type in "hw.1" as ALSA device (if the EasyCAP is the second soundcard on your system).
Into the "Extra tv parameters" field type in:
amode=1:forceaudio:immediatemode=0
else the audio stream won't be captured (and you won't hear audio if you press the "Preview channel with mplayer" button on the first tab.

When I've done some more tests I will update the description concerning the usage of mtvcgui with the EasyCAP on the Recording page of this blog.

Andrew