spin7ion / easycap-somagic-linux

Automatically exported from code.google.com/p/easycap-somagic-linux
0 stars 0 forks source link

Failed to claim device interface: Device or resource busy #18

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,
I've a problem with this driver.
I installed latest version (1.1) on a ubuntu 13.04 64bit (kernel 
3.8.0-19-generic).
Compiled the kernel modules and loaded.
But when I execute a "somagic-capture --test-only", I get this message:
Failed to claim device interface: Device or resource busy

Dmesg says:
[ 6041.113804] usb 1-6: new high-speed USB device number 5 using ehci-pci
[ 6041.689226] usb 1-6: device not accepting address 5, error -71
[ 6041.745415] hub 1-0:1.0: unable to enumerate USB device on port 6
[ 6042.200717] usb 3-6: new full-speed USB device number 5 using ohci_hcd
[ 6042.401180] usb 3-6: not running at top speed; connect to a high speed hub
[ 6042.419166] usb 3-6: New USB device found, idVendor=1c88, idProduct=0007
[ 6042.419178] usb 3-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 6042.419185] usb 3-6: Product: SM-USB 007
[ 6042.419191] usb 3-6: Manufacturer: Somagic, Inc.
[ 6042.419196] usb 3-6: SerialNumber: SMBL007
[ 6042.422260] usb 3-6: Looking for: smi2021_3c.bin
[ 6042.428357] usb 3-6: Looking for: smi2021_3e.bin
[ 6042.432855] usb 3-6: Looking for: smi2021_3f.bin
[ 6042.436204] usb 3-6: could not find any firmware for this device
[ 6338.168435] usb 3-6: USB disconnect, device number 5
[ 6338.515083] usb 1-6: new high-speed USB device number 7 using ehci-pci
[ 6338.647972] usb 1-6: New USB device found, idVendor=1c88, idProduct=003c
[ 6338.647983] usb 1-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 6338.647990] usb 1-6: Product: SMI Grabber DEV 
[ 6338.647996] usb 1-6: Manufacturer:  Somagic, Inc.  
[ 6338.648002] usb 1-6: SerialNumber: SMIGRABBER9876543210
[ 6338.652241] saa7115 5-004a: saa7113 found (8f7113000000000) @ 0x94 (smi2021)
[ 6338.677836] smi2021::smi2021_usb_probe: Driver version 0.1 successfully 
loaded
[ 6338.685359] smi2021 1-6:1.0: V4L2 device registered as video1
[ 6338.702502] smi2021::smi2021_pcm_open: PCM device open!
[ 6338.702568] smi2021::smi2021_pcm_close: PCM device closing
[ 6338.702631] smi2021::smi2021_pcm_open: PCM device open!
[ 6338.702666] smi2021::smi2021_pcm_close: PCM device closing
[ 6338.702731] smi2021::smi2021_pcm_open: PCM device open!
[ 6338.702783] smi2021::smi2021_pcm_close: PCM device closing
[ 6338.702861] smi2021::smi2021_pcm_open: PCM device open!
[ 6338.702988] smi2021::smi2021_pcm_close: PCM device closing
[ 6338.703153] smi2021::smi2021_pcm_open: PCM device open!
[ 6338.705188] smi2021::smi2021_pcm_close: PCM device closing
[ 6338.705265] smi2021::smi2021_pcm_open: PCM device open!
[ 6338.705306] smi2021::smi2021_pcm_close: PCM device closing
[ 6338.705363] smi2021::smi2021_pcm_open: PCM device open!
[ 6338.705395] smi2021::smi2021_pcm_close: PCM device closing
[ 6338.705457] smi2021::smi2021_pcm_open: PCM device open!
[ 6338.705505] smi2021::smi2021_pcm_close: PCM device closing
[ 6338.705568] smi2021::smi2021_pcm_open: PCM device open!
[ 6338.705690] smi2021::smi2021_pcm_close: PCM device closing
[ 6338.707567] smi2021::smi2021_pcm_open: PCM device open!

Any help?
Thanks a lot.

Original issue reported on code.google.com by gorot...@gmail.com on 28 Apr 2013 at 9:55

