EasyCap icon indicating copy to clipboard operation
EasyCap copied to clipboard

Support for ID 1c88:1001 Somagic, Inc.

Open utorth opened this issue 8 years ago • 31 comments

I've scoured the internet for a means to get this working in linux (Centos 7 flavor). I'd be willing to help in any way I can, just let me know what I can do!

utorth avatar Apr 20 '16 23:04 utorth

Nice,

The source code for the accompanying tools are pulled from the debian project: https://github.com/stevelacy/EasyCap/tree/master/somagic-easycap-tools_1.1 https://github.com/stevelacy/EasyCap/tree/master/somagic-easycap_1.1 If you could compile the driver or determine if the debain driver works on fedora.

Did you manage to get the project, or part of it to run?

stephenlacy avatar Apr 20 '16 23:04 stephenlacy

I was not able to successfully use the extraction tool on any of the SmiUsbGrabber3C.sys files, as each version failed, per OS (xp, win7, etc..) with "Somagic firmware was not found in driver file." I did test the extraction tool with the included SmiUsbGrabber.sys file, which successfully extracted. None of the file sizes matched in somagic-extract-firmware.c file. The xp version on my CD is 813617 (vs 805632 in the extraction tool).

./somagic-init USB device 1c88:0007 was not found. Is the device attached? lsusb Bus 001 Device 003: ID 1c88:1001 Somagic, Inc.

utorth avatar Apr 21 '16 00:04 utorth

Here's the lsusb -v dump for the device:

Bus 001 Device 007: ID 1c88:1001 Somagic, Inc. Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x1c88 Somagic, Inc. idProduct 0x1001 bcdDevice 1.00 iManufacturer 1 Somagic, Inc.
iProduct 2 ezcap Video Grabber iSerial 3 SMIGRAB03F9876543210 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 75 bNumInterfaces 2 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 500mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 255 Vendor Specific Protocol iInterface 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 1 bNumEndpoints 1 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 255 Vendor Specific Protocol iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x03ff 1x 1023 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 2 bNumEndpoints 1 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 255 Vendor Specific Protocol iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x1400 3x 1024 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 1 Boot Interface Subclass bInterfaceProtocol 1 Keyboard iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.11 bCountryCode 0 Not supported bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 65 Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x83 EP 3 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 10 Device Qualifier (for other device speed): bLength 10 bDescriptorType 6 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 bNumConfigurations 1 Device Status: 0x0000 (Bus Powered)

utorth avatar Apr 21 '16 10:04 utorth

Attached a usbmon dump of a few minutes. It includes both the device and the usb hub it was connected to, both on bus 001. usbmonzip.zip

utorth avatar Apr 21 '16 10:04 utorth

I've got the same issue on Arch Linux. I'm happy to help, if you give me some direction...

I tried with the source from the old repo on Google Code, then with yours. I was unable to extract the firmware from the drivers that were provided from the ToOTMC (branded dongle) website.

ashmastaflash avatar Apr 15 '17 22:04 ashmastaflash

I haven't used it in a while so I'd need to re-build as well. Let me see if I can extract the firmware for that device

stephenlacy avatar Apr 17 '17 16:04 stephenlacy

Just as a note, multiple versions (for different windows versions) of the driver for this device which identifies as 1c88:1001 are here:

https://ftp.csl-computer.com/pub/drivers/videograbber/302591-USB_Video_Grabber/

Extract tool doesn't work for any of them though

Drivers/vista_32/SmiUsbGrabber3C.sys
Somagic firmware was not found in driver file.
Drivers/vista_64/SmiUsbGrabber3C.sys
Somagic firmware was not found in driver file.
Drivers/win7_32/SmiUsbGrabber3C.sys
Somagic firmware was not found in driver file.
Drivers/win7_64/SmiUsbGrabber3C.sys
Somagic firmware was not found in driver file.
Drivers/win8_32/SmiUsbGrabber3C.sys
Somagic firmware was not found in driver file.
Drivers/win8_64/SmiUsbGrabber3C.sys
Somagic firmware was not found in driver file.
Drivers/win_xp/SmiUsbGrabber3C.sys
Somagic firmware was not found in driver file.

phiresky avatar Apr 21 '17 12:04 phiresky

Yeah, the signature for the driver changed when they changed the device id: https://github.com/stevelacy/EasyCap/blob/master/somagic-easycap-tools_1.1/somagic-extract-firmware.c#L205

stephenlacy avatar Apr 21 '17 15:04 stephenlacy

Hello,

Currently the project supports the device 1C88:1001 ?

