author | Xing Wang <xing.wang@amlogic.com> | 2016-12-12 07:15:38 (GMT) |
---|---|---|
committer | Xing Wang <xing.wang@amlogic.com> | 2016-12-29 11:39:17 (GMT) |
commit | 5e9c5c1f7ae35f3071b732b37355285ce735d77a (patch) | |
tree | e04e5ec7475b276aaf40f19984a66430f5402a8b | |
parent | 2fb4ea7b1fd6843aba146fe24d531552f3d6c539 (diff) | |
download | audio-5e9c5c1f7ae35f3071b732b37355285ce735d77a.zip audio-5e9c5c1f7ae35f3071b732b37355285ce735d77a.tar.gz audio-5e9c5c1f7ae35f3071b732b37355285ce735d77a.tar.bz2 |
PD#136115: audio hw: alsa write buffer is not sync with resample buffer
1) audio hal out write, in_buffer is for resample, but pcm_write with out_buffer, it should be sync with out_buffer
2) if sco device, not reset alsa
Change-Id: I09fdafb1d2f41617c3d9d59ccd292f59ce1cf25f
Signed-off-by: Xing Wang <xing.wang@amlogic.com>
-rw-r--r-- | audio_hw.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1550,6 +1550,7 @@ static ssize_t out_write_legacy(struct audio_stream_out *stream, const void* buf in_buffer, &in_frames, (int16_t*)out->buffer, &out_frames); in_buffer = (int16_t*)out->buffer; + out_buffer = in_buffer; } else { out_frames = in_frames; } @@ -1575,6 +1576,7 @@ static ssize_t out_write_legacy(struct audio_stream_out *stream, const void* buf } #endif #if 1 +if (!(adev->out_device & AUDIO_DEVICE_OUT_ALL_SCO)) { codec_type = get_sysfs_int("/sys/class/audiodsp/digital_codec"); //samesource_flag = get_sysfs_int("/sys/class/audiodsp/audio_samesource"); if (codec_type != out->last_codec_type/*samesource_flag == 0*/ && codec_type == 0) { @@ -1582,6 +1584,7 @@ static ssize_t out_write_legacy(struct audio_stream_out *stream, const void* buf pcm_stop(out->pcm); } out->last_codec_type = codec_type; +} #endif if (out->is_tv_platform == 1) { int16_t *tmp_buffer = (int16_t *)out->audioeffect_tmp_buffer; |