User avatar
fbutler
Posts: 302
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England

Re: EasyCap module compiling.

Fri Oct 26, 2012 4:39 pm

nikita_d wrote:yea i tried. Don't really understand what actually depmod -a doing, but i wrote it. Nothing helps. Re-plugging also not working
Any idias?
Is the device being detected as a USB device at all?
What does lsusb show when the device is plugged in?

Here's my output from a lsusb showing the Syntek device:

Code: Select all

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 1a40:0201 Terminus Technology Inc. FE 2.1 7-port Hub
Bus 001 Device 005: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB
Bus 001 Device 012: ID 0557:8021 ATEN International Co., Ltd
Bus 001 Device 015: ID 05e1:0408 Syntek Semiconductor Co., Ltd STK1160 Video Capture Device
Here's the full output of a dmesg from when I plug the device in:

Code: Select all

[31491.749881] usb 1-1.3.1.3: new high-speed USB device number 14 using dwc_otg
[31491.851053] usb 1-1.3.1.3: New USB device found, idVendor=05e1, idProduct=0408
[31491.851085] usb 1-1.3.1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[31491.851104] usb 1-1.3.1.3: Product: USB 2.0 Video Capture Controller
[31491.851118] usb 1-1.3.1.3: Manufacturer: Syntek Semiconductor
[31491.860507] usb 1-1.3.1.3: New device Syntek Semiconductor USB 2.0 Video Capture Controller @ 480 Mbps (05e1:0408, interface 0, class 0)
[31491.860542] usb 1-1.3.1.3: video interface 0 found
[31492.780045] saa7115 0-0025: saa7113 found (1f7113d0e100000) @ 0x4a (stk1160)
[31494.549854] stk1160: driver ver 0.9.5 successfully loaded
[31494.671745] stk1160: registers to NTSC like standard
[31494.914977] stk1160 1-1.3.1.3:1.0: V4L2 device registered as video0
Here's my output from a lsmod with the device plugged in:

Code: Select all

Module                  Size  Used by
snd_usb_audio          93242  0
snd_usbmidi_lib        17812  1 snd_usb_audio
snd_hwdep               5730  1 snd_usb_audio
snd_seq_midi            4518  0
saa7115                13861  1
snd_seq_midi_event      6453  1 snd_seq_midi
snd_rawmidi            20611  2 snd_seq_midi,snd_usbmidi_lib
stk1160                18911  0
videobuf2_vmalloc       1965  1 stk1160
videobuf2_memops        2364  1 videobuf2_vmalloc
videobuf2_core         21366  1 stk1160
v4l2_common             9405  2 stk1160,saa7115
videodev               88790  3 v4l2_common,stk1160,saa7115
snd_bcm2835            12808  0
snd_pcm                74834  2 snd_bcm2835,snd_usb_audio
snd_page_alloc          4951  1 snd_pcm
snd_seq                52536  2 snd_seq_midi_event,snd_seq_midi
snd_seq_device          6300  3 snd_seq,snd_rawmidi,snd_seq_midi
snd_timer              19698  2 snd_seq,snd_pcm
snd                    52489  9 snd_timer,snd_seq_device,snd_seq,snd_pcm,snd_bcm2835,snd_rawmidi,snd_hwdep,snd_usbmidi_lib,snd_usb_audio
evdev                   8682  0
You could also try a reboot. For me my Syntek device is not detected correctly on reboot, and I have to unplug and replug it back in after reboot to have it detected properly.

nikita_d
Posts: 9
Joined: Tue Oct 23, 2012 9:01 am

Re: EasyCap module compiling.

Fri Oct 26, 2012 5:10 pm

lsusb

[email protected]:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 05e1:0408 Syntek Semiconductor Co., Ltd STK1160 Video Capture Device


dmesg

[ 3.461934] usb 1-1.2: Product: USB 2.0 Video Capture Controller
[ 3.476714] usb 1-1.2: Manufacturer: Syntek Semiconductor
[ 6.973754] EXT4-fs (mmcblk0p2): recovery complete
[ 7.181103] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 7.198169] VFS: Mounted root (ext4 filesystem) on device 179:2.
[ 7.214402] devtmpfs: mounted
[ 7.227179] Freeing init memory: 124K
[ 8.609665] udevd[138]: starting version 175
[ 11.420150] usbcore: registered new interface driver snd-usb-audio
[ 17.321426] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[ 18.188940] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[ 18.839403] bcm2835 ALSA card created!
[ 27.917783] smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0x45E1

lsmod

