This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Codec Server fails to initialize when using setitimer

Other Parts Discussed in Thread: OMAPL138

Hi:

 

I'm working on an audio application and I use the setitimer function to set 3 timers in different parts of my code but then when I try to open the codec server after any of the timers is initialized the server won't work. I also modified firtest.c in the iuniversal examples and was able to reproduce the problem. The problem can be seem in the remote executable and not the local executable.

What we did was create a 20msec timer with setitimer() and had a Signal Handler for SIGALARM when it expires. One guess would be that it is conflicting with the Codec Engine Signal Handler. I tried disabling the Handler by following the instructions provided in the wiki page http://processors.wiki.ti.com/index.php/DSPLink_Signal_Handling_in_Codec_Engine but had no luck in getting it built.  My questions are the following:

1) should the 20msec timer be done in this way?

2) Is it ok to disable the DSP Signal Handler and are there any additional steps that need to be followed?

 

I'm attaching the segment of the firtest.c code where I added the timer setup to reproduce the issue:

 

//  ======== Time Test ===========================================================
    struct sigaction sig_act;    // Signal
    struct itimerval it_val;    // for setting itimer
     
    //---------------------------
    // Set up Signal Handler
    //---------------------------
    sig_act.sa_handler = (void*)TIME_timerInterrupt;
    sig_act.sa_flags = 0;
      if(sigaction(SIGALRM, &sig_act, NULL) == (int)SIG_ERR)
      {
            perror("Unable to catch SIGALRM");
            exit(1);
      }
 
    it_val.it_value.tv_sec = 20/1000;
    it_val.it_value.tv_usec = (20*1000) % 1000000;  
    it_val.it_interval = it_val.it_value;
 
    if(setitimer(ITIMER_REAL, &it_val, NULL) == -1) 
    {
        perror("error calling setitimer()");
        exit(1);
    }
 
//  ======== Time Test ===========================================================
 
    /* Init the global quit function */
    FIRTEST_getQuitFxn = getQuitFxn;
   
    /* reset, load, and start DSP Engine */
    if ((ce = Engine_open(engineName, NULL, NULL)) == NULL) {
        printf("%s: error: can't open engine %s\n", progName, engineName);
        goto endFailOpenEngine;
    }

 

Regards