3.384192] usb 1-1.2: Product: ezcap Video Grabber [ 3.384207] usb 1-1.2: Manufacturer: Somagic, Inc.
[ 3.384223] usb 1-1.2: SerialNumber: SMIGRAB03F9876543210 [ 3.389076] input: Somagic, Inc. ezcap Video Grabber as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.1/0003:1C88:1001.0001/input/input0 [ 3.444305] hid-generic 0003:1C88:1001.0001: input,hidraw0: USB HID v1.11 Keyboard [ Somagic, Inc. ezcap Video Grabber] on usb-3f980000.usb-1.2/input1

I'm trying on ARM but I can not get it to work. (Raspbian Pixel).

sudo somagic-init

/usr/local/bin/somagic-init: 1: /usr/local/bin/somagic-init: Syntax error: redirection unexpected

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

uyvy:fps=25" -aspect 4:3 - /usr/local/bin/somagic-capture: 1: /usr/local/bin/somagic-capture: Syntax error: "(" unexpected MPlayer2 2.0-728-g2c378c7-4+b1 (C) 2000-2012 MPlayer Team Cannot open file '/root/.mplayer/input.conf': No such file or directory Failed to open /root/.mplayer/input.conf. Cannot open file '/etc/mplayer/input.conf': No such file or directory Failed to open /etc/mplayer/input.conf.

Playing -. Reading from stdin... Detected file format: rawvideo Load subtitles in . X11 connection rejected because of wrong authentication. vo: couldn't open the X11 display (localhost:10.0)! X11 connection rejected because of wrong authentication. vo: couldn't open the X11 display (localhost:10.0)! X11 connection rejected because of wrong authentication. vo: couldn't open the X11 display (localhost:10.0)! X11 connection rejected because of wrong authentication. [gl] OpenGL 3.x context creation not implemented. X11 connection rejected because of wrong authentication. vo: couldn't open the X11 display (localhost:10.0)! X11 connection rejected because of wrong authentication. SDL SetVideoMode failed: OpenGL not available X11 connection rejected because of wrong authentication. vo: couldn't open the X11 display (localhost:10.0)! X11 connection rejected because of wrong authentication. [VO_SDL] Using driver: fbcon. X11 connection rejected because of wrong authentication. vo: couldn't open the X11 display (localhost:10.0)! [ass] auto-open Opening video filter: [screenshot] Opening video filter: [yadif] VIDEO: 720x576 25.000 fps 165888.0 kbps (20736.0 kB/s) Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] Aspect ratio is 1.33:1 - scaling to correct movie aspect. [swscaler @ 0x75a07980]using unscaled uyvy422 -> yuv420p special converter VO: [sdl] 720x576 => 768x576 Planar YV12 Selected video codec: RAW UYVY [raw] Audio: no sound Starting playback... V: 0.0 0/ 0 ??% ??% ??,?% 0 0

Exiting... (End of file)

Regards

hexagon-robotics avatar Jul 11 '17 13:07 hexagon-robotics

Syntax error: redirection unexpected and Syntax error: "(" sound like bash errors. https://stackoverflow.com/a/2462357

stephenlacy avatar Jul 11 '17 14:07 stephenlacy

Thank you!

I run

sudo dpkg-reconfigure dash

and select No. But now I have other error:

pi@raspberrypi:~/EasyCap/somagic-easycap_1.1 $ somagic-init 
-bash: /usr/local/bin/somagic-init: cannot execute binary file: Exec format error

I suppose it's because of incompatibility with ARM. Where can you download the sources to compile it from Raspbian?

Regards

hexagon-robotics avatar Jul 11 '17 18:07 hexagon-robotics

The source is in this repo, docs: https://github.com/stevelacy/EasyCap/blob/master/documentation/installation.md#compile-from-source

stephenlacy avatar Jul 11 '17 19:07 stephenlacy

Thank you!

I just tried this:

cd EasyCap
make clean
make
sudo make install
somagic_init

USB device 1c88:0007 was not found. Is the device attached?

Yes!, it's plugged to Raspberry Pi 2 and the green led is high, but my id is 1c88:1001 Somagic, Inc (aqprox brand).

somagic-capture -c --iso-transfers 100 --pal --sync=1 | mplayer -nocache -vf yadif -demuxer rawvideo -rawvideo "pal:format=uyvy:fps=25" -aspect 4:3 -

USB device 1c88:003c was not found. USB device 1c88:003d was not found. USB device 1c88:003e was not found. USB device 1c88:003f was not found. Has device initialization been performed? MPlayer2 2.0-728-g2c378c7-4+b1 (C) 2000-2012 MPlayer Team

Regards

hexagon-robotics avatar Jul 11 '17 20:07 hexagon-robotics

Did you try using the device id? #6

stephenlacy avatar Jul 11 '17 20:07 stephenlacy

sudo somagic-capture -d 1 -c --iso-transfers 100 --pal --sync=1 | mplayer -nocache -vf yadif -demuxer rawvideo -rawvideo "pal:format=uyvy:fps=25" -aspect 4:3 -

