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

All examples hangs after about 20 sec. completely #143

Closed K0F closed 11 years ago

K0F commented 11 years ago

First of all thanks for great work! I have got openFrameworks running pretty out of box on Raspi type B. The problem I had encountered is that all examples that actually runs just hangs completely about 20 seconds after run.. this is weird.. and hard to debug, because there is no error and only way how to restore Pi is to plug-off power supply.

Just to notice details, I am using Pi without any input.. controlling via ssh session with composite (RCA) analog screen attached.. I don't know if it is important but.. I am stopping applications with CTRL + C, but ssh session freezes even before I can stop it.. in some cases it is possible to escape five seconds after run, then App is running next 15 seconds and hangs.. I am unable to connect with another session afterwards.. so hard reboot is the only option.

Thanks for any help.. Krystof

jvcleave commented 11 years ago

What is your memory_split currently? Are you overclocking? What is the resolution of your display?

It's probably best to focus on the simple apps. Can you try raspberrypi_hello_world_gles2 and see if you get the same issue?

Often while debugging I log into a separate ssh session and run top before running any OF apps. This way I can see if I can see memory skyrocketing or - super high CPU, etc

K0F commented 11 years ago

Ok, I will try to run top first to watch if there are some cpu throttling.

memory split: 448 / 64 (gpu) overclock: 800 mhz, +0 voltage resolution: PAL 720x576 interlaced

Surprisingly apps also runs without X.. is it framebuffer or it is running X for that separate process?

Thanks, k.

K0F commented 11 years ago

Ok after testing.. raspberrypi_hello_world_gles2 runs actually quite well (bit yellow color shift?).. CPU load about 9%, it holds even running.. but it locks both sessions after a few seconds (one running top another app).. strange.

bakercp commented 11 years ago

@K0F on RPi, we are skipping X11 and creating our own EGL Context using dispmanx. So, you shouldn't see any X11 stuff on a Pi (unless you have installed the alpha X11 drivers and modified the core oF code :) ).

Take a look at ofAppEGLWindow for more.

https://github.com/openFrameworks-RaspberryPi/openFrameworks/blob/develop-raspberrypi/libs/openFrameworks/app/ofAppEGLWindow.h https://github.com/openFrameworks-RaspberryPi/openFrameworks/blob/develop-raspberrypi/libs/openFrameworks/app/ofAppEGLWindow.cpp

Is your memory split only giving 64MB to the GPU? Either way, I'd even the split out a little bit, 256/256 for testing might be a better option until you figure out the problem.

jvcleave commented 11 years ago

I am curious of if you it is any more stable with a lower resolution (like 720x576) set here: https://github.com/openFrameworks-RaspberryPi/openFrameworks/blob/develop-raspberrypi/apps/devApps/raspberrypi_hello_world_gles2/src/main.cpp#L11

K0F commented 11 years ago

I see, no that is certainly not my case.. )) Everything I use is pretty standard right now.

Ok thanks for suggestion, I set the split of memory even.. but well, problems still persist, app hangs after about 30 seconds, ssh session is dead almost immediately after run.

I am trying to think how to find out what is going on.. are there any useful system logs for EGL context?

K0F commented 11 years ago

@jvcleave ..that was my idea as well.. I had change it to fit my resolution, same problem.

K0F commented 11 years ago

But actually, there is some proportion between resolution and time when Pi hangs.. app is running as expected at 320x240.. I have connected mouse.. it prints out mouse coordinates and displays red cross at this low resolution.. At 640x480 mouse hangs just about after 18 frames rendered.. rendering continues but PI has no more responses.. it is dead, even mouse powers off, no ICMP ping response, just brick, plugging of the power is the only way out.

K0F commented 11 years ago

Random idea.. could be hangs caused by low power supply to arm as gles rendering drains more power? Current amp @ 5 volts is 2000mA. (???)

bakercp commented 11 years ago

It could be actually ...

On Mar 11, 2013, at 7:21 AM, "Kryštof Pešek" notifications@github.com wrote:

Random idea.. could be hangs caused by low power supply to arm as gles rendering drains more power? Current amp @ 5 volts is 2000mA. (???)

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

K0F commented 11 years ago

Assumption confirmed! Giving PI 2500mA results perfectly stable behaviour @ 1024x768 via HDMI. Thank you guys for great work on software.. it just needs enough power. )) ..whole thread may help someone to debug this though.

Best! k.

bakercp commented 11 years ago

That is a great discovery @K0F. It was mentioned in our https://github.com/openFrameworks-RaspberryPi/openFrameworks/wiki/Raspberry-Pi-Troubleshooting as a possibility, but I would have never guessed that was the problem without your investigation. Thanks!

bakercp commented 11 years ago

P.S. I run mine fine with a 1000mA power source (from a phone charger), so clearly power supplies can vary a lot from their rated max current.

K0F commented 11 years ago

..I can't measure that exactly now, the specification on box says 2500mA.. from discussions I have red, it seems almost too much to me, but to say, you never know.. especially in case of cheaper adapters what is their actual current.

Good, I am glad if this can help someone ;)