I have an issue I have been tracking down for weeks and I'm finally stuck. During a recording, once every ten minutes to an hour or so, something locks up and I lose exactly one second of video. This is a real show-stopper for our product. I've eliminated it being my application logic error, deadlock/priority inversion, kernel scheduler, rogue driver, etc. and found it is in the DSPLINK, specifically the Comm_get() function that locks up. The timestamps show this takes 900ms:
Mar 13 15:58:26 ts100v user.notice TS100KERNEL: @478,233,623us: [+0 T:0x4f531490 S:0x4f53085c] OC - Comm_get> Enter(queue=0x10003, msg=0x4f530914, timeout=-1)
<prints from app on the ARM here>
Mar 13 15:58:27 ts100v user.notice TS100KERNEL: @479,122,916us: [+0 T:0x4dd31490 S:0x4dd30794] OC - Comm_get> MSGQ_get() status=0x8000, return (0)
I also compiled the demo project supplied from another forum post called "encode1080p" into our CMAKE environment using g++ and this code skips as well. So that makes me suspect it is my memory map or codec server configuration. I am using the out of the box codec server settings. I tried generating a new codec server and memory map using the wizard and found there are many settings which are different from the stock version.
Any recommendation on what to try?
In Comm_dsplink.c, the function MSGQ_get() looks to be the culprit. I found a number of settings which could affect this, and I tried lowering ti_sdo_ce_ipc_dsplink_Ipc_maxTimeout but this led to a unrecoverable error. Could I increase the following variables?:
/* size of the communication message */
UInt32 Comm_MSGSIZE = 4096;
/* number of Comm_MSGSIZE-sized messages in the system */
UInt32 Comm_NUMMSGS = 64;
/* configure number of retries Comm_locate should do before giving up */
UInt32 Comm_LOCATERETRIES = 20;
Or possibly DSP LINK or the DSP alg runs our of scratch memory?
I tried to recompile the codec server with some changes, however it resulted in encode calls taking 200ms! (skipping 6 frames every time, so something is not right) The changes I made were increasing DDRALGHEAP_SIZE and adding Server.stackSizePad = 9000 to server.cfg. Also, the stock main.c file calls makeTC0LowestPriority(). Is this reccomended?
Here is a printout of the memory config. (Note that in this case I am using 512MB RAM instead of 256MB. I was getting the second skips with the default EVM memory map with linux having 76MB memory as well)
DDRALGHEAP: 0x97200000 size: 0x8800000 used: 0x845ac0, max free block: 0x7fba258
DDR2: base: 0x9fae8bc5 size: 0x40000 used: 0x978, max free block: 0x3f688
IRAM: base: 0x11818000 size: 0x10000 used: 0x10000, max free block: 0x0
My environment:
DM6467T
dvsdk_3_10_00_19
dmai_2_10_00_12
cs2dm6467_1_00_00_10 (with h264fhdvenc and aachlenc installed)
codec_engine_2_25_05_16
dsplink_linux_1_64
I can provide full log file with DMAI_DEBUG=1 CE_DEBUG=2 or other information if necessary.
Any insight would be much appreciated! Thanks!
Brad