EasyCAP DC 60 on openSUSE 13.1 + latest kernel

512 views
Skip to first unread message

George Pepper

unread,
Jan 29, 2014, 9:47:29 AM1/29/14
to easycap-so...@googlegroups.com
Hi All,

With all your tremendous efforts and advice and trial and error, I have almost got this working, but it's always the last hurdle that's the highest.

Device: Easycap DC 60 (at least that's what it says on the packaging)
Chip: Somagic 2021CBE (That's what is written on the chip)
Cables: 4 - one yellow (composite video), one red (audio), one white (audio), one black (S-video)
Device driver file: SmiUsbGrabber3F.sys (recovered by installing on a Windows 7 64 bit system)

O/S: openSUSE 13.1 (64 bit) downloaded 5 days ago and installed from a live USB boot
Kernel: 3.11.6-4-desktop
Machine: HP xw4300 workstation
USB rear ports: 5 off, all USB 2.0
Firmware extracted using somagic-extract-firmware (1.1) to somagic_firmware.bin and installed in /lib/firmware/somagic_firmware.bin

Plugging in the Easycap to one of the USB ports and running dmesg shows the expected output of 1c88:0007.

Running the somagic-init executable root correctly uploads the firmware to the Easycap and running dmesg shows the expected output  1c88:003f;  output from lsusb is:

Bus 001 Device 004: ID 1c88:003f Somagic, Inc.

Attach a PAL camcorder for a video source and run mplayer to capture the piped output from somagic-capture

sudo ./somagic-capture | mplayer -nocache -vf yadif -fps 25 -demuxer rawvideo -rawvideo "pal:format=uyvy:fps=25" -aspect 4:3 -

This results in a picture that jumps every second or so. Setting the mplayer command line to request fps=30 instead gives a steady clear picture.  Maybe the camera is outputting PAL at 30 fps; I'll have to verify this.

No audio, but I believe this is not available with the userspace tool.  Great, so userspace looks like it's working.

Now I try to build the linux kernel with the latest kernel drivers by following the BuildingKernelModule Wiki.

Download the 3.13-rc4 kernel from http://git.linuxtv.org/media_tree.git

The only patch I applied was the .../20010/mbox/ -O smi2021v3.patch patch.  I did not apply the patches 18233, 18232, 18368, 19535, 19536, 19537 as the kernel is 3.13; this is a potential issue.  If you tell me how I can very these patches are in the 3.13-rc4 kernel, I will.

The kernel did not compile first go.  The file smi2021_main.c is missing the first line:

#include <linux/slab.h>

Apparently between 3.12 and 3.13 some clean-up was made and slab.h is no longer implicitly included through some other routines.  This was easily remedied by adding the line above to the top of smi2021_main.c

Now the kernel compiles.

After installing the new kernel, copying /lib/firmware/somagic_firmware.bin to /lib/firmware/smi2021_3f.bin, updating grub and then rebooting, the dmesg output shows:

[ 3814.216047] usb 1-1: new high-speed USB device number 3 using ehci-pci
[ 3814.330904] usb 1-1: New USB device found, idVendor=1c88, idProduct=0007
[ 3814.330912] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3814.330918] usb 1-1: Product: SM-USB 007
[ 3814.330921] usb 1-1: Manufacturer: Somagic, Inc.
[ 3814.330924] usb 1-1: SerialNumber: SMBL007
[ 3814.438403] Linux video capture interface: v2.00
[ 3814.491943] usb 1-1: Looking for: smi2021_3c.bin
[ 3814.513381] usb 1-1: Direct firmware load failed with error -2
[ 3814.513389] usb 1-1: Falling back to user helper
[ 3814.514361] usb 1-1: Looking for: smi2021_3e.bin
[ 3814.514391] usb 1-1: Direct firmware load failed with error -2
[ 3814.514396] usb 1-1: Falling back to user helper
[ 3814.517074] usb 1-1: Looking for: smi2021_3f.bin
[ 3814.523565] usb 1-1: Found firmware for 0x003f
[ 3814.537970] usbcore: registered new interface driver smi2021
[ 3814.539215] usb 1-1: USB disconnect, device number 3
[ 3814.539264] usb 1-1: Releasing firmware for 0x003f
[ 3814.772067] usb 1-1: new high-speed USB device number 4 using ehci-pci
[ 3814.886901] usb 1-1: New USB device found, idVendor=1c88, idProduct=003f
[ 3814.886907] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3814.886911] usb 1-1: Product:  SMI Grabber Dev
[ 3814.886915] usb 1-1: Manufacturer:  Somagic, Inc. 
[ 3814.886918] usb 1-1: SerialNumber: SMIVIDEO3E9876543210
[ 3814.925693] smi2021 1-1:1.0: Somagic Easy-Cap Video Grabber

Note the absence of any messages about the saa7115 module.

I have a single videoX device file named /dev/video0 - this is normal as there is no other video device attached like a webcam.  Running the command:

arecord -l

yields:

card 1: smi2021Audio [smi2021 Audio], device 0: smi2021 Audio [Somagic smi2021 Capture]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

So next it's time to try:

vlc -vvv v4l2:///dev/video0 :v4l2-standard=PAL :input-slave=alsa://plughw:1,0

This gives me audio, but no video at all.  I just see the vlc cone in the vlc window.

The -vvv dumps a lot of output.  The only lines that look remotely error like are:

