audio: When playing DTS_Express signal,sound from ARC is unsmooth [1/1]
PD#SWPL-196303
Problem:
alsa underrun.
Solution:
increase the start threshold.
Verify:
yocto-t6d
Change-Id: I69fc9e9435b4fa4c101e14ef5b5981528638b52c
Signed-off-by: yayun.shi <yayun.shi@amlogic.com>
diff --git a/audio_hal/alsa_config_parameters.c b/audio_hal/alsa_config_parameters.c
index 9975551..ca1d156 100644
--- a/audio_hal/alsa_config_parameters.c
+++ b/audio_hal/alsa_config_parameters.c
@@ -36,20 +36,20 @@
/*
- *@brief get the hardware config parameters when the output format is DTS-HD/TRUE-HD
+ *@brief get the hardware config parameters when the output format is DTS
*/
-static void get_dts_hd_hardware_config_parameters(
+static void get_dts_hardware_config_parameters(
struct pcm_config *hardware_config
, unsigned int channels __unused
, unsigned int rate)
{
hardware_config->channels = 2;
hardware_config->format = PCM_FORMAT_S16_LE;
- //TODO, maybe we should use "/sys/class/audiodsp/digtal_codec" as 4
- hardware_config->rate = rate * 4;
+ hardware_config->rate = rate;
hardware_config->period_count = PLAYBACK_PERIOD_COUNT;
- hardware_config->period_size = PERIOD_SIZE * 4 * 2;
- hardware_config->start_threshold = PLAYBACK_PERIOD_COUNT * hardware_config->period_size;
+ hardware_config->period_size = PERIOD_SIZE * 2;
+ hardware_config->start_threshold = PLAYBACK_PERIOD_COUNT * hardware_config->period_size/8*5;
+ //For some case , the DTS output frame is 4096, so set start_threshold to 5120
hardware_config->avail_min = 0;
return ;
@@ -233,6 +233,10 @@
else if (output_format == AUDIO_FORMAT_AC3) {
get_dd_hardware_config_parameters(final_config, 2, rate);
}
+ //DTS
+ else if (output_format == AUDIO_FORMAT_DTS) {
+ get_dts_hardware_config_parameters(final_config, 2, rate);
+ }
//MAT
else if (output_format == AUDIO_FORMAT_MAT) {
get_mat_hardware_config_parameters(final_config, channels, rate, is_iec61937_input);