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 ...

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 

32 comments:

  1. Andrew,

    I am trying to get this working on an Android device (Nexus 7). I have gotten the old EasyCAP driver working by simply building the module. This one seems a little more difficult.

    I have built this driver as well as the following
    videobuf2-core
    videobuf2-vmalloc
    videobuf2-memops
    saa7115

    All of them insmod into the kernel fine. But as soon as I plug in my EasyCAP device, I get a kernel panic and a hard reboot on my N7. I have a log of the kernel pasted http://pastebin.com/fayHMmB5

    Hopefully you can give some insight as to whats causing the kernel panic.

    ReplyDelete
    Replies
    1. Hi, first I have to say that I'm not really experienced in understanding what causes a kernel panic, but I'll inform Ezequiel about your issue.
      I saw in the kernel log that you have kernel 3.1.x, maybe that causes some problems because the stk1160 driver is made for 3.2 and up.

      There are two important things we need to know:

      * Did you compile the drivers (easycap and stk1160) in Android or in Ubuntu(https://wiki.ubuntu.com/Nexus7/Installation) on your Nexus 7?

      * Does your Easycap work on any Linux PC either with the easycap or with the stk1160 driver (or with both of them)?

      Regards
      Andrew

      Delete
    2. I compiled both drivers for Android on the N7. I know my EasyCAP works in Ubuntu (On my PC) using whatever driver is included and it works in Android 3.1.x using the EasyCAP driver.

      I also know that the stk1160 works in Android as well but it was on a different device and not compiled/tested by me. The other device is the rk3066. Both devices run Android ICS or above so I think both devices are on kernel 3.1.x

      Delete
    3. Sorry, I think I'm not a great helper in this case, but I've sent a mail to Ezequiel where I've mentioned your problem.
      What you can do is, open a new issue on Ezequiels stk1160 github:
      https://github.com/ezequielgarcia/stk1160-standalone

      Drew, I would appreciate if you can tell me (or send me some links) how you compiled the drivers on Android, and how video capturing with the Easycap works on it. I personally have a rk2918 tablet for testing, and I will then create a new post with this information. Please use my email address from my profile.
      Thanks
      Andrew

      Delete
  2. Hi,

    It's working for me, I can capture video with the Easycap STK1160 on my Raspberry Pi !

    I have just installed the latest Raspbian image (2013-02-09-wheezy-raspbian, kernel 3.6.11+) :
    + apt-get update/upgrade
    + install & run 'rpi-update' to update kernel
    + remove SPI & I2C from the blacklist (modprobe.d/raspi-blacklist.conf)
    + apt install vlc, mplayer and gstreamer-0.10
    + reboot with the easycap connected

    'lsusb' shows the "STK1160 Video Capture Device"
    'usb-devices' shows the driver 'easycap' for audio and video
    And the video device has been created as /dev/video0

    To display the video stream, from a desktop session :
    mplayer tv:// -tv driver=v4l2:norm=PAL_BGHIN:width=640:height=480:outfmt=uyvy:device=/dev/video0:input=1:fps=10 -vo sdl -hardframedrop -msglevel all=6

    It also works with VLC !

    ps: the video is green if there is no signal connected to the easycap

    ReplyDelete
    Replies
    1. Sebastian, thank you very much for your report.
      I think thats very good news for many people that the STK1160 Easycap now works with the legacy easycapdriver on the RPI.

      Andrew

      Delete
    2. Hi Sebastien,

      I followed your setup, and got the green screen! So I thought this was going to work. But when I plugged up my camera, I got a grey screen with lines in it. It was the same with both VLC and Mplayer.

      Delete
    3. Hi Sebastien
      I did also follow your setup and i get the grey screen with stripes. When its running i get picture on and off a few times and the picture then has the same stripes as the grey picture. Could you please share the VLC command line you are using ?

      BR
      Tommy

      Delete
    4. Hi Tommy and Johnbaker, I have no RPI but I somewhere read that reducing the picture size in the mplayer command to width=360:height=240 or width=320:height=240 may bring some improvement.

      Andrew

      Delete
    5. Hi Tommy and Johnbaker, I forgot the last step in my setup to solve the grey screen with stripes !
      You must to load the 'easycap' driver with 'bars=0' as options !
      To do this properly, create a file into '/etc/modprobe.d' to specify the driver's options :

      sudo sh -c "echo 'options easycap bars=0' >> /etc/modprobe.d/easycap.conf"

      And reboot your RPi ;)

      Sebastien

      Delete
  3. I tried to buy an Easycap device with STK1160, twice. Both times the product description said it had STK1160. One had Somagic chip, other one had UTV007 chip. Where can I find a device with the the STK1160 and be sure I'm going to get the right chip set?

    ReplyDelete
    Replies
    1. Hard to say, I'm quite sure that the LogiLink VG0001 has the STK1160 chip inside (I saw it on amazon.de and amazon.co.uk)
      http://www.logilink.eu/showproduct/VG0001.htm
      This site
      http://usbeasycap.info/index.php?main_page=index&cPath=4
      indicates the chipset of the different models, but I really don't know if this shop is trustworthy.

      After all, the somagic-linux project
      http://code.google.com/p/easycap-somagic-linux/
      is proceeding. I read that the somagic driver should get into the kernel during 2013.

      Delete
    2. Thanks Andrew. I ordered the STK1160 3 IC device from the usbeasycap.info site and it does in fact have the correct chip set. I went through all of Sebastien's instructions (except for the 'rpi-update'. My pi has the 2013-02-09-wheezy image with a recent apt-get update/upgrade. But using mplayer, I only get green screen output. Do you think I need to do rpi-update? I stayed away from this because of warnings on other blogs.

      Delete
    3. Hi, I personally do not own any rpi. I found this thread about rpi-update:
      http://raspberrypi.stackexchange.com/questions/4355/do-i-still-need-rpi-update-if-i-am-using-the-latest-version-of-raspbian

      I think the rpi-update is necessary to get the latest improvements for the rpi's USB support. If you are unsure, you only should do that if you have a second SD card with a working system for your rpi by hand.
      Even after rpi-update I'm not sure if the easycap works because some USB problems on the rpi are pending.
      You can try to scale down the picture with mplayer, maybe that brings you a picture:

      mplayer tv:// -tv driver=v4l2:norm=PAL_BGHIN:width=360:height=240:outfmt=uyvy:device=/dev/video0:input=1:fps=10 -vo sdl -hardframedrop -msglevel all=6

      Regards
      Andrew

      Delete
  4. I did the rpi-update and everything else suggested by Sebastien, but still no good. mplayer gave nothing but green screen. I managed to get a single frame once using vlc but nothing after that. I checked the Easycap device with another PC (Ubuntu on a quad core AMD) and it worked fine using vlc. I tend to agree that the pi's USB is not up to the task.

    ReplyDelete
  5. I came to a similar conclusion. Have a beagle bone black I'm working with now that I think will do better

    ReplyDelete
    Replies
    1. John, Did you have any luck using stk1160 on the BBB?

      Doug.

      Delete
  6. Hi, thanks for your suggestions. I also think that Sebastians success is an isolated case, but the USB problems on the pi with some devices are still pending.
    Johnbaker, can you give us a short report if/ how the stk1160 is working on the beaglebone black?
    Andrew

    ReplyDelete
  7. It would be great if someone could post a solution for the PI that really does work - thanks to all anyway

    ReplyDelete
  8. It would be great if anyone could post a clear solution for the PI that actually/really works for the easycap stk1160 rather than rushing posts that other users confirm dont really work. Yours hopefully

    ReplyDelete
    Replies
    1. Hi, I found this interesting thread:
      http://raspberrypi.stackexchange.com/questions/5382/webcam-issue-apparently-not-related-to-usb-system

      Summary: The author at first suggests other reasons for his webcam problems on the pi but in the second post he comes to the conclusion:
      "So I guess that in the end, the issue is with the usb system."

      There is one comment to this post:

      "I find results are varying widely depending on which driver family you are dealing with. What I'm saying is that all my GPSCA cameras are seriously hobbled and my one UVC camera is recently rocking."

      My conclusion: almost all cameras which are supported by the uvcvideo driver(look here for a list of supported devices: http://www.ideasonboard.org/uvc/) are working on the pi, many other usb cameras (including the stk1160) are causing problems in most cases until the usb problems will be solved.

      Andrew

      Delete
  9. Has anybody made this work on one of the Odroid devices?

    Doug P.

    ReplyDelete
  10. What about the BeagleBoard (Black)? Does stk1160 work on the BB(B)? Are the USB drivers on this board good enough for stk1160?

    ReplyDelete
  11. Hello,

    I am trying to capture video over EasyCap DC60 stk1160 (yellow cable) but on my raspbian 3.10.25 (raspberry pi) in mplayer video looks like this (green and messed video, artefacts):
    http://www.youtube.com/watch?v=27YLQKNKZtw&feature=youtu.be

    And after few seconds it ends with thi error: http://www.youtube.com/watch?v=5cgQFc0i6vo&feature=youtu.be

    I tried many settings (as well as vlc) but result is the same. What am I doing wrong? :(

    ReplyDelete
    Replies
    1. Sorry for my late answer.
      I think you're doing wrong nothing. I only can repeat what I've written on the top of this post, stk1160 devices are currently not working with the RPI because of hardware, USB driver, (whatever) limitations of the RPI.

      The only thing you can try is, reduce the fps rate in the mplayer command to a very low rate ( between 1 and 10 fps) and try again.

      There are a bunch of USB webcams which are working with the RPI. Some people reported success with em28xx based devices and a modified driver.
      You can find out more here:
      http://www.raspberrypi.org/phpBB3/viewtopic.php?f=38&t=48599

      There exists an UVC based capture device (FEBON 100 UVC grabber card) from http://www.sunriase.com for 77$ which is mentioned that it works with the RPI:
      http://www.raspberrypi.org/phpBB3/viewtopic.php?f=38&t=7748

      Regards

      Andrew

      Delete
    2. Hi. I have a version of easycap with stk1160 chip and gm7113 chip decoder (compatible with philips saa7113 chip). As reported in http://easycap.blogspot.co.at/2013/03/the-stk1160-regression-problem.html, the problem maybe related also with an improvement of kernel, solved on version 3.11.

      Delete
    3. work on android 4.3 . i think it also can work on PI.
      http://febon.blogspot.com/2013/12/no-root-required-android-43-version-has.html

      Delete
  12. Hi. I plug the device (with stk11600 and gm7113 chips) in raspberry Pi, booted with latest raspbian and kernel 3.12-1-rpi image.
    Lsusb shows "Bus 001 Device 004: ID 05e1:0408 Syntek Semiconductor Co., Ltd STK1160 Video Capture Device"
    but no stk1160 module is loaded.There is no module with similar name in /lib/modules/3.12-1-rpi. Instead, there is a stk1160 module in /lib/modules/3.10.29+/, even if we know it doesn't work.
    Where is the module? how do I install it? I it in a separate deb package rather in linux-image-3.12-1-rpi

    ReplyDelete
  13. First I have to say, that I give advice for the RPI in "blind flight" (I do not own one).
    It seems that the stk1160 module is not compiled in the kernel you use.
    It is not possible to load a module which was compiled for another kernel version.
    You can try to boot kernel 3.10 and test, if the stk1160 is recognized by the system (dmesg).

    You can also try to install the module as described here:
    http://easycap.blogspot.co.at/2012/07/new-driver-for-easycap-dc60-stk1160.html
    but I don't know if it works on the RPI (you'll need kernel headers) with kernel 3.12.

    I think the best way would be to find a Linux image for the RPI with latest kernel where the module is compiled in (sure). To find out I must refer you to a specific Raspberry Pi forum.

    Regards
    Andrew

    ReplyDelete
  14. I am running Ubuntu 12.04. I have a Sabrent (EasyCap) with a Sony HDR SR11 plugged in. I can see video using Camorama. However WebRTC does not accept the video camera? Here is a bit of output:

    rayj@ubuntu12:~$ v4l2-ctl --list-formats
    ioctl: VIDIOC_ENUM_FMT
    Index : 0
    Type : Video Capture
    Pixel Format: 'UYVY'
    Name : 16 bpp YUY2, 4:2:2, packed

    Can you advise the best way to troupleshhot this issue?

    ReplyDelete
  15. This comment has been removed by a blog administrator.

    ReplyDelete
  16. Hey So I'm trying to interface the EasyCap with a raspberry PI running raspbian Jessie but I keep coming across kernel incompatibility issues, anyway to fix this?

    ReplyDelete

Please be patient, your comment will be published as soon as I'm checking my mailbox next time.
So, I will notice your comment for sure. Andrew