GoogleCodeExporter commented 9 years ago
I tried a capture:
sudo somagic-capture --iso-transfers=20 | mplayer -vf yadif,screenshot -demuxer 
rawvideo -rawvideo "pal:format=uyvy:fps=25" -aspect 4:3 -
Failed to claim device interface: Device or resource busy
Is somagic-capture already running?
MPlayer svn r34540 (Ubuntu), built with gcc-4.7 (C) 2000-2012 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing -.
Reading from stdin...
rawvideo file format detected.
Load subtitles in ./
Opening video filter: [screenshot]
Opening video filter: [yadif]
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
[swscaler @ 0x1804200] using unscaled uyvy422 -> yuv420p special converter
VO: [vdpau] 720x576 => 768x576 Planar YV12 
Selected video codec: [rawuyvy] vfm: raw (RAW UYVY)
==========================================================================
Audio: no sound
Starting playback...
V:   0.0   0/  0 ??% ??% ??,?% 0 0 

Original comment by gorot...@gmail.com on 28 Apr 2013 at 10:16

GoogleCodeExporter commented 9 years ago
I'm using v4l2 test bench. This is a sample of dmesg in a test case:

[ 8093.164526] smi2021::smi2021_read_reg: 2nd pass failing to read reg 0xf, 
usb-errno: -110
[ 8106.183800] smi2021::smi2021_write_reg: write failed on register 0x16, 
errno: -110
[ 8107.182823] smi2021::smi2021_write_reg: write failed on register 0x8, errno: 
-110
[ 8108.181843] smi2021::smi2021_write_reg: write failed on register 0x5a, 
errno: -110
[ 8109.180849] smi2021::smi2021_read_reg: 2nd pass failing to read reg 0xe, 
usb-errno: -110
[ 8110.203873] smi2021::smi2021_write_reg: write failed on register 0x15, 
errno: -110
[ 8111.202888] smi2021::smi2021_write_reg: write failed on register 0x17, 
errno: -110
[ 8116.200071] smi2021::smi2021_alloc_isoc: urbs allocated
[ 8116.200084] smi2021::smi2021_start_streaming: cannot submit urb[0] (-2)
[ 8116.200089] smi2021::smi2021_cancel_isoc: killing 4 urbs...
[ 8116.200094] smi2021::smi2021_cancel_isoc: all urbs killed
[ 8116.200097] smi2021::smi2021_free_isoc: freeing 4 urb buffers...
[ 8116.200106] smi2021::smi2021_free_isoc: all urb buffers freed
[ 8121.193150] BUG: unable to handle kernel NULL pointer dereference at 
0000000000000008
[ 8121.193164] IP: [<ffffffffa0ba36f3>] smi2021_clear_queue+0x53/0xb0 [smi2021]
[ 8121.193179] PGD 60477067 PUD 60476067 PMD 0 
[ 8121.193188] Oops: 0002 [#2] SMP 
[ 8121.193195] Modules linked in: smi2021(OF) saa7115 v4l2_common 
smi2021_bootloader(OF) joydev(F) snd_hda_codec_via hid_generic kvm_amd kvm 
edac_core microcode(F) edac_mce_amd nvidia(POF) psmouse(F) serio_raw(F) k10temp 
snd_usb_audio snd_hda_intel snd_usbmidi_lib snd_hda_codec asus_atk0110 
snd_hwdep(F) video(F) snd_seq_midi(F) snd_seq_midi_event(F) snd_rawmidi(F) wmi 
snd_pcm(F) snd_seq(F) parport_pc(F) usbhid hid ppdev(F) snd_page_alloc(F) 
snd_seq_device(F) uvcvideo snd_timer(F) videobuf2_vmalloc videobuf2_memops 
videobuf2_core videodev bnep rfcomm snd(F) mac_hid bluetooth i2c_nforce2 
soundcore(F) lp(F) parport(F) binfmt_misc(F) pata_acpi floppy(F) firewire_ohci 
firewire_core crc_itu_t(F) pata_amd forcedeth ahci(F) libahci(F)
[ 8121.193280] CPU 3 
[ 8121.193289] Pid: 5023, comm: qv4l2 Tainted: PF     D    O 3.8.0-19-generic 
#29-Ubuntu System manufacturer System Product Name/M4N72-E
[ 8121.193296] RIP: 0010:[<ffffffffa0ba36f3>]  [<ffffffffa0ba36f3>] 
smi2021_clear_queue+0x53/0xb0 [smi2021]
[ 8121.193309] RSP: 0018:ffff88007d043c18  EFLAGS: 00010006
[ 8121.193314] RAX: 0000000000000000 RBX: ffff8800bff72000 RCX: 0000000000000000
[ 8121.193319] RDX: ffff88006a02db48 RSI: 0000000000000005 RDI: ffff88006a02d800
[ 8121.193324] RBP: ffff88007d043c38 R08: 00000000ffffff92 R09: ffff88012fd96cc0
[ 8121.193328] R10: ffffea0004a154c0 R11: ffffffff814fd2a2 R12: ffff8800bff72678
[ 8121.193332] R13: ffff8800bff72d30 R14: 0000000000000282 R15: ffffffffa0110440
[ 8121.193338] FS:  00007fb80d22b7c0(0000) GS:ffff88012fd80000(0000) 
knlGS:00000000f55ffb40
[ 8121.193343] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[ 8121.193347] CR2: 0000000000000008 CR3: 0000000060474000 CR4: 00000000000007e0
[ 8121.193352] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 8121.193356] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[ 8121.193362] Process qv4l2 (pid: 5023, threadinfo ffff88007d042000, task 
ffff8800cf9f45c0)
[ 8121.193365] Stack:
[ 8121.193368]  0000000000000000 ffff8800bff72000 00000000fffffffe 
ffff8800bff72cf0
[ 8121.193378]  ffff88007d043c88 ffffffffa0ba3a9f ffff88007d043c66 
ffff880000000002
[ 8121.193385]  00000000000003e8 050188007d043c88 ffff8800bff72478 
ffff8800bff72358
[ 8121.193393] Call Trace:
[ 8121.193405]  [<ffffffffa0ba3a9f>] start_streaming+0x1cf/0x280 [smi2021]
[ 8121.193420]  [<ffffffffa012cf34>] vb2_streamon+0xf4/0x190 [videobuf2_core]
[ 8121.193433]  [<ffffffffa012d028>] vb2_ioctl_streamon+0x58/0x70 
[videobuf2_core]
[ 8121.193450]  [<ffffffffa00faaba>] v4l_streamon+0x1a/0x20 [videodev]
[ 8121.193466]  [<ffffffffa00fca01>] __video_do_ioctl+0x2c1/0x400 [videodev]
[ 8121.193477]  [<ffffffff815b1ce0>] ? __sys_sendmsg+0x3c0/0x3c0
[ 8121.193494]  [<ffffffffa00ff264>] video_usercopy+0x214/0x4b0 [videodev]
[ 8121.193511]  [<ffffffffa00fc740>] ? v4l_printk_ioctl+0xb0/0xb0 [videodev]
[ 8121.193528]  [<ffffffffa00ff515>] video_ioctl2+0x15/0x20 [videodev]
[ 8121.193542]  [<ffffffffa00f968f>] v4l2_ioctl+0x11f/0x160 [videodev]
[ 8121.193552]  [<ffffffff811a5919>] do_vfs_ioctl+0x99/0x570
[ 8121.193560]  [<ffffffff811a5e81>] sys_ioctl+0x91/0xb0
[ 8121.193569]  [<ffffffff816cc1e9>] ? do_device_not_available+0x19/0x20
[ 8121.193578]  [<ffffffff816d379d>] system_call_fastpath+0x1a/0x1f
[ 8121.193582] Code: e0 48 8b 93 78 06 00 00 49 89 c6 49 39 d4 74 4e 0f 1f 84 
00 00 00 00 00 48 8b 42 08 48 8b 0a 48 8d ba b8 fc ff ff be 05 00 00 00 <48> 89 
41 08 48 89 08 48 b8 00 01 10 00 00 00 ad de 48 89 02 48 
[ 8121.193649] RIP  [<ffffffffa0ba36f3>] smi2021_clear_queue+0x53/0xb0 [smi2021]
[ 8121.193658]  RSP <ffff88007d043c18>
[ 8121.193662] CR2: 0000000000000008
[ 8121.193668] ---[ end trace 4d0a14bf4d76c253 ]---