Failed to set active device configuration: Device or resource busy

I added 1001 device to somagic-init and somagic-capture and then compile it but I get the same message. sudo somagic-init

Failed to set active device configuration: Device or resource busy

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 -

Failed to set active device configuration: Device or resource busy

hexagon-robotics avatar Jul 11 '17 20:07 hexagon-robotics

I have the same experience as @hexagon-robotics . I put my 1001 code into the somagic-init, but I get the same device or resource busy. I also think that the firmware distributed in the git repo is not for the 1001 device. (Generally, bad form to distribute built binaries in a git repo)

mcr avatar Oct 24 '17 21:10 mcr

So, how does one go about decoding the .sys file to find the right firmware for the 0x1001 devices?

mcr avatar Oct 24 '17 21:10 mcr

Any updates on this?

melyux avatar May 12 '19 21:05 melyux

No, I will close this issue as I no longer am adding support for new devices I do not own

stephenlacy avatar May 12 '19 22:05 stephenlacy

@stevelacy Surely there is still a possibility of others adding support, since this is an open source project? Might want to leave it open for others to see that this is still an issue.

melyux avatar May 13 '19 20:05 melyux

Yes, I will gladly merge any PR for adding new devices, I'll keep it open for that

stephenlacy avatar May 13 '19 20:05 stephenlacy

I have an EasyCap which identifies as 1c88:1001 and I also have the original driver CD however the firmware extract utility does not recognise any of the firmware files.

I am using a Raspberry Pi 4 running the latest Raspbian and I compiled the tools from source. Is thre anything I can do? If someone gives me instructions I can generate the CRC or whatever and push it to the repo. It would be great if I can get this thing working

janipewter avatar Apr 14 '20 12:04 janipewter

Hi. I've managed to make firmware extraction work for 1c88:1001: see https://github.com/stevelacy/EasyCap/pull/13

However I couldn't make somagic-init work with it yet though. What I've tried:

  1. modify somagic-init to support 1c88:1001 device identifier instead of 1c88:0007
  2. release the device held by usbhid with echo -n "2-1:1.0" > /sys/bus/usb/drivers/usbhid/unbind
  3. run somagic-init
