Hello,
my Codec Engine iUniversal ARM application appears not to properly shut down.
Here is the code for ending the application:
/* teardown the codec */
cerr << "Tearing down codec" << endl;
UNIVERSAL_delete(hUniversal);
/* close the engine */
cerr << "Closing engine" << endl;
Engine_close(ce);
/* free buffers */
cerr << "Freeing memory for input/output/inOut buffers" << endl;
Memory_free(inBuf, inBufsSize, &allocParams);
Memory_free(outBuf, outBufsSize, &allocParams);
Memory_free(inOutBuf, inOutBufsSize, &allocParams);
/* exit Codec Engine Runtime */
cerr << "Exiting Codec Engine Runtime" << endl;
CERuntime_exit();
And this is the output for CE_DEBUG=2 (last few lines):
[...]
[DSP] @0,266,951tk: [+5 T:0x87d7459c] CN - NODE> returned from call(algHandle=0x87d74108, msg=0x87305880); messageId=0x000266b7
@1,036,346us: [+0 T:0x41cdf460] CE - Engine_fwriteTrace> returning count [2751]
@1,036,407us: [+0 T:0x41cdf460] CV - VISA_call Completed: messageId=0x000266b7, command=0x0, return(status=0)
@1,036,499us: [+5 T:0x41cdf460] CV - VISA_freeMsg(0x12d30, 0x41440880): Freeing message with messageId=0x000266b7
@1,036,590us: [+0 T:0x41cdf460] ti.sdo.ce.universal.UNIVERSAL - UNIVERSAL_process> Exit (handle=0x12d30, retVal=0x0)
Tearing down codec
@1,055,145us: [+0 T:0x41cdf460] ti.sdo.ce.universal.UNIVERSAL - UNIVERSAL_delete> Enter (handle=0x12d30)
@1,055,236us: [+0 T:0x41cdf460] CV - VISA_delete(0x12d30)
@1,055,267us: [+5 T:0x41cdf460] CV - VISA_delete> deleting codec (localQueue=0x10001, remoteQueue=0x2)
@1,055,328us: [+0 T:0x41cdf460] CE - Engine_ctrlNode(0x12d78, 0x12d68, 0x0)
@1,056,396us: [+0 T:0x4001e900] OP - doCmd> Enter (cmdId=3, proc=0x0)
@1,056,518us: [+0 T:0x4001e900] ti.sdo.ce.osal.Sem - Entered Sem_post> sem[0x124f0]
@1,056,610us: [+0 T:0x40bef460] ti.sdo.ce.osal.Sem - Leaving Sem_pend> sem[0x124f0] status[0]
@1,056,671us: [+0 T:0x40bef460] OP - getCmd_d> Exit (result=3)
@1,056,701us: [+0 T:0x40bef460] ti.sdo.ce.osal.Sem - Entered Sem_post> sem[0x12508]
@1,056,762us: [+0 T:0x40bef460] ti.sdo.ce.osal.Sem - Leaving Sem_post> sem[0x12508]
@1,057,464us: [+0 T:0x4001e900] ti.sdo.ce.osal.Sem - Leaving Sem_post> sem[0x124f0]
@1,057,556us: [+0 T:0x4001e900] ti.sdo.ce.osal.Sem - Entered Sem_pend> sem[0x12508] timeout[0xffffffff]
@1,057,617us: [+0 T:0x4001e900] ti.sdo.ce.osal.Sem - Leaving Sem_pend> sem[0x12508] status[0]
@1,057,647us: [+0 T:0x4001e900] OP - doCmd> Exit (result=1)
@1,057,708us: [+0 T:0x4001e900] OT - Thread_delete> Enter (task=0x12540)
@1,057,800us: [+4 T:0x4001e900] OT - Thread_delete> pthread_cancel (0x3)
@1,057,891us: [+4 T:0x4001e900] OT - Thread_delete> pthread_join (0x0)
@1,057,952us: [+0 T:0x4001e900] OT - Thread_delete> Exit (task=0x12540)
@1,058,013us: [+0 T:0x4001e900] ti.sdo.ce.osal.Sem - Entered Sem_delete> sem[0x124f0]
@1,058,074us: [+0 T:0x4001e900] ti.sdo.ce.osal.Sem - Leaving Sem_delete>
@1,058,135us: [+0 T:0x4001e900] ti.sdo.ce.osal.Sem - Entered Sem_delete> sem[0x12508]
@1,058,166us: [+0 T:0x4001e900] ti.sdo.ce.osal.Sem - Leaving Sem_delete>
[root@xxx ~]#
So the program seems to exit before calling Engine_close(ce); What could be my mistake?
Actually I'm trying to execute the ARM application from a batch script through SSH (written in GNU Octave). It needs to run hundreds of times with various input signals as stdin for a test. However, after a number of runs it hangs at the very same place (after the last line of the CE_DEBUG output above). Is there anything I should be careful about when running a CE application many times from a batch script?
Software versions:
DSP Link 1.65.00.03, CE 2.26.02.11, DSP/BIOS 5.41.10.36
Thank you for your support.