工厂模式自动测试时耳机测试只有一个发声

76平台中, 在工模下进行耳机测试,只有左耳机发声

[SOLUTION]来自半导体社区

76上是dual mic设计,左右通道各接一个ADC,并分别接到耳机的左右声道。loopback测试时只开了一个ADC,工场

模式下耳机自动测试走loopback,因此耳机只有一只有声音,这样就可以验证耳机通道的相关元器件是否焊接好,已经

够用。若是需要两个耳机都有声,需开启另一个通道的ADC和amplifier,修改代码如下:

文件路径:

\hal\audio\src\v2中的afe2.c做如下修改

1.

void AFE_TurnOnLoopback( void )

{

afe.loopback = KAL_TRUE;

L1Audio_SetEvent(afe.aud_id, NULL); //add this line

ASSERT(!kal_if_hisr());

kal_trace(TRACE_STATE, AFE_SWITCH_LOOPBACK, '+');

}

2.在函数UpdateVAPDN里面修改如下:

static void UpdateVAPDN(kal_uint8 device, kal_uint16 vapdn_dc_couple_control)

{

if( afe.mic_mute||afe.mic_flag==0 ||afe.mute ) {

//*VOICE_CON3 = ((afe.accessory_flag)? ACCESSORY_USAGE : 0);

*AUDIO_CON21 &= ~0x1000;

*AUDIO_CON22 &= ~0x1000;

*AUDIO_CON23 &= ~0x8800;

#if defined(MT6573_S00) // On MT6573E1, keep VMIC on for AP side TV out detection

afe.accessory_flag = KAL_TRUE;

#endif

if( afe.accessory_flag )

*VMIC_CON0 |= 0x0001;

else

*VMIC_CON0 &= ~0x0001;

return;

}

*VMIC_CON0 |= 0x0001;

#if !(defined(MT6573) || defined(MT6575))

#if defined(__DUAL_MIC_SUPPORT__)

if(afe.mic_src == L1SP_LNA_DIGITAL){

L1Audio_PutMessage( MSG_L1AUDIO2FAS_SPEECH_SET_UL_DEVICE, eAUD_INDEV_DUAL_DIGITAL_MIC, NULL );

*AUDIO_CON24 |= MICSEL;

//*VOICE_CON3 = 0x10 | ((afe.accessory_flag)? ACCESSORY_USAGE : 0);

*AUDIO_CON31 |= 0x8000;

}else if(afe.mic_src >= 0){

L1Audio_PutMessage( MSG_L1AUDIO2FAS_SPEECH_SET_UL_DEVICE, eAUD_INDEV_DUAL_MIC, NULL );

*AUDIO_CON24 &= ~MICSEL;

*AUDIO_CON21 |= 0x1000;

*AUDIO_CON22 |= 0x1000;

*AUDIO_CON23 |= 0x8800;

*AUDIO_CON31 |= 0x8000;

}else{

//*VOICE_CON3 = ((afe.accessory_flag)? ACCESSORY_USAGE : 0);

*AUDIO_CON21 &= ~0x1000;

*AUDIO_CON22 &= ~0x1000;

*AUDIO_CON23 &= ~0x8800;

}

#else

if(afe.mic_src == L1SP_LNA_DIGITAL){

L1Audio_PutMessage( MSG_L1AUDIO2FAS_SPEECH_SET_UL_DEVICE, eAUD_INDEV_SINGLE_DIGITAL_MIC, NULL );

*AUDIO_CON24 |= MICSEL;

*AUDIO_CON31 |= 0x8000;

//*VOICE_CON3 = 0x10 | ((afe.accessory_flag)? ACCESSORY_USAGE : 0);

}else if(afe.mic_src >= 0){

L1Audio_PutMessage( MSG_L1AUDIO2FAS_SPEECH_SET_UL_DEVICE, eAUD_INDEV_SINGLE_MIC, NULL );

*AUDIO_CON24 &= ~MICSEL;

*AUDIO_CON21 |= 0x1000;

/*add begin*/

if(afe.loopback)

*AUDIO_CON22 |= 0x1000;

/*add end*/

#if defined(MT6573) || defined(MT6575)

*AUDIO_CON22 |= 0x1000;

#endif

*AUDIO_CON23 |= 0x8000;

/*add begin*/

if(afe.loopback)

*AUDIO_CON23 |= 0x0800;

/*add end*/

*AUDIO_CON31 |= 0x8000;

}else{

//*VOICE_CON3 = ((afe.accessory_flag)? ACCESSORY_USAGE : 0);

*AUDIO_CON21 &= ~0x1000;

*AUDIO_CON22 &= ~0x1000;

*AUDIO_CON23 &= ~0x8800;

}

#endif

。。。。。。。。

你可能感兴趣的:(工厂模式自动测试时耳机测试只有一个发声)