[timestamp] [threadID] facility level [function call] <message>
--------------------------------------------------------------------------------
[ 0.002181] [0000f471] libusb: debug [libusb_get_device_list] 
[ 0.002192] [0000f471] libusb: debug [discovered_devs_append] need to increase capacity
[ 0.002195] [0000f471] libusb: debug [libusb_get_device_descriptor] 
0x1d6b:0x0003
[ 0.002199] [0000f471] libusb: debug [libusb_get_device_descriptor] 
0x18a5:0x0302
[ 0.002202] [0000f471] libusb: debug [libusb_get_device_descriptor] 
0x1c88:0x1001
[ 0.002204] [0000f471] libusb: debug [libusb_get_device_descriptor] 
0x1a40:0x0201
[ 0.002206] [0000f471] libusb: debug [libusb_get_device_descriptor] 
0x0b05:0x1847
[ 0.002209] [0000f471] libusb: debug [libusb_get_device_descriptor] 
0x046d:0x081b
[ 0.002212] [0000f471] libusb: debug [libusb_get_device_descriptor] 
0x1a40:0x0201
[ 0.002215] [0000f471] libusb: debug [libusb_get_device_descriptor] 
0x1d6b:0x0002
[ 0.002219] [0000f471] libusb: debug [libusb_get_device_descriptor] 
0x1d6b:0x0003
[ 0.002222] [0000f471] libusb: debug [libusb_get_device_descriptor] 
0x1d6b:0x0002
[ 0.002226] [0000f471] libusb: debug [libusb_get_device_list] 
[ 0.002228] [0000f471] libusb: debug [discovered_devs_append] need to increase capacity
[ 0.002231] [0000f471] libusb: debug [libusb_get_device_descriptor] 
[ 0.002233] [0000f471] libusb: debug [libusb_get_device_descriptor] 
[ 0.002234] [0000f471] libusb: debug [libusb_get_device_descriptor] 
[ 0.002236] [0000f471] libusb: debug [libusb_get_device_descriptor] 
[ 0.002238] [0000f471] libusb: debug [libusb_get_device_descriptor] 
[ 0.002240] [0000f471] libusb: debug [libusb_get_device_descriptor] 
[ 0.002242] [0000f471] libusb: debug [libusb_get_device_descriptor] 
[ 0.002244] [0000f471] libusb: debug [libusb_get_device_descriptor] 
[ 0.002245] [0000f471] libusb: debug [libusb_get_device_descriptor] 
[ 0.002246] [0000f471] libusb: debug [libusb_get_device_descriptor] 
[ 0.002248] [0000f471] libusb: debug [libusb_open] open 1.24
[ 0.002259] [0000f471] libusb: debug [usbi_add_pollfd] add fd 10 events 4
[ 0.002263] [0000f471] libusb: debug [libusb_claim_interface] interface 0
[ 0.002274] [0000f471] libusb: debug [libusb_set_interface_alt_setting] interface 0 altsetting 0
[ 0.002375] [0000f471] libusb: debug [libusb_alloc_transfer] transfer 0x5651ac093f30
[ 0.002381] [0000f471] libusb: debug [libusb_submit_transfer] transfer 0x5651ac093f30
[ 0.002382] [0000f471] libusb: debug [add_to_flying_list] arm timerfd for timeout in 1000ms (first in line)
[ 0.002390] [0000f471] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 0.002392] [0000f471] libusb: debug [handle_events] poll fds modified, reallocating
[ 0.002395] [0000f471] libusb: debug [handle_events] poll() 3 fds with timeout in 60000ms
[ 0.002504] [0000f471] libusb: debug [handle_events] poll() returned 1
[ 0.002511] [0000f471] libusb: debug [reap_for_handle] urb type=2 status=0 transferred=18
[ 0.002513] [0000f471] libusb: debug [handle_control_completion] handling completion status 0
[ 0.002515] [0000f471] libusb: debug [disarm_timerfd] 
[ 0.002517] [0000f471] libusb: debug [usbi_handle_transfer_completion] transfer 0x5651ac093f30 has callback 0x7fc6ce27d590
[ 0.002519] [0000f471] libusb: debug [sync_transfer_cb] actual_length=18
[ 0.002521] [0000f471] libusb: debug [libusb_free_transfer] transfer 0x5651ac093f30
1 get descriptor returned 18, bytes: 12 01 00 02 00 00 00 40 88 1c 01 10 00 01 01 02 03 01 ".......@.........."
[ 0.002527] [0000f471] libusb: debug [libusb_alloc_transfer] transfer 0x5651ac093050
[ 0.002529] [0000f471] libusb: debug [libusb_submit_transfer] transfer 0x5651ac093050
[ 0.002530] [0000f471] libusb: debug [add_to_flying_list] arm timerfd for timeout in 1000ms (first in line)
[ 0.002535] [0000f471] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 0.002536] [0000f471] libusb: debug [handle_events] poll() 3 fds with timeout in 60000ms
[ 0.002701] [0000f471] libusb: debug [handle_events] poll() returned 1
[ 0.002708] [0000f471] libusb: debug [reap_for_handle] urb type=2 status=0 transferred=9
[ 0.002710] [0000f471] libusb: debug [handle_control_completion] handling completion status 0
[ 0.002711] [0000f471] libusb: debug [disarm_timerfd] 
[ 0.002713] [0000f471] libusb: debug [usbi_handle_transfer_completion] transfer 0x5651ac093050 has callback 0x7fc6ce27d590
[ 0.002715] [0000f471] libusb: debug [sync_transfer_cb] actual_length=9
[ 0.002717] [0000f471] libusb: debug [libusb_free_transfer] transfer 0x5651ac093050
2 get descriptor returned 9, bytes: 09 02 4b 00 02 01 00 80 fa "..K......"
[ 0.002721] [0000f471] libusb: debug [libusb_alloc_transfer] transfer 0x5651ac099b60
[ 0.002723] [0000f471] libusb: debug [libusb_submit_transfer] transfer 0x5651ac099b60
[ 0.002724] [0000f471] libusb: debug [add_to_flying_list] arm timerfd for timeout in 1000ms (first in line)
[ 0.002729] [0000f471] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 0.002730] [0000f471] libusb: debug [handle_events] poll() 3 fds with timeout in 60000ms
[ 0.002944] [0000f471] libusb: debug [handle_events] poll() returned 1
[ 0.002951] [0000f471] libusb: debug [reap_for_handle] urb type=2 status=0 transferred=34
[ 0.002953] [0000f471] libusb: debug [handle_control_completion] handling completion status 0
[ 0.002954] [0000f471] libusb: debug [disarm_timerfd] 
[ 0.002956] [0000f471] libusb: debug [usbi_handle_transfer_completion] transfer 0x5651ac099b60 has callback 0x7fc6ce27d590
[ 0.002958] [0000f471] libusb: debug [sync_transfer_cb] actual_length=34
[ 0.002960] [0000f471] libusb: debug [libusb_free_transfer] transfer 0x5651ac099b60
3 get descriptor returned 34, bytes: 09 02 4b 00 02 01 00 80 fa 09 04 00 00 00 ff ff ff 00 09 04 00 01 01 ff ff ff 00 07 05 82 05 ff 03 01 "..K..............................."
[ 0.002967] [0000f471] libusb: debug [libusb_release_interface] interface 0
[ 0.002973] [0000f471] libusb: debug [libusb_set_configuration] configuration 1
[ 0.003161] [0000f471] libusb: debug [libusb_claim_interface] interface 0
[ 0.003172] [0000f471] libusb: debug [libusb_set_interface_alt_setting] interface 0 altsetting 0
[ 0.004324] [0000f471] libusb: debug [libusb_alloc_transfer] transfer 0x5651ac08ec90
[ 0.004330] [0000f471] libusb: debug [libusb_submit_transfer] transfer 0x5651ac08ec90
[ 0.004331] [0000f471] libusb: debug [add_to_flying_list] arm timerfd for timeout in 1000ms (first in line)
[ 0.004337] [0000f471] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 0.004338] [0000f471] libusb: debug [handle_events] poll() 3 fds with timeout in 60000ms
[ 0.004447] [0000f471] libusb: debug [handle_events] poll() returned 1
[ 0.004455] [0000f471] libusb: debug [reap_for_handle] urb type=2 status=0 transferred=2
[ 0.004456] [0000f471] libusb: debug [handle_control_completion] handling completion status 0
[ 0.004458] [0000f471] libusb: debug [disarm_timerfd] 
[ 0.004460] [0000f471] libusb: debug [usbi_handle_transfer_completion] transfer 0x5651ac08ec90 has callback 0x7fc6ce27d590
[ 0.004462] [0000f471] libusb: debug [sync_transfer_cb] actual_length=2
[ 0.004464] [0000f471] libusb: debug [libusb_free_transfer] transfer 0x5651ac08ec90
5 control msg returned 2, bytes: 01 03 ".."
[ 0.004468] [0000f471] libusb: debug [libusb_alloc_transfer] transfer 0x5651ac08ed70
[ 0.004470] [0000f471] libusb: debug [libusb_submit_transfer] transfer 0x5651ac08ed70
[ 0.004471] [0000f471] libusb: debug [add_to_flying_list] arm timerfd for timeout in 1000ms (first in line)
[ 0.004476] [0000f471] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 0.004477] [0000f471] libusb: debug [handle_events] poll() 3 fds with timeout in 60000ms
[ 0.004619] [0000f471] libusb: debug [handle_events] poll() returned 1
[ 0.004626] [0000f471] libusb: debug [reap_for_handle] urb type=2 status=-32 transferred=0
[ 0.004629] [0000f471] libusb: debug [handle_control_completion] handling completion status -32
[ 0.004632] [0000f471] libusb: debug [handle_control_completion] unsupported control request
[ 0.004634] [0000f471] libusb: debug [disarm_timerfd] 
[ 0.004637] [0000f471] libusb: debug [usbi_handle_transfer_completion] transfer 0x5651ac08ed70 has callback 0x7fc6ce27d590
[ 0.004639] [0000f471] libusb: debug [sync_transfer_cb] actual_length=0
[ 0.004641] [0000f471] libusb: debug [libusb_free_transfer] transfer 0x5651ac08ed70
6 control msg returned -9, bytes: 
[ 0.005728] [0000f471] libusb: debug [libusb_alloc_transfer] transfer 0x5651ac097d00
[ 0.005733] [0000f471] libusb: debug [libusb_submit_transfer] transfer 0x5651ac097d00
[ 0.005735] [0000f471] libusb: debug [add_to_flying_list] arm timerfd for timeout in 1000ms (first in line)
[ 0.005741] [0000f471] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 0.005742] [0000f471] libusb: debug [handle_events] poll() 3 fds with timeout in 60000ms
[ 1.005805] [0000f471] libusb: debug [handle_events] poll() returned 1
[ 1.005838] [0000f471] libusb: debug [handle_events] timerfd triggered
[ 1.005847] [0000f471] libusb: debug [libusb_cancel_transfer] transfer 0x5651ac097d00
[ 1.005981] [0000f471] libusb: debug [disarm_timerfd] 
[ 1.006019] [0000f471] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 1.006030] [0000f471] libusb: debug [handle_events] poll() 3 fds with timeout in 60000ms
[ 1.006044] [0000f471] libusb: debug [handle_events] poll() returned 1
[ 1.006058] [0000f471] libusb: debug [reap_for_handle] urb type=2 status=-2 transferred=0
[ 1.006071] [0000f471] libusb: debug [handle_control_completion] handling completion status -2
[ 1.006084] [0000f471] libusb: debug [usbi_handle_transfer_cancellation] detected timeout cancellation
[ 1.006095] [0000f471] libusb: debug [disarm_timerfd] 
[ 1.006108] [0000f471] libusb: debug [usbi_handle_transfer_completion] transfer 0x5651ac097d00 has callback 0x7fc6ce27d590
[ 1.006120] [0000f471] libusb: debug [sync_transfer_cb] actual_length=0
[ 1.006132] [0000f471] libusb: debug [libusb_free_transfer] transfer 0x5651ac097d00
7 control msg returned -7, bytes: 
[...]
^C

