icfans

MT6260自动答录机在播放提示音前挂机,死机重启

0
阅读(1125)

[DESCRIPTION]来自半导体


MT6260平台开启自动答录机功能,来电响铃10秒后,答录机开始工作,播放提示音,在提示语播完之前挂断电话,会死机重启,log显示死在SND_Stop函数中的ASSERT_REBOOT(I < 20)的位置;


[SOLUTION]
原因:在speech_off后才去stop background sound后导致。
修改方法:
1,在aud_main.h中添加
...
#ifdef __MED_SND_MOD__
extern kal_bool aud_snd_startup(void);
extern void aud_snd_check_byte_stream_format_req_hdlr(ilm_struct *ilm_ptr); extern void
aud_snd_check_file_format_req_hdlr
(ilm_struct *ilm_ptr); extern void aud_snd_play_byte_stream_req_hdlr(ilm_struct *ilm_ptr); extern void
aud_snd_play_file_req_hdlr(ilm_struct *ilm_ptr); extern void aud_snd_process_event(ilm_struct *ilm_ptr);
extern void
aud_snd_stop_req_hdlr(ilm_struct *ilm_ptr); extern void aud_snd_set_volume_req_hdlr(ilm_struct
*ilm_ptr); extern void
aud_snd_set_output_device(kal_uint8 device);
extern void aud_snd_stop(void); //add this line
...
2,请在aud_snd.c中添加函数aud_snd_stop
void aud_snd_stop(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
Media_Handle *snd_handle;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
snd_handle = aud_snd_get_handle();
AUD_VALUE_TRACE(aud_snd_cntx_p->state, snd_handle,-1);
/* sanity check */
if ((snd_handle == NULL) ||
(aud_snd_cntx_p->state != AUD_MEDIA_PLAY))
{
return;
}
SND_Stop(snd_handle);
SND_Close(snd_handle);
FSAL_Close(&aud_snd_file);
aud_snd_set_handle(NULL);
aud_snd_cntx_p->state = AUD_MEDIA_IDLE;
aud_send_snd_play_finish_ind(aud_snd_cntx_p->src_mod, aud_snd_cntx_p->identifier, MED_RES_FAIL);
}
3,在aud_speech.c中添加
void aud_speech_off(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
AUD_FUNC_ENTRY(AUD_TRC_SPEECH_OFF);
#ifdef __MED_AUD_REC_MOD__
aud_rec_speech_event_nfy(AUD_SPEECH_EVENT_PRE_OFF);
#endif
aud_snd_stop(); //add this line
L1SP_Speech_Off();
aud_context_p->speech_on = KAL_FALSE;
#ifdef __MED_AUD_REC_MOD__
aud_rec_speech_event_nfy(AUD_SPEECH_EVENT_POST_OFF);
#endif
}