snd_bcm2835 19889 0
snd_usb_audio 93242 0
snd_usbmidi_lib 17812 1 snd_usb_audio
snd_hwdep 5730 1 snd_usb_audio
snd_seq_midi 4518 0
snd_seq_midi_event 6453 1 snd_seq_midi
snd_rawmidi 20611 2 snd_seq_midi,snd_usbmidi_lib
snd_pcm 74834 2 snd_usb_audio,snd_bcm2835
snd_page_alloc 4951 1 snd_pcm
snd_seq 52536 2 snd_seq_midi_event,snd_seq_midi
snd_seq_device 6300 3 snd_seq,snd_rawmidi,snd_seq_midi
snd_timer 19698 2 snd_seq,snd_pcm
snd 52489 9 snd_timer,snd_seq_device,snd_seq,snd_pcm,snd_rawmidi,snd_hwdep,snd_usbmidi_lib,snd_usb_audio,snd_bcm2835


Okay now things are going really strange: when rpi is working and i plugg stk1160 off rpi continue working, but if i plugg it back in rpi just reboots. And also if stk1160 isn't plugged at all rpi wont even start booting. Just 1 light-emitting diode is shining red, just letting us know that my microusb is working fine.
If ur stk1160 working with rpi, can u please point me from all of the begging what to do? what kernel i should use, where i take the headers, what driver i should try to install. I'd really apreciate that.

User avatar
fbutler
Posts: 302
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England

Re: EasyCap module compiling.

Fri Oct 26, 2012 5:50 pm

nikita_d wrote:Okay now things are going really strange: when rpi is working and i plugg stk1160 off rpi continue working, but if i plugg it back in rpi just reboots. And also if stk1160 isn't plugged at all rpi wont even start booting. Just 1 light-emitting diode is shining red, just letting us know that my microusb is working fine.
If ur stk1160 working with rpi, can u please point me from all of the begging what to do? what kernel i should use, where i take the headers, what driver i should try to install. I'd really apreciate that.
I'm not sure where to start. Yes I do have the stk1160 producing output as shown by the screenshot from me in a previous post. However as you can see from the screenshot it's not working fully. Currently I believe that this may be due to the outstanding USB issues with the Pi but I know piotr-e is still making changes to his version of the driver code.

To get it working as far as I have got it working I compiled the 3.2.27+ kernel on the Pi itself. It took about 6 hours to compile it. The driver I am using is the one I referred to in the previous posting. I have seen seen some kernel panics sometimes when removing the stk1160 device when the Pi is on. This is probably due to some bug in the driver when it is de-registering the device.

From your last posting it sounds as though you need to get your Pi back into a stable state before you continue to look at the stk1160.

Once you've stabilised it and can see the Syntek device with a lsusb then use the usb-devices command to see if any driver is being assigned to it. Here's my output for the device using the usb-devices command:

Code: Select all

T:  Bus=01 Lev=04 Prnt=05 Port=02 Cnt=02 Dev#= 15 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=05e1 ProdID=0408 Rev=00.05
S:  Manufacturer=Syntek Semiconductor
S:  Product=USB 2.0 Video Capture Controller
C:  #Ifs= 3 Cfg#= 1 Atr=80 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=stk1160
I:  If#= 1 Alt= 0 #EPs= 0 Cls=01(audio) Sub=01 Prot=00 Driver=snd-usb-audio
I:  If#= 2 Alt= 0 #EPs= 1 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio
If no stk1160 driver is showing in the output then try

Code: Select all

 modprobe stk1160 
to register it. Then do a dmesg to see if the driver was sucessfully registered.

nikita_d
Posts: 9
Joined: Tue Oct 23, 2012 9:01 am

Re: EasyCap module compiling.

Fri Oct 26, 2012 6:21 pm

after depmode stk1160 terminal told me [Fatal error] and did nothing.
I just dumped my rpi to original condition (Raspbian wheezy). Can u please point to the guide, or discrube how to complie 3.2.27+ kernel by my own? and i will start all over again.

User avatar
fbutler
Posts: 302
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England

Re: EasyCap module compiling.

Fri Oct 26, 2012 6:34 pm

nikita_d wrote:after depmode stk1160 terminal told me [Fatal error] and did nothing.
I just dumped my rpi to original condition (Raspbian wheezy). Can u please point to the guide, or discrube how to complie 3.2.27+ kernel by my own? and i will start all over again.
I used this guide as the basis for the compile ensuring that I cloned the 3.2.27+ source:
http://elinux.org/Rpi_kernel_compilation

You will need to make some adjustments to it to take account of the new firmware changes for the 512 RAM as the guide doesn't reflect it.

Once you've got it all compiled and working you should back up your Pi before testing the stk1160 driver so that you can restore the 3.2.27+ image if you run into issues.

nikita_d
Posts: 9
Joined: Tue Oct 23, 2012 9:01 am

Re: EasyCap module compiling.

Fri Oct 26, 2012 6:45 pm

what exactly i should use from this guide? Can i run this guide if i'm using putty as remote controll of my RPI. So i have already a booted raspbian and then i go through the guide? or better if i will use my own PC to prepare SD card? If i'm going to prepare SD card from my PC, then my question is how? becouse there i have windows as main OS, and i don't have any Linux liked OS