hsyl20 avatar May 01 '20 17:05 hsyl20

It seems that for this particular device (the Somagic 1c88:1001) you do not need the firmware nor to run somagic-init. The USB ID does not change at any time. The key is to release the device from the USB HID module using the line mentioned by hsyl20:

echo -n "2-1:1.0" > /sys/bus/usb/drivers/usbhid/unbind

I added the proper USB ID to somagic-capture.c, and the program manages to capture some video data after freeing the USB device and connecting a camera.

To decode it properly, I had to use a 720x480 image size for the raw video, which may have to do with the camera I was using. Mplayer could play it straight using the options given in the documentation.

Thus the device seems to work, but it is a matter or releasing the HID module from it before you can use the program.

Edit: Added the critical step of releasing the driver from the USB HID. Edit 2: I managed to decode it properly, added info.

pablob127 avatar May 18 '20 22:05 pablob127

Hi pablob127,

I added the correct USB ID to the source, but can seem to complete the step of releasing the device as I get this error:

~/source/EasyCap/somagic-easycap_1.1$ sudo echo -n "2-1:1.0" > /sys/bus/usb/drivers/usbhid/unbind bash: /sys/bus/usb/drivers/usbhid/unbind: Permission denied. Perhaps the echo string required is different than your example? Here's some additional information:

