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