]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/commitdiff
PASDK-277:Increase MAT-THD nominal delay to 3504.
authorFrank Livingston <frank-livingston@ti.com>
Sat, 3 Jun 2017 18:26:37 +0000 (13:26 -0500)
committerFrank Livingston <frank-livingston@ti.com>
Sat, 3 Jun 2017 18:26:37 +0000 (13:26 -0500)
Resulting maximum size for PCM circular buffer in CB is 7680 samples.
=>maximum size for AF circular buffer size in CB is 7680/256=30.

We currently allocate 90*4096 bytes for each audio frame, and this is
being allocated from SR_DDR3. Needed to increase size of SR_DDR3, which
required moving other memory regions to different base addresses.
NOTE: COMMON2_DDR3 is untouched, hard-coded MAR settings in DSP system
init thread don't need to be changed.

pasdk/common/aspDecOpCircBuf_common.h
pasdk/shared/config.bld
pasdk/test_arm/framework/aspDecOpCircBuf_slave.c
pasdk/test_arm/framework/audioStreamDecodeProc.c
pasdk/test_dsp/framework/audioStreamInpProc.c

index 9f289379a4bd92d68fe4a6d5ed28e614e2e7fed1..c6c18aaeea6f98ac488e842c79d340439b94260a 100644 (file)
@@ -53,10 +53,12 @@ All rights reserved.
 #define ASP_DECOP_CB_SOK                        ( 0 )                               // ok
 #define ASP_DECOP_CB_CTL_INIT_INV_GATE          ( ASP_DECOP_CB_SOK-1 )              // error: invalid gate handle
 #define ASP_DECOP_CB_ERR_START                  ( ASP_DECOP_CB_CTL_INIT_INV_GATE )  // start error return ID for master & slave error return definitions
-#define ASP_DECOP_CB_MAX_NUM_AF                 ( 15 )                              // decoder output circular buffer maximum number audio frames
-#define ASP_DECOP_CB_MAX_NUM_PCM_CH             ( 16 )                              // decoder output circular buffer maximum number audio PCM channels
-#define ASP_DECOP_CB_MAX_NUM_PCM_FRAMES         ( 15 )                              // decoder output circular buffer maximum number PCM frames //Qin - Increased to prevent cb overflow for ddp.
-#define ASP_DECOP_CB_MAX_PCM_FRAME_LEN          ( 6*256 )                           // decoder output circular buffer maximum PCM frame length
+
+#define ASP_DECOP_CB_MAX_NUM_AF                 ( 30 )      // decoder output circular buffer maximum number audio frames
+
+#define ASP_DECOP_CB_MAX_NUM_PCM_CH             ( 16 )      // decoder output circular buffer maximum number audio PCM channels
+#define ASP_DECOP_CB_MAX_NUM_PCM_FRAMES         ( 15 )      // decoder output circular buffer maximum number PCM frames //Qin - Increased to prevent cb overflow for ddp.
+#define ASP_DECOP_CB_MAX_PCM_FRAME_LEN          ( 6*256 )   // decoder output circular buffer maximum PCM frame length
 
 #define ASP_DECOP_CB_MAX_NUM_PCM_CH_DDP         ( 16 )      // decoder output circular buffer maximum number audio PCM channels for DDP
 #define ASP_DECOP_CB_MAX_PCM_FRAME_LEN_48kDDP   ( 6*256 )   // decoder output circular buffer maximum PCM frame length at 48kHz sampling rate
@@ -68,22 +70,31 @@ All rights reserved.
 #define ASP_DECOP_CB_PCM_BUF_SZ_32CH48kMAT      ( ASP_DECOP_CB_MAX_NUM_PCM_CH_MAT * ASP_DECOP_CB_MAX_NUM_PCM_FRAMES * ASP_DECOP_CB_MAX_PCM_FRAME_LEN_48kMAT )
 
 #define ASP_DECOP_CB_MAX_NUM_AF_PCM             ( 4 )