[329009.082839] usb 1-1.2: new high-speed USB device number 21 using xhci_hcd [329009.103995] usb 1-1.2: New USB device found, idVendor=1c88, idProduct=1001, bcdDevice= 1.00 [329009.103999] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [329009.104001] usb 1-1.2: Product: ezcap Video Grabber [329009.104003] usb 1-1.2: Manufacturer: Somagic, Inc.
[329009.104004] usb 1-1.2: SerialNumber: SMIGRAB03F9876543210 [329009.107453] input: Somagic, Inc. ezcap Video Grabber as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.2/1-1.2:1.1/0003:1C88:1001.000A/input/input44 [329009.167486] hid-generic 0003:1C88:1001.000A: input,hidraw6: USB HID v1.11 Keyboard [ Somagic, Inc. ezcap Video Grabber] on usb-0000:00:14.0-1.2/input1

Thanks again for getting me this far!

mrgw454 avatar Jun 02 '20 19:06 mrgw454

sudo echo -n "2-1:1.0" > /sys/bus/usb/drivers/usbhid/unbind

The redirection isn't done by root, hence the error. See: https://stackoverflow.com/questions/82256/how-do-i-use-sudo-to-redirect-output-to-a-location-i-dont-have-permission-to-wr

Moreover you need to adapt the device number (e.g. "2-1:1.0" above) to your device. First find the device id:

> lsusb -d 1c88:1001
Bus 001 Device 007: ID 1c88:1001 Somagic, Inc. 

# Device number is 7

> lsusb -t
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 10000M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/10p, 10000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/16p, 480M
    |__ Port 3: Dev 2, If 0, Class=Hub, Driver=hub/7p, 480M
        [...]
        |__ Port 4: Dev 5, If 2, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 5: Dev 6, If 0, Class=Hub, Driver=hub/7p, 480M
            |__ Port 4: Dev 8, If 0, Class=Mass Storage, Driver=usb-storage, 480M
            |__ Port 2: Dev 7, If 0, Class=Vendor Specific Class, Driver=, 480M
            |__ Port 2: Dev 7, If 1, Class=Human Interface Device, Driver=usbhid, 480M
                          ^-- HERE: device 7 is bound to usbhid
            |__ Port 5: Dev 9, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M

The device id seems to be: BUS-Port[.Port]*:1.If So in my case it is 1-3.5.2:1.1

> su
> echo -n "1-3.5.2:1.1" > /sys/bus/usb/drivers/usbhid/unbind
> exit

hsyl20 avatar Jun 03 '20 14:06 hsyl20

I am off with something. Here's my info:

[407354.312463] usb 1-1.2: new high-speed USB device number 23 using xhci_hcd [407354.333604] usb 1-1.2: New USB device found, idVendor=1c88, idProduct=1001, bcdDevice= 1.00 [407354.333609] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [407354.333611] usb 1-1.2: Product: ezcap Video Grabber [407354.333614] usb 1-1.2: Manufacturer: Somagic, Inc. [407354.333616] usb 1-1.2: SerialNumber: SMIGRAB03F9876543210 [407354.337758] input: Somagic, Inc. ezcap Video Grabber as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.2/1-1.2:1.1/0003:1C88:1001.000B/input/input45 [407354.397107] hid-generic 0003:1C88:1001.000B: input,hidraw6: USB HID v1.11 Keyboard [ Somagic, Inc. ezcap Video Grabber] on usb-0000:00:14.0-1.2/input1