I hope this helps... :-)

Original comment by gorot...@gmail.com on 28 Apr 2013 at 10:23

GoogleCodeExporter commented 9 years ago
I have the same issue.
OS - ubuntu 13.04 64bit (kernel 3.8.0-19-generic).

The same errors in dmesg. I have compiled kernel modules, extracted firmware 
and renamed it to smi2021_3c.bin. Added such lines to /etc/modules:
saa7115
uvcvideo
smi2021_bootloader
smi2021

But after reboot I get such output in dmesg:
[   45.936102] usb 3-1: new full-speed USB device number 2 using uhci_hcd
[   62.643783] usb 3-1: not running at top speed; connect to a high speed hub
[   62.673168] usb 3-1: New USB device found, idVendor=1c88, idProduct=003c
[   62.673174] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   62.673177] usb 3-1: Product: SMI Grabber DEV
[   62.673180] usb 3-1: Manufacturer:  Somagic, Inc.
[   62.673182] usb 3-1: SerialNumber: SMIGRABBER9876543210
[   63.676566] smi2021::smi2021_write_reg: write failed on register 0x3a, 
errno: -110
[   64.681196] smi2021::smi2021_write_reg: write failed on register 0x3b, 
errno: -110
[   64.686098] saa7115 1-004a: saa7113 found (8f7113000000000) @ 0x94 (smi2021)
[   65.689074] smi2021::smi2021_write_reg: write failed on register 0x2, errno: 
-110
[   66.692272] smi2021::smi2021_write_reg: write failed on register 0x4, errno: 
-110
[   67.697078] smi2021::smi2021_write_reg: write failed on register 0x6, errno: 
-110
[   68.700455] smi2021::smi2021_write_reg: write failed on register 0x8, errno: 
-110
[   69.704226] smi2021::smi2021_write_reg: write failed on register 0xa, errno: 
-110
[   70.709116] smi2021::smi2021_write_reg: write failed on register 0xc, errno: 
-110
[   71.713125] smi2021::smi2021_write_reg: write failed on register 0xe, errno: 
-110
[   72.716386] smi2021::smi2021_write_reg: write failed on register 0x10, 
errno: -110
[   73.720473] smi2021::smi2021_write_reg: write failed on register 0x12, 
errno: -110
[   74.724444] smi2021::smi2021_write_reg: write failed on register 0x15, 
errno: -110
[   75.728720] smi2021::smi2021_write_reg: write failed on register 0x17, 
errno: -110
[   76.733032] smi2021::smi2021_write_reg: write failed on register 0x41, 
errno: -110
[   77.736908] smi2021::smi2021_write_reg: write failed on register 0x43, 
errno: -110
[   78.740495] smi2021::smi2021_write_reg: write failed on register 0x45, 
errno: -110
[   79.745089] smi2021::smi2021_write_reg: write failed on register 0x47, 
errno: -110
[   80.748661] smi2021::smi2021_write_reg: write failed on register 0x49, 
errno: -110
[   81.752262] smi2021::smi2021_write_reg: write failed on register 0x4b, 
errno: -110
[   82.756892] smi2021::smi2021_write_reg: write failed on register 0x4d, 
errno: -110
[   83.760471] smi2021::smi2021_write_reg: write failed on register 0x4f, 
errno: -110
[   84.765212] smi2021::smi2021_write_reg: write failed on register 0x51, 
errno: -110
[   85.768672] smi2021::smi2021_write_reg: write failed on register 0x53, 
errno: -110
[   86.772272] smi2021::smi2021_write_reg: write failed on register 0x55, 
errno: -110
[   87.777072] smi2021::smi2021_write_reg: write failed on register 0x57, 
errno: -110
[   88.780461] smi2021::smi2021_write_reg: write failed on register 0x59, 
errno: -110
[   89.784238] smi2021::smi2021_write_reg: write failed on register 0x5e, 
errno: -110
[   90.788665] smi2021::smi2021_write_reg: write failed on register 0x15, 
errno: -110
[   91.792744] smi2021::smi2021_write_reg: write failed on register 0x17, 
errno: -110
[   92.796887] smi2021::smi2021_write_reg: write failed on register 0xe, errno: 
-110
[   93.800469] smi2021::smi2021_read_reg: 1st pass failing to read reg 0xe, 
usb-errno: -110
[   94.804466] smi2021::smi2021_write_reg: write failed on register 0xa, errno: 
-110
[   95.808376] smi2021::smi2021_write_reg: write failed on register 0xc, errno: 
-110
[   96.812196] smi2021::smi2021_write_reg: write failed on register 0xf, errno: 
-110
[   96.812219] smi2021::smi2021_usb_probe: Driver version 0.1 successfully 
loaded
[   97.820376] smi2021::smi2021_write_reg: write failed on register 0x16, 
errno: -110
[   98.824587] smi2021::smi2021_write_reg: write failed on register 0x8, errno: 
-110
[   99.828720] smi2021::smi2021_write_reg: write failed on register 0x5a, 
errno: -110
[  100.832790] smi2021::smi2021_read_reg: 2nd pass failing to read reg 0xe, 
usb-errno: -110
[  101.836345] smi2021::smi2021_read_reg: 1st pass failing to read reg 0x2, 
usb-errno: -110
[  102.840597] smi2021::smi2021_read_reg: 1st pass failing to read reg 0x9, 
usb-errno: -110
[  102.844823] smi2021 3-1:1.0: V4L2 device registered as video0