User avatar
fbutler
Posts: 302
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England

Re: EasyCap module compiling.

Fri Oct 26, 2012 7:10 pm

nikita_d wrote:what exactly i should use from this guide? Can i run this guide if i'm using putty as remote controll of my RPI. So i have already a booted raspbian and then i go through the guide? or better if i will use my own PC to prepare SD card? If i'm going to prepare SD card from my PC, then my question is how? becouse there i have windows as main OS, and i don't have any Linux liked OS
Compile directly on the Pi from Putty as root. The two sections in the guide that you want to follow are:

"Firmware", making sure you change it to copy the necessary files according to the latest firmware instructions for the 512 RAM firmware changes

"Common", making sure that you clone the 3.2.27+ source

There may be other guides to compiling the kernel which are more up to date and which you might find easier to follow, so it may be worth googling to see if you can find one.

I'm switching off my computer now for the night, so I won't be able to help any further this evening.

nikita_d
Posts: 9
Joined: Tue Oct 23, 2012 9:01 am

Re: EasyCap module compiling.

Fri Oct 26, 2012 7:14 pm

thanks! will try and reply tommorow. go0d night

User avatar
cowpat
Posts: 90
Joined: Sat Apr 14, 2012 12:13 pm
Location: London
Contact: Website

Re: EasyCap module compiling.

Fri Oct 26, 2012 7:24 pm

I found this useful http://elinux.org/RPi_Kernel_Compilation

I think it's important to reiterate fbutler's point that this driver doesn't work on the raspberry pi...


try an em28xx capture device or another arm board. In either case, be prepared for another battle.


IMHO it isn't just the price, (it's certainly not the quality), of these capture cards + RPi that is appealing it's the community support - but ultimately you're going to need to think about going off piste if you want a functional analog video input. For example the Leopardboard or the EMBEST - SBC8018 both have analog video modules, but there really isn't much help out there if you need it to make them work. The IGEPv2 + Expansion board offers two analog inputs, and I think there's a bit more help out there; but this is 400 euros of hardware now.

I gave RPi + em28xx one last go earlier in the week. Still no luck. I wonder if there's another branch of the driver git repository I could have a go at... but I know it's kind of futile because it will only be 320 x 240 again, (I have seen it working once) so I've let it lie for now. (it would be nice to see it working again though, in case that magic USB fix turns up!)

BTW thanks to piotr-e for the raspberry pi branch of the stk-1160; That also compiles beautifully on the beaglebone - but I've struggled with video capture on that board too.

I'm going to try the OLinuXino A13 next, if that doesn't work I'm going to need deeper pockets.

That's not a rant... i think it's a fairly objective summary of my battle thus far. Nor do I mean to start a battle of ARM boards -this is a RPi forum not an eLinux forum- and I think they're all great for what they can do. I really just want to highlight the present difficulty I have found of getting a £6+ usb capture device working with an ARM processor.

It's stating the obvious, but if I didn't dearly want the low power consumption (and the price is nice too), I would be taking a harder look at x86 boards and pci capture cards now...


...in any case if I were you I wouldn't be spending too much longer trying to get STK1160 working on a raspberry pi until there's some movement on the USB issues.

nikita_d
Posts: 9
Joined: Tue Oct 23, 2012 9:01 am

Re: EasyCap module compiling.

Sat Oct 27, 2012 11:09 am

last night i compiled 3.2.27+ kernel as u told me to. after kernel was installed i triede piotr's driver and after running make command terminal told me /lib/modules/3.2.27+/build no such file or directory. through ls /lib/modules/3.2.27+ i saw bild and sources directories it selfs, but driver didn't recognize them. but lsusb works fine and i see my easycap plugged in. after i tried to download headers and symlinked build and sources to that headrs as i did previously in some mine posts. that helped and piotr's driver compiled but no video0 was found at ls /dev. i tried to repluggig . then i ran depmod -a but my terminal gone crazy and i waited abouts 10-15 minutes but command doesn't end. so i switched depmod off with ctrl+c. now i'm struck no more idias coming i y head.

User avatar
piotr-e
Posts: 71
Joined: Tue Aug 28, 2012 10:51 am
Location: Poland

Re: EasyCap module compiling.

Sat Oct 27, 2012 11:57 am