Diego Chaverri

  • I think you're on the right path - seems like DSP Link's signal handler may be getting in the way.  Here's a FAQ with some evidence of that:

    http://processors.wiki.ti.com/index.php/DSPLink_FAQs#Why_does_signal_handler_registered_in_my_application_stop_working_when_I_integrate_DSPLink_.3F

    The other article you referenced describes the steps to disable DSP Link's signal handler in a Codec Engine environment.  If you're struggling to work through those steps, please post questions here and we'll help.

    Chris

  • Chris,

    If I disable the DSP signal handler, what do I need to take care of in the custom signal handler?  I can understand making sure that all the handles are closed properly, but I was wondering if the DSP signal handler is doing anything else. 

    Thanks,

    Danny

  • Chris,

    I have a second question.  I was wondering where I was suppose to define MAX_DSPS?  I followed the instructions found in this post and ended up with the same error where it was looking for MAX_DSPS. 

     

    http://e2e.ti.com/support/embedded/f/355/t/56742.aspx

     

    Thanks,

    Danny

  • I disabled the DSP Signal handler and the remote fir example still won't run.  The local fir example runs fine.  I was hoping that someone at TI could try running the code that Diego Chaverri posted above.  I think the problem can be easily replicated by TI.   I can send the modified firtest.c if necessary.

    Thanks,
    Danny Marsh

  • Hi Chris:

    I followed your suggestion, disabled the signal handler (by adding the piece of code with the signal handler flag set to FALSE as specified in the wiki link for DSP Link) and tried running the firtest example from iuniversal (with the timer interrupt code) and got the following error log. I apologize for the messy paste:

     

    /iuniversal_examples # CE_DEBUG=2 ./remote_ti_platforms_evmDM6446_fir.xv5T
    @0,528,652us: [+4 T:0x4001d240] OG - Global_init> This program was built with the following packages:
    @0,529,597us: [+4 T:0x4001d240] OG -     package gnu.targets.arm.rtsv5T (/home/sdks/telex/proprietary/xdctools_3_15_01/xdctools_3_15_01_59/packages/gnu/targets/arm/rtsv5T/) [1, 0, 0, 0]
    @0,529,836us: [+4 T:0x4001d240] OG -     package ti.sdo.algos.fir (/home/sdks/telex/myapps/iuniversal_examples/packages/ti/sdo/algos/fir/) [1, 0, 0]
    @0,529,966us: [+4 T:0x4001d240] OG -     package ti.sdo.ce.global (/home/sdks/telex/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/codec_engine_2_23_01/packages/ti/sdo/ce/global/) [1, 0, 0]
    @0,530,291us: [+4 T:0x4001d240] OG -     package dsplink.gpp (/home/sdks/telex/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/dsplink-1_61_03-prebuilt/packages/dsplink/gpp/) [5, 0, 0]
    @0,530,428us: [+4 T:0x4001d240] OG -     package ti.sdo.linuxutils.cmem (/home/sdks/telex/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/linuxutils_2_23_01/packages/ti/sdo/linuxutils/cmem/) [2, 2, 0]
    @0,530,558us: [+4 T:0x4001d240] OG -     package gnu.targets (/home/sdks/telex/proprietary/xdctools_3_15_01/xdctools_3_15_01_59/packages/gnu/targets/) [1, 0, 1]
    @0,530,683us: [+4 T:0x4001d240] OG -     package gnu.targets.arm (/home/sdks/telex/proprietary/xdctools_3_15_01/xdctools_3_15_01_59/packages/gnu/targets/arm/) [1, 0, 0, 0]
    @0,530,919us: [+4 T:0x4001d240] OG -     package ti.sdo.utils.trace (/home/sdks/telex/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/framework_components_2_23_01/packages/ti/sdo/utils/trace/) [1, 0, 0]
    @0,531,062us: [+4 T:0x4001d240] OG -     package ti.xdais.dm (/home/sdks/telex/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/xdais_6_23/packages/ti/xdais/dm/) [1, 0, 5]
    @0,531,316us: [+4 T:0x4001d240] OG -     package ti.xdais (/home/sdks/telex/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/xdais_6_23/packages/ti/xdais/) [1, 2.0, 1]
    @0,531,447us: [+4 T:0x4001d240] OG -     package ti.sdo.ce.node (/home/sdks/telex/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/codec_engine_2_23_01/packages/ti/sdo/ce/node/) [1, 0, 0]
    @0,531,576us: [+4 T:0x4001d240] OG -     package ti.sdo.ce.utils.xdm (/home/sdks/telex/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/codec_engine_2_23_01/packages/ti/sdo/ce/utils/xdm/) [1, 0, 2]
    @0,531,705us: [+4 T:0x4001d240] OG -     package ti.sdo.fc.global (/home/sdks/telex/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/framework_components_2_23_01/packages/ti/sdo/fc/global/) [1, 0, 0]
    @0,531,835us: [+4 T:0x4001d240] OG -     package ti.sdo.fc.dman3 (/home/sdks/telex/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/framework_components_2_23_01/packages/ti/sdo/fc/dman3/) [1, 0, 4]
    @0,531,964us: [+4 T:0x4001d240] OG -     package ti.sdo.fc.memutils (/home/sdks/telex/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/framework_components_2_23_01/packages/ti/sdo/fc/memutils/) [1, 0, 0]
    @0,532,095us: [+4 T:0x4001d240] OG -     package ti.sdo.fc.acpy3 (/home/sdks/telex/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/framework_components_2_23_01/packages/ti/sdo/fc/acpy3/) [1, 0, 4]
    @0,532,336us: [+4 T:0x4001d240] OG -     package ti.catalog.arm (/home/sdks/telex/proprietary/xdctools_3_15_01/xdctools_3_15_01_59/packages/ti/catalog/arm/) [1, 0, 1, 0]
    @0,532,479us: [+4 T:0x4001d240] OG -     package ti.catalog (/home/sdks/telex/proprietary/xdctools_3_15_01/xdctools_3_15_01_59/packages/ti/catalog/) [1, 0, 0]
    @0,532,602us: [+4 T:0x4001d240] OG -     package ti.platforms.evmDM6446 (/home/sdks/telex/proprietary/xdctools_3_15_01/xdctools_3_15_01_59/packages/ti/platforms/evmDM6446/) [1, 0, 0, 1]
    @0,532,730us: [+4 T:0x4001d240] OG -     package ti.sdo.ce.osal (/home/sdks/telex/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/codec_engine_2_23_01/packages/ti/sdo/ce/osal/) [2, 0, 2]
    @0,532,858us: [+4 T:0x4001d240] OG -     package ti.sdo.ce.osal.linux (/home/sdks/telex/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/codec_engine_2_23_01/packages/ti/sdo/ce/osal/linux/) [2, 0, 1]
    @0,532,989us: [+4 T:0x4001d240] OG -     package ti.sdo.ce.ipc (/home/sdks/telex/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/codec_engine_2_23_01/packages/ti/sdo/ce/ipc/) [2, 0, 1]
    @0,533,117us: [+4 T:0x4001d240] OG -     package ti.sdo.ce.ipc.dsplink (/home/sdks/telex/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/codec_engine_2_23_01/packages/ti/sdo/ce/ipc/dsplink/) [2, 0, 1]
    @0,873,640us: [+4 T:0x4001d240] OG -     package ti.sdo.ce.alg (/home/sdks/telex/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/codec_engine_2_23_01/packages/ti/sdo/ce/alg/) [1, 0, 1]
    @0,873,792us: [+4 T:0x4001d240] OG -     package ti.sdo.ce (/home/sdks/telex/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/codec_engine_2_23_01/packages/ti/sdo/ce/) [1, 0, 6]
    @0,873,919us: [+4 T:0x4001d240] OG -     package ti.sdo.ce.universal (/home/sdks/telex/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/codec_engine_2_23_01/packages/ti/sdo/ce/universal/) [1, 0, 0]
    @0,874,048us: [+4 T:0x4001d240] OG -     package ti.sdo.algos.fir.ce (/home/sdks/telex/myapps/iuniversal_examples/packages/ti/sdo/algos/fir/ce/) [1, 0, 0]
    @0,874,176us: [+4 T:0x4001d240] OG -     package remote_ti_platforms_evmDM6446 (/home/sdks/telex/myapps/iuniversal_examples/packages/ti/sdo/apps/fir/cfg/linux/remote_ti_platforms_evmDM6446/) []
    @0,875,087us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Sem_create> count: 0
    @0,875,362us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Leaving Sem_create> sem[0x3e1c0]
    @0,875,509us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Sem_create> count: 0
    @0,875,632us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Leaving Sem_create> sem[0x3e1d8]
    @0,875,770us: [+0 T:0x4001d240] OT - Thread_create> Enter (fxn=0x11a50, attrs=0x0)
    @0,876,651us: [+1 T:0x40a01490] OP - daemon> thread created.
    @0,876,813us: [+0 T:0x40a01490] OP - getCmd_d> Enter (proc=0x40a00de8)
    @0,876,932us: [+0 T:0x40a01490] ti.sdo.ce.osal.Sem - Entered Sem_pend> sem[0x3e1c0] timeout[0xffffffff]
    @0,877,155us: [+0 T:0x4001d240] OT - Thread_create> Exit (task=0x3e210)
    @0,877,433us: [+0 T:0x4001d240] ti.sdo.ce.alg - ALG_init> Enter
    @0,877,591us: [+0 T:0x4001d240] ti.sdo.ce.alg - ALG_init> Exit
    @0,877,908us: [+6 T:0x4001d240] CE - Engine_init> CE debugging on (CE_DEBUG=2; allowed CE_DEBUG levels: 1=min, 2=good, 3=max)
    @0,878,230us: [+0 T:0x4001d240] CS - Server_init()
    @0,878,367us: [+0 T:0x4001d240] CS - Server_init> Global_useLinkArbiter = 0
    @0,878,525us: [+2 T:0x4001d240] ZZ - main> Welcome to app's main().
    @0,878,661us: [+6 T:0x4001d240] OM - Memory_contigAlloc> Warning: non-default alignment not supported for pool-based allocations, using default 0xffffffff.
    @0,879,058us: [+4 T:0x4001d240] OM - Memory_contigAlloc> CMEM_alloc(14) = 0x4001f000.
    @0,879,353us: [+4 T:0x4001d240] OM - Memory_contigAlloc> CMEM_getPhys(0x4001f000) = 0x8f6c5000.
    @0,879,529us: [+6 T:0x4001d240] OM - Memory_contigAlloc> Warning: non-default alignment not supported for pool-based allocations, using default 0xffffffff.
    @0,879,797us: [+4 T:0x4001d240] OM - Memory_contigAlloc> CMEM_alloc(32) = 0x40021000.
    @0,879,975us: [+4 T:0x4001d240] OM - Memory_contigAlloc> CMEM_getPhys(0x40021000) = 0x8f6c3000.
    @0,880,326us: [+6 T:0x4001d240] OM - Memory_contigAlloc> Warning: non-default alignment not supported for pool-based allocations, using default 0xffffffff.
    @0,880,693us: [+4 T:0x4001d240] OM - Memory_contigAlloc> CMEM_alloc(46) = 0x40a02000.
    @0,880,886us: [+4 T:0x4001d240] OM - Memory_contigAlloc> CMEM_getPhys(0x40a02000) = 0x8f6c7000.
    App-> Application started.
    @0,881,359us: [+0 T:0x4001d240] CE - Engine_open> Enter('firEngine', 0x0, 0xbef15bcc)
    @0,881,548us: [+0 T:0x4001d240] CE - rserverOpen('fir_unitserver_evmdm6446.x64P'), count = 0
    @0,881,685us: [+0 T:0x4001d240] OP - Processor_create> Enter(imageName='fir_unitserver_evmdm6446.x64P', linkCfg='(null)', attrs=0xbef15bb0)
    @0,882,911us: [+0 T:0x4001d240] OP - doCmd> Enter (cmdId=1, proc=0x3e558)
    @0,883,079us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Entered Sem_post> sem[0x3e1c0]
    @0,883,318us: [+0 T:0x40a01490] ti.sdo.ce.osal.Sem - Leaving Sem_pend> sem[0x3e1c0] status[0]
    @0,883,568us: [+0 T:0x40a01490] OP - getCmd_d> Exit (result=1)
    @0,883,706us: [+0 T:0x40a01490] @0,883,706us: [+0 T:0x40a01490] OP - Processor_create_d> Enter(proc=0x3e558)
    In Timer Interrupt
    OP - Processor_create_d> Enter(proc=0x3e558)
    @0,921,719us: [+2 T:0x40a01490] OP - Processor_create_d> Initializing DSP PROC...
    @0,921,966us: [+2 T:0x40a01490] OP - Processor_create_d> Using DspLink config data for entry #0 [server 'fir_unitserver_evmdm6446.x64P']
    @0,922,202us: [+2 T:0x40a01490] OP - Processor_create_d> Adding DSP@0,922,202us: [+2 T:0x40a01490] OP - Processor_create_d> Adding DSP segment #0 to Link configuration: name='DDR2', startAddress=00
    In Timer Interrupt
     segmenIn Timer Interrupt
    t #0 to Link configuration: name='DDR2', startAddress=0x8fa00000, sizeInBytes=0x400000, shared=1, syncd=0
    @0,961,623us: [+2 T:0x40a01490] OP - Processor_create_d> Adding DSP segment #1 to Link configuration: name='DSPLI@0,961,623us: [+2 T:0x40a01490] OP - Processor_create_d> Adding DSP segment #1 to L0
    In Timer Interrupt
    NIn Timer Interrupt
    KMEM', startAddress=0x8fe00000, sizeInBytes=0x100000, shared=1, syncd=0
    @1,001,725us: [+2 T:0x40a01490] OP - Processor_create_d> Adding DSP segment #2 to Link configuration: name='RESET_VECTOR', startAddress=0x8ff00000,@1,001,725us: [+2 T:0x40a01490] OP - Processor_cr0
    In Timer Interrupt
     sizeInBytes=0x80, In Timer Interrupt
    shared=1, syncd=0
    @1,041,650us: [+2 T:0x40a01490] OP - Processor_create_d> Adding DSP segment #3 to Link configuration: name='DDRALGHEAP', startAddress=0x88000000, sizeInBytes=0x7a00000, shared=0, syncd=@1,041,650u0
    In Timer Interrupt
    0
    @1,061,663us:@1,061,663us: [+2 T:0x40a01490] OP - Processor_create_d> DODSPCTRL was=1; now=0
    In Timer Interrupt
     [+2 T:0x40a01490] OP - Processor_create_d> DODSPCTRL was=1; now=0
    @1,092,399us: [+2 T:0x40a01490] OP - Processor_create_d> Attaching to DSP PROC...
    In Timer Interrupt
    @1,095,739us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Leaving Sem_post> sem[0x3e1c0]
    @1,095,906u@1,095,906us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Entered Sem_pend> sem[0x3e1d8] timeout[0xffffffff]
    In Timer Interrupt
    In Timer Interrupt
    terrupt
    :0x4001d240] ti.sdo.ce.osal.Sem - Entered Sem_pend> sem[0x3e1d8] timeout[0xffffffff]
    In Timer Interrupt
    @1,442,298us: [+2 T:0x40a0149[42949381.730000] Unable to handle kernel NULL pointer dereference at virtual address 00000008
    0] OP - Processo[42949381.740000] pgd = ce810000
    r_create_d> Open[42949381.750000] [00000008] *pgd=8f163031ing MSGQ pool..., *pte=00000000
    @1,443,001us: , *ppte=00000000[+2 T:0x40a01490
    ] OP - Processor[42949381.760000] Internal error: Oops: 17 [#1] PREEMPT
    [42949381.760000] Modules linked in: dsplinkk cmemk
    [42949381.760000] CPU: 0    Not tainted  (2.6.26-rt1-ridgerun #1)
    [42949381.760000] pc : [<c00f5860>]    lr : [<00000000>]    psr: 60000013
    [42949381.760000] sp : ce8159d0  ip : cea73e00  fp : ce815a64
    [42949381.760000] r10: ce815b60  r9 : ce815b38  r8 : cecc64f8
    [42949381.760000] r7 : 00001000  r6 : cea73f38  r5 : ce815b38  r4 : cea73e00
    [42949381.760000] r3 : 00001000  r2 : c027a2d0  r1 : cea73e00  r0 : ce9781a0
    [42949381.760000] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
    [42949381.760000] Control: 0005717f  Table: 8e810000  DAC: 00000017
    [42949381.760000] Process remote_ti_platf (pid: 454, stack limit = 0xce814268)
    [42949381.760000] Stack: (0xce8159d0 to 0xce816000)
    [42949381.760000] 59c0:                                     ce815a04 00000000 ce815b38 00011250
    [42949381.760000] 59e0: ce814000 cf3e9a80 ce815a04 ce8159f8 c0078710 c00928cc ce815a44 ce815a08
    [42949381.760000] 5a00: c00788c8 c0078700 00000158 cea73c64 ce815a34 00000000 c02555e4 c025ceac
    [42949381.760000] 5a20: ce815b38 00000001 c0317bb0 00001000 cecc64f8 ce815b60 ce815a64 cea73e00
    [42949381.760000] 5a40: ce815b38 cea73f38 00001000 cecc64f8 ce815b38 ce815b60 ce815a8c ce815a68
    [42949381.760000] 5a60: c00f5c84 c00f5854 00000000 cecc64f8 ce815b38 ce9782a0 ce9782a0 00001000
    [42949381.760000] 5a80: ce815aac ce815a90 c00f3290 c00f5bd0 00000000 ce815aa0 c00f38f4 ce815b38
    [42949381.760000] 5aa0: ce815acc ce815ab0 c00f3320 c00f3238 00001000 c04f31c0 00000000 ce9782a0
    [42949381.760000] 5ac0: ce815afc ce815ad0 c00f54ec c00f32c8 00001000 c04f31c0 c04f31c0 ce815bb0
    [42949381.760000] 5ae0: cecc6590 ce815b60 c00f53d0 00001000 ce815b24 ce815b00 c007eea4 c00f53e0
    [42949381.760000] 5b00: cf1679a0 ce814000 ce8efe00 cecc64f8 cf162120 cecc6400 ce815b94 ce815b28
    [42949381.760000] 5b20: c00f50fc c007ee08 00000000 00000044 ce815bb0 cecc6590 ce815b38 ce815b38
    [42949381.760000] 5b40: 00000000 00001000 00001000 00000000 cecc64f8 c00f5bc0 00000000 00000000
    [42949381.760000] 5b60: ce815b38 00000000 cecc6594 00000000 000000d1 0000000f cecc6594 0000000f
    [42949381.760000] 5b80: 000000de 000000c2 ce815be4 ce815b98 c007ec64 c00f5018 cf973950 ce815bb0
    [42949381.760000] 5ba0: cf162120 cecc6590 0000000f 0000000f c04f32d8 c04f31b8 4c244324 cf162168
    [42949381.760000] 5bc0: 0000000f 00001000 000000c2 cecc6590 cf162120 cf162120 ce815c14 ce815be8
    [42949381.760000] 5be0: c007efb0 c007eabc 0000000f cecc6594 000000c2 00000000 00001000 00000000
    [42949381.760000] 5c00: cecc6590 000000c2 ce815c34 ce815c18 c007f11c c007eed0 000000c2 00000016
    [42949381.760000] 5c20: 000000c2 00001000 ce815ccc ce815c38 c0077ee8 c007f0f8 00000016 00000000
    [42949381.760000] 5c40: c02d215c ce814000 ce815c84 ce815d58 c007a890 c007a5d4 ce815d08 00000000
    [42949381.760000] 5c60: 00000000 ce814000 00000000 00000000 000000d8 cf162168 cecc64f8 ce815d98
    [42949381.760000] 5c80: 000000c1 00000001 00000044 0000ecce 00015b5a cf980cce 00000000 00024828
    [42949381.760000] 5ca0: c00edd84 000b3332 00000000 00024828 00000000 ce815d08 00000000 ce815d98
    [42949381.760000] 5cc0: ce815cfc ce815cd0 c00ebfa0 c0077a64 000b3332 00000000 ce815d08 cf162120
    [42949381.760000] 5ce0: ce815d98 00000000 cf162140 000b3332 ce815dc4 ce815d00 c009635c c00ebe94
    [42949381.760000] 5d00: 000b3332 00000000 00000001 c04fae20 00000000 00000001 ffffffff cf162120
    [42949381.760000] 5d20: 00000000 00000000 00000000 00000000 cf1679a0 00000025 00000000 00000000
    [42949381.760000] 5d40: ffffffff cf1679a0 c00533ec ce815d4c ce815d4c ce815d60 000b3332 00000000
    [42949381.760000] 5d60: 000b3332 00000002 ce815d9c ce9cf514 00024828 ffffffff 000000ef 00008000
    [42949381.760000] 5d80: cf93a010 000b3332 ce815dc4 ce815d98 c0090150 c008ff88 cf972000 00024828
    [42949381.760000] 5da0: bf0097cc bf000000 cf93e000 cf93c000 00008000 cf93a010 ce815ddc ce815dc8
    [42949381.760000] 5dc0: bf008ef8 c00962ac cf972000 cf93a000 ce815df4 ce815de0 bf009124 bf008e78
    [42949381.760000] 5de0: bf009184 00000000 ce815e3c ce815df8 bf015e68 bf0090dc 00000000 000d7b5a
    [42949381.760000] 5e00: 00000000 cf972000 cf972000 00010000 bf009364 00008000 cf93a000 bf018874
    [42949381.760000] 5e20: 00000000 0002e334 00000000 ce815e80 ce815e74 ce815e40 bf014c30 bf015b88
    [42949381.760000] 5e40: ce815e64 cf93c000 bf018868 bf018868 00000000 cf85d000 0002e334 00000001
    [42949381.760000] 5e60: ce814000 bef15bbc ce815ecc ce815e78 bf007670 bf014ba4 ce815e94 ce815e88
    [42949381.760000] 5e80: 00000002 bf0185a0 ce815eac ce815e98 c0157b50 c015744c 00000071 00000000
    [42949381.760000] 5ea0: bf0185a0 bf01869c 00006c05 40a00d74 00006c05 cf0448a0 c0026d04 0003c140
    [42949381.760000] 5ec0: ce815f2c ce815ed0 bf006578 bf007498 00000000 c003552c ce814000 ce8e9c10
    [42949381.760000] 5ee0: ce815f0c ce815ef0 c013ee3c c0036d7c c013ed60 00000072 ce815f20 ce8e9c00
    [42949381.760000] 5f00: 00008000 00000000 0002e334 00000001 bef15bbc 0003d080 cf0448a0 40a00d74
    [42949381.760000] 5f20: ce815f4c ce815f30 c00a3fa4 bf00609c cf0448a0 00000004 cf0448a0 40a00d74
    [42949381.760000] 5f40: ce815f7c ce815f50 c00a41b8 c00a3f24 ce815f7c ce815f60 00000004 40a00d74
    [42949381.760000] 5f60: 00006c05 cf0448a0 c0026d04 ce814000 ce815fa4 ce815f80 c00a432c c00a3fc4
    [42949381.760000] 5f80: ce814000 00000001 000001c5 0003d080 0003d0d0 00000036 00000000 ce815fa8
    [42949381.760000] 5fa0: c0026b60 c00a42f8 000001c5 0003d080 00000004 00006c05 40a00d74 00000004
    [42949381.760000] 5fc0: 000001c5 0003d080 0003d0d0 00000036 00000050 00000004 0003c140 40a00d5c
    [42949381.760000] 5fe0: 0003e62c 40a00c88 0001ae6c 4019a72c 20000010 00000004 ff76e3f7 7effcaff
    [42949381.760000] Backtrace:
    [42949381.760000] Function entered at [<c00f5844>] from [<c00f5c84>]
    [42949381.760000] Function entered at [<c00f5bc0>] from [<c00f3290>]
    [42949381.760000]  r7:00001000 r6:ce9782a0 r5:ce9782a0 r4:ce815b38
    [42949381.760000] Function entered at [<c00f3228>] from [<c00f3320>]
    [42949381.760000]  r4:ce815b38
    [42949381.760000] Function entered at [<c00f32b8>] from [<c00f54ec>]
    [42949381.760000]  r6:ce9782a0 r5:00000000 r4:c04f31c0
    [42949381.760000] Function entered at [<c00f53d0>] from [<c007eea4>]
    [42949381.760000] Function entered at [<c007edf8>] from [<c00f50fc>]
    [42949381.760000]  r8:cecc6400 r7:cf162120 r6:cecc64f8 r5:ce8efe00 r4:ce814000
    [42949381.760000] Function entered at [<c00f5008>] from [<c007ec64>]
    [42949381.760000] Function entered at [<c007eaac>] from [<c007efb0>]
    [42949381.760000] Function entered at [<c007eec0>] from [<c007f11c>]
    [42949381.760000] Function entered at [<c007f0e8>] from [<c0077ee8>]
    [42949381.760000]  r4:00001000
    [42949381.760000] Function entered at [<c0077a54>] from [<c00ebfa0>]
    [42949381.760000] Function entered at [<c00ebe84>] from [<c009635c>]
    [42949381.760000] Function entered at [<c009629c>] from [<bf008ef8>]
    [42949381.760000]  r8:cf93a010 r7:00008000 r6:cf93c000 r5:cf93e000 r4:bf000000
    [42949381.760000] Function entered at [<bf008e68>] from [<bf009124>]
    [42949381.760000]  r5:cf93a000 r4:cf972000
    [42949381.760000] Function entered at [<bf0090cc>] from [<bf015e68>]
    [42949381.760000]  r4:00000000
    [42949381.760000] Function entered at [<bf015b78>] from [<bf014c30>]
    [42949381.760000] Function entered at [<bf014b94>] from [<bf007670>]
    [42949381.760000] Function entered at [<bf007488>] from [<bf006578>]
    [42949381.760000] Function entered at [<bf00608c>] from [<c00a3fa4>]
    [42949381.760000]  r5:40a00d74 r4:cf0448a0
    [42949381.760000] Function entered at [<c00a3f14>] from [<c00a41b8>]
    [42949381.760000]  r6:40a00d74 r5:cf0448a0 r4:00000004
    [42949381.760000] Function entered at [<c00a3fb4>] from [<c00a432c>]
    [42949381.760000]  r9:ce814000 r8:c0026d04 r7:cf0448a0 r6:00006c05 r5:40a00d74
    [42949381.760000] r4:00000004
    [42949381.760000] Function entered at [<c00a42e8>] from [<c0026b60>]
    [42949381.760000]  r7:00000036 r6:0003d0d0 r5:0003d080 r4:000001c5
    [42949381.760000] Code: e24dd06c e1a00000 e590e00c e1a0c001 (e59e1008)
    _create_d> Loadi[42949382.490000] ---[ end trace ac08ca577dc85aac ]---
    ng fir_unitserver_evmdm6446.x64P on DSP (1 args)...
    In Timer Interrupt
    @1,470,540us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Leaving Sem_pend> sem[0x3e1d8] status[0]
    @1,471,144us: [+0 T:0x4001d240] OP - doCmd> Exit (result=0)
    @1,471,717us: [+0 T:0x4001d240] OP - Processor_delete> Enter(proc=0x3e558)
    @1,472,143us: [+1 T:0x4001d240] OP - Processor_delete(0x3e558) freeing object ...
    @1,472,331us: [+0 T:0x4001d240] OP - Processor_delete> return.
    @1,472,464us: [+6 T:0x4001d240] CE - rserverOpen: can't start 'fir_unitserver_evmdm6446.x64P'; Processor_create failed
    @1,472,596us: [+0 T:0x4001d240] CE - rserverOpen('fir_unitserver_evmdm6446.x64P'): 0x0 done.
    @1,472,725us: [+0 T:0x4001d240] CE - Engine_close(0x3e528)
    @1,472,858us: [+0 T:0x4001d240] CE - Engine_open> return(0)
    app: error: can't open engine firEngine
    app ended.
    In Timer Interrupt
    @1,484,524us: [+0 T:0x4001d240] OP - doCmd> Enter (cmdId=3, proc=0x0)
    @1,484,792us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Entered Sem_post> sem[0x3e1c0]
    @1,484,940us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Leaving Sem_post> sem[0x3e1c0]
    @1,485,069us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Entered Sem_pend> sem[0x3e1d8] timeout[0xffffffff]
    In Timer Interrupt
    In Timer Interrupt
    @2,249,086us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Leaving Sem_pend> sem[0x3e1d8] status[0]
    @2,249,239us: [+0 T:0x4001d240] OP - doCmd> Exit (result=0)
    @2,249,351us: [+0 T:0x4001d240] OT - Thread_delete> Enter (task=0x3e210)
    @2,249,524us: [+4 T:0x4001d240] OT - Thread_delete> pthread_cancel (0x3)
    @2,249,694us: [+4 T:0x4001d240] OT - Thread_delete> pthread_join (0x0)
    @2,249,835us: [+0 T:0x4001d240] OT - Thread_delete> Exit (task=0x3e210)
    @2,249,959us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Entered Sem_delete> sem[0x3e1c0]
    @2,250,375us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Leaving Sem_delete>
    @2,250,505us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Entered Sem_delete> sem[0x3e1d8]
    @2,250,627us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Leaving Sem_delete>
    /iuniversal_examples #

    As you can see I get a dump due to a null pointer, tried running the example removing the timer interrupt code and worked just fine. Any assistance is much appreciated.

    Regards

    Diego Chaverri

  • There's some trace missing, so it's difficult to follow exactly what's going on and where the crash is happening.  You should be able to correlate the trace flow with the source in codec_engine_2_23_01/packages/ti/sdo/ce/ipc/dsplink/Processor_dsplink.c.  The call flow looks like this:

    PROC_setup(), PROC_attach(), POOL_open(), PROC_load(), PROC_start(), ...

    I can see trace indicating the calls up to PROC_open() succeeded, and I see the trace right before PROC_load(), but I don't get trace indicating success.  Further, I see trace _later_ that "CE - rserverOpen: can't start 'fir_unitserver_evmdm6446.x64P'; Processor_create failed".  But I don't see trace indicating the error code from PROC_open(), which I expect to see.

    FWIW, you might get more 'coherent' trace if you telnet into the board and run your test rather than use the shell at the UART.  At least that would keep the crash dump out of the mix.  I wonder if "sometimes" the missing trace is actually printed, with the error code I'm interested in, and it may give a glimpse into why it's happening.

    Do you still get a crash if you don't start the timer until _after_ the call to Engine_open()?  What about if you lower the rate of the timer?

    What does your TIME_timerInterrupt() fxn look like?  What if you remove your call to printf() in it?

    Chris

  • dmarsh10 said:
    I was wondering where I was suppose to define MAX_DSPS?

    The necessary defines to throw when using DSP Link headers directly fall out of the DSP Link perl config step.  MAX_DSPS is included in that list, among others.  There are some generated files (e.g. dsplink/gpp/export/BIN/Linux/OMAPL138/DEBUG/API_defines.txt if you're using the OMAPL138 'debug' build) that list these defines. They may change if you modify your DSP Link config, so it's often best to add these -D options by cat'ing that file onto your compile line.

    There's a good _simple_ DSP Link-using example here which has a makefile showing how that can be done in this example:

    http://processors.wiki.ti.com/index.php/Audio_Soc_example

    Chris

  • Chris,

    As you might have guessed Diego and myself are both trying to figure out this issue.  I wanted to give you a little background of what we are trying to do.  We currently have an application that initializes a USB port / function (that has a setitimer) and another 20msec setitimer used for sending out ethernet audio.   After this initialization we create multiple threads to handle the different audio inputs and outputs.    Now from what I read, I should create a new DSP Server handle for each thread.  Correct?  If I do this then the server doesn't open properly.   So that is when we duplicated the problem in the firtest.c, fir iuniversal example.  We currently have ssh and telnet disabled so I am going to rebuild and see if I can get that error code.

    Chris Ring said:

    Do you still get a crash if you don't start the timer until _after_ the call to Engine_open()? 

    No it doesn't crash and seems to work properly.  The issue is we need to initialize the timer before we start our threads.

     

    Chris Ring said:

    What about if you lower the rate of the timer?

    This also seems to work.  If I set the timer to 1 second it will work.  The issue with this is we need to be compatible with existing equipment and it wants the ethernet audio every 20 msec. 

     

    Chris Ring said:

    What does your TIME_timerInterrupt() fxn look like?  What if you remove your call to printf() in it?

    It is an empty function right now.  I commented the printf() but it made no difference.

     

    It seems like if we get a timer interrupt while the Engine is opening this is causing the crash.

    Question:

    1. Is there a better way to do the 20msec timer?

    Thanks,

    Danny

     

  • Chris,

    Here is the output from the telnet window.

     

    @0,206,718us: [+4 T:0x4001d240] OG - Global_init> This program was built with the following packages:
    @0,207,758us: [+4 T:0x4001d240] OG -     package gnu.targets.arm.rtsv5T (/home/dmarsh/projects/ip224sdk/proprietary/xdctools_3_15_01/xdctools_3_15_01_59/packages/gnu/targets/arm/rtsv5T/) [1, 0, 0, 0]
    @0,208,542us: [+4 T:0x4001d240] OG -     package ti.sdo.algos.fir (/home/dmarsh/projects/ip224sdk/myapps/iuniversal_examples/packages/ti/sdo/algos/fir/) [1, 0, 0]
    @0,210,452us: [+4 T:0x4001d240] OG -     package ti.sdo.ce.global (/home/dmarsh/projects/ip224sdk/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/codec_engine_2_23_01/packages/ti/sdo/ce/global/) [1, 0, 0]
    @0,210,641us: [+4 T:0x4001d240] OG -     package dsplink.gpp (/home/dmarsh/projects/ip224sdk/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/dsplink-1_61_03-prebuilt/packages/dsplink/gpp/) [5, 0, 0]
    @0,210,799us: [+4 T:0x4001d240] OG -     package ti.sdo.linuxutils.cmem (/home/dmarsh/projects/ip224sdk/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/linuxutils_2_23_01/packages/ti/sdo/linuxutils/cmem/) [2, 2, 0]
    @0,210,959us: [+4 T:0x4001d240] OG -     package gnu.targets (/home/dmarsh/projects/ip224sdk/proprietary/xdctools_3_15_01/xdctools_3_15_01_59/packages/gnu/targets/) [1, 0, 1]
    @0,211,115us: [+4 T:0x4001d240] OG -     package gnu.targets.arm (/home/dmarsh/projects/ip224sdk/proprietary/xdctools_3_15_01/xdctools_3_15_01_59/packages/gnu/targets/arm/) [1, 0, 0, 0]
    @0,211,272us: [+4 T:0x4001d240] OG -     package ti.sdo.utils.trace (/home/dmarsh/projects/ip224sdk/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/framework_components_2_23_01/packages/ti/sdo/utils/trace/) [1, 0, 0]
    @0,211,431us: [+4 T:0x4001d240] OG -     package ti.xdais.dm (/home/dmarsh/projects/ip224sdk/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/xdais_6_23/packages/ti/xdais/dm/) [1, 0, 5]
    @0,211,588us: [+4 T:0x4001d240] OG -     package ti.xdais (/home/dmarsh/projects/ip224sdk/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/xdais_6_23/packages/ti/xdais/) [1, 2.0, 1]
    @0,211,744us: [+4 T:0x4001d240] OG -     package ti.sdo.ce.node (/home/dmarsh/projects/ip224sdk/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/codec_engine_2_23_01/packages/ti/sdo/ce/node/) [1, 0, 0]
    @0,211,902us: [+4 T:0x4001d240] OG -     package ti.sdo.ce.utils.xdm (/home/dmarsh/projects/ip224sdk/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/codec_engine_2_23_01/packages/ti/sdo/ce/utils/xdm/) [1, 0, 2]
    @0,212,060us: [+4 T:0x4001d240] OG -     package ti.sdo.fc.global (/home/dmarsh/projects/ip224sdk/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/framework_components_2_23_01/packages/ti/sdo/fc/global/) [1, 0, 0]
    @0,212,358us: [+4 T:0x4001d240] OG -     package ti.sdo.fc.dman3 (/home/dmarsh/projects/ip224sdk/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/framework_components_2_23_01/packages/ti/sdo/fc/dman3/) [1, 0, 4]
    @0,212,515us: [+4 T:0x4001d240] OG -     package ti.sdo.fc.memutils (/home/dmarsh/projects/ip224sdk/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/framework_components_2_23_01/packages/ti/sdo/fc/memutils/) [1, 0, 0]
    @0,212,672us: [+4 T:0x4001d240] OG -     package ti.sdo.fc.acpy3 (/home/dmarsh/projects/ip224sdk/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/framework_components_2_23_01/packages/ti/sdo/fc/acpy3/) [1, 0, 4]
    @0,212,829us: [+4 T:0x4001d240] OG -     package ti.catalog.arm (/home/dmarsh/projects/ip224sdk/proprietary/xdctools_3_15_01/xdctools_3_15_01_59/packages/ti/catalog/arm/) [1, 0, 1, 0]
    @0,212,983us: [+4 T:0x4001d240] OG -     package ti.catalog (/home/dmarsh/projects/ip224sdk/proprietary/xdctools_3_15_01/xdctools_3_15_01_59/packages/ti/catalog/) [1, 0, 0]
    @0,213,134us: [+4 T:0x4001d240] OG -     package ti.platforms.evmDM6446 (/home/dmarsh/projects/ip224sdk/proprietary/xdctools_3_15_01/xdctools_3_15_01_59/packages/ti/platforms/evmDM6446/) [1, 0, 0, 1]
    @0,213,291us: [+4 T:0x4001d240] OG -     package ti.sdo.ce.osal (/home/dmarsh/projects/ip224sdk/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/codec_engine_2_23_01/packages/ti/sdo/ce/osal/) [2, 0, 2]
    @0,213,447us: [+4 T:0x4001d240] OG -     package ti.sdo.ce.osal.linux (/home/dmarsh/projects/ip224sdk/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/codec_engine_2_23_01/packages/ti/sdo/ce/osal/linux/) [2, 0, 1]
    @0,213,778us: [+4 T:0x4001d240] OG -     package ti.sdo.ce.ipc (/home/dmarsh/projects/ip224sdk/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/codec_engine_2_23_01/packages/ti/sdo/ce/ipc/) [2, 0, 1]
    @0,213,963us: [+4 T:0x4001d240] OG -     package ti.sdo.ce.ipc.dsplink (/home/dmarsh/projects/ip224sdk/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/codec_engine_2_23_01/packages/ti/sdo/ce/ipc/dsplink/) [2, 0, 1]
    @0,214,127us: [+4 T:0x4001d240] OG -     package ti.sdo.ce.alg (/home/dmarsh/projects/ip224sdk/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/codec_engine_2_23_01/packages/ti/sdo/ce/alg/) [1, 0, 1]
    @0,214,289us: [+4 T:0x4001d240] OG -     package ti.sdo.ce (/home/dmarsh/projects/ip224sdk/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/codec_engine_2_23_01/packages/ti/sdo/ce/) [1, 0, 6]
    @0,214,454us: [+4 T:0x4001d240] OG -     package ti.sdo.ce.universal (/home/dmarsh/projects/ip224sdk/proprietary/dvsdk_2_00_00/dvsdk_2_00_00_22/codec_engine_2_23_01/packages/ti/sdo/ce/universal/) [1, 0, 0]
    @0,214,618us: [+4 T:0x4001d240] OG -     package ti.sdo.algos.fir.ce (/home/dmarsh/projects/ip224sdk/myapps/iuniversal_examples/packages/ti/sdo/algos/fir/ce/) [1, 0, 0]
    @0,214,780us: [+4 T:0x4001d240] OG -     package remote_ti_platforms_evmDM6446 (/home/dmarsh/projects/ip224sdk/myapps/iuniversal_examples/packages/ti/sdo/apps/fir/cfg/linux/remote_ti_platforms_evmDM6446/) []
    @0,215,721us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Sem_create> count: 0
    @0,216,041us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Leaving Sem_create> sem[0x3e1c0]
    @0,216,232us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Sem_create> count: 0
    @0,216,401us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Leaving Sem_create> sem[0x3e1d8]
    @0,216,584us: [+0 T:0x4001d240] OT - Thread_create> Enter (fxn=0x11a44, attrs=0x0)
    @0,217,540us: [+1 T:0x40a01490] OP - daemon> thread created.
    @0,217,744us: [+0 T:0x40a01490] OP - getCmd_d> Enter (proc=0x40a00de8)
    @0,217,901us: [+0 T:0x40a01490] ti.sdo.ce.osal.Sem - Entered Sem_pend> sem[0x3e1c0] timeout[0xffffffff]
    @0,219,583us: [+0 T:0x4001d240] OT - Thread_create> Exit (task=0x3e210)
    @0,219,935us: [+0 T:0x4001d240] ti.sdo.ce.alg - ALG_init> Enter
    @0,220,320us: [+0 T:0x4001d240] ti.sdo.ce.alg - ALG_init> Exit
    @0,220,933us: [+6 T:0x4001d240] CE - Engine_init> CE debugging on (CE_DEBUG=2; allowed CE_DEBUG levels: 1=min, 2=good, 3=max)
    @0,221,246us: [+0 T:0x4001d240] CS - Server_init()
    @0,221,427us: [+0 T:0x4001d240] CS - Server_init> Global_useLinkArbiter = 0
    @0,221,637us: [+2 T:0x4001d240] ZZ - main> Welcome to app's main().
    @0,221,816us: [+6 T:0x4001d240] OM - Memory_contigAlloc> Warning: non-default alignment not supported for pool-based allocations, using default 0xffffffff.
    @0,222,280us: [+4 T:0x4001d240] OM - Memory_contigAlloc> CMEM_alloc(14) = 0x4001f000.
    @0,222,514us: [+4 T:0x4001d240] OM - Memory_contigAlloc> CMEM_getPhys(0x4001f000) = 0x8f6c5000.
    @0,222,711us: [+6 T:0x4001d240] OM - Memory_contigAlloc> Warning: non-default alignment not supported for pool-based allocations, using default 0xffffffff.
    @0,223,024us: [+4 T:0x4001d240] OM - Memory_contigAlloc> CMEM_alloc(32) = 0x40021000.
    @0,224,519us: [+4 T:0x4001d240] OM - Memory_contigAlloc> CMEM_getPhys(0x40021000) = 0x8f6c3000.
    @0,224,719us: [+6 T:0x4001d240] OM - Memory_contigAlloc> Warning: non-default alignment not supported for pool-based allocations, using default 0xffffffff.
    @0,225,061us: [+4 T:0x4001d240] OM - Memory_contigAlloc> CMEM_alloc(46) = 0x40a02000.
    @0,225,297us: [+4 T:0x4001d240] OM - Memory_contigAlloc> CMEM_getPhys(0x40a02000) = 0x8f6c7000.
    App-> Application started.
    @0,232,512us: [+0 T:0x4001d240] CE - Engine_open> Enter('firEngine', 0x0, 0xbed19bcc)
    @0,232,737us: [+0 T:0x4001d240] CE - rserverOpen('fir_unitserver_evmdm6446.x64P'), count = 0
    @0,232,915us: [+0 T:0x4001d240] OP - Processor_create> Enter(imageName='fir_unitserver_evmdm6446.x64P', linkCfg='(null)', attrs=0xbed19bb0)
    @0,234,528us: [+0 T:0x4001d240] OP - doCmd> Enter (cmdId=1, proc=0x3e558)
    @0,234,731us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Entered Sem_post> sem[0x3e1c0]
    @0,235,081us: [+0 T:0x40a01490] ti.sdo.ce.osal.Sem - Leaving Sem_pend> sem[0x3e1c0] status[0]
    @0,235,293us: [+0 T:0x40a01490] OP - getCmd_d> Exit (result=1)
    @0,235,449us: [+0 T:0x40a01490] OP - Processor_create_d> Enter(proc=0x3e558)
    @0,235,608us: [+2 T:0x40a01490] OP - Processor_create_d> Initializing DSP PROC...
    @0,235,777us: [+2 T:0x40a01490] OP - Processor_create_d> Using DspLink config data for entry #0 [server 'fir_unitserver_evmdm6446.x64P']
    @0,236,030us: [+2 T:0x40a01490] OP - Processor_create_d> Adding DSP segment #0 to Link configuration: name='DDR2', startAddress=0x8fa00000, sizeInBytes=0x400000, shared=1, syncd=0
    @0,236,261us: [+2 T:0x40a01490] OP - Processor_create_d> Adding DSP segment #1 to Link configuration: name='DSPLINKMEM', startAddress=0x8fe00000, sizeInBytes=0x100000, shared=1, syncd=0
    @0,236,458us: [+2 T:0x40a01490] OP - Processor_create_d> Adding DSP segment #2 to Link configuration: name='RESET_VECTOR', startAddress=0x8ff00000, sizeInBytes=0x80, shared=1, syncd=0
    @0,236,650us: [+2 T:0x40a01490] OP - Processor_create_d> Adding DSP segment #3 to Link configuration: name='DDRALGHEAP', startAddress=0x88000000, sizeInBytes=0x7a00000, shared=0, syncd=0
    @0,236,840us: [+2 T:0x40a01490] OP - Processor_create_d> DODSPCTRL was=1; now=0
    @0,249,478us: [+2 T:0x40a01490] OP - Processor_create_d> Attaching to DSP PROC...
    @0,262,402us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Leaving Sem_post> sem[0x3e1c0]
    @0,262,607us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Entered Sem_pend> sem[0x3e1d8] timeout[0xffffffff]
    @0,271,815us: [+2 T:0x40a01490] OP - Processor_create_d> Opening MSGQ pool...
    @0,272,751us: [+2 T:0x40a01490] OP - Processor_create_d> Loading fir_unitserver_evmdm6446.x64P on DSP (1 args)...
    @0,274,062us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Leaving Sem_pend> sem[0x3e1d8] status[0]
    @0,275,594us: [+0 T:0x4001d240] OP - doCmd> Exit (result=0)
    @0,275,746us: [+0 T:0x4001d240] OP - Processor_delete> Enter(proc=0x3e558)
    @0,275,903us: [+1 T:0x4001d240] OP - Processor_delete(0x3e558) freeing object ...
    @0,277,875us: [+0 T:0x4001d240] OP - Processor_delete> return.
    @0,278,081us: [+6 T:0x4001d240] CE - rserverOpen: can't start 'fir_unitserver_evmdm6446.x64P'; Processor_create failed
    @0,278,558us: [+0 T:0x4001d240] CE - rserverOpen('fir_unitserver_evmdm6446.x64P'): 0x0 done.
    @0,339,919us: [+0 T:0x4001d240] CE - Engine_close(0x3e528)
    @0,416,984us: [+0 T:0x4001d240] CE - Engine_open> return(0)
    app: error: can't open engine firEngine
    app ended.
    @0,461,151us: [+0 T:0x4001d240] OP - doCmd> Enter (cmdId=3, proc=0x0)
    @1,253,190us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Entered Sem_post> sem[0x3e1c0]
    @1,253,660us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Leaving Sem_post> sem[0x3e1c0]
    @1,254,029us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Entered Sem_pend> sem[0x3e1d8] timeout[0xffffffff]
    @1,272,634us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Leaving Sem_pend> sem[0x3e1d8] status[0]
    @1,272,845us: [+0 T:0x4001d240] OP - doCmd> Exit (result=0)
    @1,272,998us: [+0 T:0x4001d240] OT - Thread_delete> Enter (task=0x3e210)
    @1,273,223us: [+4 T:0x4001d240] OT - Thread_delete> pthread_cancel (0x3)
    @1,273,451us: [+4 T:0x4001d240] OT - Thread_delete> pthread_join (0x0)
    @1,273,639us: [+0 T:0x4001d240] OT - Thread_delete> Exit (task=0x3e210)
    @1,273,802us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Entered Sem_delete> sem[0x3e1c0]
    @1,274,007us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Leaving Sem_delete>
    @1,274,185us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Entered Sem_delete> sem[0x3e1d8]
    @1,274,347us: [+0 T:0x4001d240] ti.sdo.ce.osal.Sem - Leaving Sem_delete>

     

    Thanks,

    Danny

  • Danny

    What is the recommended way to use SIGALRM in a multi threaded environment? Is the recommended way to use a special "timers" thread for this that blocks with sigwait() for SIGALRM and mask out all other threads from receving SIGALRM?

    Deepali

  • Deepali,

    I am new to the Codec Engine and Linux programming so I am not sure.  Sorry.

    Thanks,

    Danny

  • Danny

    Can you confirm that the signal handling is disabled in DSPLink. Which version of DSPLink is this?

    Can you enable trace and send the log? See http://processors.wiki.ti.com/index.php/Enabling_trace_in_DSPLink for details

    .Deepali

  • We are using the dvsdk_2_00_00_22, and it contains dsplink-1_61_03-prebuilt.

    How do I start the dsplinkcfg.pl?  I am looking for the command line for the DM6446 EVM board.

    perl dsplinkcfg.pl --platform DAVINCI  (Do you have an example?)

    Thanks,

    Danny

     

     

  • Here is an update.  Hopefully someone can give me some ideas on what to try next.

    Our system is a DM6446 running Linux with dvsdk_2_00_00_22 that contains codec_engine_2_23_01 and dsplink-1_61_03-prebuilt.  The issue I am seeing is the Codec Engine and Linux interval timers aren't working together.

    At first we tried creating a 20msec interval timer and then opening the dsp server.  The server wouldn't open.   I created the interval timer with setitimer(ITIMER_REAL, &it_val, NULL) and timer_create(CLOCK_REALTIME, &se, &timerid) for testing.  When the timer expires it triggers SIGALRM (I also tried SIGUSR1) and calls our Timer function.  It was then suggested that I disable the DSP signal handler.  I did this and verified it was disabled.  The server still wouldn't open.  I verified this issue with the firtest.c in the iuniversal examples from TI and received the same error that the server couldn't be opened.

    It was then discovered that if I opened the server before creating the 20msec interval timer that the server would open correctly and appeared to work correctly in the firtest.c iuniversal example.  I then modified our audio application.  Our audio application contains numerous threads to handle ethernet and ALSA audio.  It was suggested that I needed to open a different handle for each thread so I opened the necessary handles to the dsp server before creating any interval timers.  After adding all this to our audio application, it wasn't working properly.  After a lot of testing and removing of code I verified something was going wrong with the interval timing portion of the code.  So there is some conflict between the Codec Engine and interval timers that I can't figure out.  I again tried disabling the DSP signal handler, but that made no difference.

    If I call the function CERuntime_init(); and don't try opening the dsp server our application works fine.  If I open the dsp server (Engine_open(CeData->sCEngineName, NULL, NULL);) and close the server (Engine_close(CeData->hCEngine);) right away even before setting the interval timer, the interval timer doesn't work correctly.  So this led me to believe something might be wrong with our server.  I then tried to open the firtest iuniversal example server and got the same results.  I just opened it and closed it right away before setting the interval timers.

    1) Is there a better way to do accurate 20msec timing?

    Thanks,

    Danny

  • Danny,

    You mentioned that a 1 second interval on the timer works, and that you suspect that getting a timer interrupt while the Engine is opening is inducing the problem.

    Is it possible for you to change the timer interval on the fly?  Slow it down to 1 sec during the Engine opening, then change it back to 20ms?  Might be interesting to see the results.  If it is successful, would the temporary interval change break your application?

    -Kevin

  • Kevin,

    Unfortunately, I don't think that will work very well for us.  I tried opening all the Codec Engine handles before the setitimer and was able to get them all to open, but was still having issues.  It really seemed like the SIGALARM was causing an issue with the Codec Engine.  Like I said I tried disabling the DSP link signal handler, but it didn't seem to make a difference.

    Thanks,

    Danny

  • Danny

    The default signal in DSPLink must be disabled to ensure the application catches SIGALARM. I see you are already doing this.

    The logs are not very clear. Which DSPLink API failing? Have you had success in rebuilding DSPLink? I would see if you can rebuild DSPLink with trace on. See some links at http://processors.wiki.ti.com/index.php/Enabling_trace_in_DSPLink

    The other issue I am suspecting is a bug in DSPLink SDOCM00070468: Gdb session hangs when trying to debug DSPLink based applications

    This issue was root caused to internal OSAL implementation in DSPLink not handling signals correctly. There is a bug fix on version 1.63 at http://software-dl.ti.com/dsps/dsps_registered_sw/sdo_sb/targetcontent/link/link_1_60/index.html

    There is no bug fix available on 1.61.03 but the patch fix can be used as reference to fix on 1.61.03 to check if that is the problem.

    Deepali

     

     

     

     

     

     

  • Danny,

    Some additional feedback to try:

    There might be an issue with the parameters being passed for sigaction to set the signal handler.

     The app should register the signal handler  like this

     

            sigemptyset (&block_mask) ;

            sigfillset( &block_mask) ;

            sigInstaller.sa_flags   = (SA_RESTART) ;

            sigInstaller.sa_mask    = block_mask;

     

    Note the difference in the values for sa_flags and sa_mask.

     

    Since SA_RESTART is not being passed, it could be the internal interruptible functions are failing. See description below

     

    sa_mask should not matter as much.

     

    SA_RESTART

    This flag affects the behavior of interruptible functions; that is, those specified to fail with errno set to [EINTR]. If set, and a function specified as interruptible is interrupted by this signal, the function shall restart and shall not fail with [EINTR] unless otherwise specified. If the flag is not set, interruptible functions interrupted by this signal shall fail with errno set to [EINTR].

    sigset_t

    sa_mask

    Additional set of signals to be blocked during execution of signal-catching function.