wibble82
Posts: 66
Joined: Sun Jan 27, 2013 5:06 pm
Contact: Website

stuck getting omx to shutdown/startup with camera component

Sat Nov 09, 2013 11:15 am

Hi

Just posted this in gfx forum, but wasn't sure if it was better placed in camera section...

I'm writing some code to try and access the camera component. I've taken a fair bit from various sources and it almost works. My current and final issue is that open mx seems to lock up (normally inside OMX_GetState, but I think it happens at other points), almost consistently on my 3rd run of the application. Once this has happened the program can't be shutdown (even calling abort from the signal handler), and the system won't reboot even if I type sudo reboot in a different console.

The only clue I can think of is that on shutting down OMX in the prior runs, I hit this error in shutting down the camera component:
OMX error: Failed to switch state of the camera component to loaded: 0x80001000 insufficient resource
S

It could be irrelevant, but I could imagine if the camera system hadn't properly shutdown it would cause odd behaviour on future runs of the application when it started trying to use OMX again. Problem is, I'm totally stuck diagnosing either side of the problem.

Anyone any thoughts? tips? Any help at all?

Code all here if you fancy a look: http://www.cheerfulprogrammer.com/downloads/gpucam.zip

thanks

-Chris

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24956
Joined: Sat Jul 30, 2011 7:41 pm

Re: stuck getting omx to shutdown/startup with camera compon

Sat Nov 09, 2013 12:46 pm

I think you are leaking memory in the GPU, probably not shutting down correctly. It eventually runs out of memory and dies a horrible death.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

wibble82
Posts: 66
Joined: Sun Jan 27, 2013 5:06 pm
Contact: Website

Re: stuck getting omx to shutdown/startup with camera compon

Sat Nov 09, 2013 2:40 pm

Yeah that's what I was thinking - problem is, how do I track that kind of issue down. My omx use has been mostly guesswork, so I'm not really clear in how I should be using it.

Or I could just stop being impatient and wait for the mmal version of write to texture I guess :)

Return to “Camera board”