当前位置: 移动技术网 > 移动技术>移动开发>Android > FAQ-MT5193 atv调节声音大小,不起作用,声音无变化

FAQ-MT5193 atv调节声音大小,不起作用,声音无变化

2019年06月20日  | 移动技术网移动技术  | 我要评论

通过volume_up,volume_down调节atv的声音,不变化,只有调到静音的时候,才没有声音,界面上的声音大小是显示对的.
[solution]
这类问题常见的原因是音频参数没有进行设置,使用原始release默认的参数,而默认的参数在各版本上0-6均为255,导致调节音量等级,声音大小无变化。
分析方法:请在相关函数中加trace查看,
mmi层
mmi_mtv_player_entry_channel_list_screen,中注册按键是否有执行到,
setkeyhandler(mmi_mtv_player_vol_inc, key_right_arrow, key_event_down);
setkeyhandler(mmi_mtv_player_vol_dec, key_left_arrow, key_event_down);
setkeyhandler(mmi_mtv_player_vol_inc, key_vol_up, key_event_down);
setkeyhandler(mmi_mtv_player_vol_dec, key_vol_down, key_event_down);
mmi_mtv_player_vol_inc 中mdi_audio_set_volume->
media_aud_set_volume_ext- > aud_send_set_volume_req 中的type, volume值是多少,是否正常传下去了等。
med层,
加trace看音量是否有正确设置下去。同样type ,volume等关键的值都打印出来,并trace看是走的哪个分支。
aud_audio_set_volume_req_hdlr,
aud_atv_set_volume_by_mode
查看tv_out_support,__atv_i2s_support__,__med_bt_a2dp_mod__ 的定义情况.
依次跟下去看最终是否有在afe设置音量。
aud_atv_set_volume_by_mode 中 analog_gain 值为多少传入
aud_atv_set_output_volume(analog_gain, 0);
aud_atv_set_output_volume->atv_audiosetoutputvolume-
>linein_setoutputvolume
void atv_audiosetoutputvolume(kal_uint8 volume1, kal_int8
digital_gain_index)
{
#if defined(__atv_i2s_support__)
media_setoutputvolume( volume1, digital_gain_index );
#else
linein_setoutputvolume( volume1, digital_gain_index );
#endif
}
void linein_setoutputvolume( uint8 volume1, int8 digital_gain_index )
{
afe_setoutputvolume( l1sp_linein, volume1, digital_gain_index );
}
afe_setoutputvolume 中ext_dac_support 是否有定义?
是aud_atv_set_volume_by_mode这个函数中的analog_gain不对,它传给
aud_atv_set_output_volume(analog_gain, 0);这个函数的"analog_gain"变量一直为255。
gain_hnd_gmi_vol0-6的值这些值都是255,就找到调音量不起作用的原因了,请把这些值设置成递增的数据。例如以下参数,注意这只是示例,可以自行调节。
#define gain_hnd_gmi_vol 3
#define gain_hnd_gmi_vol0 16
#define gain_hnd_gmi_vol1 32
#define gain_hnd_gmi_vol2 48
#define gain_hnd_gmi_vol3 64
#define gain_hnd_gmi_vol4 80
#define gain_hnd_gmi_vol5 96
#define gain_hnd_gmi_vol6 112

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网