~$ lsusb -d 1c88:1001 Bus 001 Device 023: ID 1c88:1001 Somagic, Inc.

~$ lsusb -t /: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 10000M /: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/8p, 5000M |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M |__ Port 3: Dev 7, If 0, Class=Hub, Driver=hub/4p, 5000M |__ Port 1: Dev 4, If 0, Class=Mass Storage, Driver=uas, 5000M |__ Port 2: Dev 3, If 0, Class=Hub, Driver=hub/4p, 5000M |__ Port 3: Dev 5, If 0, Class=Mass Storage, Driver=usb-storage, 5000M /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/16p, 480M |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M |__ Port 3: Dev 4, If 0, Class=Hub, Driver=hub/4p, 480M |__ Port 3: Dev 15, If 0, Class=Vendor Specific Class, Driver=ftdi_sio, 12M |__ Port 4: Dev 16, If 2, Class=Human Interface Device, Driver=usbhid, 12M |__ Port 4: Dev 16, If 0, Class=Human Interface Device, Driver=usbhid, 12M |__ Port 4: Dev 16, If 1, Class=Human Interface Device, Driver=usbhid, 12M |__ Port 2: Dev 14, If 0, Class=Vendor Specific Class, Driver=ftdi_sio, 12M |__ Port 4: Dev 6, If 2, Class=Human Interface Device, Driver=usbhid, 12M |__ Port 4: Dev 6, If 0, Class=Human Interface Device, Driver=usbhid, 12M |__ Port 4: Dev 6, If 1, Class=Human Interface Device, Driver=usbhid, 12M |__ Port 2: Dev 23, If 1, Class=Human Interface Device, Driver=usbhid, 480M |__ Port 2: Dev 23, If 0, Class=Vendor Specific Class, Driver=, 480M |__ Port 2: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M |__ Port 1: Dev 7, If 3, Class=Video, Driver=uvcvideo, 480M |__ Port 1: Dev 7, If 1, Class=Audio, Driver=snd-usb-audio, 480M |__ Port 1: Dev 7, If 2, Class=Video, Driver=uvcvideo, 480M |__ Port 1: Dev 7, If 0, Class=Audio, Driver=snd-usb-audio, 480M |__ Port 4: Dev 19, If 0, Class=Mass Storage, Driver=usb-storage, 480M |__ Port 4: Dev 5, If 1, Class=Wireless, Driver=btusb, 12M |__ Port 4: Dev 5, If 0, Class=Wireless, Driver=btusb, 12M |__ Port 8: Dev 9, If 1, Class=CDC Data, Driver=cdc_acm, 12M |__ Port 8: Dev 9, If 0, Class=Communications, Driver=cdc_acm, 12M |__ Port 12: Dev 11, If 0, Class=Video, Driver=uvcvideo, 480M |__ Port 12: Dev 11, If 1, Class=Video, Driver=uvcvideo, 480M

~$ su

echo -n "1-2.2.2:1.1" > /sys/bus/usb/drivers/usbhid/unbind

bash: echo: write error: No such device

Thanks again for your help!

On Wed, Jun 3, 2020 at 9:22 AM Sylvain Henry [email protected] wrote:

sudo echo -n "2-1:1.0" > /sys/bus/usb/drivers/usbhid/unbind

The redirection isn't done by root, hence the error. See: https://stackoverflow.com/questions/82256/how-do-i-use-sudo-to-redirect-output-to-a-location-i-dont-have-permission-to-wr

Moreover you need to adapt the device number (e.g. "2-1:1.0" above) to your device. First find the device id:

lsusb -d 1c88:1001 Bus 001 Device 007: ID 1c88:1001 Somagic, Inc.

Device number is 7

lsusb -t /: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 10000M /: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/10p, 10000M /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/16p, 480M |__ Port 3: Dev 2, If 0, Class=Hub, Driver=hub/7p, 480M [...] |__ Port 4: Dev 5, If 2, Class=Human Interface Device, Driver=usbhid, 12M |__ Port 5: Dev 6, If 0, Class=Hub, Driver=hub/7p, 480M |__ Port 4: Dev 8, If 0, Class=Mass Storage, Driver=usb-storage, 480M |__ Port 2: Dev 7, If 0, Class=Vendor Specific Class, Driver=, 480M |__ Port 2: Dev 7, If 1, Class=Human Interface Device, Driver=usbhid, 480M ^-- HERE: device 7 is bound to usbhid |__ Port 5: Dev 9, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M

