openFrameworks-RaspberryPi / openFrameworks

This repo has migrated into the openFramworks core! Please go to http://github.com/openFrameworks/openFrameworks for the latest!
http://github.com/openFrameworks/openFrameworks
Other
104 stars 11 forks source link

videoGrabber is glitchy #95

Closed danzeeeman closed 11 years ago

danzeeeman commented 11 years ago

please see the video below to understand what is going on. I'm using the eye toy for the playstation 2 and I'm getting a ton of glitchy frames. Any ideas?

https://vimeo.com/56434557

jvcleave commented 11 years ago

does overclocking make any difference?

what is your gstreamer pipeline?

danzeeeman commented 11 years ago

I dropped it down to stock to double check that and I'm still getting the same glitch.

gstreamer pipeline: v4l2src name=video_source device=/dev/video0 ! video/x-raw-rgb,width=320,height=240 ! ffmpegcolorspace ! appsink name=ofappsink caps="video/x-raw-rgb, depth=24, bpp=24, endianness=4321, red_mask=0xff0000, green_mask=0x00ff00, blue_mask=0x0000ff, alpha_mask=0x000000ff, width=320, height=240"

On Sat, Dec 29, 2012 at 1:25 AM, Jason Van Cleave notifications@github.comwrote:

does overclocking make any difference?

what is your gstreamer pipeline?

— Reply to this email directly or view it on GitHubhttps://github.com/openFrameworks-RaspberryPi/openFrameworks/issues/95#issuecomment-11749540.

"I believe in science. Unlike mathematical theorems, scientific results can't be proved. They can only be tested again and again, until only a fool would not believe them.

I cannot prove that electrons exist, but I believe fervently in their existence. And if you don't believe in them, I have a high voltage cattle prod I'm willing to apply as an argument on their behalf. Electrons speak for themselves."

-- Seth Lloyd: Quantum Mechanical Engineer, MIT

/.

jvcleave commented 11 years ago

can you try this app in my comment here? https://github.com/openFrameworks-RaspberryPi/openFrameworks/issues/28#issuecomment-11339049

danzeeeman commented 11 years ago

still glitchy. :(

On Sat, Dec 29, 2012 at 1:37 AM, Jason Van Cleave notifications@github.comwrote:

can you try this app in my comment here?

28https://github.com/openFrameworks-RaspberryPi/openFrameworks/issues/28#issuecomment-11339049

— Reply to this email directly or view it on GitHubhttps://github.com/openFrameworks-RaspberryPi/openFrameworks/issues/95#issuecomment-11749611.

"I believe in science. Unlike mathematical theorems, scientific results can't be proved. They can only be tested again and again, until only a fool would not believe them.

I cannot prove that electrons exist, but I believe fervently in their existence. And if you don't believe in them, I have a high voltage cattle prod I'm willing to apply as an argument on their behalf. Electrons speak for themselves."

-- Seth Lloyd: Quantum Mechanical Engineer, MIT

/.

jvcleave commented 11 years ago

any difference if you remove ! ffmpegcolorspace

danzeeeman commented 11 years ago

that blew everything up. So I think I stumbled upon a bug with the pi. Looks like there is a very limited list of known working webcams.

danzeeeman commented 11 years ago

I should add this to the wiki http://elinux.org/RPi_VerifiedPeripherals

danzeeeman commented 11 years ago

here is a nice bit about how to get logs for USB devices. I'm gonna try this when I get home and see what the problem is.

rm /var/log/kern.log /var/log/kern.log.1 /var/log/kern.log.*.gz shutdown -r now

make the error happen <--run your oF App

lsusb -v | grep -iP "Transfer Type.(Interrupt|Isochronous)" | wc -l cat /var/log/kern.log | grep -iP "fail|warn|error" | perl -p -e 's/^[^]\n]]//g;s/(warn_alloc_failed: )[0-9]+/$1/g' | sort -u; dmesg

jvcleave commented 11 years ago

when I was troubleshooting I was comparing my output with mplayer which worked well out of the box

danzeeeman commented 11 years ago

I tired mjpeg-streamer and mplayer both showed the same glitchy behavior with the PS2 EyeToy and the Pi. I tried another cheap webcam and came up empty too. It just didn't show any output at all

On the http://elinux.org/ wiki they state:

"Shortly after the Raspberry Pi was released it was confirmed that there were a number of issues with the Linux USB driver for the SMSC95xx chip. These included problems with USB 1.x peripherals that use split transactions, a fixed number of channels (causing problems with Kinect) and the way the ARM processor handles the SMSC95xx interrupts. [1] [2] A large number of fixes were included in the 2012-08-19-Wheezy-raspbian Linux image."

arturoc commented 11 years ago

yes that seems like a problem with the sync of the usb, probably nothing we can do about it, some times i've fixed things like this by reading as fast as possible some frames before beginning the app: set the camera to use no texture, update the camera inside setup in a loop for some frames then set the texture on again