summaryrefslogtreecommitdiff
path: root/software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c
diff options
context:
space:
mode:
Diffstat (limited to 'software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c')
-rw-r--r--software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c365
1 files changed, 98 insertions, 267 deletions
diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c
index 766f93b..4536ad4 100644
--- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c
+++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c
@@ -2,7 +2,7 @@
File: oct6100_channel.c
- Copyright (c) 2001-2006 Octasic Inc.
+ Copyright (c) 2001-2007 Octasic Inc.
Description:
@@ -23,9 +23,9 @@ You should have received a copy of the GNU General Public License
along with the OCT6100 GPL API; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-$Octasic_Release: OCT612xAPI-01.00-PR47 $
+$Octasic_Release: OCT612xAPI-01.00-PR48 $
-$Octasic_Revision: 480 $
+$Octasic_Revision: 491 $
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
@@ -122,7 +122,6 @@ UINT32 Oct6100ChannelOpenDef(
f_pChannelOpen->VqeConfig.lRinAutomaticLevelControlTargetDb = -20;
f_pChannelOpen->VqeConfig.fSoutAutomaticLevelControl = FALSE;
f_pChannelOpen->VqeConfig.lSoutAutomaticLevelControlTargetDb = -20;
- f_pChannelOpen->VqeConfig.ulAlcNoiseBleedOutTime = 0;
f_pChannelOpen->VqeConfig.fRinHighLevelCompensation = FALSE;
f_pChannelOpen->VqeConfig.lRinHighLevelCompensationThresholdDb = -10;
f_pChannelOpen->VqeConfig.fSoutAdaptiveNoiseReduction = FALSE;
@@ -154,8 +153,6 @@ UINT32 Oct6100ChannelOpenDef(
f_pChannelOpen->VqeConfig.fEnableMusicProtection = FALSE;
/* Older images have idle code detection hard-coded to enabled. */
f_pChannelOpen->VqeConfig.fIdleCodeDetection = TRUE;
- f_pChannelOpen->VqeConfig.fResetRinAlcOnTones = FALSE;
- f_pChannelOpen->VqeConfig.fResetSoutAlcOnTones = FALSE;
/* TDM configuration.*/
f_pChannelOpen->TdmConfig.ulRinNumTssts = 1;
@@ -358,7 +355,6 @@ UINT32 Oct6100ChannelModifyDef(
f_pChannelModify->VqeConfig.lRinAutomaticLevelControlTargetDb = (INT32)cOCT6100_KEEP_PREVIOUS_SETTING;
f_pChannelModify->VqeConfig.fSoutAutomaticLevelControl = cOCT6100_KEEP_PREVIOUS_SETTING;
f_pChannelModify->VqeConfig.lSoutAutomaticLevelControlTargetDb = (INT32)cOCT6100_KEEP_PREVIOUS_SETTING;
- f_pChannelModify->VqeConfig.ulAlcNoiseBleedOutTime = cOCT6100_KEEP_PREVIOUS_SETTING;
f_pChannelModify->VqeConfig.fRinHighLevelCompensation = cOCT6100_KEEP_PREVIOUS_SETTING;
f_pChannelModify->VqeConfig.lRinHighLevelCompensationThresholdDb = (INT32)cOCT6100_KEEP_PREVIOUS_SETTING;
f_pChannelModify->VqeConfig.fSoutAdaptiveNoiseReduction = cOCT6100_KEEP_PREVIOUS_SETTING;
@@ -388,8 +384,6 @@ UINT32 Oct6100ChannelModifyDef(
f_pChannelModify->VqeConfig.ulToneDisablerVqeActivationDelay = cOCT6100_KEEP_PREVIOUS_SETTING;
f_pChannelModify->VqeConfig.fEnableMusicProtection = cOCT6100_KEEP_PREVIOUS_SETTING;
f_pChannelModify->VqeConfig.fIdleCodeDetection = cOCT6100_KEEP_PREVIOUS_SETTING;
- f_pChannelModify->VqeConfig.fResetRinAlcOnTones = cOCT6100_KEEP_PREVIOUS_SETTING;
- f_pChannelModify->VqeConfig.fResetSoutAlcOnTones = cOCT6100_KEEP_PREVIOUS_SETTING;
/* TDM config. */
f_pChannelModify->TdmConfig.ulRinNumTssts = cOCT6100_KEEP_PREVIOUS_SETTING;
@@ -838,7 +832,6 @@ UINT32 Oct6100ChannelGetStatsDef(
f_pChannelStats->VqeConfig.fSoutLevelControl = FALSE;
f_pChannelStats->VqeConfig.fRinAutomaticLevelControl = FALSE;
f_pChannelStats->VqeConfig.fSoutAutomaticLevelControl = FALSE;
- f_pChannelStats->VqeConfig.ulAlcNoiseBleedOutTime = cOCT6100_INVALID_STAT;
f_pChannelStats->VqeConfig.fRinHighLevelCompensation = FALSE;
f_pChannelStats->VqeConfig.fAcousticEcho = FALSE;
f_pChannelStats->VqeConfig.fSoutAdaptiveNoiseReduction = FALSE;
@@ -869,8 +862,6 @@ UINT32 Oct6100ChannelGetStatsDef(
f_pChannelStats->VqeConfig.ulToneDisablerVqeActivationDelay = cOCT6100_INVALID_STAT;
f_pChannelStats->VqeConfig.fEnableMusicProtection = FALSE;
f_pChannelStats->VqeConfig.fIdleCodeDetection = FALSE;
- f_pChannelStats->VqeConfig.fResetRinAlcOnTones = FALSE;
- f_pChannelStats->VqeConfig.fResetSoutAlcOnTones = FALSE;
@@ -1967,7 +1958,7 @@ UINT32 Oct6100ApiWriteChannelStructs(
mOCT6100_GET_CHANNEL_ENTRY_PNT( f_pApiInstance->pSharedInfo, pChanEntry, f_pChanIndexConf->usEchoChanIndex );
/*==============================================================================*/
- /* Configure the Tsst control memory.*/
+ /* Configure the Input Tsst control memory.*/
/* Set the RIN Tsst control entry.*/
if ( f_pChanIndexConf->usRinTsstIndex != cOCT6100_INVALID_INDEX )
@@ -1980,18 +1971,6 @@ UINT32 Oct6100ApiWriteChannelStructs(
return ulResult;
}
- /* Set the ROUT Tsst control entry.*/
- if ( f_pChanIndexConf->usRoutTsstIndex != cOCT6100_INVALID_INDEX )
- {
- ulResult = Oct6100ApiWriteOutputTsstControlMemory( f_pApiInstance,
- f_pChanIndexConf->usRoutTsstIndex,
- f_pChannelOpen->CodecConfig.ulAdpcmNibblePosition,
- pTdmConfig->ulRoutNumTssts,
- f_pChanIndexConf->usRinRoutTsiMemIndex );
- if ( ulResult != cOCT6100_ERR_OK )
- return ulResult;
- }
-
/* Set the SIN Tsst control entry.*/
if ( f_pChanIndexConf->usSinTsstIndex != cOCT6100_INVALID_INDEX )
{
@@ -2003,18 +1982,6 @@ UINT32 Oct6100ApiWriteChannelStructs(
return ulResult;
}
- /* Set the SOUT Tsst control entry.*/
- if ( f_pChanIndexConf->usSoutTsstIndex != cOCT6100_INVALID_INDEX )
- {
- ulResult = Oct6100ApiWriteOutputTsstControlMemory( f_pApiInstance,
- f_pChanIndexConf->usSoutTsstIndex,
- f_pChannelOpen->CodecConfig.ulAdpcmNibblePosition,
- pTdmConfig->ulSoutNumTssts,
- f_pChanIndexConf->usSinSoutTsiMemIndex );
- if ( ulResult != cOCT6100_ERR_OK )
- return ulResult;
- }
-
/*==============================================================================*/
/*==============================================================================*/
@@ -2036,10 +2003,19 @@ UINT32 Oct6100ApiWriteChannelStructs(
{
if ( pTdmConfig->ulRinPcmLaw == pTdmConfig->ulRoutPcmLaw )
fProgramAdpcmMem = FALSE;
+
+ /* Check if both ports are assigned. If not, no law conversion needed here.. */
+ if ( ( pTdmConfig->ulRinStream == cOCT6100_UNASSIGNED )
+ || ( pTdmConfig->ulRoutStream == cOCT6100_UNASSIGNED ) )
+ fProgramAdpcmMem = FALSE;
}
else /* f_pChannelOpen->CodecConfig.ulDecoderPort == cOCT6100_CHANNEL_PORT_SIN */
{
- if ( f_pChannelOpen->TdmConfig.ulSinPcmLaw == f_pChannelOpen->TdmConfig.ulSoutPcmLaw )
+ if ( pTdmConfig->ulSinPcmLaw == pTdmConfig->ulSoutPcmLaw )
+ fProgramAdpcmMem = FALSE;
+
+ if ( ( pTdmConfig->ulSinStream == cOCT6100_UNASSIGNED )
+ || ( pTdmConfig->ulSoutStream == cOCT6100_UNASSIGNED ) )
fProgramAdpcmMem = FALSE;
}
break;
@@ -2165,6 +2141,11 @@ UINT32 Oct6100ApiWriteChannelStructs(
/* Check for law conversion.*/
if ( pTdmConfig->ulRinPcmLaw == pTdmConfig->ulRoutPcmLaw )
fProgramAdpcmMem = FALSE;
+
+ /* Check if both ports are assigned. If not, no law conversion needed here.. */
+ if ( ( pTdmConfig->ulRinStream == cOCT6100_UNASSIGNED )
+ || ( pTdmConfig->ulRoutStream == cOCT6100_UNASSIGNED ) )
+ fProgramAdpcmMem = FALSE;
}
else /* f_pChannelOpen->CodecConfig.ulEncoderPort == cOCT6100_CHANNEL_PORT_SOUT */
{
@@ -2176,8 +2157,13 @@ UINT32 Oct6100ApiWriteChannelStructs(
/* Check for law conversion.*/
if ( pTdmConfig->ulSinPcmLaw == pTdmConfig->ulSoutPcmLaw )
fProgramAdpcmMem = FALSE;
- }
+ /* Check if both ports are assigned. If not, no law conversion needed here.. */
+ if ( ( pTdmConfig->ulSinStream == cOCT6100_UNASSIGNED )
+ || ( pTdmConfig->ulSoutStream == cOCT6100_UNASSIGNED ) )
+ fProgramAdpcmMem = FALSE;
+ }
+
break;
case cOCT6100_G726_40KBPS:
ulCompType = 0x3;
@@ -2504,6 +2490,35 @@ UINT32 Oct6100ApiWriteChannelStructs(
/*==============================================================================*/
+ /*==============================================================================*/
+ /* Configure the Output Tsst control memory.*/
+
+ /* Set the ROUT Tsst control entry.*/
+ if ( f_pChanIndexConf->usRoutTsstIndex != cOCT6100_INVALID_INDEX )
+ {
+ ulResult = Oct6100ApiWriteOutputTsstControlMemory( f_pApiInstance,
+ f_pChanIndexConf->usRoutTsstIndex,
+ f_pChannelOpen->CodecConfig.ulAdpcmNibblePosition,
+ pTdmConfig->ulRoutNumTssts,
+ f_pChanIndexConf->usRinRoutTsiMemIndex );
+ if ( ulResult != cOCT6100_ERR_OK )
+ return ulResult;
+ }
+
+ /* Set the SOUT Tsst control entry.*/
+ if ( f_pChanIndexConf->usSoutTsstIndex != cOCT6100_INVALID_INDEX )
+ {
+ ulResult = Oct6100ApiWriteOutputTsstControlMemory( f_pApiInstance,
+ f_pChanIndexConf->usSoutTsstIndex,
+ f_pChannelOpen->CodecConfig.ulAdpcmNibblePosition,
+ pTdmConfig->ulSoutNumTssts,
+ f_pChanIndexConf->usSinSoutTsiMemIndex );
+ if ( ulResult != cOCT6100_ERR_OK )
+ return ulResult;
+ }
+
+ /*==============================================================================*/
+
return cOCT6100_ERR_OK;
}
#endif
@@ -2568,7 +2583,6 @@ UINT32 Oct6100ApiUpdateChannelEntry(
pChanEntry->VqeConfig.fRinAutomaticLevelControl = (UINT8)( pVqeConfig->fRinAutomaticLevelControl & 0xFF );
pChanEntry->VqeConfig.chRinAutomaticLevelControlTargetDb = (OCT_INT8)( pVqeConfig->lRinAutomaticLevelControlTargetDb & 0xFF );
pChanEntry->VqeConfig.fSoutAutomaticLevelControl = (UINT8)( pVqeConfig->fSoutAutomaticLevelControl & 0xFF );
- pChanEntry->VqeConfig.usAlcNoiseBleedOutTime = (UINT16)( pVqeConfig->ulAlcNoiseBleedOutTime & 0xFFFF );
pChanEntry->VqeConfig.chSoutAutomaticLevelControlTargetDb = (OCT_INT8)( pVqeConfig->lSoutAutomaticLevelControlTargetDb & 0xFF );
pChanEntry->VqeConfig.fRinHighLevelCompensation = (UINT8)( pVqeConfig->fRinHighLevelCompensation & 0xFF );
pChanEntry->VqeConfig.chRinHighLevelCompensationThresholdDb = (OCT_INT8)( pVqeConfig->lRinHighLevelCompensationThresholdDb & 0xFF );
@@ -2597,8 +2611,6 @@ UINT32 Oct6100ApiUpdateChannelEntry(
pChanEntry->VqeConfig.chRoutNoiseReductionLevelGainDb = (OCT_INT8) (pVqeConfig->lRoutNoiseReductionLevelGainDb & 0xFF);
pChanEntry->VqeConfig.fEnableMusicProtection = (UINT8)( pVqeConfig->fEnableMusicProtection & 0xFF );
pChanEntry->VqeConfig.fIdleCodeDetection = (UINT8)( pVqeConfig->fIdleCodeDetection & 0xFF );
- pChanEntry->VqeConfig.fResetRinAlcOnTones = (UINT8)( pVqeConfig->fResetRinAlcOnTones & 0xFF );
- pChanEntry->VqeConfig.fResetSoutAlcOnTones = (UINT8)( pVqeConfig->fResetSoutAlcOnTones & 0xFF );
/* Save the codec information.*/
pChanEntry->CodecConfig.byAdpcmNibblePosition = (UINT8)( pCodecConfig->ulAdpcmNibblePosition & 0xFF );
@@ -3259,6 +3271,16 @@ UINT32 Oct6100ApiInvalidateChannelStructs(
return ulResult;
/*------------------------------------------------------------------------------*/
+ /*------------------------------------------------------------------------------*/
+ /* Clear the NLP memory. */
+
+ SmearParams.ulWriteAddress = cOCT6100_CHANNEL_ROOT_BASE + ( pChanEntry->usEchoMemIndex * cOCT6100_CHANNEL_ROOT_SIZE ) + pSharedInfo->MemoryMap.ulChanRootConfOfst + 0x28;
+ SmearParams.usWriteData = 0x0000;
+ SmearParams.ulWriteLength = 2;
+
+ mOCT6100_DRIVER_WRITE_SMEAR_API( SmearParams, ulResult );
+ if ( ulResult != cOCT6100_ERR_OK )
+ return ulResult;
/*------------------------------------------------------------------------------*/
/* Clear the AF information memory. */
@@ -3526,6 +3548,11 @@ UINT32 Oct6100ApiReleaseChannelResources(
pChanEntry->fReserved = FALSE;
pChanEntry->byEntryOpenCnt++;
+ /* Reset the port, the bridge and BidirInfo */
+ pChanEntry->usMutedPorts = cOCT6100_CHANNEL_MUTE_PORT_NONE;
+ pChanEntry->fBiDirChannel = FALSE;
+ pChanEntry->usBridgeIndex = cOCT6100_INVALID_INDEX;
+
/* Decrement the number of channel open.*/
f_pApiInstance->pSharedInfo->ChipStats.usNumberChannels--;
@@ -5846,7 +5873,6 @@ UINT32 Oct6100ApiModifyChannelEntry(
pApiVqeConf->fSoutLevelControl = (UINT8)( f_pChannelOpen->VqeConfig.fSoutLevelControl & 0xFF );
pApiVqeConf->fRinAutomaticLevelControl = (UINT8)( f_pChannelOpen->VqeConfig.fRinAutomaticLevelControl & 0xFF );
pApiVqeConf->fSoutAutomaticLevelControl = (UINT8)( f_pChannelOpen->VqeConfig.fSoutAutomaticLevelControl & 0xFF );
- pApiVqeConf->usAlcNoiseBleedOutTime = (UINT16)( f_pChannelOpen->VqeConfig.ulAlcNoiseBleedOutTime & 0xFFFF );
pApiVqeConf->fRinHighLevelCompensation = (UINT8)( f_pChannelOpen->VqeConfig.fRinHighLevelCompensation & 0xFF );
pApiVqeConf->fSoutAdaptiveNoiseReduction = (UINT8)( f_pChannelOpen->VqeConfig.fSoutAdaptiveNoiseReduction & 0xFF );
@@ -5879,8 +5905,6 @@ UINT32 Oct6100ApiModifyChannelEntry(
pApiVqeConf->chRoutNoiseReductionLevelGainDb = (OCT_INT8)( f_pChannelOpen->VqeConfig.lRoutNoiseReductionLevelGainDb & 0xFF );
pApiVqeConf->fEnableMusicProtection = (UINT8)( f_pChannelOpen->VqeConfig.fEnableMusicProtection & 0xFF );
pApiVqeConf->fIdleCodeDetection = (UINT8)( f_pChannelOpen->VqeConfig.fIdleCodeDetection & 0xFF );
- pApiVqeConf->fResetRinAlcOnTones = (UINT8)( f_pChannelOpen->VqeConfig.fResetRinAlcOnTones & 0xFF );
- pApiVqeConf->fResetSoutAlcOnTones = (UINT8)( f_pChannelOpen->VqeConfig.fResetSoutAlcOnTones & 0xFF );
}
/*=======================================================================*/
@@ -6932,7 +6956,6 @@ UINT32 Oct6100ApiChannelGetStatsSer(
f_pChannelStats->VqeConfig.fSoutLevelControl = pChanEntry->VqeConfig.fSoutLevelControl;
f_pChannelStats->VqeConfig.fRinAutomaticLevelControl = pChanEntry->VqeConfig.fRinAutomaticLevelControl;
f_pChannelStats->VqeConfig.fSoutAutomaticLevelControl = pChanEntry->VqeConfig.fSoutAutomaticLevelControl;
- f_pChannelStats->VqeConfig.ulAlcNoiseBleedOutTime = pChanEntry->VqeConfig.usAlcNoiseBleedOutTime;
f_pChannelStats->VqeConfig.fRinHighLevelCompensation = pChanEntry->VqeConfig.fRinHighLevelCompensation;
f_pChannelStats->VqeConfig.fSoutAdaptiveNoiseReduction = pChanEntry->VqeConfig.fSoutAdaptiveNoiseReduction;
f_pChannelStats->VqeConfig.fSoutNoiseBleaching = pChanEntry->VqeConfig.fSoutNoiseBleaching;
@@ -6961,8 +6984,6 @@ UINT32 Oct6100ApiChannelGetStatsSer(
f_pChannelStats->VqeConfig.lRoutNoiseReductionLevelGainDb = pChanEntry->VqeConfig.chRoutNoiseReductionLevelGainDb;
f_pChannelStats->VqeConfig.fEnableMusicProtection = pChanEntry->VqeConfig.fEnableMusicProtection;
f_pChannelStats->VqeConfig.fIdleCodeDetection = pChanEntry->VqeConfig.fIdleCodeDetection;
- f_pChannelStats->VqeConfig.fResetRinAlcOnTones = pChanEntry->VqeConfig.fResetRinAlcOnTones;
- f_pChannelStats->VqeConfig.fResetSoutAlcOnTones = pChanEntry->VqeConfig.fResetSoutAlcOnTones;
/* Copy the CODEC configuration.*/
f_pChannelStats->CodecConfig.ulAdpcmNibblePosition = pChanEntry->CodecConfig.byAdpcmNibblePosition;
@@ -7783,23 +7804,9 @@ UINT32 Oct6100ApiCheckVqeConfig(
if ( ( f_pVqeConfig->fRinAutomaticLevelControl == TRUE ) && ( pImageInfo->fRinAutoLevelControl == FALSE ) )
return cOCT6100_ERR_NOT_SUPPORTED_CHANNEL_RIN_AUTO_LC;
- if ( f_pVqeConfig->ulAlcNoiseBleedOutTime > 63750 )
- return cOCT6100_ERR_CHANNEL_ALC_NOISE_BLEED_OUT_TIME;
-
- if ( ( f_pVqeConfig->ulAlcNoiseBleedOutTime != 0 ) && ( pImageInfo->fAlcNoiseBleedOutTime == FALSE ) )
- return cOCT6100_ERR_NOT_SUPPORTED_CHANNEL_ALC_NOISE_BLEED_OUT_TIME;
-
if ( ( f_pVqeConfig->fRinHighLevelCompensation == TRUE ) && ( pImageInfo->fRinHighLevelCompensation == FALSE ) )
return cOCT6100_ERR_NOT_SUPPORTED_CHANNEL_RIN_HIGH_LEVEL_COMP;
- /* Check the enable reset Rin ALC on tone detection flag. */
- if ( ( f_pVqeConfig->fResetRinAlcOnTones != TRUE ) && ( f_pVqeConfig->fResetRinAlcOnTones != FALSE ) )
- return cOCT6100_ERR_CHANNEL_RESET_RIN_ALC_ON_TONES;
-
- /* The reset Rin ALC on tone detection can be activated if the image supports it. */
- if ( ( f_pVqeConfig->fResetRinAlcOnTones == TRUE ) && ( pImageInfo->fResetRinAlcOnTones == FALSE ) )
- return cOCT6100_ERR_NOT_SUPPORTED_RESET_RIN_ALC_ON_TONES;
-
if ( f_pVqeConfig->fRinAutomaticLevelControl == TRUE )
{
if ( f_pVqeConfig->fRinLevelControl == TRUE )
@@ -7811,12 +7818,6 @@ UINT32 Oct6100ApiCheckVqeConfig(
if ( ( f_pVqeConfig->lRinAutomaticLevelControlTargetDb < -40 || f_pVqeConfig->lRinAutomaticLevelControlTargetDb > 0 ) )
return cOCT6100_ERR_CHANNEL_RIN_AUTO_LEVEL_CONTROL_TARGET;
}
- else /* if ( f_pVqeConfig->fRinAutomaticLevelControl != TRUE ) */
- {
- /* Reset Rin ALC on tones can only be activated in Rin ALC is requested. */
- if ( f_pVqeConfig->fResetRinAlcOnTones == TRUE )
- return cOCT6100_ERR_CHANNEL_RIN_AUTO_LEVEL_CONTROL_REQUIRED;
- }
if ( f_pVqeConfig->fRinHighLevelCompensation == TRUE )
{
@@ -7833,14 +7834,6 @@ UINT32 Oct6100ApiCheckVqeConfig(
if ( ( f_pVqeConfig->fSoutAutomaticLevelControl == TRUE ) && ( pImageInfo->fSoutAutoLevelControl == FALSE ) )
return cOCT6100_ERR_NOT_SUPPORTED_CHANNEL_SOUT_AUTO_LC;
- /* Check the enable reset Sout ALC on tone detection flag. */
- if ( ( f_pVqeConfig->fResetSoutAlcOnTones != TRUE ) && ( f_pVqeConfig->fResetSoutAlcOnTones != FALSE ) )
- return cOCT6100_ERR_CHANNEL_RESET_SOUT_ALC_ON_TONES;
-
- /* The reset Sout ALC on tone detection can be activated if the image supports it. */
- if ( ( f_pVqeConfig->fResetSoutAlcOnTones == TRUE ) && ( pImageInfo->fResetSoutAlcOnTones == FALSE ) )
- return cOCT6100_ERR_NOT_SUPPORTED_RESET_SOUT_ALC_ON_TONES;
-
if ( f_pVqeConfig->fSoutAutomaticLevelControl == TRUE )
{
if ( f_pVqeConfig->fSoutLevelControl == TRUE )
@@ -7849,21 +7842,6 @@ UINT32 Oct6100ApiCheckVqeConfig(
if ( ( f_pVqeConfig->lSoutAutomaticLevelControlTargetDb < -40 || f_pVqeConfig->lSoutAutomaticLevelControlTargetDb > 0 ) )
return cOCT6100_ERR_CHANNEL_SOUT_AUTO_LEVEL_CONTROL_TARGET;
}
- else /* if ( f_pVqeConfig->fSoutAutomaticLevelControl != TRUE ) */
- {
- /* Reset Sout ALC on tones can only be activated if Sout ALC is requested. */
- if ( f_pVqeConfig->fResetSoutAlcOnTones == TRUE )
- return cOCT6100_ERR_CHANNEL_SOUT_AUTO_LEVEL_CONTROL_REQUIRED;
- }
-
- /* ALC noise bleed out can only be configured if ALC is requested. */
- if ( f_pVqeConfig->ulAlcNoiseBleedOutTime != 0 )
- {
- /* If both ports ALC is disabled, let the user know. */
- if ( ( f_pVqeConfig->fRinAutomaticLevelControl == FALSE )
- && ( f_pVqeConfig->fSoutAutomaticLevelControl == FALSE ) )
- return cOCT6100_ERR_CHANNEL_AUTO_LEVEL_CONTROL_REQUIRED;
- }
if ( f_pVqeConfig->fSoutAdaptiveNoiseReduction != TRUE &&
f_pVqeConfig->fSoutAdaptiveNoiseReduction != FALSE )
@@ -8076,20 +8054,16 @@ UINT32 Oct6100ApiCheckVqeConfig(
if ( f_pVqeConfig->fRoutNoiseReduction == TRUE && pImageInfo->fRoutNoiseReduction == FALSE )
return cOCT6100_ERR_NOT_SUPPORTED_CHANNEL_ROUT_NR;
- /* Validate Rout noise reduction Level. */
- if ( f_pVqeConfig->fRoutNoiseReduction == TRUE )
- {
- /*Check if noise reduction level gain is supported*/
- if ( ( pImageInfo->fRoutNoiseReductionLevel == FALSE ) && ( f_pVqeConfig->lRoutNoiseReductionLevelGainDb != -18 ) )
- return cOCT6100_ERR_NOT_SUPPORTED_CHANNEL_ROUT_NOISE_REDUCTION_GAIN;
-
- if ( ( f_pVqeConfig->lRoutNoiseReductionLevelGainDb != 0 ) &&
- ( f_pVqeConfig->lRoutNoiseReductionLevelGainDb != -6 ) &&
- ( f_pVqeConfig->lRoutNoiseReductionLevelGainDb != -12 ) &&
- ( f_pVqeConfig->lRoutNoiseReductionLevelGainDb != -18 ) )
-
- return cOCT6100_ERR_CHANNEL_ROUT_NOISE_REDUCTION_GAIN;
- }
+ /*Check if noise reduction level gain is supported*/
+ if ( ( pImageInfo->fRoutNoiseReductionLevel == FALSE ) && ( f_pVqeConfig->lRoutNoiseReductionLevelGainDb != -18 ) )
+ return cOCT6100_ERR_NOT_SUPPORTED_CHANNEL_ROUT_NOISE_REDUCTION_GAIN;
+
+ if ( ( f_pVqeConfig->lRoutNoiseReductionLevelGainDb != 0 ) &&
+ ( f_pVqeConfig->lRoutNoiseReductionLevelGainDb != -6 ) &&
+ ( f_pVqeConfig->lRoutNoiseReductionLevelGainDb != -12 ) &&
+ ( f_pVqeConfig->lRoutNoiseReductionLevelGainDb != -18 ) )
+
+ return cOCT6100_ERR_CHANNEL_ROUT_NOISE_REDUCTION_GAIN;
/* Check if ANR SNRE is supported. */
if ( ( f_pVqeConfig->lAnrSnrEnhancementDb != -18 ) && ( pImageInfo->fAnrSnrEnhancement == FALSE ) )
@@ -8948,7 +8922,8 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
/* Check if the configuration has been changed. */
if ( ( f_fModifyOnly == FALSE )
|| ( ( f_fModifyOnly == TRUE )
- && ( f_pVqeConfig->lRoutNoiseReductionLevelGainDb != pChanEntry->VqeConfig.chRoutNoiseReductionLevelGainDb ) ) )
+ && ( (f_pVqeConfig->lRoutNoiseReductionLevelGainDb != pChanEntry->VqeConfig.chRoutNoiseReductionLevelGainDb )
+ ||( f_pVqeConfig->fRoutNoiseReduction != pChanEntry->VqeConfig.fRoutNoiseReduction ) ) ) )
{
ulFeatureBytesOffset = pSharedInfo->MemoryMap.RinAnrValOfst.usDwordOffset * 4;
ulFeatureBitOffset = pSharedInfo->MemoryMap.RinAnrValOfst.byBitOffset;
@@ -10552,18 +10527,6 @@ UINT32 Oct6100ApiUpdateOpenStruct(
f_pChanOpen->VqeConfig.fRinAutomaticLevelControl = f_pChanModify->VqeConfig.fRinAutomaticLevelControl;
- if ( f_pChanModify->VqeConfig.fResetRinAlcOnTones == cOCT6100_KEEP_PREVIOUS_SETTING )
- f_pChanOpen->VqeConfig.fResetRinAlcOnTones = f_pChanEntry->VqeConfig.fResetRinAlcOnTones;
- else
- f_pChanOpen->VqeConfig.fResetRinAlcOnTones = f_pChanModify->VqeConfig.fResetRinAlcOnTones;
-
-
- if ( f_pChanModify->VqeConfig.ulAlcNoiseBleedOutTime == cOCT6100_KEEP_PREVIOUS_SETTING )
- f_pChanOpen->VqeConfig.ulAlcNoiseBleedOutTime = f_pChanEntry->VqeConfig.usAlcNoiseBleedOutTime;
- else
- f_pChanOpen->VqeConfig.ulAlcNoiseBleedOutTime = f_pChanModify->VqeConfig.ulAlcNoiseBleedOutTime;
-
-
if ( f_pChanModify->VqeConfig.fRinHighLevelCompensation == cOCT6100_KEEP_PREVIOUS_SETTING )
f_pChanOpen->VqeConfig.fRinHighLevelCompensation = f_pChanEntry->VqeConfig.fRinHighLevelCompensation;
else
@@ -10612,12 +10575,6 @@ UINT32 Oct6100ApiUpdateOpenStruct(
f_pChanOpen->VqeConfig.fSoutAutomaticLevelControl = f_pChanModify->VqeConfig.fSoutAutomaticLevelControl;
- if ( f_pChanModify->VqeConfig.fResetSoutAlcOnTones == cOCT6100_KEEP_PREVIOUS_SETTING )
- f_pChanOpen->VqeConfig.fResetSoutAlcOnTones = f_pChanEntry->VqeConfig.fResetSoutAlcOnTones;
- else
- f_pChanOpen->VqeConfig.fResetSoutAlcOnTones = f_pChanModify->VqeConfig.fResetSoutAlcOnTones;
-
-
if ( f_pChanModify->VqeConfig.lRinLevelControlGainDb == ( (INT32)cOCT6100_KEEP_PREVIOUS_SETTING ) )
f_pChanOpen->VqeConfig.lRinLevelControlGainDb = f_pChanEntry->VqeConfig.chRinLevelControlGainDb;
else
@@ -11124,7 +11081,9 @@ UINT32 Oct6100ApiCheckChannelCreateBiDirParams(
return cOCT6100_ERR_CHANNEL_BIDIR_FIRST_CHANNEL_HANDLE;
/* Check the specific state of the channel.*/
- if ( pFirstChanEntry->fRinRoutCodecActive == TRUE || pFirstChanEntry->fSinSoutCodecActive == TRUE )
+ if ( pFirstChanEntry->fRinRoutCodecActive == TRUE && pFirstChanEntry->CodecConfig.byEncoderPort != cOCT6100_CHANNEL_PORT_ROUT)
+ return cOCT6100_ERR_CHANNEL_CODEC_ACTIVATED;
+ if ( pFirstChanEntry->fSinSoutCodecActive == TRUE && pFirstChanEntry->CodecConfig.byEncoderPort != cOCT6100_CHANNEL_PORT_SOUT)
return cOCT6100_ERR_CHANNEL_CODEC_ACTIVATED;
if ( pFirstChanEntry->fBiDirChannel == TRUE )
return cOCT6100_ERR_CHANNEL_ALREADY_BIDIR;
@@ -11168,9 +11127,9 @@ UINT32 Oct6100ApiCheckChannelCreateBiDirParams(
return cOCT6100_ERR_CHANNEL_BIDIR_SECOND_CHANNEL_HANDLE;
/* Check the specific state of the channel.*/
- if ( pSecondChanEntry->fRinRoutCodecActive == TRUE )
+ if ( pSecondChanEntry->fRinRoutCodecActive == TRUE && pSecondChanEntry->CodecConfig.byEncoderPort != cOCT6100_CHANNEL_PORT_ROUT)
return cOCT6100_ERR_CHANNEL_CODEC_ACTIVATED;
- if ( pSecondChanEntry->fSinSoutCodecActive == TRUE )
+ if ( pSecondChanEntry->fSinSoutCodecActive == TRUE && pSecondChanEntry->CodecConfig.byEncoderPort != cOCT6100_CHANNEL_PORT_SOUT)
{
return cOCT6100_ERR_CHANNEL_CODEC_ACTIVATED;
@@ -12695,10 +12654,7 @@ UINT32 Oct6100ApiSetChannelLevelControl(
|| ( f_pVqeConfig->lSoutAutomaticLevelControlTargetDb != pChanEntry->VqeConfig.chSoutAutomaticLevelControlTargetDb )
|| ( f_pVqeConfig->fSoutNaturalListenerEnhancement != pChanEntry->VqeConfig.fSoutNaturalListenerEnhancement )
|| ( f_pVqeConfig->ulSoutAutomaticListenerEnhancementGainDb != pChanEntry->VqeConfig.bySoutAutomaticListenerEnhancementGainDb )
- || ( f_pVqeConfig->ulSoutNaturalListenerEnhancementGainDb != pChanEntry->VqeConfig.bySoutNaturalListenerEnhancementGainDb )
- || ( f_pVqeConfig->fResetRinAlcOnTones != pChanEntry->VqeConfig.fResetRinAlcOnTones )
- || ( f_pVqeConfig->fResetSoutAlcOnTones != pChanEntry->VqeConfig.fResetSoutAlcOnTones )
- || ( f_pVqeConfig->ulAlcNoiseBleedOutTime != pChanEntry->VqeConfig.usAlcNoiseBleedOutTime ) )
+ || ( f_pVqeConfig->ulSoutNaturalListenerEnhancementGainDb != pChanEntry->VqeConfig.bySoutNaturalListenerEnhancementGainDb ) )
{
/* Calculate base address for manual level control configuration. */
ulBaseAddress = cOCT6100_CHANNEL_ROOT_BASE + ( f_usEchoMemIndex * cOCT6100_CHANNEL_ROOT_SIZE ) + pSharedInfo->MemoryMap.ulChanRootConfOfst;
@@ -12812,49 +12768,6 @@ UINT32 Oct6100ApiSetChannelLevelControl(
/* Calculate base address for auto level control + high level compensation configuration. */
ulBaseAddress = pSharedInfo->MemoryMap.ulChanMainMemBase + ( f_usEchoMemIndex * pSharedInfo->MemoryMap.ulChanMainMemSize ) + f_pApiInstance->pSharedInfo->MemoryMap.ulChanMainIoMemOfst;
- /* Configure the ALC bleed out time. */
- if ( pSharedInfo->ImageInfo.fAlcNoiseBleedOutTime == TRUE )
- {
- ulFeatureBytesOffset = pSharedInfo->MemoryMap.AlcNoiseBleedOutTimeFieldOfst.usDwordOffset * 4;
- ulFeatureBitOffset = pSharedInfo->MemoryMap.AlcNoiseBleedOutTimeFieldOfst.byBitOffset;
- ulFeatureFieldLength = pSharedInfo->MemoryMap.AlcNoiseBleedOutTimeFieldOfst.byFieldSize;
-
- /* First read the DWORD where the field is located.*/
- mOCT6100_RETRIEVE_NLP_CONF_DWORD( f_pApiInstance,
- pChanEntry,
- ulBaseAddress + ulFeatureBytesOffset,
- &ulTempData,
- ulResult );
- if ( ulResult != cOCT6100_ERR_OK )
- return ulResult;
-
- /* Clear previous value set in the feature field.*/
- mOCT6100_CREATE_FEATURE_MASK( ulFeatureFieldLength, ulFeatureBitOffset, &ulMask );
-
- ulTempData &= (~ulMask);
-
- if ( f_pVqeConfig->ulAlcNoiseBleedOutTime != 0 )
- {
- /* Set ALC noise bleed out time. */
- usTempData = (UINT16)( f_pVqeConfig->ulAlcNoiseBleedOutTime / 250 );
- ulTempData |= ( usTempData << ulFeatureBitOffset );
- }
- else /* if ( f_pVqeConfig->ulAlcNoiseBleedOutTime == 0 ) */
- {
- /* Disable ALC noise bleed out. */
- ulTempData |= ( 0x0 << ulFeatureBitOffset );
- }
-
- /* Save the DWORD where the field is located.*/
- mOCT6100_SAVE_NLP_CONF_DWORD( f_pApiInstance,
- pChanEntry,
- ulBaseAddress + ulFeatureBytesOffset,
- ulTempData,
- ulResult );
- if ( ulResult != cOCT6100_ERR_OK )
- return ulResult;
- }
-
/* Check which one is to be disabled first. */
if ( f_pVqeConfig->fRinAutomaticLevelControl == TRUE )
fDisableAlcFirst = FALSE;
@@ -13004,88 +12917,6 @@ UINT32 Oct6100ApiSetChannelLevelControl(
return ulResult;
}
- /* Set the reset Rin ALC on tones. */
- if ( pSharedInfo->ImageInfo.fResetRinAlcOnTones == TRUE )
- {
- ulFeatureBytesOffset = pSharedInfo->MemoryMap.ResetRinAlcOnTonesFieldOfst.usDwordOffset * 4;
- ulFeatureBitOffset = pSharedInfo->MemoryMap.ResetRinAlcOnTonesFieldOfst.byBitOffset;
- ulFeatureFieldLength = pSharedInfo->MemoryMap.ResetRinAlcOnTonesFieldOfst.byFieldSize;
-
- /* First read the DWORD where the field is located.*/
- mOCT6100_RETRIEVE_NLP_CONF_DWORD( f_pApiInstance,
- pChanEntry,
- ulBaseAddress + ulFeatureBytesOffset,
- &ulTempData,
- ulResult );
- if ( ulResult != cOCT6100_ERR_OK )
- return ulResult;
-
- /* Clear previous value set in the feature field.*/
- mOCT6100_CREATE_FEATURE_MASK( ulFeatureFieldLength, ulFeatureBitOffset, &ulMask );
-
- ulTempData &= (~ulMask);
-
- if ( f_pVqeConfig->fResetRinAlcOnTones == TRUE )
- {
- ulTempData |= ( 1 << ulFeatureBitOffset );
- }
- else /* if ( f_pVqeConfig->fResetRinAlcOnTones == FALSE ) */
- {
- /* Disable ALC reset on tone detection. */
- ulTempData |= ( 0 << ulFeatureBitOffset );
- }
-
- /* Save the DWORD where the field is located.*/
- mOCT6100_SAVE_NLP_CONF_DWORD( f_pApiInstance,
- pChanEntry,
- ulBaseAddress + ulFeatureBytesOffset,
- ulTempData,
- ulResult );
- if ( ulResult != cOCT6100_ERR_OK )
- return ulResult;
- }
-
- /* Set the reset Sout ALC on tones. */
- if ( pSharedInfo->ImageInfo.fResetSoutAlcOnTones == TRUE )
- {
- ulFeatureBytesOffset = pSharedInfo->MemoryMap.ResetSoutAlcOnTonesFieldOfst.usDwordOffset * 4;
- ulFeatureBitOffset = pSharedInfo->MemoryMap.ResetSoutAlcOnTonesFieldOfst.byBitOffset;
- ulFeatureFieldLength = pSharedInfo->MemoryMap.ResetSoutAlcOnTonesFieldOfst.byFieldSize;
-
- /* First read the DWORD where the field is located.*/
- mOCT6100_RETRIEVE_NLP_CONF_DWORD( f_pApiInstance,
- pChanEntry,
- ulBaseAddress + ulFeatureBytesOffset,
- &ulTempData,
- ulResult );
- if ( ulResult != cOCT6100_ERR_OK )
- return ulResult;
-
- /* Clear previous value set in the feature field.*/
- mOCT6100_CREATE_FEATURE_MASK( ulFeatureFieldLength, ulFeatureBitOffset, &ulMask );
-
- ulTempData &= (~ulMask);
-
- if ( f_pVqeConfig->fResetSoutAlcOnTones == TRUE )
- {
- ulTempData |= ( 1 << ulFeatureBitOffset );
- }
- else /* if ( f_pVqeConfig->fResetSoutAlcOnTones == FALSE ) */
- {
- /* Disable ALC reset on tone detection. */
- ulTempData |= ( 0 << ulFeatureBitOffset );
- }
-
- /* Save the DWORD where the field is located.*/
- mOCT6100_SAVE_NLP_CONF_DWORD( f_pApiInstance,
- pChanEntry,
- ulBaseAddress + ulFeatureBytesOffset,
- ulTempData,
- ulResult );
- if ( ulResult != cOCT6100_ERR_OK )
- return ulResult;
- }
-
/* Set the high level compensation threshold Db for the Sout port. */
if ( pSharedInfo->ImageInfo.fSoutHighLevelCompensation == TRUE )
{
@@ -13960,11 +13791,11 @@ UINT32 Oct6100ApiMuteChannelPorts(
if ( pChanEntry->usRoutTsstIndex != cOCT6100_INVALID_INDEX )
{
- /* Deactivate the TSST entry.*/
- WriteParams.ulWriteAddress = cOCT6100_TSST_CONTROL_MEM_BASE + ( pChanEntry->usRoutTsstIndex * cOCT6100_TSST_CONTROL_MEM_ENTRY_SIZE );
- WriteParams.usWriteData = 0x0000;
-
- mOCT6100_DRIVER_WRITE_API( WriteParams, ulResult );
+ ulResult = Oct6100ApiWriteOutputTsstControlMemory( f_pApiInstance,
+ pChanEntry->usRoutTsstIndex,
+ pChanEntry->CodecConfig.byAdpcmNibblePosition,
+ pChanEntry->TdmConfig.byRoutNumTssts,
+ 1534 );
if ( ulResult != cOCT6100_ERR_OK )
return ulResult;
}
@@ -14032,12 +13863,12 @@ UINT32 Oct6100ApiMuteChannelPorts(
if ( pChanEntry->usSoutTsstIndex != cOCT6100_INVALID_INDEX )
{
- /* Deactivate the TSST entry.*/
- WriteParams.ulWriteAddress = cOCT6100_TSST_CONTROL_MEM_BASE + ( pChanEntry->usSoutTsstIndex * cOCT6100_TSST_CONTROL_MEM_ENTRY_SIZE );
- WriteParams.usWriteData = 0x0000;
-
- mOCT6100_DRIVER_WRITE_API( WriteParams, ulResult );
- if ( ulResult != cOCT6100_ERR_OK )
+ ulResult = Oct6100ApiWriteOutputTsstControlMemory( f_pApiInstance,
+ pChanEntry->usSoutTsstIndex,
+ pChanEntry->CodecConfig.byAdpcmNibblePosition,
+ pChanEntry->TdmConfig.bySoutNumTssts,
+ 1534 );
+ if ( ulResult != cOCT6100_ERR_OK )
return ulResult;
}