[0x7f592c000e68] v4l2 demux debug:  unknown frame sizes: Inappropriate ioctl for device
[0x7f592c000e68] v4l2 demux debug:  current frame size: 720x576
[0x7f592c000e68] v4l2 demux debug:   unknown frame intervals: Inappropriate ioctl for device
[0x7f592c000e68] v4l2 demux debug:   constant frame interval: 1/25
[0x7f592c000e68] v4l2 demux warning: cannot set streaming parameters: Inappropriate ioctl for device
[0x7f592c000e68] v4l2 demux debug: cannot get cropping properties: Inappropriate ioctl for device
...
[0x7f59300009b8] main input debug: Buffering 98%
[0x7f59300009b8] main input debug: Stream buffering done (316 ms in 307 ms)
[0x7f59300009b8] main input debug: Decoder buffering done in 0 ms
[0x7efe48] pulse audio output debug: cannot synchronize start
[0x7efe48] pulse audio output debug: deferring start (8893 us)
[0x7efe48] pulse audio output warning: starting late (-13028 us)
[0x7efe48] pulse audio output debug: started
[0x7efe48] pulse audio output debug: underflow
[0x7efe48] pulse audio output debug: underflow

If I try to use mplayer to view the stream using:

mplayer tv:///1 -tv driver=v4l2:width=720:height=576:norm=PAL:outfmt=uyvy:device=/dev/video0:fps=30:alsa:amode=1:forcechan=2:audiorate=48000:adevice=plughw.1,0:forceaudio:immediatemode=0 -vf yadif -msglevel all=9

The only indication of a problem in this output is right at the end when it reports:

Using a ring buffer for maximum 240 frames, 189 MB total size.
v4l2: ioctl set mute failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
[V] filefmt:9  fourcc:0x59565955  size:720x576  fps:30.000  ftime:=0.0333
get_path('sub/') -> '/home/user/.mplayer/sub/'
Load subtitles in /home/user/.mplayer/sub/
v4l2: going to capture
v4l2: select timeout
v4l2: select timeout
v4l2: select timeout
v4l2: select timeout

and this will keep scrolling for ever.

Once last thing to try is the userspace tool in the new kernel.  The 3.13 kernel I built won't let me rmmod the smi2021.ko module, so if I rename the file

/lib/modules/3.13.0-rc1-4-desktop+/kernel/drivers/media/usb/smi2021/smi2021.ko

to something else and reboot in order to disable this module, I can run the userspace capture tool (somagic-capture) as with the 3.11 kernel, and I get my steady picture again.

So I conclude the 3.13 kernel is missing something but I have exhausted my competence in trying to investigate just what.

Any help would be appreciated.

George

Jon Arne Jørgensen

unread,
Jan 29, 2014, 10:10:40 AM1/29/14
to easycap-so...@googlegroups.com

On Wed, 29 Jan 2014, 15:47:29 CET, George Pepper <cbx...@gmail.com> wrote:

Hi George,
thank you for a good description of your problem.

I haven't worked on/used the driver in a couple of months,
but could it be that the driver defaults to the s-video input and not the composite?

You might have to select the correct video input source.
You can do this with an application called "qv4l2".
That application is used to test all v4l2 features of a driver.

But I'm not sure where you will find that application for your distro.

> --
> You received this message because you are subscribed to the Google
> Groups "easycap-somagic-linux" group. To unsubscribe from this group and
> stop receiving emails from it, send an email to
> easycap-somagic-...@googlegroups.com. For more options,
> visit https://groups.google.com/groups/opt_out.

George Pepper

unread,
Jan 29, 2014, 10:24:50 AM1/29/14
to easycap-so...@googlegroups.com, Jon Arne Jørgensen
Hi Jon,

Thanks for the rapid response.

I am not at my build machine at the moment, but I seem to remember some diagnostics saying it found input 0, but of course there's no guarantee that the composite input is input 0, it could be the S-video as you say.

Is there anyway to force selection of input from your source?

First I will try to install the qv4l2 from the latest repo I can get.  If that fails, I will see if I can obtain the qv4l2 source and compile in the latest build environment.

I will report back when I have tried.

Thanks...George

George Pepper

unread,
Jan 30, 2014, 7:34:09 AM1/30/14
to easycap-so...@googlegroups.com, Jon Arne Jørgensen
OK, so I installed qv4l2 using YaST - the current latest version seems OK with the 3.13-rc4 kernel.

When I run qv42l, there is a single Tab called "General".  There I can set things like input, TV standard, height and width.

With the 3f version of the firmware (smi2021_3f.bin), the input choices are Composite 0, Composite 2, Composite 3, Composite 4.  None works when you hit the red capture button in qv42l, nor using vlc/mplayer.  The strange thing is that the firmware does not seem to be adapted to the device.  It looks like the 3f firmware expects a 4 channel device, when the cabling on my device is clearly 3 CVBS + S-video.

So, I acquired a version of the 3c firmware.  I repeated the test with the userspace capture (somagic-capture) and this works just as it did with the 3f firmware.  Clear & crisp video at 30fps, but no audio.

Now when I reboot with the 3c kernel module loaded in the 3.13-rc4 kernel, qv42l gives me the input options of Composite 0 or S-video.  This looks more consistent with the device I have, but still no video when I try to capture..

So the good news is the device does not seem fussy about the firmware version, but I am still no further forward.

Any inputs appreciated...George.



On Wednesday, January 29, 2014 4:10:40 PM UTC+1, Jon Arne wrote:
Reply all
Reply to author
Forward
0 new messages