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

EasyCap module compiling.

Sun Sep 30, 2012 7:53 am

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 :?: :?: :?:
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.

Mon Oct 01, 2012 5:01 am

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
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.

yaMatt
Posts: 1
Joined: Fri Jul 20, 2012 7:10 pm

Re: EasyCap module compiling.

Wed Oct 03, 2012 11:37 am

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?

pete910
Posts: 8
Joined: Sat Oct 06, 2012 12:03 am

Re: EasyCap module compiling.

Sat Oct 06, 2012 12:26 am

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?

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

Re: EasyCap module compiling.

Thu Oct 11, 2012 5:22 pm

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
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.

Thu Oct 11, 2012 5:54 pm

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.
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.

Tue Oct 16, 2012 6:48 am

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?
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
fbutler
Posts: 302
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England

Re: EasyCap module compiling.

Tue Oct 16, 2012 7:28 pm

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

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

Re: EasyCap module compiling.

Wed Oct 17, 2012 7:16 am

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
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
fbutler
Posts: 302
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England

Re: EasyCap module compiling.

Wed Oct 17, 2012 7:53 am

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

[email protected] ~ $ 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
[email protected] ~ $ 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

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

Re: EasyCap module compiling.

Wed Oct 17, 2012 8:47 am

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?
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
fbutler
Posts: 302
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England

Re: EasyCap module compiling.

Wed Oct 17, 2012 10:32 am

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:
Attachments
MPlayer_002.gif
MPlayer_002.gif (56.95 KiB) Viewed 18445 times

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

Re: EasyCap module compiling.

Wed Oct 17, 2012 11:10 am

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

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

Re: EasyCap module compiling.

Wed Oct 17, 2012 6:30 pm

@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
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
fbutler
Posts: 302
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England

Re: EasyCap module compiling.

Wed Oct 17, 2012 7:23 pm

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

[email protected] ~ $ 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

[email protected] ~ $ 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.

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

Re: EasyCap module compiling.

Wed Oct 17, 2012 9:14 pm

I have the same result. :(
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.

Thu Oct 18, 2012 11:10 am

Some information:
https://github.com/raspberrypi/linux/issues/137

Short:
It is USB driver problem. :(
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
fbutler
Posts: 302
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England

Re: EasyCap module compiling.

Thu Oct 18, 2012 1:26 pm

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

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

Re: EasyCap module compiling.

Tue Oct 23, 2012 10:31 am

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.

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

Re: EasyCap module compiling.

Tue Oct 23, 2012 5:12 pm

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

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

Re: EasyCap module compiling.

Fri Oct 26, 2012 12:37 pm

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

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

Re: EasyCap module compiling.

Fri Oct 26, 2012 12:55 pm

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.

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

Re: EasyCap module compiling.

Fri Oct 26, 2012 2:36 pm

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?

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

Re: EasyCap module compiling.

Fri Oct 26, 2012 2:54 pm

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

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

Re: EasyCap module compiling.

Fri Oct 26, 2012 4:16 pm

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?

Return to “C/C++”