Original comment by paul.ann...@gmail.com on 21 Jul 2013 at 10:37

GoogleCodeExporter commented 9 years ago
Did you find a solution guys? 
I am using ubuntu 13.04 and kernel 3.8.13.. and applied Jon patch ver 4... and 
still have issue but with a _3f device:
- same above errors writing to registries and device buzy on somagic-capture; 
- the /dev/video0 appears but not working with motion or avplay or other 
viewers. 
- I have 4 video inputs in the device and only one /dev/video0 is there.

Any help will be appreciate.

Original comment by cair...@gmail.com on 1 Sep 2013 at 11:32

GoogleCodeExporter commented 9 years ago
I have completely installed it on ubuntu 13.04 64bit (kernel 3.8.0-19-generic) 
and all works pretty well. Here is my guide:

1. Install the following packages:
sudo apt-get install git build-essential libusb-1.0-0-dev libgcrypt11-dev 
usbutils
For Debian install linux headers:
sudo apt-get install linux-headers-$(uname -r)

2. Clone project from git
git clone https://code.google.com/p/easycap-somagic-linux/

3. Compile utility for firmware extraction
cd easycap-somagic-linux/tools/somagic-extract-firmware
make && sudo make install

4. Extract firmware from file (SmiUsbGrabberXX.sys) that you may find after 
Windows driver installation.
sudo somagic-extract-firmware SmiUsbGrabberXX.sys

