diff options
author | Manisha Agarwal <maniagar@codeaurora.org> | 2019-09-20 14:03:57 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-10-16 03:41:44 -0700 |
commit | 6e691c01baae41f4449a97f7a882a68152d0e2ea (patch) | |
tree | f9730fd82757230254cf265f644452c23813accb /hal | |
parent | 28e1e5ceece19eaf506c65c39e43e3be1ad9f4f6 (diff) | |
download | android_hardware_qcom_audio-6e691c01baae41f4449a97f7a882a68152d0e2ea.tar.gz android_hardware_qcom_audio-6e691c01baae41f4449a97f7a882a68152d0e2ea.tar.bz2 android_hardware_qcom_audio-6e691c01baae41f4449a97f7a882a68152d0e2ea.zip |
A2dp: Send default channel mapping for TWS+ mono.
Audio loss observed when encoder configured with mono mode.
This occurs because when configuration of encoder with mono mode
happens 0 channel mapping is sent to ADSP which rejects it as invalid
channel mapping.
To avoid this send default stereo channel mapping for both mono and dual
mono case.
CRs-Fixed: 2528391
Change-Id: Ie8d04965fb43f1beea747b23ae86464f943afdae
Diffstat (limited to 'hal')
-rw-r--r-- | hal/audio_extn/a2dp.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/hal/audio_extn/a2dp.c b/hal/audio_extn/a2dp.c index bcdcb1cc..534abb36 100644 --- a/hal/audio_extn/a2dp.c +++ b/hal/audio_extn/a2dp.c @@ -1807,10 +1807,14 @@ static void audio_a2dp_update_tws_channel_mode() { char* channel_mode; struct mixer_ctl *ctl_channel_mode; + + ALOGD("Update tws for mono_mode on=%d",a2dp.is_tws_mono_mode_on); + if (a2dp.is_tws_mono_mode_on) channel_mode = "One"; else channel_mode = "Two"; + ctl_channel_mode = mixer_get_ctl_by_name(a2dp.adev->mixer,MIXER_FMT_TWS_CHANNEL_MODE); if (!ctl_channel_mode) { ALOGE("failed to get tws mixer ctl"); @@ -1851,14 +1855,8 @@ static int update_aptx_dsp_config_v2(struct aptx_enc_cfg_t *aptx_dsp_cfg, break; case 2: default: - if (!a2dp.is_tws_mono_mode_on) { aptx_dsp_cfg->custom_cfg.channel_mapping[0] = PCM_CHANNEL_L; aptx_dsp_cfg->custom_cfg.channel_mapping[1] = PCM_CHANNEL_R; - } - else { - a2dp.is_tws_mono_mode_on = true; - ALOGD("Update tws for mono_mode_on: %d",a2dp.is_tws_mono_mode_on); - } break; } a2dp.enc_channels = aptx_dsp_cfg->custom_cfg.num_channels; |