nikita_d wrote:last night i compiled 3.2.27+ kernel as u told me to. after kernel was installed i triede piotr's driver and after running make command terminal told me /lib/modules/3.2.27+/build no such file or directory. through ls /lib/modules/3.2.27+ i saw bild and sources directories it selfs, but driver didn't recognize them. but lsusb works fine and i see my easycap plugged in. after i tried to download headers and symlinked build and sources to that headrs as i did previously in some mine posts. that helped and piotr's driver compiled but no video0 was found at ls /dev. i tried to repluggig . then i ran depmod -a but my terminal gone crazy and i waited abouts 10-15 minutes but command doesn't end. so i switched depmod off with ctrl+c. now i'm struck no more idias coming i y head.
Can You compile and install stk1160 again?
Next you copy all lines and you paste here.
Raspberry Pi, model B, revision 2, 256MB RAM; Raspbian; Huawei E3131 modem (it works :-) ); EasyCap 4CH USB DVR (it works, but very slow)

I'm sorry for my English.

User avatar
piotr-e
Posts: 71
Joined: Tue Aug 28, 2012 10:51 am
Location: Poland

Re: EasyCap module compiling.

Sat Oct 27, 2012 3:23 pm

...and you paste here all option of your /boot/cmdline.txt file.
Raspberry Pi, model B, revision 2, 256MB RAM; Raspbian; Huawei E3131 modem (it works :-) ); EasyCap 4CH USB DVR (it works, but very slow)

I'm sorry for my English.

olav
Posts: 1
Joined: Mon Dec 10, 2012 4:40 pm

Re: EasyCap module compiling.

Mon Dec 10, 2012 9:23 pm

Hi,
I'm new to this forum, so apologies if my question has already been answered in a different thread. I have the same problems as described in earlier post where no videodevice is found in /dev/ . I have downloaded the kernel source and the stk1160driver source for RPi. I've built the module without warnings but cant insmod it. It is missing some references in some other modules loaded in the kernel such as videobuf. I've checked that the videobufmodule is loaded. If this thread is still active I'll write a more accurate and correct description.

Has the issues been resolved?

richardp
Posts: 117
Joined: Thu Jan 12, 2012 11:46 am

Re: EasyCap module compiling.

Sat Dec 29, 2012 8:57 pm

fbutler wrote:
nikita_d wrote: But when i'm trying to install the driver (using make file) it's now sucsesfully opening the /lib/modules/3.2.27+/build directory. But now it's running with the warning :"
WARNING: "snd_ac97_bus" [/home/stk1160-standalone/stk1160.ko] undefined!
WARNING: "snd_ac97_mixer" [/home/stk1160-standalone/stk1160.ko] undefined!"
Even with that warning installation still completes, but after that there's still no video0 file in /dev, and i can't find any symbols poiting to stk1160 in dmesg | grep registered command. Can u help me apply ac97 modules please? i think that is the main problem now
Try this version of the driver source:

https://github.com/piotr-e/stk1160-raspberrypi

This has had the references to the snd_ac97_bus and snd_ac97_mixer removed as the Pi uses other sound modules. There are also other differences in this source in allocating buffers. This version should compile correctly for you.
Insmodding fine... just does not work for long.
I am using the above stk driver and have blacklisted the easycap driver.

Code: Select all

[email protected] ~ $ gst-launch v4l2src ! videoscale ! ffmpegcolorspace ! theoraenc ! queue ! oggmux name=mux ! queue ! filesink location=out.ogg
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Caught SIGSEGV accessing address 0x44f8d000
#0  0x4045b864 in ?? ()
#1  0x40475ee8 in ?? ()
#2  0x40475ee8 in ?? ()
Spinning.  Please run 'gdb gst-launch 2119' to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.
^CCaught interrupt -- handling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 5275806170 ns.
Setting pipeline to PAUSED ...
RaspberryPi's galore
Solid run CuBox
ODroid U2

rvinoth39
Posts: 37
Joined: Mon Jan 07, 2013 8:42 am

Re: EasyCap module compiling.

Mon Jan 07, 2013 10:03 am

hi everyone. i'm new to this forum. need some help.
i've a 1/3'' sony ccd pal camera cxd3142r . it has two wires one for power supply 12V and another BNC.
Now i got bnc to rca male converter cable and connected to easycap D60 v3.1c smi grabber chipset.
now the question is how can i get easycap working with my pi model B???
after lsusb it detects and shows the easycap. i've mplayer installed and as well as ffmpeg.
how do i capture the video????

crashlaker
Posts: 2
Joined: Fri May 02, 2014 10:03 pm

Re: EasyCap module compiling.

Thu May 15, 2014 12:31 am

Hello guys.
I was just think of doing everything you guys went through. so..
Since it's been over 1 year that no one posts on this thread can you help me figure out some issues?

1 - Did that USB bus problem get solved?
2 - Why does using class 10 SD card enhances the video image? Does the data stream really goes through the SD before going to screen?
3 - Since you guys are having problem with just 1 video input. Is it worth trying to use RPI? Because what I'm trying to achieve is 2 Easycap fully running (8 video inputs) at an average framerate and dimension. If this is not possible what's the maximum number of RCA inputs RPI is able to handle?
4 - What do you recommend as other solutions to this problem?

Return to “C/C++”