Using ti-dvsdk_dm365-evm_4_02_00_06 on DM368, MP3 encoder dm365_mp3enc_3_5_00. Audio sample rate is 48000Hz stereo, mp3 bit rate is 192kbps, input buffer size 4608, output buffer size 2048.
Very intermittently, a SIGSEGV will be raised during Aenc1_process function call. Attempting to print stack trace from the signal handler only shows this:
0x1bf48 /usr/bin/myapp() [0x1bf48]
0x404137b0 /lib/libc.so.6(__default_sa_restorer_v2+0) [0x404137b0]
Any suggestions on how to debug this?
Edit: I found that the gcc option -mapcs-frame should be used when compiling to walk past default_sa_restorer, but mp3_enc_prod.a must not have that.
Edit: More info from using sigaction to handle the segfault:
trap_no=e error_code=17 oldmask=0
r0=4059f000 r1=ffffffff r2=49dd7440 r3=4015d034 r4=404f9494
r5=00000000 r6=404f9494 r7=00000000 r8=00000001 r9=40541240 r10=4015d034
fp=4015d044 ip=40541274 sp=49dd73a8 lr=00106a14 pc=0010637c cpsr=80000010
The pc points to ia_mp3_encoder_table_choose+0x40
106378: e59a0008 ldr r0, [sl, #8]
10637c: e7906101 ldr r6, [r0, r1, lsl #2]
The lr points to ia_mp3_encoder_count_bits+0x440
106a10: ebfffe4d bl 10634c <ia_mp3_encoder_table_choose>
106a14: e5c60016 strb r0, [r6, #22]