Stk1160 based USB 2.0 video and audio capture devices: Difference between revisions
(add template) |
(link to blog for ffmpeg yuv420p) |
||
(32 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
This article covers all the tunerless USB 2.0 video and audio capture devices which are based on the STK1160 chip. This device is convenient for capturing from cameras, VHS-tapes, receivers ... and even for small surveillance installation (4 inputs model). |
This article covers all the tunerless USB 2.0 video and audio capture devices which are based on the STK1160 chip from [http://www.stk.com.tw/product-01.asp?Product_Type=32 Syntec Semiconductor.co.ltd.]. This device is convenient for capturing from cameras, VHS-tapes, receivers ... and even for small surveillance installation (4 inputs model). |
||
Many but not all of these devices are branded as [[Easycap]]. Althought this device is sold with different names and labels, in many forums and blogs this device is called "EasyCAP DC60". |
Many but not all of these devices are branded as [[Easycap]]. Althought this device is sold with different names and labels, in many forums and blogs this device is called "EasyCAP DC60". |
||
==Overview/Features== |
==Overview/Features== |
||
* USB ID 05e1:0408 |
|||
* USB 2.0 interface (USB 1.1 will not work, it's too slow). |
|||
* USB 2.0 interface (USB 1.1 will not work, it's too slow). |
|||
* Video capturing up to 720x576px @ 25fps (PAL) and 720x480px @ 30fps (NTSC) |
|||
* Inputs: (Model 001) CVBS, S-VIDEO, AUDIO(L), AUDIO(R) |
* Inputs: (Model 001) CVBS, S-VIDEO, AUDIO(L), AUDIO(R) |
||
* Inputs: (Model 002) 4 yellow input cables (CVBS) labelled 1, 2, 3, 4 and one white unlabelled audio cable |
* Inputs: (Model 002) 4 yellow input cables (CVBS) labelled 1, 2, 3, 4 and one white unlabelled audio cable |
||
** Capturing is possible from '''only one''' input at a time |
|||
* Audioquality: Model 001 has AC'97 audio (48000 Hz samplerate), model 002 (and some models 001 where the AC'97 chip is missing) has microphone audio (8000 Hz samplerate). |
|||
** Switching the inputs while capturing can be done with v4l2-ctl |
|||
v4l2-ctl -d /dev/video0 -i 1 |
|||
* Audioquality: Model 001 has AC'97 audio (48000 Hz samplerate), model 002 (and some models 001 where the AC'97 chip is missing) has mono microphone audio (8000 Hz samplerate). |
|||
===Components Used=== |
===Components Used=== |
||
* |
* Syntek STK1160 (USB video bridge) |
||
* Silan SC8113 (Philips SAA7113 compatible |
* [http://www.silan.com.cn/english/product/ProductItemDetail.aspx?id=18&pid=20090706092630633824691909652010&c=%E8%A7%86%E9%A2%91%E7%94%B5%E8%B7%AF Silan SC8113] or GM7113 (Philips SAA7113 compatible video decoder chips) |
||
* AC'97 audio processor (from different manufacturers. In models where this chip is missing (2 chip stk1160 Easycaps) audio capturing is done by the STK1160 chips built-in 8 bit ADC for mono microphone audio recording.) |
|||
* AC'97 audio chip |
|||
===Other Images=== |
===Other Images=== |
||
<gallery |
<gallery> |
||
Image:Easycap.png|STK1160 based capture devices: Model 001 (left) Model 002 (right) |
|||
Image:VideoMate_DVB-T220_box.jpg|VideoMate DVB-T220 Box |
|||
Image: |
Image:dc60-front.jpg|Front side of board |
||
Image:dc60-back.jpg|Back side of board |
|||
</gallery> |
</gallery> |
||
===Identification=== |
===Identification=== |
||
# lsusb |
|||
<span style="color:#009000">''Provide here, for PCI/PCIe devices, the relevant output of <code>lspci -vnn</code> or, in the case of USB devices, <code>lsusb -v </code>. We're particularly interested in the subsystem ID's. To make a code block simply make the first character of each line a space. For example:''</span><br> |
|||
Bus 001 Device 003: ID 05e1:0408 Syntek Semiconductor Co., Ltd STK1160 Video Capture Device |
|||
# lspci -vvvnn |
|||
04:03.0 Multimedia controller [0480]: Philips Semiconductors SAA7130 Video Broadcast Decoder [1131:7130] (rev 01) |
|||
Subsystem: Compro Technology, Inc. Videomate DVB-T200 [185b:c901] |
|||
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- |
|||
Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- |
|||
Latency: 84 (21000ns min, 8000ns max) |
|||
Interrupt: pin A routed to IRQ 20 |
|||
Region 0: Memory at fdcfe000 (32-bit, non-prefetchable) [size=1K] |
|||
Capabilities: [40] Power Management version 1 |
|||
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-) |
|||
Status: D0 PME-Enable- DSel=0 DScale=1 PME- |
|||
[[Stk1160#Full_lsusb_-v_output|lsusb -v see below]] |
|||
==Making it Work== |
|||
<span style="color:#009000">''Is it supported under Linux? Are there experimental drivers? Does it partially work or identify as another card? (if yes, add this information below)''</span> |
|||
==== Identify the audiotype of your device ==== |
|||
===Firmware=== |
|||
<span style="color:#009000">''Is there any firmware specific information for this device? if so, list it here. If your device doesn't require a firmware, simply mention that this is the case.''</span> |
|||
The following shell command reports the audiorate (sampling frequency) of your STK1160 based device: |
|||
===Drivers=== |
|||
<span style="color:#009000">''Discuss the kernel driver modules used by the device here. Provide the details of where the drivers, any patches, and any other necessary tools are available.''</span> |
|||
lsusb -v -d 05e1:0408 | grep tSamFreq | sed -e "s,^.* ,," |
|||
===Sample Kernel Output=== |
|||
<span style="color:#009000">''Provide the '''relevant''' portion of dmesg here. For example:''</span><br> |
|||
# dmesg |
|||
[ 45.569669] saa7130/34: v4l2 driver version 0.2.14 loaded |
|||
[ 45.569739] saa7130[0]: found at 0000:04:03.0, rev: 1, irq: 20, latency: 84, mmio: 0xfdcfe000 |
|||
[ 45.569745] saa7130[0]: subsystem: 185b:c901, board: Compro Videomate DVB-T200 [card=71,autodetected] |
|||
[ 45.569753] saa7130[0]: board init: gpio is 843f00 |
|||
[ 45.569809] input: saa7134 IR (Compro Videomate DV as /devices/pci0000:00/0000:00:1e.0/0000:04:03.0/input/input7 |
|||
[ 45.755429] saa7130[0]: i2c eeprom 00: 5b 18 01 c9 54 20 1c 00 43 43 a9 1c 55 d2 b2 92 |
|||
[ 45.755437] saa7130[0]: i2c eeprom 10: 00 ff 86 0f ff 20 ff ff ff ff ff ff ff ff ff ff |
|||
[ 45.755443] saa7130[0]: i2c eeprom 20: 01 40 01 03 03 ff 03 01 08 ff 00 88 ff ff ff ff |
|||
[ 45.755449] saa7130[0]: i2c eeprom 30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |
|||
[ 45.755454] saa7130[0]: i2c eeprom 40: ff d5 00 c4 86 1e ff ff ff ff ff ff ff ff ff ff |
|||
[ 45.755460] saa7130[0]: i2c eeprom 50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff cb |
|||
[ 45.755466] saa7130[0]: i2c eeprom 60: 30 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |
|||
[ 45.755471] saa7130[0]: i2c eeprom 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |
|||
[ 45.755478] saa7130[0]: Unexpected tuner type info: d5 in eeprom |
|||
[ 45.755532] saa7130[0]: registered device video0 [v4l2] |
|||
[ 45.755550] saa7130[0]: registered device vbi0 |
|||
[ 45.873425] saa7134 ALSA driver for DMA sound loaded |
|||
[ 45.873448] saa7130[0]/alsa: saa7130[0] at 0xfdcfe000 irq 20 registered as card -2 |
|||
[ 45.943354] saa7130[0]/dvb: frontend initialization failed |
|||
* 48000 = Model with AC'97 chip |
|||
===Remote Control Support=== |
|||
* 8000 = Model without AC'97 chip (currently not supported by the stk1160 driver) |
|||
<span style="color:#009000">''Discuss support for the remote control here.''</span> |
|||
===An Appropriate Title=== |
|||
<span style="color:#009000">''If deemed necessary, create an additional heading (using an appropriate title) and add anything else that you think might be relevant''</span> |
|||
== |
==Making it Work== |
||
STK1160 based devices ar supported under Linux since kernel 2.6.38 |
|||
<span style="color:#009000">''Provide a link to the vendor's product page here along with any other external link to information that is generally helpful in relation to the device. For example:''</span><br> |
|||
* [http://www.comprousa.com/en/product/t100t220/t220.html Compro T-220 product page] |
|||
===Drivers=== |
|||
==== stk1160 driver ==== |
|||
<span style="color:#009000">''Finally, the very last thing is to add a category. (Remove the nowiki tags). For example''</span><br> |
|||
The stk1160 driver is in the mainline kernel since version 3.7. It is the successor of the legacy easycap driver (see below). |
|||
<nowiki>[[Category:DVB-T PCI Devices]]</nowiki> |
|||
The stk1160 module supports: |
|||
* V4L2 video capturing |
|||
* audio capturing via ALSA (only the 48000Hz Easycap is supported) |
|||
====== Enable sound capture ====== |
|||
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 created after plugging in the STK1160 device by the '''snd_usb_audio''' module. |
|||
On a fresh installed system, or if you have installed the driver by yourself, you once (!) need to enable sound capture from '''stk1160-mixer''' in the mixer settings. |
|||
To enable sound capture you have to select in alsamixer the '''Line''' item on the capture menu for stk1160-mixer when the STK1160 device is plugged in: |
|||
You can do this in the terminal as well with this command: |
|||
# 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! |
|||
===== Limitations ===== |
|||
====== AC'97 audio only ====== |
|||
== How to identify your device == |
|||
The stk1160 module only supports audio capturing from the CVBS + S-Video Easycap with builtin AC'97 chip (3 chip stk1160 Easycap; 48000Hz model). Adding support for the 8 bit ADC in the stk1160 chip is planned in the future. |
|||
When '''lsusb''' reports the following output you have an STK1160 based video capture card: |
|||
If you have the 4 CVBS model or the CVBS + S-Video model without AC'97 chip the dmesg messages look like this: |
|||
Bus 001 Device 002: ID 05e1:0408 Syntek Semiconductor Co., Ltd STK1160 Video Capture Device |
|||
# dmesg |
|||
[12677.625434] usb 2-2: new high-speed USB device number 8 using ehci-pci |
|||
[12677.740513] usb 2-2: New device Syntek Semiconductor USB 2.0 Video |
|||
Capture Controller @ 480 Mbps (05e1:0408, interface 0, class 0) |
|||
[12677.740517] usb 2-2: video interface 0 found |
|||
[12678.217418] stk1160: driver ver 0.9.5 successfully loaded |
|||
[12678.220618] '''AC'97 0 access is not valid [0x0], removing mixer.''' |
|||
[12678.220623] stk1160: registers to NTSC like standard |
|||
[12678.221681] stk1160 2-2:1.0: V4L2 device registered as video1 |
|||
In this case you maybe can get some crappy sound through the '''Controlle''' soundcard created by the '''snd_usb_audio''' module, but if you want to capture hight quality sound you need to plug in the audio source to the Line in plug of your built-in soundcard. (You only need to change the number of the sound device in the capturing program if you want to watch/ record video with sound.) |
|||
====== Framescaling is not supported ====== |
|||
== Hardware == |
|||
On the board of this USB 2.0 video capture device there is on the front side a green LED, the STK1160 USB Bridge and a SAA7113 compatible video processing chip (silan sc8113) and on the back side a AC97 audio chip (this chip is missing on the 8000 Hz audio models of this device). |
|||
[[File:dc60-front.jpg|350px]] |
|||
[[File:dc60-back.jpg|350px]] |
|||
Unlike the legacy easycapdriver the stk1160 driver doesn't support framescaling. |
|||
== Drivers == |
|||
This is important for some programs where setting width and height of the video stream (e.g. Zonemeinder) is necessary. Other settings than 720x576 PAL or 720x480 NTSC may cause proplems with those programs. |
|||
=== |
===== Known issues ===== |
||
The easycap driver is part of the current kernel (since 2.6.38) and supports all the features of the STK1160 based devices but has some limitations (framedropping, stability, sound issues). |
|||
* Easycap devices which have the gm7113 video decoder chip (saa7113 clone) inside don't work on stk1160 in kernel under 3.11, but do work on the legacy easycap driver. |
|||
=== stk1160 driver === |
|||
* There is an unresolved problem with the sound capture. It is expressed in a constant background noise. Sound much worse in stereo. [http://marc.info/?l=linux-sound&m=139223599126215&w=2 Issue link.] |
|||
The stk1160 driver is the successor of the easycap driver. It supports video capturing and audio capturing via ALSA. This driver doesn't suffer from the limitations of the easycap driver but is still under development. It is intended that the stk1160 module will replace the easycap module in one of the next kernel releases. |
|||
* Audio chip is not recognized properly by the snd_usb_audio driver. But the default settings apply and it does not affect the issue with the sound. |
|||
* To one root hub port can connect only one device. Can connect multiple, but at the same time only one operate. This not an power supply issue, since the device consumes only 200mA in operation mode. Number of devices that can simultaneously connect to PC depends on the amount root hub ports. |
|||
* The xhci_hcd driver in charge of USB 3.0 very often crashes when using the stk1160 driver. This happens when the video turn on or off. |
|||
===== Sourcecode ===== |
|||
If you want to use the stk1160 driver under previous kernels (3.2, 3.4 or 3.6 kernel only !), you can get the sourcecode frome here: |
|||
[https://github.com/ezequielgarcia/stk1160-standalone stk1160 github repository] |
[https://github.com/ezequielgarcia/stk1160-standalone stk1160 github repository] |
||
Select the svideo2_for_3.2 version if you want to use the s-video input of yout stk1160 device. |
|||
[https://github.com/ezequielgarcia/stk1160-standalone/zipball/for_v3.2 stk1160 sourcecode-zipball for kernel 3.2] |
|||
[http://easycap.blogspot.co.at/2012/07/new-driver-for-easycap-dc60-stk1160.html Additional installation instructions] |
[http://easycap.blogspot.co.at/2012/07/new-driver-for-easycap-dc60-stk1160.html Additional installation instructions] |
||
== Models == |
|||
[[File:easycap.png]] |
|||
These known STK1160 based models of the video capture device are supported by the above mentioned drivers. All models do have the same USB device ID: 05e1:0408. |
|||
* Model 001 with input cables labelled CVBS, S-VIDEO, AUDIO(L), AUDIO(R) and 48000 Hz audio (AC'97 audio) |
|||
==== legacy easycap driver ==== |
|||
* Model 002 with 4 yellow input cables (CVBS) labelled 1, 2, 3, 4 and one white unlabelled audio cable and 8000 Hz audio (microphone audio) |
|||
The easycap driver is part of the kernel from 2.6.38 up to 3.6.x and supports all the features of the STK1160 based devices but has some limitations (framedropping, stability, sound issues). |
|||
===== easycap audio support ===== |
|||
* Model 001m with input cables labelled CVBS, S-VIDEO, AUDIO(L), AUDIO(R) and 8000 Hz audio (microphone audio) |
|||
(Obviously this device has the board of Model 002 but the cables of Model 001) |
|||
The eascap module supports audio from the 48000Hz and the 8000Hz models. |
|||
=== Identify the audiotype of your device === |
|||
The following shell command reports the audiorate (sampling frequency) of your STK1160 based device: (48000 = Model 001; 8000 = Model 001m or Model 002). |
|||
The easycap module creates an additional ALSA soundcard '''EasyALSA0'''. |
|||
lsusb -v -d 05e1:0408 | grep tSamFreq | sed -e "s,^.* ,," |
|||
Often when the STK1160 device is plugged in the '''snd_usb_audio''' module conflicts with the easycap module and the EasyALSA0 soundcard is not created. As a workaround you need to unplug the device, unload the module (rmmod snd_usb_audio) and then plug in the device again. |
|||
If you encounter audio problems while capturing you need to specify the correct audiorate of your model in the capturing program. |
|||
=== Video inputs (channels) === |
|||
If you encounter audio problems while capturing you need to specify the correct audiorate of your model (48000 or 8000) in the capturing program. |
|||
===Sample Kernel Output=== |
|||
==== easycap module ==== |
|||
# dmesg |
|||
[ 250.728092] usb 1-2: new high speed USB device number 4 using ehci_hcd |
|||
[ 254.681355] easycap::0adjust_standard: selected standard: PAL_BGHIN |
|||
[ 254.992254] easycap::0adjust_format: sought: 640x480,UYVY(0x59565955),1=field,0x00=std mask |
|||
[ 254.992263] easycap::0adjust_format: sought: V4L2_FIELD_NONE |
|||
[ 254.992273] easycap::0adjust_format: actioning: 640x480 PAL_BGHIN_AT_640x480_FMT_UYVY-n |
|||
[ 255.016137] easycap::0adjust_brightness: adjusting brightness to 0x7F |
|||
[ 255.040149] easycap::0adjust_contrast: adjusting contrast to 0x3F |
|||
[ 255.064162] easycap::0adjust_saturation: adjusting saturation to 0x2F |
|||
[ 255.088173] easycap::0adjust_hue: adjusting hue to 0x00 |
|||
[ 255.089557] easycap::0easycap_usb_probe: registered with videodev: 0=minor |
|||
[ 255.089565] easycap::0easycap_usb_probe: ends successfully for interface 0 |
|||
[ 255.089713] easycap::0easycap_usb_probe: ends successfully for interface 1 |
|||
[ 255.090017] easycap::0easycap_usb_probe: audio hardware is AC'97 |
|||
[ 255.090485] easycap::0easycap_alsa_probe: registered EasyALSA0 |
|||
[ 255.090492] easycap::0easycap_usb_probe: ends successfully for interface 2 |
|||
[ 255.091910] easycap:: easycap_open: ==========OPEN========= |
|||
[ 255.161078] easycap::0audio_setup: 0x414C:0x4760 is audio vendor id |
|||
[ 255.181331] easycap::0audio_setup: 0x414C:0x4760 is audio vendor id |
|||
[ 255.263624] easycap::0audio_setup: 0x414C:0x4760 is audio vendor id |
|||
[ 255.345927] easycap::0audio_setup: 0x414C:0x4760 is audio vendor id |
|||
[ 255.432975] easycap::0audio_setup: 0x414C:0x4760 is audio vendor id |
|||
[ 255.525395] easycap::0audio_setup: 0x414C:0x4760 is audio vendor id |
|||
[ 255.631195] snd_pcm_update_hw_ptr0: 24 callbacks suppressed |
|||
[ 256.341308] easycap::0adjust_standard: selected standard: PAL_BGHIN |
|||
[ 256.652338] easycap::0adjust_format: sought: 640x480,UYVY(0x59565955),1=field,0x00=std mask |
|||
[ 256.652346] easycap::0adjust_format: sought: V4L2_FIELD_NONE |
|||
[ 256.652355] easycap::0adjust_format: actioning: 640x480 PAL_BGHIN_AT_640x480_FMT_UYVY-n |
|||
[ 256.676218] easycap::0adjust_brightness: adjusting brightness to 0x7F |
|||
[ 256.700233] easycap::0adjust_contrast: adjusting contrast to 0x3F |
|||
[ 256.724242] easycap::0adjust_saturation: adjusting saturation to 0x2F |
|||
[ 256.748129] easycap::0adjust_hue: adjusting hue to 0x00 |
|||
==== stk1160 module ==== |
|||
# dmesg |
|||
[16873.944081] usb 1-2: new high-speed USB device number 2 using ehci_hcd |
|||
[16874.892446] Linux video capture interface: v2.00 |
|||
[16875.012940] usb 1-2: New device Syntek Semiconductor USB 2.0 Video Capture Controller @ 480 Mbps (05e1:0408, interface 0, class 0) |
|||
[16875.012949] usb 1-2: video interface 0 found |
|||
[16875.836259] saa7115 14-0025: saa7113 found (1f7113d0e100000) @ 0x4a (stk1160) |
|||
[16877.372155] stk1160: driver ver 0.9.3 successfully loaded |
|||
[16877.469999] stk1160: registers to NTSC like standard |
|||
[16877.792436] stk1160 1-2:1.0: V4L2 device registered as video0 |
|||
[16877.793733] usbcore: registered new interface driver snd-usb-audio |
|||
[16877.795409] usbcore: registered new interface driver stk1160 |
|||
From the two or four video cables on the device only one (!) can be used at the same time. |
|||
If you want to switch through the different inputs of your card you need to start the capturing program again with the next input number. |
|||
== Usage == |
|||
The STK1160 device needs a USB 2.0 capable USB port. USB 1.1 will not work (it's too slow). |
The STK1160 device needs a USB 2.0 capable USB port. USB 1.1 will not work (it's too slow). |
||
The driver for the STK1160 device creates a /dev/video'''N''' node and an ALSA soundcard, The different video-inputs of the device can be accessed by their inputnumber (starting at 0). |
The driver for the STK1160 device creates a /dev/video'''N''' node and an ALSA soundcard, The different video-inputs of the device can be accessed by their inputnumber (starting at 0). <br/> |
||
''From the two or four video cables on the device only one (!) can be used at the same time. If you want to switch through the different inputs of your card you need to start the capturing program again with the next input number.'' |
|||
In the viewing/ capturing program (e.g. mplayer) you must specify |
In the viewing/ capturing program (e.g. mplayer) you must specify |
||
Line 149: | Line 186: | ||
* the input number of the cable where the source is plugged in, |
* the input number of the cable where the source is plugged in, |
||
* the TV norm of the videosource and (e.g. PAL, NTSC) |
* the TV norm of the videosource and (e.g. PAL, NTSC) |
||
* the ALSA sounddevice if you want to capture audio |
* the ALSA sounddevice if you want to capture audio. Get a list of ALSA soundcards with this command: |
||
# cat /proc/asound/cards |
|||
''If you encounter audio problems while capturing you need to specify the [[Stk1160#Identify_the_audiotype_of_your_device|correct audiorate]] of your model in the capturing program.'' |
|||
==== Example for mplayer ==== |
|||
=== Example for mplayer === |
|||
Assumed that your STK1160 device is the second videodevice (the first is your webcam) and the second soundcard on your system, and that on the first CVBS input a PAL camera is plugged in and sound also comes from the STK1160 device, the mplayer command for viewing would look like this: |
Assumed that your STK1160 device is the second videodevice (the first is your webcam) and the second soundcard on your system, and that on the first CVBS input a PAL camera is plugged in and sound also comes from the STK1160 device, the mplayer command for viewing would look like this: |
||
mplayer tv:// -tv driver=v4l2:norm=PAL:width=720:height=576:outfmt=uyvy:device=/dev/video1:input=0:\ |
mplayer tv:// -tv driver=v4l2:norm=PAL:width=720:height=576:outfmt=uyvy:device=/dev/video1:input=0:\ |
||
alsa:adevice=hw.1:forceaudio:immediatemode=0 -ao sdl |
alsa:adevice=hw.1:audiorate=48000:forceaudio:immediatemode=0 -ao sdl |
||
=== More programs === |
|||
These programs are known to be useful for analogue audio- and videocapturing with STK1160 based (and similar) devices. |
These programs are known to be useful for analogue audio- and videocapturing with STK1160 based (and similar) devices. |
||
Line 165: | Line 205: | ||
* VLC |
* VLC |
||
* TVtime |
* TVtime |
||
* avconv (libav; formerly ffmpeg), see also: stackoverflow [https://superuser.com/questions/1124026/capture-and-view-pal-b-raw-video-and-stereo-alsa-sound-from-easycap-stk1160-with](using tee muxer to play simultaneously) and a blog [https://medium.com/@bionazgul/the-adventures-of-converting-vhs-tapes-to-mp4-using-easycap-and-ffmpeg-to-create-a-christmas-f12364bfefe1](use yuv420p for more compatibility) |
|||
* avconv (libav; formerly ffmpeg) |
|||
* Zoneminder - Linux surveillance suite |
* Zoneminder - Linux surveillance suite |
||
* Any other program which is capable of analogue video- and audiocapturing will probably work with STK1160 devices. |
* Any other program which is capable of analogue video- and audiocapturing will probably work with STK1160 devices. |
||
== Short linux driver history == |
== Short linux driver history == |
||
In early 2010 [http://sourceforge.net/projects/easycapdc60/ Mike Thomas] started developing a driver for the |
In early 2010 [http://sourceforge.net/projects/easycapdc60/ Mike Thomas] started developing a driver for the STK1160 based video capture device which is sold as EasyCAP DC60. He used the [http://sourceforge.net/projects/syntekdriver/ stk11xx] driver and some existing [http://ubuntuforums.org/showthread.php?t=924504&page=3 patches] for the "05e1:0408" Syntek device as a basis for his project. Since the easycapdriver (version 0.9) has been added to the staging directory of the Linux kernel in November 2011 Mike Thomas stopped his development and support. |
||
Some people added changes in order to clean up the sourcecode. These changes didn't hardly affect the limitations (framedropping, stability) of the driver. |
Some people added changes in order to clean up the sourcecode. These changes didn't hardly affect the limitations (framedropping, stability) of the driver. |
||
Line 176: | Line 216: | ||
At the middle of 2012 [https://github.com/ezequielgarcia/stk1160-standalone Ezequiel Garcia] decided to rework the easycapdriver. He changed the drivers name to "stk1160". |
At the middle of 2012 [https://github.com/ezequielgarcia/stk1160-standalone Ezequiel Garcia] decided to rework the easycapdriver. He changed the drivers name to "stk1160". |
||
In the 3.7 kernel release the legacy easycapdriver has been replaced by the stk1160 driver. |
|||
In one of the next kernel releases (3.6/7) the stk1160 driver will come into mainlaine and replace the old easycapdriver. |
|||
== Summary == |
|||
stk1160 |
|||
* audio: poor |
|||
* video: good |
|||
* stability: poor |
|||
easycap |
|||
* audio: good |
|||
* video: poor |
|||
* stability: good (not tested fully) |
|||
==External Links== |
|||
* [http://easycap.blogspot.co.at easycap.blogspot.co.at] Blog supporting STK1160 based EasyCAP devices |
|||
== Full lsusb -v output == |
|||
The following lsusb -v output is from the STK1160 based model 001 with builtin AC'97 audio processor: |
|||
# lsusb -v |
|||
Bus 001 Device 002: ID 05e1:0408 Syntek Semiconductor Co., Ltd STK1160 Video Capture Device |
|||
Couldn't open device, some information will be missing |
|||
Device Descriptor: |
|||
bLength 18 |
|||
bDescriptorType 1 |
|||
bcdUSB 2.00 |
|||
bDeviceClass 0 (Defined at Interface level) |
|||
bDeviceSubClass 0 |
|||
bDeviceProtocol 0 |
|||
bMaxPacketSize0 64 |
|||
idVendor 0x05e1 Syntek Semiconductor Co., Ltd |
|||
idProduct 0x0408 STK1160 Video Capture Device |
|||
bcdDevice 0.05 |
|||
iManufacturer 1 |
|||
iProduct 2 |
|||
iSerial 0 |
|||
bNumConfigurations 1 |
|||
Configuration Descriptor: |
|||
bLength 9 |
|||
bDescriptorType 2 |
|||
wTotalLength 251 |
|||
bNumInterfaces 3 |
|||
bConfigurationValue 1 |
|||
iConfiguration 0 |
|||
bmAttributes 0x80 |
|||
(Bus Powered) |
|||
MaxPower 500mA |
|||
Interface Descriptor: |
|||
bLength 9 |
|||
bDescriptorType 4 |
|||
bInterfaceNumber 0 |
|||
bAlternateSetting 0 |
|||
bNumEndpoints 2 |
|||
bInterfaceClass 255 Vendor Specific Class |
|||
bInterfaceSubClass 255 Vendor Specific Subclass |
|||
bInterfaceProtocol 255 Vendor Specific Protocol |
|||
iInterface 0 |
|||
Endpoint Descriptor: |
|||
bLength 7 |
|||
bDescriptorType 5 |
|||
bEndpointAddress 0x81 EP 1 IN |
|||
bmAttributes 3 |
|||
Transfer Type Interrupt |
|||
Synch Type None |
|||
Usage Type Data |
|||
wMaxPacketSize 0x0000 1x 0 bytes |
|||
bInterval 5 |
|||
Endpoint Descriptor: |
|||
bLength 7 |
|||
bDescriptorType 5 |
|||
bEndpointAddress 0x82 EP 2 IN |
|||
bmAttributes 1 |
|||
Transfer Type Isochronous |
|||
Synch Type None |
|||
Usage Type Data |
|||
wMaxPacketSize 0x0000 1x 0 bytes |
|||
bInterval 1 |
|||
Interface Descriptor: |
|||
bLength 9 |
|||
bDescriptorType 4 |
|||
bInterfaceNumber 0 |
|||
bAlternateSetting 1 |
|||
bNumEndpoints 2 |
|||
bInterfaceClass 255 Vendor Specific Class |
|||
bInterfaceSubClass 255 Vendor Specific Subclass |
|||
bInterfaceProtocol 255 Vendor Specific Protocol |
|||
iInterface 0 |
|||
Endpoint Descriptor: |
|||
bLength 7 |
|||
bDescriptorType 5 |
|||
bEndpointAddress 0x81 EP 1 IN |
|||
bmAttributes 3 |
|||
Transfer Type Interrupt |
|||
Synch Type None |
|||
Usage Type Data |
|||
wMaxPacketSize 0x0002 1x 2 bytes |
|||
bInterval 5 |
|||
Endpoint Descriptor: |
|||
bLength 7 |
|||
bDescriptorType 5 |
|||
bEndpointAddress 0x82 EP 2 IN |
|||
bmAttributes 1 |
|||
Transfer Type Isochronous |
|||
Synch Type None |
|||
Usage Type Data |
|||
wMaxPacketSize 0x0300 1x 768 bytes |
|||
bInterval 1 |
|||
Interface Descriptor: |
|||
bLength 9 |
|||
bDescriptorType 4 |
|||
bInterfaceNumber 0 |
|||
bAlternateSetting 2 |
|||
bNumEndpoints 2 |
|||
bInterfaceClass 255 Vendor Specific Class |
|||
bInterfaceSubClass 255 Vendor Specific Subclass |
|||
bInterfaceProtocol 255 Vendor Specific Protocol |
|||
iInterface 0 |
|||
Endpoint Descriptor: |
|||
bLength 7 |
|||
bDescriptorType 5 |
|||
bEndpointAddress 0x81 EP 1 IN |
|||
bmAttributes 3 |
|||
Transfer Type Interrupt |
|||
Synch Type None |
|||
Usage Type Data |
|||
wMaxPacketSize 0x0002 1x 2 bytes |
|||
bInterval 5 |
|||
Endpoint Descriptor: |
|||
bLength 7 |
|||
bDescriptorType 5 |
|||
bEndpointAddress 0x82 EP 2 IN |
|||
bmAttributes 1 |
|||
Transfer Type Isochronous |
|||
Synch Type None |
|||
Usage Type Data |
|||
wMaxPacketSize 0x03fc 1x 1020 bytes |
|||
bInterval 1 |
|||
Interface Descriptor: |
|||
bLength 9 |
|||
bDescriptorType 4 |
|||
bInterfaceNumber 0 |
|||
bAlternateSetting 3 |
|||
bNumEndpoints 2 |
|||
bInterfaceClass 255 Vendor Specific Class |
|||
bInterfaceSubClass 255 Vendor Specific Subclass |
|||
bInterfaceProtocol 255 Vendor Specific Protocol |
|||
iInterface 0 |
|||
Endpoint Descriptor: |
|||
bLength 7 |
|||
bDescriptorType 5 |
|||
bEndpointAddress 0x81 EP 1 IN |
|||
bmAttributes 3 |
|||
Transfer Type Interrupt |
|||
Synch Type None |
|||
Usage Type Data |
|||
wMaxPacketSize 0x0002 1x 2 bytes |
|||
bInterval 5 |
|||
Endpoint Descriptor: |
|||
bLength 7 |
|||
bDescriptorType 5 |
|||
bEndpointAddress 0x82 EP 2 IN |
|||
bmAttributes 1 |
|||
Transfer Type Isochronous |
|||
Synch Type None |
|||
Usage Type Data |
|||
wMaxPacketSize 0x0400 1x 1024 bytes |
|||
bInterval 1 |
|||
Interface Descriptor: |
|||
bLength 9 |
|||
bDescriptorType 4 |
|||
bInterfaceNumber 0 |
|||
bAlternateSetting 4 |
|||
bNumEndpoints 2 |
|||
bInterfaceClass 255 Vendor Specific Class |
|||
bInterfaceSubClass 255 Vendor Specific Subclass |
|||
bInterfaceProtocol 255 Vendor Specific Protocol |
|||
iInterface 0 |
|||
Endpoint Descriptor: |
|||
bLength 7 |
|||
bDescriptorType 5 |
|||
bEndpointAddress 0x81 EP 1 IN |
|||
bmAttributes 3 |
|||
Transfer Type Interrupt |
|||
Synch Type None |
|||
Usage Type Data |
|||
wMaxPacketSize 0x0002 1x 2 bytes |
|||
bInterval 5 |
|||
Endpoint Descriptor: |
|||
bLength 7 |
|||
bDescriptorType 5 |
|||
bEndpointAddress 0x82 EP 2 IN |
|||
bmAttributes 1 |
|||
Transfer Type Isochronous |
|||
Synch Type None |
|||
Usage Type Data |
|||
wMaxPacketSize 0x0c00 2x 1024 bytes |
|||
bInterval 1 |
|||
Interface Descriptor: |
|||
bLength 9 |
|||
bDescriptorType 4 |
|||
bInterfaceNumber 0 |
|||
bAlternateSetting 5 |
|||
bNumEndpoints 2 |
|||
bInterfaceClass 255 Vendor Specific Class |
|||
bInterfaceSubClass 255 Vendor Specific Subclass |
|||
bInterfaceProtocol 255 Vendor Specific Protocol |
|||
iInterface 0 |
|||
Endpoint Descriptor: |
|||
bLength 7 |
|||
bDescriptorType 5 |
|||
bEndpointAddress 0x81 EP 1 IN |
|||
bmAttributes 3 |
|||
Transfer Type Interrupt |
|||
Synch Type None |
|||
Usage Type Data |
|||
wMaxPacketSize 0x0002 1x 2 bytes |
|||
bInterval 5 |
|||
Endpoint Descriptor: |
|||
bLength 7 |
|||
bDescriptorType 5 |
|||
bEndpointAddress 0x82 EP 2 IN |
|||
bmAttributes 1 |
|||
Transfer Type Isochronous |
|||
Synch Type None |
|||
Usage Type Data |
|||
wMaxPacketSize 0x1400 3x 1024 bytes |
|||
bInterval 1 |
|||
Interface Descriptor: |
|||
bLength 9 |
|||
bDescriptorType 4 |
|||
bInterfaceNumber 1 |
|||
bAlternateSetting 0 |
|||
bNumEndpoints 0 |
|||
bInterfaceClass 1 Audio |
|||
bInterfaceSubClass 1 Control Device |
|||
bInterfaceProtocol 0 |
|||
iInterface 11 |
|||
AudioControl Interface Descriptor: |
|||
bLength 9 |
|||
bDescriptorType 36 |
|||
bDescriptorSubtype 1 (HEADER) |
|||
bcdADC 1.00 |
|||
wTotalLength 38 |
|||
bInCollection 1 |
|||
baInterfaceNr( 0) 2 |
|||
AudioControl Interface Descriptor: |
|||
bLength 12 |
|||
bDescriptorType 36 |
|||
bDescriptorSubtype 2 (INPUT_TERMINAL) |
|||
bTerminalID 1 |
|||
wTerminalType 0x0602 Digital Audio Interface |
|||
bAssocTerminal 0 |
|||
bNrChannels 2 |
|||
wChannelConfig 0x0003 |
|||
Left Front (L) |
|||
Right Front (R) |
|||
iChannelNames 0 |
|||
iTerminal 0 |
|||
AudioControl Interface Descriptor: |
|||
bLength 9 |
|||
bDescriptorType 36 |
|||
bDescriptorSubtype 3 (OUTPUT_TERMINAL) |
|||
bTerminalID 2 |
|||
wTerminalType 0x0101 USB Streaming |
|||
bAssocTerminal 0 |
|||
bSourceID 3 |
|||
iTerminal 0 |
|||
AudioControl Interface Descriptor: |
|||
bLength 8 |
|||
bDescriptorType 36 |
|||
bDescriptorSubtype 6 (FEATURE_UNIT) |
|||
bUnitID 3 |
|||
bSourceID 1 |
|||
bControlSize 1 |
|||
bmaControls( 0) 0x01 |
|||
Mute Control |
|||
iFeature 0 |
|||
Interface Descriptor: |
|||
bLength 9 |
|||
bDescriptorType 4 |
|||
bInterfaceNumber 2 |
|||
bAlternateSetting 0 |
|||
bNumEndpoints 1 |
|||
bInterfaceClass 1 Audio |
|||
bInterfaceSubClass 2 Streaming |
|||
bInterfaceProtocol 0 |
|||
iInterface 11 |
|||
Endpoint Descriptor: |
|||
bLength 7 |
|||
bDescriptorType 5 |
|||
bEndpointAddress 0x84 EP 4 IN |
|||
bmAttributes 5 |
|||
Transfer Type Isochronous |
|||
Synch Type Asynchronous |
|||
Usage Type Data |
|||
wMaxPacketSize 0x0000 1x 0 bytes |
|||
bInterval 1 |
|||
Interface Descriptor: |
|||
bLength 9 |
|||
bDescriptorType 4 |
|||
bInterfaceNumber 2 |
|||
bAlternateSetting 1 |
|||
bNumEndpoints 1 |
|||
bInterfaceClass 1 Audio |
|||
bInterfaceSubClass 2 Streaming |
|||
bInterfaceProtocol 0 |
|||
iInterface 11 |
|||
AudioStreaming Interface Descriptor: |
|||
bLength 7 |
|||
bDescriptorType 36 |
|||
bDescriptorSubtype 1 (AS_GENERAL) |
|||
bTerminalLink 2 |
|||
bDelay 1 frames |
|||
wFormatTag 1 PCM |
|||
AudioStreaming Interface Descriptor: |
|||
bLength 11 |
|||
bDescriptorType 36 |
|||
bDescriptorSubtype 2 (FORMAT_TYPE) |
|||
bFormatType 1 (FORMAT_TYPE_I) |
|||
bNrChannels 2 |
|||
bSubframeSize 2 |
|||
bBitResolution 16 |
|||
bSamFreqType 1 Discrete |
|||
tSamFreq[ 0] 48000 |
|||
Endpoint Descriptor: |
|||
bLength 7 |
|||
bDescriptorType 5 |
|||
bEndpointAddress 0x84 EP 4 IN |
|||
bmAttributes 5 |
|||
Transfer Type Isochronous |
|||
Synch Type Asynchronous |
|||
Usage Type Data |
|||
wMaxPacketSize 0x0100 1x 256 bytes |
|||
bInterval 4 |
|||
AudioControl Endpoint Descriptor: |
|||
bLength 7 |
|||
bDescriptorType 37 |
|||
bDescriptorSubtype 1 (EP_GENERAL) |
|||
bmAttributes 0x00 |
|||
bLockDelayUnits 0 Undefined |
|||
wLockDelay 0 Undefined |
|||
[[Category:Analog USB Devices]] [[Category:Capture Devices]] [[Category:Hardware]] [[Category:Drivers]] |
Latest revision as of 07:29, 12 July 2021
This article covers all the tunerless USB 2.0 video and audio capture devices which are based on the STK1160 chip from Syntec Semiconductor.co.ltd.. This device is convenient for capturing from cameras, VHS-tapes, receivers ... and even for small surveillance installation (4 inputs model).
Many but not all of these devices are branded as Easycap. Althought this device is sold with different names and labels, in many forums and blogs this device is called "EasyCAP DC60".
Overview/Features
- USB ID 05e1:0408
- USB 2.0 interface (USB 1.1 will not work, it's too slow).
- Video capturing up to 720x576px @ 25fps (PAL) and 720x480px @ 30fps (NTSC)
- Inputs: (Model 001) CVBS, S-VIDEO, AUDIO(L), AUDIO(R)
- Inputs: (Model 002) 4 yellow input cables (CVBS) labelled 1, 2, 3, 4 and one white unlabelled audio cable
- Capturing is possible from only one input at a time
- Switching the inputs while capturing can be done with v4l2-ctl
v4l2-ctl -d /dev/video0 -i 1
- Audioquality: Model 001 has AC'97 audio (48000 Hz samplerate), model 002 (and some models 001 where the AC'97 chip is missing) has mono microphone audio (8000 Hz samplerate).
Components Used
- Syntek STK1160 (USB video bridge)
- Silan SC8113 or GM7113 (Philips SAA7113 compatible video decoder chips)
- AC'97 audio processor (from different manufacturers. In models where this chip is missing (2 chip stk1160 Easycaps) audio capturing is done by the STK1160 chips built-in 8 bit ADC for mono microphone audio recording.)
Other Images
Identification
# lsusb Bus 001 Device 003: ID 05e1:0408 Syntek Semiconductor Co., Ltd STK1160 Video Capture Device
Identify the audiotype of your device
The following shell command reports the audiorate (sampling frequency) of your STK1160 based device:
lsusb -v -d 05e1:0408 | grep tSamFreq | sed -e "s,^.* ,,"
- 48000 = Model with AC'97 chip
- 8000 = Model without AC'97 chip (currently not supported by the stk1160 driver)
Making it Work
STK1160 based devices ar supported under Linux since kernel 2.6.38
Drivers
stk1160 driver
The stk1160 driver is in the mainline kernel since version 3.7. It is the successor of the legacy easycap driver (see below).
The stk1160 module supports:
- V4L2 video capturing
- audio capturing via ALSA (only the 48000Hz Easycap is supported)
Enable sound capture
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 created after plugging in the STK1160 device by the snd_usb_audio module.
On a fresh installed system, or if you have installed the driver by yourself, you once (!) need to enable sound capture from stk1160-mixer in the mixer settings.
To enable sound capture you have to select in alsamixer the Line item on the capture menu for stk1160-mixer when the STK1160 device is plugged in: You can do this in the terminal as well with this command:
# 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!
Limitations
AC'97 audio only
The stk1160 module only supports audio capturing from the CVBS + S-Video Easycap with builtin AC'97 chip (3 chip stk1160 Easycap; 48000Hz model). Adding support for the 8 bit ADC in the stk1160 chip is planned in the future.
If you have the 4 CVBS model or the CVBS + S-Video model without AC'97 chip the dmesg messages look like this:
# dmesg [12677.625434] usb 2-2: new high-speed USB device number 8 using ehci-pci [12677.740513] usb 2-2: New device Syntek Semiconductor USB 2.0 Video Capture Controller @ 480 Mbps (05e1:0408, interface 0, class 0) [12677.740517] usb 2-2: video interface 0 found [12678.217418] stk1160: driver ver 0.9.5 successfully loaded [12678.220618] AC'97 0 access is not valid [0x0], removing mixer. [12678.220623] stk1160: registers to NTSC like standard [12678.221681] stk1160 2-2:1.0: V4L2 device registered as video1
In this case you maybe can get some crappy sound through the Controlle soundcard created by the snd_usb_audio module, but if you want to capture hight quality sound you need to plug in the audio source to the Line in plug of your built-in soundcard. (You only need to change the number of the sound device in the capturing program if you want to watch/ record video with sound.)
Framescaling is not supported
Unlike the legacy easycapdriver the stk1160 driver doesn't support framescaling. This is important for some programs where setting width and height of the video stream (e.g. Zonemeinder) is necessary. Other settings than 720x576 PAL or 720x480 NTSC may cause proplems with those programs.
Known issues
- Easycap devices which have the gm7113 video decoder chip (saa7113 clone) inside don't work on stk1160 in kernel under 3.11, but do work on the legacy easycap driver.
- There is an unresolved problem with the sound capture. It is expressed in a constant background noise. Sound much worse in stereo. Issue link.
- Audio chip is not recognized properly by the snd_usb_audio driver. But the default settings apply and it does not affect the issue with the sound.
- To one root hub port can connect only one device. Can connect multiple, but at the same time only one operate. This not an power supply issue, since the device consumes only 200mA in operation mode. Number of devices that can simultaneously connect to PC depends on the amount root hub ports.
- The xhci_hcd driver in charge of USB 3.0 very often crashes when using the stk1160 driver. This happens when the video turn on or off.
Sourcecode
If you want to use the stk1160 driver under previous kernels (3.2, 3.4 or 3.6 kernel only !), you can get the sourcecode frome here:
Select the svideo2_for_3.2 version if you want to use the s-video input of yout stk1160 device.
Additional installation instructions
legacy easycap driver
The easycap driver is part of the kernel from 2.6.38 up to 3.6.x and supports all the features of the STK1160 based devices but has some limitations (framedropping, stability, sound issues).
easycap audio support
The eascap module supports audio from the 48000Hz and the 8000Hz models.
The easycap module creates an additional ALSA soundcard EasyALSA0.
Often when the STK1160 device is plugged in the snd_usb_audio module conflicts with the easycap module and the EasyALSA0 soundcard is not created. As a workaround you need to unplug the device, unload the module (rmmod snd_usb_audio) and then plug in the device again.
If you encounter audio problems while capturing you need to specify the correct audiorate of your model (48000 or 8000) in the capturing program.
Sample Kernel Output
easycap module
# dmesg [ 250.728092] usb 1-2: new high speed USB device number 4 using ehci_hcd [ 254.681355] easycap::0adjust_standard: selected standard: PAL_BGHIN [ 254.992254] easycap::0adjust_format: sought: 640x480,UYVY(0x59565955),1=field,0x00=std mask [ 254.992263] easycap::0adjust_format: sought: V4L2_FIELD_NONE [ 254.992273] easycap::0adjust_format: actioning: 640x480 PAL_BGHIN_AT_640x480_FMT_UYVY-n [ 255.016137] easycap::0adjust_brightness: adjusting brightness to 0x7F [ 255.040149] easycap::0adjust_contrast: adjusting contrast to 0x3F [ 255.064162] easycap::0adjust_saturation: adjusting saturation to 0x2F [ 255.088173] easycap::0adjust_hue: adjusting hue to 0x00 [ 255.089557] easycap::0easycap_usb_probe: registered with videodev: 0=minor [ 255.089565] easycap::0easycap_usb_probe: ends successfully for interface 0 [ 255.089713] easycap::0easycap_usb_probe: ends successfully for interface 1 [ 255.090017] easycap::0easycap_usb_probe: audio hardware is AC'97 [ 255.090485] easycap::0easycap_alsa_probe: registered EasyALSA0 [ 255.090492] easycap::0easycap_usb_probe: ends successfully for interface 2 [ 255.091910] easycap:: easycap_open: ==========OPEN========= [ 255.161078] easycap::0audio_setup: 0x414C:0x4760 is audio vendor id [ 255.181331] easycap::0audio_setup: 0x414C:0x4760 is audio vendor id [ 255.263624] easycap::0audio_setup: 0x414C:0x4760 is audio vendor id [ 255.345927] easycap::0audio_setup: 0x414C:0x4760 is audio vendor id [ 255.432975] easycap::0audio_setup: 0x414C:0x4760 is audio vendor id [ 255.525395] easycap::0audio_setup: 0x414C:0x4760 is audio vendor id [ 255.631195] snd_pcm_update_hw_ptr0: 24 callbacks suppressed [ 256.341308] easycap::0adjust_standard: selected standard: PAL_BGHIN [ 256.652338] easycap::0adjust_format: sought: 640x480,UYVY(0x59565955),1=field,0x00=std mask [ 256.652346] easycap::0adjust_format: sought: V4L2_FIELD_NONE [ 256.652355] easycap::0adjust_format: actioning: 640x480 PAL_BGHIN_AT_640x480_FMT_UYVY-n [ 256.676218] easycap::0adjust_brightness: adjusting brightness to 0x7F [ 256.700233] easycap::0adjust_contrast: adjusting contrast to 0x3F [ 256.724242] easycap::0adjust_saturation: adjusting saturation to 0x2F [ 256.748129] easycap::0adjust_hue: adjusting hue to 0x00
stk1160 module
# dmesg [16873.944081] usb 1-2: new high-speed USB device number 2 using ehci_hcd [16874.892446] Linux video capture interface: v2.00 [16875.012940] usb 1-2: New device Syntek Semiconductor USB 2.0 Video Capture Controller @ 480 Mbps (05e1:0408, interface 0, class 0) [16875.012949] usb 1-2: video interface 0 found [16875.836259] saa7115 14-0025: saa7113 found (1f7113d0e100000) @ 0x4a (stk1160) [16877.372155] stk1160: driver ver 0.9.3 successfully loaded [16877.469999] stk1160: registers to NTSC like standard [16877.792436] stk1160 1-2:1.0: V4L2 device registered as video0 [16877.793733] usbcore: registered new interface driver snd-usb-audio [16877.795409] usbcore: registered new interface driver stk1160
Usage
The STK1160 device needs a USB 2.0 capable USB port. USB 1.1 will not work (it's too slow).
The driver for the STK1160 device creates a /dev/videoN node and an ALSA soundcard, The different video-inputs of the device can be accessed by their inputnumber (starting at 0).
From the two or four video cables on the device only one (!) can be used at the same time. If you want to switch through the different inputs of your card you need to start the capturing program again with the next input number.
In the viewing/ capturing program (e.g. mplayer) you must specify
- the videodevicenode of the STK1160 card (/dev/videoN),
- the input number of the cable where the source is plugged in,
- the TV norm of the videosource and (e.g. PAL, NTSC)
- the ALSA sounddevice if you want to capture audio. Get a list of ALSA soundcards with this command:
# cat /proc/asound/cards
If you encounter audio problems while capturing you need to specify the correct audiorate of your model in the capturing program.
Example for mplayer
Assumed that your STK1160 device is the second videodevice (the first is your webcam) and the second soundcard on your system, and that on the first CVBS input a PAL camera is plugged in and sound also comes from the STK1160 device, the mplayer command for viewing would look like this:
mplayer tv:// -tv driver=v4l2:norm=PAL:width=720:height=576:outfmt=uyvy:device=/dev/video1:input=0:\ alsa:adevice=hw.1:audiorate=48000:forceaudio:immediatemode=0 -ao sdl
More programs
These programs are known to be useful for analogue audio- and videocapturing with STK1160 based (and similar) devices.
- qv4l2 - useful for testing
- mplayer and mencoder
- mtvcgui - Python GUI for mplayer and mencoder
- VLC
- TVtime
- avconv (libav; formerly ffmpeg), see also: stackoverflow [1](using tee muxer to play simultaneously) and a blog [2](use yuv420p for more compatibility)
- Zoneminder - Linux surveillance suite
- Any other program which is capable of analogue video- and audiocapturing will probably work with STK1160 devices.
Short linux driver history
In early 2010 Mike Thomas started developing a driver for the STK1160 based video capture device which is sold as EasyCAP DC60. He used the stk11xx driver and some existing patches for the "05e1:0408" Syntek device as a basis for his project. Since the easycapdriver (version 0.9) has been added to the staging directory of the Linux kernel in November 2011 Mike Thomas stopped his development and support.
Some people added changes in order to clean up the sourcecode. These changes didn't hardly affect the limitations (framedropping, stability) of the driver.
At the middle of 2012 Ezequiel Garcia decided to rework the easycapdriver. He changed the drivers name to "stk1160".
In the 3.7 kernel release the legacy easycapdriver has been replaced by the stk1160 driver.
Summary
stk1160
- audio: poor
- video: good
- stability: poor
easycap
- audio: good
- video: poor
- stability: good (not tested fully)
External Links
- easycap.blogspot.co.at Blog supporting STK1160 based EasyCAP devices
Full lsusb -v output
The following lsusb -v output is from the STK1160 based model 001 with builtin AC'97 audio processor:
# lsusb -v Bus 001 Device 002: ID 05e1:0408 Syntek Semiconductor Co., Ltd STK1160 Video Capture Device Couldn't open device, some information will be missing Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x05e1 Syntek Semiconductor Co., Ltd idProduct 0x0408 STK1160 Video Capture Device bcdDevice 0.05 iManufacturer 1 iProduct 2 iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 251 bNumInterfaces 3 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 500mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 255 Vendor Specific Protocol iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0000 1x 0 bytes bInterval 5 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 1 Transfer Type Isochronous Synch Type None Usage Type Data wMaxPacketSize 0x0000 1x 0 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 1 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 255 Vendor Specific Protocol iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0002 1x 2 bytes bInterval 5 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 1 Transfer Type Isochronous Synch Type None Usage Type Data wMaxPacketSize 0x0300 1x 768 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 2 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 255 Vendor Specific Protocol iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0002 1x 2 bytes bInterval 5 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 1 Transfer Type Isochronous Synch Type None Usage Type Data wMaxPacketSize 0x03fc 1x 1020 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 3 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 255 Vendor Specific Protocol iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0002 1x 2 bytes bInterval 5 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 1 Transfer Type Isochronous Synch Type None Usage Type Data wMaxPacketSize 0x0400 1x 1024 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 4 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 255 Vendor Specific Protocol iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0002 1x 2 bytes bInterval 5 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 1 Transfer Type Isochronous Synch Type None Usage Type Data wMaxPacketSize 0x0c00 2x 1024 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 5 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 255 Vendor Specific Protocol iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0002 1x 2 bytes bInterval 5 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 1 Transfer Type Isochronous Synch Type None Usage Type Data wMaxPacketSize 0x1400 3x 1024 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 1 Audio bInterfaceSubClass 1 Control Device bInterfaceProtocol 0 iInterface 11 AudioControl Interface Descriptor: bLength 9 bDescriptorType 36 bDescriptorSubtype 1 (HEADER) bcdADC 1.00 wTotalLength 38 bInCollection 1 baInterfaceNr( 0) 2 AudioControl Interface Descriptor: bLength 12 bDescriptorType 36 bDescriptorSubtype 2 (INPUT_TERMINAL) bTerminalID 1 wTerminalType 0x0602 Digital Audio Interface bAssocTerminal 0 bNrChannels 2 wChannelConfig 0x0003 Left Front (L) Right Front (R) iChannelNames 0 iTerminal 0 AudioControl Interface Descriptor: bLength 9 bDescriptorType 36 bDescriptorSubtype 3 (OUTPUT_TERMINAL) bTerminalID 2 wTerminalType 0x0101 USB Streaming bAssocTerminal 0 bSourceID 3 iTerminal 0 AudioControl Interface Descriptor: bLength 8 bDescriptorType 36 bDescriptorSubtype 6 (FEATURE_UNIT) bUnitID 3 bSourceID 1 bControlSize 1 bmaControls( 0) 0x01 Mute Control iFeature 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 1 Audio bInterfaceSubClass 2 Streaming bInterfaceProtocol 0 iInterface 11 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x84 EP 4 IN bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x0000 1x 0 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 1 bNumEndpoints 1 bInterfaceClass 1 Audio bInterfaceSubClass 2 Streaming bInterfaceProtocol 0 iInterface 11 AudioStreaming Interface Descriptor: bLength 7 bDescriptorType 36 bDescriptorSubtype 1 (AS_GENERAL) bTerminalLink 2 bDelay 1 frames wFormatTag 1 PCM AudioStreaming Interface Descriptor: bLength 11 bDescriptorType 36 bDescriptorSubtype 2 (FORMAT_TYPE) bFormatType 1 (FORMAT_TYPE_I) bNrChannels 2 bSubframeSize 2 bBitResolution 16 bSamFreqType 1 Discrete tSamFreq[ 0] 48000 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x84 EP 4 IN bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x0100 1x 256 bytes bInterval 4 AudioControl Endpoint Descriptor: bLength 7 bDescriptorType 37 bDescriptorSubtype 1 (EP_GENERAL) bmAttributes 0x00 bLockDelayUnits 0 Undefined wLockDelay 0 Undefined