Hello,
I am using the
- Mistral's DM3730 Evaulation kit,
- TI_Android_GingerBread_2_3_4_DevKit_2_1 (Build date: 09232011, http://software-dl.ti.com/dsps/dsps_public_sw/sdo_tii/TI_Android_DevKit/TI_Android_GingerBread_2_3_4_DevKit_2_1/index_FDS.html)
and trying to preview the frames captured from camISP interface.
I can see the camera stream output on my LCD screen by clicking on the Camera icon in GingerBread's applications folder. However, video streaming has some artifacts:
1. some frames are missed
2. frequently, view is divided into 2 or more horizontal sub-views and it seems that they belong to different frames:
|------------------------------|
| |
| |
|------------------------------|
| |
|------------------------------|
Upon seeing these I immediately thought that my board couldn't keep with the streaming pace and checked the CPU usage: I saw that "mediaserver" process used up all the remaing CPU power. I further looked for the cause leading the high CPU usage and I realized that it was the frame buffer memory copy operations taking place in the Android Camera HAL.
Android Camera HAL copies frames from camera capture driver into its own buffers, and it does this by passing "MemoryHeapBase" and "MemoryBase" objects into the standart memcpy() function. This copy operation should not use so much system resources however it poses as the bottleneck for my case: copying 30 200Kbyte frames in a second takes more than %50 of my CPU usage.
In the current implementation for TI GingerBread 2.3.4 version 2.1 Android Camera HAL; "MemoryHeapBase" and "MemoryBase" objects use scattered virtual memory and I suspect this is why my copy operations are extremely slow. I don't have Android experience but I feel like I should use "MemoryHeapBase" and "MemoryBase" objects for memory operations because they can be used easily passing the shared memory to the user application (Camera.apk in my case) through the Android Binder. So, feeling obliged to use these framework I decided to use "MemoryHeapPmem" for contiguous physical memory.
First of all, I could not find any documents or examples how to use "pmem", so I tried to figure out:
- I created to pmem blocks registering the driver and later opening them in the Android Camera HAL.
- I performed random copy operations from one block to another, mostly failing with (external abort) (non-linefetch 0x1018) (NULL pointer exception). I guess these errors are all related with using the wrong physical address. When I use a physical address of my SDRAM then the copy operation performs with no exception but this time it happens much slower than the virtual memory copy case.
Any ideas what might be going wrong here?
Thanks in advance
Inanc