I'm a little stumped at the moment, so was wondering if anyone else with mmal programming experience could comment on the following? Or if anyone knows about recent mmal, kernel or Pi firmware changes that might affect my app? Any info would be most gratefully received.
The mmal configuration that shows the problem is this:
Code: Select all
camera: [video port output] -> splitter: [output 0] -> JPEG encoder: [output] -> callback [output 1] -> resize: [output] -> callback
What I see in the application are callbacks for both the resize and JPEG encoder happening, but after a few iterations the app stops getting callbacks for the JPEG encoder port. Because of the way the app is written, it then hangs waiting for buffers to appear in that queue (there's a separate timeout watchdog running elsewhere that eventually wakes up to make the app fail gracefully). According to the logging in my code, buffer handling has proceeded as expected (i.e. all buffers returned to ports, no leaks).
If the app is shutdown after this point, it runs through code to shut down mmal (disable ports, disable and destroy components, etc) and at this point I suddenly get callbacks for buffers from the JPEG encoder - but it's too late by then.
On earlier versions of Raspbian/Pi firmware, this model works absolutely fine (e.g. Linux version 3.6.11+ #557 PREEMPT Wed Oct 2 18:49:09 BST 2013).
The problem seems to be related to the JPEG encoder component - if the mmal configuration is modified to remove it and just attach a callback to output 0 of the splitter, it works fine on the latest Raspbian & firmware.