+#if (ASP_DECOP_CB_MAX_NUM_AF_PCM > ASP_DECOP_CB_MAX_NUM_AF)
+    #error "CB Max AF PCM error"
+#endif
 #define ASP_DECOP_CB_INIT_WRTIDX_PCM            ( 0 )
 #define ASP_DECOP_CB_INIT_RDIDX_PCM             ( 0 )
 #define ASP_DECOP_CB_INIT_LAG_PCM               ( 2 )
 #define ASP_DECOP_CB_TARGET_ND_SAMPS_48kPCM     ( ASP_DECOP_CB_INIT_LAG_PCM * 256 ) // PCM target Nominal Delay in number of samples, fs=48 kHz
 
 #define ASP_DECOP_CB_MAX_NUM_AF_DDP             ( 2 )
+#if (ASP_DECOP_CB_MAX_NUM_AF_DDP > ASP_DECOP_CB_MAX_NUM_AF)
+    #error "CB Max AF DDP error"
+#endif
 #define ASP_DECOP_CB_INIT_WRTIDX_DDP            ( 0 )
 #define ASP_DECOP_CB_INIT_RDIDX_DDP             ( 0 )
 #define ASP_DECOP_CB_INIT_LAG_DDP               ( 1 )
 #define ASP_DECOP_CB_TARGET_ND_SAMPS_48kDDP     ( ASP_DECOP_CB_INIT_LAG_DDP * 1536 ) // DDP target Nominal Delay in number of samples, fs=48 kHz
 
-#define ASP_DECOP_CB_MAX_NUM_AF_THD             ( 15 )
+#define ASP_DECOP_CB_MAX_NUM_AF_THD             ( 30 ) //( 15 )
+#if (ASP_DECOP_CB_MAX_NUM_AF_THD > ASP_DECOP_CB_MAX_NUM_AF)
+    #error "CB Max AF THD error"
+#endif
 #define ASP_DECOP_CB_INIT_WRTIDX_THD            ( 0 )
 #define ASP_DECOP_CB_INIT_RDIDX_THD             ( 0 )
 //#define ASP_DECOP_CB_INIT_LAG_THD               ( 5 ) // 5*20ms = 100 ms, For the worst case of 100 ms
-#define ASP_DECOP_CB_TARGET_ND_SAMPS_48kTHD     ( 2224 ) // THD target Nominal Delay in number of samples, fs=48 kHz
+#define ASP_DECOP_CB_TARGET_ND_SAMPS_48kTHD     ( 3504 )//( 2224 ) // THD target Nominal Delay in number of samples, fs=48 kHz
 
 #define ASP_DECODE_CB_GATE_NAME                 ( "AspDecOpCbGate" ) // name of GateMP used for circular buffer shared memory protection
 #define ASP_DECODE_CB_GATE_REGION_ID            ( 0 )                // IPC shared region ID used for CB gate allocation   
index f61e1b65f136da0a9b661238545ce7b876646b18..ace1f43e424a60cd1da547279240df267e3c4465 100644 (file)
@@ -47,12 +47,12 @@ var Build = xdc.useModule('xdc.bld.BuildEnvironment');
  *    0C08_0000   0004_0000  ( 256 KB)  HOST_MSMC   (code, data)
  *    0C0C_0000   0004_0000  ( 256 KB)  CORE_MSMC   (code, data)
  *    8000_0000   0020_0000  (   2 MB)  SR_0        (ipc)
- *    8020_0000   0080_0000  (   8 MB)  SR_DDR3     (ipc:data)
- *    80A0_0000   0060_0000  (   6 MB)  COMMON_DDR3 (data)
+ *    8020_0000   00E0_0000  (  14 MB)  SR_DDR3     (ipc:data)
  *    8100_0000   0100_0000  (  16 MB)  COMMON2_DDR3(code, data)      // aligned to MAR memory region  