The device id seems to be: BUS-Port[.Port]*:1.If So in my case it is 1-3.5.2:1:1

su echo -n "1-3.5.2:1.1" > /sys/bus/usb/drivers/usbhid/unbind exit

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stevelacy/EasyCap/issues/1#issuecomment-638231314, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHMNPM6KK6VONNRZFWCWIKDRUZMCRANCNFSM4CBQ3KJA .

mrgw454 avatar Jun 03 '20 17:06 mrgw454

@mrgw454 In your case it should be: 1-1.2:1.1

It's also given in the log:

[407354.337758] input:  Somagic, Inc.   ezcap Video Grabber as
/devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.2/1-1.2:1.1/0003:1C88:1001.000B/input/input45
[407354.397107] hid-generic 0003:1C88:1001.000B: input,hidraw6: USB HID

hsyl20 avatar Jun 03 '20 17:06 hsyl20

That was it.

Thank you so much!

On Wed, Jun 3, 2020 at 12:40 PM Sylvain Henry [email protected] wrote:

@mrgw454 https://github.com/mrgw454 In your case it should be: 1-1.2:1.1

It's also given in the log:

[407354.337758] input: Somagic, Inc. ezcap Video Grabber as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.2/1-1.2:1.1/0003:1C88:1001.000B/input/input45 [407354.397107] hid-generic 0003:1C88:1001.000B: input,hidraw6: USB HID

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stevelacy/EasyCap/issues/1#issuecomment-638348204, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHMNPM2OJQULCYSOAHMJPOTRU2DHNANCNFSM4CBQ3KJA .

mrgw454 avatar Jun 03 '20 18:06 mrgw454

I have new EzCap USB Video Grabber from aliexpress (https://aliexpress.ru/item/32824460178.html). The CD with Windows driver is included. In Windows 8.1 device is works. image And faced with installation too. I use Slackware64-current linux up to date. $ lsusb Bus 001 Device 021: ID 1c88:1001 Somagic, Inc. ezcap Video Grabber

$ dmesg [34339.604688] usb 1-1: new high-speed USB device number 21 using xhci_hcd [34339.731567] usb 1-1: New USB device found, idVendor=1c88, idProduct=1001, bcdDevice= 1.00 [34339.731571] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [34339.731574] usb 1-1: Product: ezcap Video Grabber [34339.731576] usb 1-1: Manufacturer: Somagic, Inc.
[34339.731578] usb 1-1: SerialNumber: SMIGRAB03F9876543210 [34339.733072] input: Somagic, Inc. ezcap Video Grabber as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1/0003:1C88:1001.000F/input/input38 [34339.785175] hid-generic 0003:1C88:1001.000F: input,hidraw3: USB HID v1.11 Keyboard [ Somagic, Inc. ezcap Video Grabber] on usb-0000:00:14.0-1/input1 [34340.364091] udevd[3197]: failed to execute '/lib/udev/libinput-device-group' 'libinput-device-group /sys/devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1/0003:1C88:1001.000F/input/input38/event17': No such file or directory

I dowloaded EasyCap source version 1.1 from github and compiled. Then applied somagic-easycap-tools_1.1 for copy of driver from CD.

$ sudo ./somagic-extract-firmware ../../Driver/Drivers/win_xp/SmiUsbGrabber3C.sys Firmware written to '/lib/firmware/somagic_firmware.bin'.

Unbind the device: echo -n "1-1:1.1" > /sys/bus/usb/drivers/usbhid/unbind

Go to somagic-easycap_1.1 directory and apply somagic-init: sudo ./somagic-init Firmware file '/lib/firmware/somagic_firmware.bin' was not recognized.

Then I change ID in somagic-init.c to 0x1001, recompile and again sudo ./somagic-init Firmware file '/lib/firmware/somagic_firmware.bin' was not recognized.

However, video capture is works after reboot. sudo ./somagic-capture | mplayer -vf yadif,screenshot -demuxer rawvideo -rawvideo "pal:format=uyvy:fps=25" -aspect 4:3 -

Also I changed raw to #define PRODUCT 0x1001 in somagic-audio-capture.c. And audio is captured However, the last problem remains. How to capture video and audio together? I try to use somagic-both: sudo ./somagic-both 2> >(ffplay -f s32le -ar 48k -ac 2 -i -) | ffplay -f rawvideo -pixel_format uyvy422 -video_size 720x576 -framerate 25 -vf yadif -i - I see video but no audio. somagic-audio-capture gives s32le PCM audio flow, I listen audio without video. I try to change PCM format to s16le, s24le, and many others, no effects. I listen noise or silent. Where the normal sound? What format of audio dataflow generated by somagic-both?

YuryPakhomov avatar Jun 20 '20 22:06 YuryPakhomov