Results 1 to 10 of 47

Thread: Easycap - Somagic - Linux Drivers

Hybrid View

  1. #1
    Join Date
    Mar 2006
    Beans
    Hidden!

    Easycap - Somagic - Linux Drivers

    This info is for the Somagic variant of the easycap DC60 Video convertor. When you plug it in and do an "lsusb" you should see:
    Code:
    Bus 00x Device 00x: ID 1 Somagic, Inc.
    All the work on this has been done by the guys over on:

    https://code.google.com/p/easycap-somagic-linux/

    but I thought I would replicate it here following my efforts (so this is not my own work!). The current state of the drivers provides you with two options: the userspace programs and the kernel module (buggy?). The benefit of the kernel module is that it gives you a /dev/videoX device and runs with V4L2.

    Here is how to install:

    A. Prerequisites
    GNU/Linux with the following programs and libraries installed: wine, git, make, gcc, libusb-1.0-0 (and development headers), libgcrypt11 (and development headers), mplayer, lsusb (optional). On Ubuntu, that can all be installed by running the following command as root:

    Code:
    sudo apt-get install wine git build-essential libusb-1.0-0-dev libgcrypt11-dev mplayer usbutils
    USB 2.0 capable USB port. USB 1.1 will not work (it's too slow).

    Somagic variant of the EasyCAP. To determine that: plug in the EasyCAP, run "lsusb", and verify "1 Somagic, Inc."

    EasyCAP USB 2.0 Video Adapter with Audio or EasyCAP002 4-Channel USB 2.0 DVR installation CD-ROM.

    B. Downloading git sources
    Go to your home directory and create a folder called easycap
    Code:
    cd
    mkdir easycap
    cd easycap 
    git clone
    To update it in the future, use "git pull".

    C. Extracting firmware
    Using wine run
    Code:
    Drivers/Setup.exe
    on the EasyCAP installation CD. This should create a file named either
    Code:
    Program Files/Common Files/Somagic/SmiUsbGrabber3C/xp/SmiUsbGrabber3C.sys
    for the EasyCAP DC60 or
    Code:
    Program Files/Common Files/Somagic/SmiUsbGrabber3E/xp/SmiUsbGrabber3E.sys
    for the EasyCAP002.
    Then
    Code:
    cd ~/easycap/easycap-somagic-linux/tools/somagic-extract-firmware
    Run
    Code:
    make
    For the EasyCAP DC60 run
    Code:
    cp ~/.wine/drive_c/Program\ Files/Common\ Files/Somagic/SmiUsbGrabber3C/xp/SmiUsbGrabber3C.sys
    or for the EasyCAP002 run
    Code:
    cp ~/.wine/drive_c/Program\ Files/Common\ Files/Somagic/SmiUsbGrabber3E/xp/SmiUsbGrabber3E.sys
    Run
    Code:
    sudo ./somagic-extract-firmware SmiUsbGrabber3C.sys
    to create "/lib/firmware/somagic_firmware.bin".

    Compiling user space programs
    cd ~/easycap/easycap-somagic-linux/user
    Run
    Code:
    make && sudo make install
    Performing user space capture
    Plug in the EasyCAP device.
    Run
    Code:
    somagic-init
    to initialize the EasyCAP device, which changes its USB id. If there is no output, initialization was successful. However, to manually verify whether initialization was successful, re-run "somagic-init" or check "lsusb" for the new id "1 Somagic, Inc" (EasyCAP DC60) or "1 Somagic, Inc" (EasyCAP002).

    Activate your video source and ensure video is connected, either via CVBS (composite) or S-VIDEO (EasyCAP DC60), or via "2" (EasyCAP002).

    Choose and run a usage example from "man somagic-capture".

    I had success with:
    Code:
    sudo somagic-capture -c --iso-transfers 100 --pal --sync=1 | mplayer -nocache -vf yadif -demuxer rawvideo -rawvideo "pal:format=uyvy:fps=25" -aspect 4:3 -
    Building and using the kernel module
    Code:
    cd ~/easycap/easycap-somagic-linux/kernel/
    Code:
    make
    sudo modprobe videodev
    sudo insmod somagic.ko
    You should now get "something if you run
    Code:
    mplayer tv:// -tv driver=
    where X is the number of your easycap video device

    So far I have not been able to get colour or a stable synced picture with the kernel module, but it is early days

    You can make the kernel permanent and load when you insert the usb device:
    Code:
    sudo cp somagic.ko /lib/modules/$(uname -r)/kernel/drivers//media/video
    depmod -a
    Full kudos and credits to the guys on easycap-somagic-linux


    n.b. You may have an easycap that is not this device, if so, try here:http://ubuntuforums.org/showthread.php?t=924504
    Last edited by Jose Catre-Vandis; April 14th, 2012 at 03:18 PM.
    No longer participating......

  2. #2
    Join Date
    Mar 2006
    Beans
    Hidden!

    Re: Easycap - Somagic - Linux Drivers

    Sources and Debs for Version 1.0 now available:

    https://code.google.com/p/easycap-so...downloads/list

    You still need to create the firmware file though
    Last edited by Jose Catre-Vandis; April 29th, 2012 at 08:11 PM.
    No longer participating......

  3. #3
    Join Date
    Jul 2007
    Location
    Toronto, Ontario, Canada
    Beans
    265

    Re: Easycap - Somagic - Linux Drivers

    Could you upload either the firmware file or the SmiUsbGrabber3C.sys file? I have the EasyCAP DC60, but the driver CD I got installs with a different sys file than specified in the instructions. The file I get is called "SmiUsbGrabber3F.sys", and it appears that the somagic-extract-firmware utility doesn't like it. When I try extracting the firmware, I get:

    Code:
    somagic-extract-firmware SmiUsbGrabber.sys 
    Somagic firmware was not found in driver file.
    I'm going to guess whoever I bought this from tried to screw around with the firmware themselves or something; but judging from what I see online - this device is the exact same as all the other EasyCAP DC60 devices going around.

    Thanks!

  4. #4
    Join Date
    Mar 2006
    Beans
    Hidden!

    Re: Easycap - Somagic - Linux Drivers

    @ ownaginatious

    Check your pm's
    No longer participating......

  5. #5
    Join Date
    Mar 2006
    Beans
    Hidden!

    Re: Easycap - Somagic - Linux Drivers

    See here:

    http://ubuntuforums.org/showthread.php?t=1964103

    for struggles and my solution to recording from somagic easycap
    No longer participating......

  6. #6
    Join Date
    Mar 2006
    Beans
    Hidden!

    Smile Re: Easycap - Somagic - Linux Drivers

    Thought I would share my latest efforts in getting the somagic capture device under control for capturing gameplay from the XBox (for my son!).

    First, a bash script, using yad to produce dialogs, to produce a playback window. This script is also run inside the recortding script to check everything is OK before recording, hence the cut down window size. You will need to add your sudo password to the script for it to work, and amned your mplayer line to match your device settings

    Code:
    #!/bin/bash
    #easycap.sh
    #playback for somagic easycap
    
    #VARIABLES
    #put your password here to get around the sudo
    pass=xxxx
    #correct lsusb output for somagic device
    capdev=$(lsusb | grep 1c88:003c)
    
    #ensures capture device is setup
    if [[ -z $capdev ]]; then
    echo $pass | sudo -S somagic-init
    sleep 2
    fi
    
    #turns on the audio input
    amixer set 'Mic',0 'Playback' 'on'
    #playback chain
    echo $pass | sudo -S somagic-capture --ntsc-4.43-50 --sync=1 | mplayer -ontop -noborder -xy 640 -geometry +100+100 -nocache -vf yadif,crop=708:478:4:2 -demuxer rawvideo -rawvideo "ntsc:format=uyvy:fps=30000/1001" -aspect 1.7777 - &
    
    #dialog to close playback
    yad --form --title XBOX-Playback --button gtk-quit:1 --center --width 400 --height 100 --field "Click the Quit Button to Exit":LBL
    ret=$?
    if [[ $ret -eq 1 ]]; then
    killall -9 mplayer
    #turns off audio input
    amixer set 'Mic',0 'Playback' 'off'
    fi
    exit 0
    Second, the capture script, which relies on the playback script for a preview, your sudo password, and your ffmpeg capture chain. If you want to save to a different location you will have to edit the "serverlocation" variable

    Code:
    #!/bin/bash
    # xboxrec.sh
    #recording and encoding script for xbox gameplay
    
    #VARIABLES
    #the capture line wouldn't work in a variable so written out in all its glory
    #gives time based filename to all output files
    fname=xbox$(date +%H%M%S)
    #allows for sudo usage without entering a password, add password here
    pass=xxxx
    #re-encoding line
    mp4encode="ffmpeg -i $fname.avi -c:v libx264 -preset veryfast -crf 24 -b:a 128k -y -vf yadif,crop=708:478:4:2 $fname.mp4"
    #correct lsusb output for somagic device
    capdev=$(lsusb | grep 1c88:003c)
    #location for re-encoded file
    serverlocation=/xxxx/xxxx/xxxx
    
    #human/manual check that all is connected
    xboxup=$(yad --form --center --width 400 --on-top --field="Is XBox Connected and Running?":LBL --title XBOX-Recorder)
    if [[ -z $xboxup ]]; then
    exit 0
    fi
    
    #ensures capture device is setup
    if [[ -z $capdev ]]; then
    echo $pass | sudo -S somagic-init
    sleep 2
    fi
    
    #preview output before recording?
    yad --form --title XBOX-Recorder --field "Do you want to preview output before recording?":LBL --button gtk-yes:1 --button gtk-no:2 --width 400 --height 100 --on-top --center
    ret=$?
    if [[ $ret -eq 1 ]]; then
    #separate playback only script
    $HOME/easycap.sh
    fi
    
    #start recording?
    record=$(yad --form --center --width 400 --height 100 --on-top --field="Start Recording ?":LBL --title XBOX-Recorder)
    if [[ -z $record ]]; then
    exit 0
    else
    #ffmpeg capture chain
    echo $pass | sudo -S somagic-capture --ntsc-4.43-50 --sync=1 --iso-transfers 20 -B 149 -C 72 --luminance 2 --lum-aperture 3 | ffmpeg -f rawvideo -pix_fmt uyvy422 -vtag 2vuy -s 720x480 -y -an -r ntsc -i - -f alsa -i hw:0,0 -aspect 1.77 -b:v 2200k $fname.avi &
    yad --form --field="Click to Stop Recording...":LBL --button="gtk-stop:1" --width 400 --height 100 --center --on-top --title XBOX-Recorder
    ret=$?
    if [[ $ret -eq 1 ]]; then
    killall -9 ffmpeg
    fi
    fi
    
    #start encoding
    echo "now encoding file"
    $mp4encode | yad --progress --width 400 --height 100 --percentage 85 --auto-close --progress-text "Encoding File, Please Wait" --title XBOX-Recorder
    
    #move completed file to server:does file exist?:does server destination exist?:if so move it to server
    if [[ -e $fname.mp4 ]] && [[ -e $serverlocation ]]; then 
    echo "XBOX directory exists"
    mv $fname.mp4 $serverlocation
    yad --form --field "Moving Encoded File to Server":LBL --timeout 10 --timeout-indicator bottom --width 400 --height 100 --center --title XBOX-Recorder
    else
    echo "File Not Moved"
    fi
    
    #cleanup:delete avi
    yad --form --field "Delete Original recording?":LBL --button gtk-yes:1 --button gtk-no:2 --width 400 --height 100 --title XBOX-Recorder
    ret=$?
    if [[ $ret -eq 1 ]]; then
    rm $fname.avi
    fi
    exit 0
    Last edited by Jose Catre-Vandis; May 13th, 2012 at 01:14 AM. Reason: amended scripts
    No longer participating......

  7. #7
    Join Date
    Sep 2009
    Location
    Pittsburgh
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Easycap - Somagic - Linux Drivers

    Quote Originally Posted by ownaginatious View Post
    Could you upload either the firmware file or the SmiUsbGrabber3C.sys file? I have the EasyCAP DC60, but the driver CD I got installs with a different sys file than specified in the instructions. The file I get is called "SmiUsbGrabber3F.sys", and it appears that the somagic-extract-firmware utility doesn't like it. When I try extracting the firmware, I get:

    Code:
    somagic-extract-firmware SmiUsbGrabber.sys 
    Somagic firmware was not found in driver file.
    I'm going to guess whoever I bought this from tried to screw around with the firmware themselves or something; but judging from what I see online - this device is the exact same as all the other EasyCAP DC60 devices going around.

    Thanks!
    Hi

    I have exactly the problem - did you ever sort it out?
    The outrageous is the reasonable, if introduced politely.

  8. #8
    Join Date
    Aug 2012
    Beans
    1

    Re: Easycap - Somagic - Linux Drivers

    Dear Jose,

    I got errors when trying to follow "make" in "Building and using the kernel module".
    I compiled the kernel module on Ubuntu having kernel: 2.6.35-22-server
    The errors are as follows:
    make -C /lib/modules/2.6.35-22-server/build M=/root/Downloads/easycap/easycap-somagic-linux/kernel modules
    make[1]: Entering directory `/usr/src/linux-headers-2.6.35-22-server'
    CC [M] /root/Downloads/easycap/easycap-somagic-linux/kernel/somagic_video.o
    /root/Downloads/easycap/easycap-somagic-linux/kernel/somagic_video.c: In function ‘allocate_scratch_buffer’:
    /root/Downloads/easycap/easycap-somagic-linux/kernel/somagic_video.c:188: error: implicit declaration of function ‘vmalloc_32’
    /root/Downloads/easycap/easycap-somagic-linux/kernel/somagic_video.c:188: warning: assignment makes pointer from integer without a cast
    /root/Downloads/easycap/easycap-somagic-linux/kernel/somagic_video.c: In function ‘free_scratch_buffer’:
    /root/Downloads/easycap/easycap-somagic-linux/kernel/somagic_video.c:211: error: implicit declaration of function ‘vfree’
    /root/Downloads/easycap/easycap-somagic-linux/kernel/somagic_video.c: In function ‘rvmalloc’:
    /root/Downloads/easycap/easycap-somagic-linux/kernel/somagic_video.c:237: warning: assignment makes pointer from integer without a cast
    /root/Downloads/easycap/easycap-somagic-linux/kernel/somagic_video.c: In function ‘vdev_init’:
    /root/Downloads/easycap/easycap-somagic-linux/kernel/somagic_video.c:1533: error: ‘struct video_device’ has no member named ‘lock’
    make[2]: *** [/root/Downloads/easycap/easycap-somagic-linux/kernel/somagic_video.o] Error 1
    make[1]: *** [_module_/root/Downloads/easycap/easycap-somagic-linux/kernel] Error 2
    make[1]: Leaving directory `/usr/src/linux-headers-2.6.35-22-server'
    make: *** [all] Error 2

    Please help me!

  9. #9
    Join Date
    Jun 2011
    Beans
    36

    Re: Easycap - Somagic - Linux Drivers

    Thank you for the useful guide! I have one problem however:

    When I follow the steps under Building and using the kernel module, the insmod command gives me the following error:
    Code:
    insmod: error inserting 'somagic.ko': -1 Unknown symbol in module
    I also can't seem to get the somagic-capture command to work. I didn't get any errors during all the steps.

    I'm running Ubuntu 12.04 and have a Somagic 4 channel input (the 3F version).

    Thank you

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •