Page 1 of 2

EasyCap module compiling.

Posted: Sun Sep 30, 2012 7:53 am
by piotr-e
Hi,
I clone by git source of raspbian and I find source for easycap:
Image

...and I would like to compile it.

How does compile easycap from staging direcory of raspbian linux source :?: :?: :?:

Re: EasyCap module compiling.

Posted: Mon Oct 01, 2012 5:01 am
by piotr-e
I compiled kernel and I launched MPlayer with command:

Code: Select all

mplayer tv:// -tv driver=v4l2:norm=PAL_BGHIN:width=640:height=480:outfmt=uyvy:device=/dev/video0:input=1:fps=25 -vo x11 -msglevel all=6
... but EasyCap isn't work. I see only green screen. :(
Image

Image
Dmesg command shows:
Image

Re: EasyCap module compiling.

Posted: Wed Oct 03, 2012 11:37 am
by yaMatt
Sorry to revive an old post but we were just discussing this problem in the IRC.

First of all, how did you get the kernel module working? Could you go in to more detail please.

Second of all, does your Pi have enough power supplied to it? I.e. is it running from a phone charger or from a USB port off a computer?

Re: EasyCap module compiling.

Posted: Sat Oct 06, 2012 12:26 am
by pete910
Try a different input number as daft as that sounds, or keep switching ports on the camera connection. :idea:

Have one running for my zoneminder install ATM. until camsecure pull there finger out and send me one of those 8 channel cards i ordered 3+ weeks ago :cry:

What command did you pass to compile the module?

Re: EasyCap module compiling.

Posted: Thu Oct 11, 2012 5:22 pm
by piotr-e
yaMatt wrote:Sorry to revive an old post but we were just discussing this problem in the IRC.

First of all, how did you get the kernel module working? Could you go in to more detail please.

Second of all, does your Pi have enough power supplied to it? I.e. is it running from a phone charger or from a USB port off a computer?
Hi,

I tried driver for easycap from here:
https://github.com/ezequielgarcia/stk1160-standalone

Raspberry Pi has too slow cpu for for high-resolution. In my opinion easycap will work for 320x240.

PS. After driver compile you must remove AC97 support and you must reduce number of buffers. Some details you can find here:
https://github.com/ezequielgarcia/stk11 ... e/issues/8

Re: EasyCap module compiling.

Posted: Thu Oct 11, 2012 5:54 pm
by piotr-e
pete910 wrote:...

What command did you pass to compile the module?
You must compile all kernel - it is about 7-12h.
...but it doesn't work after compilation, I see only green screen. :(
I tried also reduce of number of buffers, but still doesn't work.

Re: EasyCap module compiling.

Posted: Tue Oct 16, 2012 6:48 am
by piotr-e
Here:
https://github.com/piotr-e/stk1160-raspberrypi
...you can find stk1160 for rasperrypi, but it works such as on some pictures below.

700MHz
Image

1GHz
Image

Compare 700MHz vs 1GHz
Image

Propably it is problem with usb driver (or chip working badly?). I tried switch on CONFIG_DMA_NONCOHERENT option in kernel, but this option isn't exists for raspbian.

How resolve this problem?

Re: EasyCap module compiling.

Posted: Tue Oct 16, 2012 7:28 pm
by fbutler
piotr-e wrote: I tried switch on CONFIG_DMA_NONCOHERENT option in kernel, but this option isn't exists for raspbian.

How resolve this problem?
Having googled CONFIG_DMA_NONCOHERENT it looks to me like it is specific to MIPs processors. As such I don't believe it is used for the Raspberry Pi.

With the same modifications as in your driver, and using a UK TV input, I am seeing a similar video pattern as you are with colour.

The command I am using is:

Code: Select all

 mplayer tv:// -tv driver=v4l2:norm=PAL-I:width=720:height=576:outfmt=uyvy:device=/dev/video0:input=0:fps=25

Re: EasyCap module compiling.

Posted: Wed Oct 17, 2012 7:16 am
by piotr-e
fbutler wrote:
piotr-e wrote: I tried switch on CONFIG_DMA_NONCOHERENT option in kernel, but this option isn't exists for raspbian.

How resolve this problem?
Having googled CONFIG_DMA_NONCOHERENT it looks to me like it is specific to MIPs processors. As such I don't believe it is used for the Raspberry Pi.

With the same modifications as in your driver, and using a UK TV input, I am seeing a similar video pattern as you are with colour.

The command I am using is:

Code: Select all

 mplayer tv:// -tv driver=v4l2:norm=PAL-I:width=720:height=576:outfmt=uyvy:device=/dev/video0:input=0:fps=25
What SD card have you?
How fast?

I analyzed work of EasyCap on the Raspberry Pi and I prepared diagram:

EasyCap ->(19,7 MBytes/sec)-> Stk1160 driver ->(writing -only around 5 MBytes/sec for my SD card)->Video0 file on SD Card ->(reading-only around 5 MBytes/sec)-> MPlayer ->(19,7 MBytes/sec)-> X11 window

So, is only SD card bottleneck?

If somebody have fast SD card(20MBytes/sec min) and EasyCap then can you test this driver:

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

Re: EasyCap module compiling.

Posted: Wed Oct 17, 2012 7:53 am
by fbutler
piotr-e wrote: What SD card have you?
How fast?
I am using a Samsung SP8GA.

The technical specification for it is here:

http://www.samsung.com/latin_en/consume ... GA/US-spec

Using the SD performance tests from here:

http://elinux.org/RPi_Performance#SD_card

I am seeing the following:

Code: Select all

pi@raspberrypi ~ $ dd if=/dev/zero of=~/test.tmp bs=500K count=1024
1024+0 records in
1024+0 records out
524288000 bytes (524 MB) copied, 29.7213 s, 17.6 MB/s
pi@raspberrypi ~ $ dd if=~/test.tmp of=/dev/null bs=500K count=1024
1024+0 records in
1024+0 records out
524288000 bytes (524 MB) copied, 27.0925 s, 19.4 MB/s

Re: EasyCap module compiling.

Posted: Wed Oct 17, 2012 8:47 am
by piotr-e
fbutler wrote:

Code: Select all

524288000 bytes (524 MB) copied, 29.7213 s, 17.6 MB/s
524288000 bytes (524 MB) copied, 27.0925 s, 19.4 MB/s
You have very fast SD. :shock:
Can you insert print screen of easycap capture window to next post?

Re: EasyCap module compiling.

Posted: Wed Oct 17, 2012 10:32 am
by fbutler
piotr-e wrote:You have very fast SD. :shock:
Can you insert print screen of easycap capture window to next post?
Yeah, it's quite a good card. :)
Here's a screenshot:

Re: EasyCap module compiling.

Posted: Wed Oct 17, 2012 11:10 am
by fbutler
piotr-e wrote:Can you insert print screen of easycap capture window to next post?
Here's a link to a bigger image:
Image

In case the image link doesn't work the image is at: http://www.trans-omni.co.uk/pi/STK1160/MPlayer_002.png

Re: EasyCap module compiling.

Posted: Wed Oct 17, 2012 6:30 pm
by piotr-e
@fbutler can you add option sdhci-bcm2708.sync_after_dma=0 to /boot/cmdline.txt file?
...and reboot.

PS. Backing up sdcard before.

PS2. and run easycap

Re: EasyCap module compiling.

Posted: Wed Oct 17, 2012 7:23 pm
by fbutler
piotr-e wrote:@fbutler can you add option sdhci-bcm2708.sync_after_dma=0 to /boot/cmdline.txt file?
...and reboot.

PS. Backing up sdcard before.

PS2. and run easycap
I've done it but I don't notice any perceptible difference in the output

I also did:

Code: Select all

pi@raspberrypi ~ $ dd if=/dev/video0 of=/dev/null bs=500K count=1024
dd: warning: partial read (207188 bytes); suggest iflag=fullblock
512+512 records in
512+512 records out
364531030 bytes (365 MB) copied, 20.5877 s, 17.7 MB/s
and

Code: Select all

pi@raspberrypi ~ $ dd iflag=fullblock if=/dev/video0 of=/dev/null bs=500K count=1024
1024+0 records in
1024+0 records out
524288000 bytes (524 MB) copied, 29.2278 s, 17.9 MB/s
I'm becoming convinced that it is being affected by USB packet loss.

Re: EasyCap module compiling.

Posted: Wed Oct 17, 2012 9:14 pm
by piotr-e
I have the same result. :(

Re: EasyCap module compiling.

Posted: Thu Oct 18, 2012 11:10 am
by piotr-e
Some information:
https://github.com/raspberrypi/linux/issues/137

Short:
It is USB driver problem. :(

Re: EasyCap module compiling.

Posted: Thu Oct 18, 2012 1:26 pm
by fbutler
piotr-e wrote:Some information:
https://github.com/raspberrypi/linux/issues/137

Short:
It is USB driver problem. :(
Yeah, the latest update on the USB issues is given in this posting:

http://www.raspberrypi.org/phpBB3/viewt ... 18#p196918

Re: EasyCap module compiling.

Posted: Tue Oct 23, 2012 10:31 am
by nikita_d
Hi do you help me with a little problem?
I have a raspberry pi model b (256mb Ram), and easy cap (i dont know about version easycap(dc60+ or ++), but i know its based on chip's stk1160-usb contrl and silan sc8113-video contrl .

When i install driver to stk1160, from github repo link, on raspbian hard-float and soft-float .He issues error: make ****/lib/modules/3.1.9+/build: No such file or directory .stop
make ****/lib/modules/3.2.3+/build: No such file or directory .stop

how can I solve this problem, I apologize for any grammatical, lexical error?

"easycap" needed for the organization of video capture with the broadcast on the Internet.

Re: EasyCap module compiling.

Posted: Tue Oct 23, 2012 5:12 pm
by fbutler
nikita_d wrote: When i install driver to stk1160, from github repo link, on raspbian hard-float and soft-float .He issues error: make ****/lib/modules/3.1.9+/build: No such file or directory .stop
make ****/lib/modules/3.2.3+/build: No such file or directory .stop

how can I solve this problem, I apologize for any grammatical, lexical error?

"easycap" needed for the organization of video capture with the broadcast on the Internet.
You will need to compile the kernel before you attempt to build the driver code. Instructions on how to build the kernel are here: http://elinux.org/Rpi_kernel_compilation

However even when you get the STK1160 driver compiled and working the video capture will still not work correctly as there are currently issues with the Pi and USB, especially with isonchronous high speed transfers. It may be some time before a fix is found for these issues. See the latest two updates
from the engineer working on the USB issues here:

http://www.raspberrypi.org/phpBB3/viewt ... 18#p196918
and here:
http://www.raspberrypi.org/phpBB3/viewt ... 09#p198809

Re: EasyCap module compiling.

Posted: Fri Oct 26, 2012 12:37 pm
by nikita_d
Hello again. As i asume when we boot raspbian(wheezy) the lastest version from off site, it's already has a 3.2.27+ kernel. I found some same issues in the web. Using guide by shig from http://www.raspberrypi.org/phpBB3/viewt ... 71&t=17666 (second post) i symlinked lib/modules/../build to latest headers and sources. 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

Re: EasyCap module compiling.

Posted: Fri Oct 26, 2012 12:55 pm
by fbutler
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.

Re: EasyCap module compiling.

Posted: Fri Oct 26, 2012 2:36 pm
by nikita_d
okay driver compiled correctly, but i still cannot see the device in /dev directory.

code for dmesg | grep registered command

[ 0.936873] usbcore: registered new interface driver usbfs
[ 0.942496] usbcore: registered new interface driver hub
[ 0.948126] usbcore: registered new device driver usb
[ 1.011419] TCP reno registered
[ 1.204702] FS-Cache: Netfs 'nfs' registered for caching
[ 1.216792] io scheduler noop registered
[ 1.220901] io scheduler deadline registered (default)
[ 1.226208] io scheduler cfq registered
[ 1.312135] usbcore: registered new interface driver smsc95xx
[ 1.325605] usbcore: registered new interface driver cdc_ncm
[ 1.802881] dwc_otg bcm2708_usb: new USB bus registered, assigned bus number 1
[ 1.885819] usbcore: registered new interface driver uas
[ 1.900610] usbcore: registered new interface driver usb-storage
[ 1.908785] USB Mass Storage support registered.
[ 1.915748] usbcore: registered new interface driver libusual
[ 2.025629] usbcore: registered new interface driver usbhid
[ 2.048216] TCP cubic registered
[ 2.119272] registered taskstats version 1
[ 6.401770] usbcore: registered new interface driver snd-usb-audio

Can u recommend me next step?

Re: EasyCap module compiling.

Posted: Fri Oct 26, 2012 2:54 pm
by fbutler
nikita_d wrote:okay driver compiled correctly, but i still cannot see the device in /dev directory.
Can u recommend me next step?
Did you do the following after doing the make?

Code: Select all

sudo make install
sudo depmod -a
If you did then try removing and re-plugging in the stk1160 device and then do another dmesg to see if it has now been registered

Re: EasyCap module compiling.

Posted: Fri Oct 26, 2012 4:16 pm
by nikita_d
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?