Posts: 4
Joined: Thu Oct 12, 2017 10:25 am

MMAL callback problems using own code

Thu Oct 12, 2017 10:45 am

Sorry if the title or section is not the right one is not very good how to define it.
I am currently working on a project with Ultibo.
I am trying to access the camera to be able to process images and then save them.

For this I am using the Userland "raspicam" library, the difference is that I have generated a "Wrapper" that takes certain functions of raspiCamControl.c.

That is the code: ... s/raspicam
(raspiCamWrapper.c and raspiCamWrapper.h)
The module is doing so so later using Ultibo can do a Wrapper in Free Pascal, but this may not be the most important now.

To compile I've simply added in the raspicam CMakelist.txt one more library ( ... eLists.txt line 28).

The code in linux works perfectly. But when I compile it in arm-none (no operating system), it compiles perfectly, the problem comes once I try to run it on the board. I'm waiting in a semaphore (line 361), it seems that no time enters the callback line 258 (_RaspiCam_buffer_callback).
Ultibo have the support with VC4, MMAL, etc, and have a example working with raspistill, the problem is that can not process the image only save.

It is strange because the only reason I have found of why it does not work is because it does not enter correctly in the callback and when not being able to enter, can not change the state of the semaphore.

Anyone know if this is for some reason? Is this code wrong? Have I forgotten any part? When should the callback be executed, normally?
It would be very interesting to be able to use the camera from Ultibo, we would have the possibility of processing images without having an linux operating system.

User avatar
Posts: 161
Joined: Wed Sep 30, 2015 10:29 am
Location: Australia
Contact: Website

Re: MMAL callback problems using own code

Tue Oct 17, 2017 3:28 am

The example provided by totolia helped to narrow down a memory overwrite bug in the Ultibo VCHIQ driver when using buffers from non contiguous physical memory and we've now updated the driver to include a fix.

With this fix in place totolia's camera code works exactly the same in Ultibo as it does in Linux :D | Make something amazing

Threads, multi-core, OpenGL, Camera, FAT, NTFS, TCP/IP, USB and more in 3MB with 2 second boot!

Return to “Camera board”