- *    8200_0000   0320_0000  (  50 MB)  HOST_DDR3   (code, data)
- *    8520_0000   0400_0000  (  64 MB)  CORE0_DDR3  (code, data)
- *    8920_0000   76E0_0000  (1902 MB)  DDR3        (code, data)
+ *    8200_0000   0060_0000  (   6 MB)  COMMON_DDR3 (data)
+ *    8260_0000   0320_0000  (  50 MB)  HOST_DDR3   (code, data)
+ *    8580_0000   0400_0000  (  64 MB)  CORE0_DDR3  (code, data)
+ *    8980_0000   7680_0000  (1896 MB)  DDR3        (code, data)
  */
 
 var SR_MSMC = {
@@ -69,13 +69,13 @@ var SR_0 = {
 
 var SR_DDR3 = {
         name: "SR_DDR3", space: "data", access: "RW",
-        base: 0x80200000, len: 0x00800000,
+        base: 0x80200000, len: 0x00E00000,
         comment: "SR DDR3 Memory"
     };
 
 var COMMON_DDR3 = {
         name: "COMMON_DDR3", space: "data", access: "RW",
-        base: 0x80A00000, len: 0x00600000,
+        base: 0x82000000, len: 0x00600000,
         comment: "COMMON DDR3 Memory"
     };
     
@@ -87,7 +87,7 @@ var COMMON2_DDR3 = {  // Common Structure for shared data, Non cacheable
 
 var DDR3 = {
         name: "DDR3", space: "code/data", access: "RW",
-        base: 0x89200000, len: 0x76E00000,
+        base: 0x89800000, len: 0x76800000,
         comment: "DDR3 Memory"
     };
 
@@ -112,7 +112,7 @@ Build.platformTable["ti.platforms.evmTCI66AK2G02:host"] = {
         
         [ "HOST_DDR3",  {
             name: "HOST_DDR3", space: "code/data", access: "RWX",
-            base: 0x82000000, len: 0x03200000,
+            base: 0x82600000, len: 0x03200000,
             comment: "HOST DDR3"
         }], 
         
@@ -172,7 +172,7 @@ Build.platformTable["ti.platforms.evmTCI66AK2G02:core0"] = {
         
         [ "CORE0_DDR3",  {
             name: "CORE0_DDR3", space: "code/data", access: "RWX",
-            base: 0x85200000, len: 0x04000000,
+            base: 0x85800000, len: 0x04000000,
             comment: "CORE0 DDR3"
         }], 
         
index 9a37e6eeaaad839456d0639e5d7c136ea3be5baf..31532010ce5082b43cfd48d598efb42756a1b9e6 100644 (file)
@@ -174,6 +174,7 @@ Int cbWriteStop(
 //Int16 gCalcDeltaSampsBuf[10];
 //Int8 gPrimedFlagCnt=0;
 
+// (***) FL: revisit
 // Write audio frame to circular buffer
 Int cbWriteAf(
     PAF_AST_DecOpCircBufCtl *pCbCtl,    // decoder output circular buffer control
@@ -231,7 +232,7 @@ Int cbWriteAf(
         }
 #endif        
 
-        //Log_info2("cbWriteAf:pCb->numAfCb=%d, pCb->maxNumAfCb=%d", (IArg)pCb->readerActiveFlag, (IArg)pCb->maxNumAfCb); // FL: debug
+        //Log_info2("cbWriteAf:pCb->numAfCb=%d, pCb->maxNumAfCb=%d", (IArg)pCb->readerActiveFlag, (IArg)pCb->maxNumAfCb); // debug
 
         // check overflow
         //while (pCb->numAfCb >= pCb->maxNumAfCb); // debug
@@ -248,7 +249,7 @@ Int cbWriteAf(
             // Leave the gate
             GateMP_leave(gateHandle, key);
 
-            //Log_info2("cbWriteAf:gate leave, gateHandle=0x%04x, key=%d", (IArg)gateHandle, (IArg)key); // FL: debug
+            //Log_info2("cbWriteAf:gate leave, gateHandle=0x%04x, key=%d", (IArg)gateHandle, (IArg)key); // debug
 
             return ASP_DECOP_CB_WRITE_OVERFLOW;
         }
@@ -418,7 +419,6 @@ Int cbWriteAf(
             //    gPrimedFlagCnt++;
         }
 
-        // (***) FL: revisit
         // Write back circular buffer configuration
         Cache_wb(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
         // write back audio frame
@@ -445,14 +445,13 @@ Int cbWriteAf(
            toggleState = ~(toggleState);
         }
         Log_info3("wrote %d samples into AF %d sourceSel: %d", pAfCb->sampleCount, pCb->afWrtIdx, pCb->sourceSel);
-        // write back private metadata // QIN
         Log_info4("CBWMETA num=%d  size=%d  offset=%d chrequest=0x%04x", pAfCb->numPrivateMetadata, pAfCb->pafPrivateMetadata[0].size, pAfCb->pafPrivateMetadata[0].offset, pAfCb->channelConfigurationRequest.full);
     }
 
     // Leave the gate
     GateMP_leave(gateHandle, key);
 
-    //Log_info2("cbWriteAf:gate leave, gateHandle=0x%04x, key=%d", (IArg)gateHandle, (IArg)key); // FL: debug
+    //Log_info2("cbWriteAf:gate leave, gateHandle=0x%04x, key=%d", (IArg)gateHandle, (IArg)key); // debug
 
     return ASP_DECOP_CB_SOK;
 }
index e56050480217bf2ddd8a0f4148153aa4664b68a1..0ebe5db65f76ccb3773fef5114c60b2a707e045c 100644 (file)
@@ -921,8 +921,7 @@ PAF_ASDT_initPhaseMalloc(
     // Initialize error block
     Error_init(&eb); 
 
-//    if (!(gpDecAudioFrame = (PAF_AudioFrame *)Memory_calloc((IHeap_Handle)HEAP_INTERNAL1,
-    if (!(gpDecAudioFrame = (PAF_AudioFrame *)Memory_calloc((IHeap_Handle)HEAP_EXTERNAL, //Qin - moved to external memory
+    if (!(gpDecAudioFrame = (PAF_AudioFrame *)Memory_calloc((IHeap_Handle)HEAP_EXTERNAL,
         DECODEN * sizeof (PAF_AudioFrame), 4, &eb)))
     {
         TRACE_TERSE1("PAF_ASDT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
index 4b94edde1b6a41b4cdb6254503da7228486265ca..af3fa9ed4df3c525f3423cfddc27305e43bb2362 100644 (file)
@@ -1588,7 +1588,7 @@ PAF_ASIT_initPhaseDecOpCircBuf(
             SW_BREAKPOINT;
         }
         pCb->pcmBufEnd = pCb->pcmBuf + ASP_DECOP_CB_PCM_BUF_SZ;
-        // allocate Metadata buffers //QIN
+        // allocate Metadata buffers
         if (!(pCb->metaBuf = Memory_calloc((IHeap_Handle)HEAP_EXTERNAL_SHM, ASP_DECOP_CB_MAX_NUM_AF * PAF_MAX_PRIVATE_MD_SZ * PAF_MAX_NUM_PRIVATE_MD * sizeof(Int8), 4, &eb)))
         {
             TRACE_TERSE1("PAF_ASIT_initPhaseDecOpCircBuf: AS%d: Memory_calloc failed", as+zMS);
@@ -1596,8 +1596,7 @@ PAF_ASIT_initPhaseDecOpCircBuf(
         }
         pCb->metaBufEnd = pCb->metaBuf + (ASP_DECOP_CB_MAX_NUM_AF * PAF_MAX_PRIVATE_MD_SZ * PAF_MAX_NUM_PRIVATE_MD);
 
-
-        #ifdef CB_RW_OP_CAP_PP
+        #ifdef CB_RW_OP_CAP_PP // debug
         // allocate debug buffer
         if (!(pCb->cb_samples_op = Memory_calloc((IHeap_Handle)HEAP_EXTERNAL_NONCACHED_SHM, CB_OP_COUNT_MAX * sizeof(UInt32), 4, &eb)))
         {
@@ -3025,10 +3024,6 @@ PAF_ASIT_decodeInfo(
             // (***) FL: revisit
             // write back Inp configuration
             Cache_wb(&pAstCfg->xInp[zI], sizeof(PAF_AST_InpBuf), Cache_Type_ALLD, 0);
-            // write back input data //  (***) GJ: don't need this for 1xI2S HDMI/SPDIF. Maybe need this for 4xI2S HDMI.
-            //pIpBufConfig = &gPAF_AST_config.xInp[zI].inpBufConfig;
-            //size = pIpBufConfig->frameLength * pIpBufConfig->sizeofElement;
-            //Cache_wb((Ptr)pIpBufConfig->pntr.pSmInt, size, Cache_Type_ALLD, 0);
             // write back Dec configuration
             Cache_wb(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
             Cache_wait();