5. There will be firmware file called somagic_firmware.bin in /lib/firmware 
afer extract. You must rename it with version suffix (3c in my case)
sudo cp /lib/firmware/somagic_firmware.bin /lib/firmware/smi2021_3c.bin

6. Compile kernel driver
cd ../../kernel
make

7. There will be 2 files after compilation: smi2021.ko and 
smi2021_bootloader.ko. Copy them to the directory of current kernel
sudo cp smi2021.ko /lib/modules/$(uname -r)/kernel/drivers/media/usb/smi2021
sudo cp smi2021_bootloader.ko /lib/modules/$(uname 
-r)/kernel/drivers/media/usb/smi2021

8. Add the following lines to /etc/modules
videodev
saa7115
uvcvideo
snd-usb-audio # If you see snd_pcm_* errors
smi2021_bootloader # Initializes device
smi2021

9. Update drivers tree
depmod -a

Good luck ;)

Original comment by paul.ann...@gmail.com on 1 Sep 2013 at 11:21

GoogleCodeExporter commented 9 years ago
Hi, I tried all steps in #5 from paul, without problems.
But nothing, when I launch capturing, I get same results and same errors!

On latest ubuntu update, kernel 3.8.0-30-generic 64bit.

Thank's for your help....

Sob sob sob sob....no luck :-(

Original comment by gorot...@gmail.com on 13 Sep 2013 at 6:32

GoogleCodeExporter commented 9 years ago
The developer has written new post about kernel module building not far ago. 
You can read it here: 
https://code.google.com/p/easycap-somagic-linux/wiki/BuildingKernelModule

Original comment by paul.ann...@gmail.com on 15 Sep 2013 at 4:14