We have an application running on ARM (Critex-A8) of DM3730 and an algorithm executing remotely on the DSP under the Codec Engine (2.26.02.11) framework. Under normal execution the application runs for a preset amount time and then deletes the algorithm, does Engine_close and exits. We are able to do multiple run of the application in this way.
However if the application terminates abruptly (say through Ctrl-c) and thus unable to execute the normal shutdown of DSP, we sometime run into situation whereby we are unable to re-run the application. We get following error
@1,158,020us: [+0 T:0x41a93490] OP - doCmd> Enter (cmdId=1, proc=0x62840)
@1,158,081us: [+0 T:0x41a93490] ti.sdo.ce.osal.Sem - Entered Sem_post> sem[0x621c0]
@1,158,234us: [+0 T:0x40c49490] ti.sdo.ce.osal.Sem - Leaving Sem_pend> sem[0x621c0] status[0]
@1,158,295us: [+0 T:0x40c49490] OP - getCmd_d> Exit (result=1)
@1,158,356us: [+0 T:0x40c49490] OP - Processor_create_d> Enter(proc=0x62840)
@1,158,417us: [+0 T:0x40c49490] ti.sdo.ce.ipc.Power - Power_on> Enter(handle=0x6285c)
@1,158,448us: [+2 T:0x40c49490] ti.sdo.ce.ipc.Power - Power_on> Opening Local Power Manager for the DSP on /dev/lpm0...
@1,158,570us: [+2 T:0x40c49490] ti.sdo.ce.ipc.Power - Power_on> Turning on DSP power...
@1,365,479us: [+7 T:0x40c49490] ti.sdo.ce.ipc.Power - Power_on> Turning on DSP power FAILED
@1,365,540us: [+2 T:0x40c49490] ti.sdo.ce.ipc.Power - Power_on> return (1)
@1,365,601us: [+6 T:0x40c49490] OP - Processor_create_d> Power_on failed.
@1,365,631us: [+2 T:0x40c49490] OP - Processor_create_d> return (0)
@1,365,692us: [+0 T:0x40c49490] ti.sdo.ce.osal.Sem - Entered Sem_post> sem[0x621d8]
@1,365,784us: [+0 T:0x40c49490] ti.sdo.ce.osal.Sem - Leaving Sem_post> sem[0x621d8]
@1,365,815us: [+0 T:0x40c49490] OP - getCmd_d> Enter (proc=0x40c48dec)
@1,365,876us: [+0 T:0x40c49490] ti.sdo.ce.osal.Sem - Entered Sem_pend> sem[0x621c0] timeout[0xffffffff]
@1,365,937us: [+0 T:0x41a93490] ti.sdo.ce.osal.Sem - Leaving Sem_post> sem[0x621c0]
@1,365,967us: [+0 T:0x41a93490] ti.sdo.ce.osal.Sem - Entered Sem_pend> sem[0x621d8] timeout[0xffffffff]
We thought one way around this issue is to explicitly call lpmOFF followed by lpmON and then rerun the application. But the lpmOFF itself fails wiht folowing o/p
==== LPM OFF Test ====
app: LPM_open
app: LPM_set(LPM_CTRL_REFCOUNTOVR)
app: LPM_off
app: Error: LPM_off failed
app: LPM_close
==== LPM OFF test completed ====
We have following questions
1) How can we debug/fix this issue?
2) Our idea is to have signal handler installed in our application that will actually turn off/on the DSP core in the event of unexpected termination of the application. Is that doable?
3) Does LPM use DSPLink?
Sachin