summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9ea1043)
raw | patch | inline | side by side (parent: 9ea1043)
author | Jianzhong Xu <a0869574@ti.com> | |
Fri, 25 May 2018 20:36:13 +0000 (16:36 -0400) | ||
committer | Jianzhong Xu <a0869574@ti.com> | |
Fri, 25 May 2018 20:47:39 +0000 (16:47 -0400) |
1. I/O DATA added DTSHD specific handling
2. ASIT decoder init split into two parts in order not to wait for slave decoder reset too long
3. ASIT decoder FSM change corresponding to #2.
4. ASOT added reset of audio frame data pointers.
2. ASIT decoder init split into two parts in order not to wait for slave decoder reset too long
3. ASIT decoder FSM change corresponding to #2.
4. ASOT added reset of audio frame data pointers.
diff --git a/pasdk/test_dsp/framework/audioStreamInpDec.c b/pasdk/test_dsp/framework/audioStreamInpDec.c
index 43dd8e725f68ce0730b129e455786de0e34ea49f..3e9d1f06fa187c346e268d5c17952955745e02a2 100644 (file)
extern void asitPostDecEvent(); // TODO: remove
enum {
+ DEC_STATE_INIT_ACK,
DEC_STATE_INFO_SND,
DEC_STATE_INFO_ACK_DECODE_SND,
DEC_STATE_DECODE_ACK,
static Int decodeInit(const PAF_ASIT_Params *pP, PAF_ASIT_Config *pAsitCfg,
Int sourceSelect);
+static Int decodeInitSnd(
+ const PAF_ASIT_Params *pP,
+ PAF_ASIT_Config *pAsitCfg,
+ Int sourceSelect);
+static Int decodeInitAck(
+ const PAF_ASIT_Params *pP,
+ PAF_ASIT_Config *pAsitCfg,
+ Int sourceSelect);
static Int decDecodeComplete(const PAF_ASIT_Params *pP,
PAF_ASIT_Config *pAsitCfg);
{
Int errno;
- errno = decodeInit(pP, pAsitCfg, sourceSelect);
+// errno = decodeInit(pP, pAsitCfg, sourceSelect);
+ errno = decodeInitSnd(pP, pAsitCfg, sourceSelect);
if(errno) {
decDecodeComplete(pP, pAsitCfg);
; // No error
}
- if (decMsg & DEC_MSGMSK_INPDATA) {
+ //if ( (decMsg & DEC_MSGMSK_INPDATA) && (pDec->state != DEC_STATE_INIT_ACK)) {
+ if ( (decMsg & DEC_MSGMSK_INPDATA) ) {
// put IB read information to the queue
decGetStreamInfo(&pAsitCfg->pIoInp[pAsitCfg->pAstCfg->masterDec], pDec);
TRACE_VERBOSE0("decDecodeFsm: INPUT DATA event. Put IB info into queue.");
do {
switch(pDec->state)
{
+ case DEC_STATE_INIT_ACK:
+ // Ignore any input data event in this state
+ if(decMsg & DEC_MSGMSK_INPDATA) {
+ decMsg &= ~DEC_MSGMSK_INPDATA; // clear bit mask
+ }
+
+ if (decMsg & DEC_MSGMSK_RXACK) {
+ int errno;
+ errno = decodeInitAck(pP, pAsitCfg, sourceSelect);
+
+ if(errno) {
+ decDecodeComplete(pP, pAsitCfg);
+
+ return ASIP_ERR_DECODE_INIT;
+ }
+
+ pDec->state = DEC_STATE_INFO_SND;
+ TRACE_VERBOSE0("decDecodeFsm: DEC_STATE_INIT_ACK done.");
+
+ decMsg &= ~DEC_MSGMSK_RXACK; // clear the bit mask
+ }
+ break;
+
case DEC_STATE_INFO_SND:
if(decMsg != DEC_MSGMSK_INPDATA) {
// Only DEC_MSGMSK_INPDATA is expected in this state
// -----------------------------------------------------------------------------
// ASIT Decoding Function - Reinitialization of Decode
//
-// Name: decDecodeInit
+// Name: decodeInit
// Purpose: Decoding Function for reinitializing the decoding process.
// From: AST Parameter Function -> decodeProcessing
// Uses: See code.
//PAF_AST_DecOpCircBufCtl *pCbCtl; /* Decoder output circular buffer control */
Int as; /* Audio Stream Number (1, 2, etc.) */
Int z; /* decode/encode counter */
- Int errno; /* error number */
+ Int errno = 0; /* error number */
Int zI, zS;
Int argIdx;
Int8 tempVar8;
Cache_wait();
// send dec activate message to slave
+ TRACE_VERBOSE1("AS%d: PAF_ASIT_decodeInit: sending dec activate message to slave", as+zS);
argIdx = 0; // set decIdx (zone index)
*(Int32 *)&decMsgBuf[argIdx] = z;
status = AspMsgSnd(hAspMsgMaster, ASP_SLAVE_DEC_ACTIVATE, decMsgBuf);
SW_BREAKPOINT; // temporary
return ASIP_ERR_DECODE_MSG; // temporary
}
+
+ TRACE_VERBOSE1("AS%d: PAF_ASIT_decodeInit: waiting slave to finish dec activate", as+zS);
status = AspMsgRcvAck(hAspMsgMaster, ASP_MASTER_DEC_ACTIVATE_DONE, NULL, TRUE);
if (status != ASP_MSG_NO_ERR)
{
SW_BREAKPOINT; // temporary
return ASIP_ERR_DECODE_MSG; // temporary
}
+ TRACE_VERBOSE1("AS%d: PAF_ASIT_decodeInit: slave finished dec activate", as+zS);
// send dec reset message to slave
argIdx = 0; // set decIdx
SW_BREAKPOINT; // temporary
return ASIP_ERR_DECODE_MSG; // temporary
}
+
+ TRACE_VERBOSE1("AS%d: PAF_ASIT_decodeInit: waiting slave to finish dec reset", as+zS);
status = AspMsgRcvAck(hAspMsgMaster, ASP_MASTER_DEC_RESET_DONE, decMsgBuf, TRUE);
if (status != ASP_MSG_NO_ERR)
{
argIdx = 0; // get decErrno
errno = *(Int32 *)&decMsgBuf[argIdx];
}
+ TRACE_VERBOSE1("AS%d: PAF_ASIT_decodeInit: slave finished dec reset", as+zS);
// invalidate Dec configuration
Cache_inv(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
pAsitCfg->inpDec.wridx = 0;
return ASIP_NO_ERR;
-} /* decDecodeInit */
+} /* decodeInit */
+
+
+// -----------------------------------------------------------------------------
+// ASIT Decoding Function - Reinitialization of Decode
+//
+// Name: decDecodeInit
+// Purpose: Decoding Function for reinitializing the decoding process.
+// From: AST Parameter Function -> decodeProcessing
+// Uses: See code.
+// States: x
+// Return: Error number in standard or SIO form (0 on success).
+// Trace: Message Log "trace" in Debug Project Configuration reports:
+// * State information as per parent.
+//
+// -----------------------------------------------------------------------------
+static Int decodeInitSnd(
+ const PAF_ASIT_Params *pP,
+ PAF_ASIT_Config *pAsitCfg,
+ Int sourceSelect)
+{
+ PAF_AST_Config *pAstCfg;
+ PAF_AST_IoInp *pInp;
+ AspMsgMaster_Handle hAspMsgMaster; // ASIT message master handle
+ //PAF_AST_DecOpCircBufCtl *pCbCtl; /* Decoder output circular buffer control */
+ Int as; /* Audio Stream Number (1, 2, etc.) */
+ Int z; /* decode/encode counter */
+ Int errno; /* error number */
+ Int zI, zS;
+ Int argIdx;
+ Int8 tempVar8;
+ char decMsgBuf[ASP_MSG_BUF_LEN];
+ Int status;
+
+ pAstCfg = pAsitCfg->pAstCfg; // get pointer to AST common (shared) configuration
+ pInp = pAsitCfg->pIoInp; // get pointer to IO configuration
+ hAspMsgMaster = pAsitCfg->hAspMsgMaster; // get message master handle
+
+ as = pAstCfg->as;
+ (void)as; // clear compiler warning in case not used with tracing disabled
+
+ //pCbCtl = &pAsitCfg->pAspmCfg->decOpCircBufCtl; // get pointer to circular buffer control
+
+ // reset frameCount
+ for (z=DECODE1; z < DECODEN; z++)
+ {
+ tempVar8 = sharedMemReadInt8(&(pAstCfg->xDec[z].decodeStatus.mode),
+ GATEMP_INDEX_DEC);
+ if (tempVar8)
+ {
+ sharedMemWriteInt(&(pAstCfg->xDec[z].decodeStatus.frameCount),
+ (Int)0, GATEMP_INDEX_DEC);
+ }
+ }
+
+ // loop through all supported inputs
+ for (z=DECODE1; z < DECODEN; z++)
+ {
+ zI = pP->inputsFromDecodes[z];
+ zS = pP->streamsFromDecodes[z];
+ (void)zS; // clear compiler warning in case not used with tracing disabled
+ tempVar8 = sharedMemReadInt8(&(pAstCfg->xDec[z].decodeStatus.mode),
+ GATEMP_INDEX_DEC);
+ if (pInp[zI].hIoPhy && tempVar8)
+ {
+ TRACE_VERBOSE1("AS%d: PAF_ASIT_decodeInit: initializing decode", as+zS);
+
+ // write back Dec configuration
+ Cache_wb(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+ Cache_wait();
+
+ // send dec activate message to slave
+ TRACE_VERBOSE1("AS%d: PAF_ASIT_decodeInit: sending dec activate message to slave", as+zS);
+ argIdx = 0; // set decIdx (zone index)
+ *(Int32 *)&decMsgBuf[argIdx] = z;
+ status = AspMsgSnd(hAspMsgMaster, ASP_SLAVE_DEC_ACTIVATE, decMsgBuf);
+ if (status != ASP_MSG_NO_ERR)
+ {
+ TRACE_TERSE0("decodeInit: error in sending DEC_ACTIVATE message ");
+ SW_BREAKPOINT; // temporary
+ return ASIP_ERR_DECODE_MSG; // temporary
+ }
+
+ TRACE_VERBOSE1("AS%d: PAF_ASIT_decodeInit: waiting slave to finish dec activate", as+zS);
+ status = AspMsgRcvAck(hAspMsgMaster, ASP_MASTER_DEC_ACTIVATE_DONE, NULL, TRUE);
+ if (status != ASP_MSG_NO_ERR)
+ {
+ TRACE_TERSE0("decodeInit: error in receiving DEC_ACTIVATE_DONE ack message ");
+ SW_BREAKPOINT; // temporary
+ return ASIP_ERR_DECODE_MSG; // temporary
+ }
+ TRACE_VERBOSE1("AS%d: PAF_ASIT_decodeInit: slave finished dec activate", as+zS);
+
+ // send dec reset message to slave
+ argIdx = 0; // set decIdx
+ *(Int32 *)&decMsgBuf[argIdx] = z;
+ status = AspMsgSnd(hAspMsgMaster, ASP_SLAVE_DEC_RESET, decMsgBuf);
+ if (status != ASP_MSG_NO_ERR)
+ {
+ TRACE_TERSE0("decodeInit: error in sending DEC_RESET message ");
+ SW_BREAKPOINT; // temporary
+ return ASIP_ERR_DECODE_MSG; // temporary
+ }
+
+ TRACE_VERBOSE1("AS%d: PAF_ASIT_decodeInit: waiting slave to finish dec reset", as+zS);
+ } /* end of if(hIoPhy && decodeStatus.mode) */
+ } /* end of for (z=DECODE1; z < DECODEN; z++) */
+
+ pAsitCfg->inpDec.state = DEC_STATE_INIT_ACK;
+
+ return ASIP_NO_ERR;
+} /* decDecodeInitSnd */
+
+
+static Int decodeInitAck(
+ const PAF_ASIT_Params *pP,
+ PAF_ASIT_Config *pAsitCfg,
+ Int sourceSelect)
+{
+ PAF_AST_Config *pAstCfg;
+ PAF_AST_IoInp *pInp;
+ AspMsgMaster_Handle hAspMsgMaster; // ASIT message master handle
+ Int as; /* Audio Stream Number (1, 2, etc.) */
+ Int z; /* decode/encode counter */
+ Int errno; /* error number */
+ Int zI, zS;
+ Int8 tempVar8;
+ char decMsgBuf[ASP_MSG_BUF_LEN];
+
+ pAstCfg = pAsitCfg->pAstCfg; // get pointer to AST common (shared) configuration
+ pInp = pAsitCfg->pIoInp; // get pointer to IO configuration
+
+ as = pAstCfg->as;
+ (void)as; // clear compiler warning in case not used with tracing disabled
+
+
+ // loop through all supported inputs
+ for (z=DECODE1; z < DECODEN; z++)
+ {
+ Uns gear;
+ int status;
+ zI = pP->inputsFromDecodes[z];
+ zS = pP->streamsFromDecodes[z];
+ (void)zS; // clear compiler warning in case not used with tracing disabled
+
+ hAspMsgMaster = pAsitCfg->hAspMsgMaster; // get message master handle
+ status = AspMsgRcvAck(hAspMsgMaster, ASP_MASTER_DEC_RESET_DONE, decMsgBuf, FALSE);
+ if (status != ASP_MSG_NO_ERR)
+ {
+ TRACE_TERSE0("decodeInit: error in sending DEC_RESET message ");
+ SW_BREAKPOINT; // temporary
+ return ASIP_ERR_DECODE_MSG; // temporary
+ }
+ else
+ {
+ errno = *(Int32 *)&decMsgBuf[0];
+ if (errno != 0) {
+ return ASIP_ERR_DECODE_MSG;
+ }
+ }
+ TRACE_VERBOSE1("AS%d: PAF_ASIT_decodeInit: slave finished dec reset", as+zS);
+
+ // invalidate Dec configuration
+ Cache_inv(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+ Cache_wait();
+
+ if (errno != 0) {
+ return ASIP_ERR_DECODE_MSG;
+ }
+
+ gear = (Uns)sharedMemReadInt8(&(pAstCfg->xDec[z].decodeStatus.aspGearControl),
+ GATEMP_INDEX_DEC);
+ tempVar8 = gear < GEARS ? gear : 0;
+ sharedMemWriteInt8(&(pAstCfg->xDec[z].decodeStatus.aspGearStatus),
+ tempVar8, GATEMP_INDEX_DEC);
+
+ //JXTODO: do we need to update input status here again?
+ if (errno = asitUpdateInputStatus(pInp[zI].pRxParams,
+ &pAstCfg->xInp[zI].inpBufStatus,
+ &pAstCfg->xInp[zI].inpBufConfig)) {
+ return ASIP_ERR_INPUT_CFG;
+ }
+ } /* end of for (z=DECODE1; z < DECODEN; z++) */
+
+ pAsitCfg->inpDec.frame = 0;
+ pAsitCfg->inpDec.block = 0;
+ pAsitCfg->inpDec.rdidx = 0;
+ pAsitCfg->inpDec.wridx = 0;
+
+ return ASIP_NO_ERR;
+} /* decDecodeInitAck */
Int decDecodeComplete( const PAF_ASIT_Params *pP,
PAF_ASIT_Config *pAsitCfg)
diff --git a/pasdk/test_dsp/framework/audioStreamInpProc.h b/pasdk/test_dsp/framework/audioStreamInpProc.h
index 4f9ca0dea5830bb29ab43714b6a3b4b682ced21d..52304c785b5503c869e39d09d3f194293df3d1a0 100644 (file)
bool firstTimeInit;
} PAF_AST_IoInp;
-#define DEC_INPBUF_CONFIG_QUEUE_SIZE 4
+#define DEC_INPBUF_CONFIG_QUEUE_SIZE 8
// Decoder structure
typedef struct asipDecProc_s {
Int state;
diff --git a/pasdk/test_dsp/framework/audioStreamInpProcNewIO.c b/pasdk/test_dsp/framework/audioStreamInpProcNewIO.c
index e07c9f1a725a1098216562a7e8b3c383d409ff64..b298da7ab77392e04931f62a441df9c0f1bb6ec2 100644 (file)
asitErr = asitInputDataProcess(pInp, &autoDetStatus);
if(asitErr != ASIT_NO_ERR) {
// Even though there is error, still need to start next transfer to
- // maintain McASP transfer.
+ // maintain McASP transfer, before returning error.
asitPhyTransferStart(pInp);
return asitErr;
if(autoDetStatus.syncState == IODATA_SYNC_BITSTREAM) {
// Input is bit stream: go to decoding
pInp->asipState = ASIT_DECODE_PROCESSING;
+ TRACE_VERBOSE0("Bit stream detected. Go to decoding. ");
}
else {
// Input is PCM: stop swapping data
// Go to transition state to switch to PCM
pInp->asipState = ASIT_PCM_TRANSITION;
+ TRACE_VERBOSE0("PCM stream detected. Go to PCM transition. ");
}
}
}
// Inform decoder to complete the decoding of previous frame - is this good?
pInp->sourceSelect = PAF_SOURCE_NONE;
- pInp->numFrameReceived = 0; // for debugging
+ pInp->numFrameReceived = 0; // for debugging
+ pInp->numPcmFrameReceived = 0; // for debugging
TRACE_TERSE0("asitDecodeProcessing: SYNC lost.");
#ifdef DEBUG_SKIP_DECODING
#endif
}
else {
- pInp->numFrameReceived += 1; // for debugging
+ if(autoDetStatus.syncState == IODATA_SYNC_PCM) {
+ pInp->numPcmFrameReceived += 1; // for debugging
+ }
+ else {
+ pInp->numFrameReceived += 1; // for debugging
+ }
// Communicate input stream information to decoder through input
// buffer configuration -- this was moved inside decDecodeFsm
else {
// Inform decoder to complete the decoding of previous frame - is this good?
pInp->sourceSelect = PAF_SOURCE_NONE;
- pInp->numFrameReceived = 0; // for debugging
+ pInp->numFrameReceived = 0; // for debugging
+ pInp->numPcmFrameReceived = 0; // for debugging
TRACE_TERSE1("asitDecodeProcessing: asitInputDataProcess error: %d", asitErr);
#ifdef DEBUG_SKIP_DECODING
ioBuffParams.size = pInpBuf->inpBufConfig.allocation / STRIDE_WORST_CASE
* STRIDE_WORST_CASE;
ioBuffParams.sync = IOBUFF_WRITE_SYNC;
- ioBuffParams.nominalDelay = INPUT_FRAME_SIZE_DEF;
+ ioBuffParams.nominalDelay = pInpIo->phyXferSize;
if (ioBuffInit(pInpIo->hIoBuff, &ioBuffParams) != IOBUFF_NOERR) {
return (ASIT_ERR_IOBUFF_INIT); // to remove magic number
}
// pInp->swapData = TRUE;
pInp->pcmSwitchHangOver = INPUT_SWITCH_HANGOVER;
pDec->initDone = FALSE;
- pInp->numFrameReceived = 0;
+ pInp->numFrameReceived = 0; // for debugging
+ pInp->numPcmFrameReceived = 0; // for debugging
}
/*======================================================================================
if(mcasp_packet->arg == IOPHY_XFER_FINAL) {
//Semaphore_post(asipSemRx);
Event_post(gAsitEvtHandle, ASIT_EVTMSK_INPDATA);
+ //Log_info0("asipMcaspCallback: final packet - event posted.\n");
} else {
+ //Log_info0("asipMcaspCallback: intermediate packet.\n");
; // intermediate packet due to buffer wrapping around
}
}
System_abort("\nMcASP for input overruns! %d!\n");
}
else {
+ //TRACE_VERBOSE0("asitPhyTransferStart: submit a transfer");
ioPhyErr = ioPhyXferSubmit(pInpIo->hIoPhy);
//if(ioPhyXferSubmit(pInpIo->hIoPhy)==IOPHY_ERR_BUFF_OVERFLOW) {
if(ioPhyErr!=IOPHY_NOERR){
}
if(autoDetStatus->syncState == IODATA_SYNC_BITSTREAM) {
- uint_least16_t pc = autoDetStatus->bitStreamInfo & SYNC_PC_MASK; //0x001F
+ uint_least16_t pc = autoDetStatus->streamInfo.IEC_PC;
sourceProgram = IECpafSource[pc];
}
}
else {
// For bitstream, I/O frame length is the frame length of the bitstream
- uint_least16_t pc = autoDetStatus->bitStreamInfo & SYNC_PC_MASK; //0x001F
- ioFrameLength = iecFrameLength[pc];
-
-/*
- if( (pc == 0x11) && (DTSHDSubType == 3)
- && (PAF_ASP_sampleRateHzTable[pBufConfig->pBufStatus->sampleRateStatus][PAF_SAMPLERATEHZ_STD] <=48000.0))
- pDevExt->sourceProgram = PAF_SOURCE_DXP; // LBR is 23
-
- if (pc == 1)
- pDevExt->elementSize = 4288;
- else if (pc == 0x11) {
- pDevExt->frameLength = (pDevExt->pIECFrameLength[pc] << DTSHDSubType);
- pDevExt->lengthofData = pDevExt->frameLength;
- }
-*/
-
pBufConfig->sizeofElement = WORD_SIZE_BITSTREAM;
- pBufConfig->frameLength = ioFrameLength;
- pBufConfig->lengthofData = ioFrameLength - IEC_HEADER_LENGTH;
+ pBufConfig->frameLength = autoDetStatus->streamInfo.frameLength;
+ pBufConfig->lengthofData = autoDetStatus->streamInfo.dataLength;
+ ioFrameLength = autoDetStatus->streamInfo.frameLength;
// Change I/O PHY transfer size to bitstream frame size
- pInp->phyXferSize = ioFrameLength*WORD_SIZE_BITSTREAM;
+ pInp->phyXferSize = ioFrameLength*(WORD_SIZE_BITSTREAM);
}
pBufConfig->stride = pInp->stride; // common for PCM and bitstream
diff --git a/pasdk/test_dsp/framework/audioStreamOutProc.c b/pasdk/test_dsp/framework/audioStreamOutProc.c
index d25f1e476b42a766ae0aef7f2f2160f15b1c626f..bb462ad7b1fdc99b854dd36e9143b4ecac3a91ad 100644 (file)
asopMarkOutBuffsWriteComplete(&pAstCfg->xOut[zO], &pAsotCfg->pIoOut[zO]);
}
+ // Audio frame pointers need to be reset because DTS PARMA modifies them!!
+ resetAfPointers(pP, pAstCfg->xStr);
+
if (status == ASOP_SOK)
{
// Execute Info2
index 1db06be89256b916a3ec3cb68e5ccfa79f45e1a4..bd30f3b0ce2d511f4cee02917796acfc1decda37 100644 (file)
#define IODATA_SYNC_THD 0x16
#define IODATA_MIN_NUM_ZEROS_BEFORE_PA 2
-#define IODATA_PREAMBLE_MAX_LEN 8 // TBD
+#define IODATA_PREAMBLE_MAX_LEN 16 // TBD
#define IODATA_HEADER_LENGTH_IEC 4
#define IODATA_HEADER_CHECK_LENGTH_IEC 2 // For IEC, only look at 2 words to check SYNC.
case IODATA_CTL_GET_AUTODET_STATUS:
ioDataCtl->param.autoDetStats.syncState = pIoDataInst->autoDet.syncState;
ioDataCtl->param.autoDetStats.deliverZeros = pIoDataInst->deliverZeros;
- ioDataCtl->param.autoDetStats.bitStreamInfo = pIoDataInst->autoDet.bitStreamInfo;
+ ioDataCtl->param.autoDetStats.streamInfo.IEC_PC = pIoDataInst->autoDet.bitStreamInfo & IODATA_SYNC_PC_MASK;
+ ioDataCtl->param.autoDetStats.streamInfo.frameLength = pIoDataInst->autoDet.frameLength;
+ ioDataCtl->param.autoDetStats.streamInfo.dataLength = pIoDataInst->autoDet.frameLength
+ - pIoDataInst->autoDet.headerLength;
break;
/*
case IODATA_CTL_GET_STEAM_INFO:
/* Check if a full frame has been received and if so, check if SYNC is maintained */
if(pIoDataInst->autoDet.completeFrameRcvd) {
if(pIoDataInst->autoDet.syncDetected) {
+ pIoDataInst->dbgStats.numFramesRcvd += 1;
pIoDataInst->autoDet.syncState = IODATA_SYNC_BITSTREAM;
pIoDataInst->autoDet.completeFrameRcvd = FALSE;
// Store the beginning address of data in current frame (not including the preamble)
pIoDataInst->autoDet.frameDataStartConfirm = pIoDataInst->autoDet.frameDataStartTemp;
- pIoDataInst->dbgStats.numFramesRcvd += 1;
// re-initialize for SYNC check
syncCheckInit(pIoDataInst);
uint_least16_t pc = pIoDataInst->autoDet.bitStreamInfo & IODATA_SYNC_PC_MASK;
pIoDataInst->autoDet.frameLength = pIoDataInst->IECframeLengths[pc];
+
+ if (pc == 1) {
+ pIoDataInst->autoDet.frameLength = 4288;
+ }
+ else if (pc == IODATA_SYNC_SUBTYPE_DTSHD) {
+ int DTSHDSubType = (pIoDataInst->autoDet.bitStreamInfo & IODATA_SYNC_SUBTYPE_MASK)
+ >> IODATA_SYNC_SUBTYPE_SHIFT;
+ pIoDataInst->autoDet.frameLength = pIoDataInst->IECframeLengths[pc] << DTSHDSubType;
+ }
+
pIoDataInst->autoDet.distToFrameEnd = pIoDataInst->autoDet.frameLength
- pIoDataInst->autoDet.numElementsRcvd;
//pDevExt->headerSize = IEC_HEADER_SIZE;
pDet->preambleRef[3] = tail; /* save this word for sync check */
pDet->headerLength = IODATA_HEADER_LENGTH_IEC;
+ if( (pDet->bitStreamInfo & 0x1F) == 0x11) { // DTSHD subtype
+ pDet->headerLength += 6;
+ }
pDet->headerCheckLen = IODATA_HEADER_CHECK_LENGTH_IEC;
scanState = SCANNED_IEC_PD;
index bed31c5adbc2ea892a4860b1c70c054c010e7d81..1c27a4eeb8a89e7a00f7ff4248e128c4d5c1c1ac 100644 (file)
int8_t elementSize; // size of elements in bytes
} ioDataFrameInfo_t;
+typedef struct streamInfo_s {
+ uint_least16_t IEC_PC;
+ uint_least32_t frameLength;
+ uint_least32_t dataLength;
+} streamInfo_t;
+
// Auto-detection status
typedef struct ioDataAutoDetStat_s {
uint_least16_t syncState; // SYNC state
- uint_least16_t bitStreamInfo; // bit stream information - value of IEC_PC
+ streamInfo_t streamInfo; // bit stream information - value of IEC_PC
uint8_t deliverZeros; // flag to indicate whether zeros should be sent to output
} ioDataAutoDetStat_t;