summaryrefslogtreecommitdiff
authorzedong.xiong <zedong.xiong@amlogic.com>2014-06-13 12:48:50 (GMT)
committer tao.dong <tao.dong@amlogic.com>2014-07-04 08:49:30 (GMT)
commit07f2ea917993411bd83dcdd1df1a43724cd975d5 (patch)
tree6ee6121954190aa78c6095618bf3279008e91d96
parentfa84559cff630e13caf913eb52e908da2add8f4d (diff)
downloadaudio-07f2ea917993411bd83dcdd1df1a43724cd975d5.zip
audio-07f2ea917993411bd83dcdd1df1a43724cd975d5.tar.gz
audio-07f2ea917993411bd83dcdd1df1a43724cd975d5.tar.bz2
PD #92125: modify buffer size for supporting truehd
Diffstat
-rwxr-xr-xhdmi_audio_hw.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hdmi_audio_hw.c b/hdmi_audio_hw.c
index 13a2e5a..f0dd32a 100755
--- a/hdmi_audio_hw.c
+++ b/hdmi_audio_hw.c
@@ -447,6 +447,10 @@ static int start_output_stream(struct aml_stream_out *out)
out->config.period_size=PERIOD_SIZE*2;
out->write_threshold = PLAYBACK_PERIOD_COUNT * PERIOD_SIZE*2;
out->config.start_threshold = PLAYBACK_PERIOD_COUNT*PERIOD_SIZE*2;
+ }else if(codec_type == 7){
+ out->config.period_size=PERIOD_SIZE*4*2;
+ out->write_threshold = PLAYBACK_PERIOD_COUNT * PERIOD_SIZE*4*2;
+ out->config.start_threshold = PLAYBACK_PERIOD_COUNT*PERIOD_SIZE*4*2;
}else{
out->write_threshold = PLAYBACK_PERIOD_COUNT * PERIOD_SIZE;
out->config.start_threshold = PERIOD_SIZE * PLAYBACK_PERIOD_COUNT;
@@ -686,6 +690,8 @@ static size_t out_get_buffer_size(const struct audio_stream *stream)
int codec_type=get_codec_type("/sys/class/audiodsp/digital_codec");
if(codec_type == 4 || codec_type == 5)//dd+
size = (PERIOD_SIZE*2* PLAYBACK_PERIOD_COUNT * DEFAULT_OUT_SAMPLING_RATE) / out->config.rate;
+ else if(codec_type == 7)
+ size = (PERIOD_SIZE*2 * 4* PLAYBACK_PERIOD_COUNT * DEFAULT_OUT_SAMPLING_RATE) / out->config.rate;
else if(codec_type>0 && codec_type<4 ) //dd/dts
size = (PERIOD_SIZE*4*DEFAULT_OUT_SAMPLING_RATE) / out->config.rate;
else//pcm
@@ -1961,6 +1967,8 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
dc = get_codec_type("/sys/class/audiodsp/digital_codec");
if(dc == 4 || dc == 5)
out->config.period_size=pcm_config_out.period_size*2;
+ else if(dc == 7)
+ out->config.period_size=pcm_config_out.period_size*4*2;
if(channel_count > 2){
ALOGI("[adev_open_output_stream]: out/%p channel/%d\n",out,channel_count);
out->multich = channel_count;