Loading hal/audio_extn/a2dp.c +64 −37 Original line number Diff line number Diff line Loading @@ -76,6 +76,7 @@ #define MIXER_SCRAMBLER_MODE "AFE Scrambler Mode" #define MIXER_SAMPLE_RATE_RX "BT SampleRate RX" #define MIXER_SAMPLE_RATE_TX "BT SampleRate TX" #define MIXER_SAMPLE_RATE_DEFAULT "BT SampleRate" #define MIXER_AFE_IN_CHANNELS "AFE Input Channels" #define MIXER_ABR_TX_FEEDBACK_PATH "A2DP_SLIM7_UL_HL Switch" #define MIXER_SET_FEEDBACK_CHANNEL "BT set feedback channel" Loading Loading @@ -787,16 +788,14 @@ static int a2dp_set_backend_cfg() ALOGD("%s: set backend rx sample rate = %s", __func__, rate_str); ctl_sample_rate = mixer_get_ctl_by_name(a2dp.adev->mixer, MIXER_SAMPLE_RATE_RX); if (!ctl_sample_rate) { ALOGE("%s: ERROR backend sample rate mixer control not identifed", __func__); return -ENOSYS; } if (ctl_sample_rate) { if (mixer_ctl_set_enum_by_string(ctl_sample_rate, rate_str) != 0) { ALOGE("%s: Failed to set backend sample rate = %s", __func__, rate_str); return -ENOSYS; } // Set Tx backend sample rate /* Set Tx backend sample rate */ if (a2dp.abr_config.is_abr_enabled) rate_str = ABR_TX_SAMPLE_RATE; Loading @@ -807,11 +806,26 @@ static int a2dp_set_backend_cfg() ALOGE("%s: ERROR backend sample rate mixer control not identifed", __func__); return -ENOSYS; } if (mixer_ctl_set_enum_by_string(ctl_sample_rate, rate_str) != 0) { ALOGE("%s: Failed to set backend sample rate = %s", __func__, rate_str); return -ENOSYS; } } else { /* Fallback to legacy approch if MIXER_SAMPLE_RATE_RX and MIXER_SAMPLE_RATE_TX is not supported */ ctl_sample_rate = mixer_get_ctl_by_name(a2dp.adev->mixer, MIXER_SAMPLE_RATE_DEFAULT); if (!ctl_sample_rate) { ALOGE("%s: ERROR backend sample rate mixer control not identifed", __func__); return -ENOSYS; } if (mixer_ctl_set_enum_by_string(ctl_sample_rate, rate_str) != 0) { ALOGE("%s: Failed to set backend sample rate = %s", __func__, rate_str); ALOGE("%s: Failed to set backend sample rate = %s", __func__, rate_str); return -ENOSYS; } } //Configure AFE input channels switch (a2dp.enc_channels) { Loading Loading @@ -849,10 +863,8 @@ static int a2dp_reset_backend_cfg() ALOGD("%s: reset backend sample rate = %s", __func__, rate_str); ctl_sample_rate_rx = mixer_get_ctl_by_name(a2dp.adev->mixer, MIXER_SAMPLE_RATE_RX); if (!ctl_sample_rate_rx) { ALOGE("%s: ERROR Rx backend sample rate mixer control not identifed", __func__); return -ENOSYS; } if (ctl_sample_rate_rx) { if (mixer_ctl_set_enum_by_string(ctl_sample_rate_rx, rate_str) != 0) { ALOGE("%s: Failed to reset Rx backend sample rate = %s", __func__, rate_str); return -ENOSYS; Loading @@ -864,10 +876,25 @@ static int a2dp_reset_backend_cfg() ALOGE("%s: ERROR Tx backend sample rate mixer control not identifed", __func__); return -ENOSYS; } if (mixer_ctl_set_enum_by_string(ctl_sample_rate_tx, rate_str) != 0) { ALOGE("%s: Failed to reset Tx backend sample rate = %s", __func__, rate_str); return -ENOSYS; } } else { ctl_sample_rate_rx = mixer_get_ctl_by_name(a2dp.adev->mixer, MIXER_SAMPLE_RATE_DEFAULT); if (!ctl_sample_rate_rx) { ALOGE("%s: ERROR backend sample rate mixer control not identifed", __func__); return -ENOSYS; } if (mixer_ctl_set_enum_by_string(ctl_sample_rate_rx, rate_str) != 0) { ALOGE("%s: Failed to reset backend sample rate = %s", __func__, rate_str); return -ENOSYS; } } // Reset AFE input channels ALOGD("%s: reset AFE input channels = %s", __func__, in_channels); Loading Loading
hal/audio_extn/a2dp.c +64 −37 Original line number Diff line number Diff line Loading @@ -76,6 +76,7 @@ #define MIXER_SCRAMBLER_MODE "AFE Scrambler Mode" #define MIXER_SAMPLE_RATE_RX "BT SampleRate RX" #define MIXER_SAMPLE_RATE_TX "BT SampleRate TX" #define MIXER_SAMPLE_RATE_DEFAULT "BT SampleRate" #define MIXER_AFE_IN_CHANNELS "AFE Input Channels" #define MIXER_ABR_TX_FEEDBACK_PATH "A2DP_SLIM7_UL_HL Switch" #define MIXER_SET_FEEDBACK_CHANNEL "BT set feedback channel" Loading Loading @@ -787,16 +788,14 @@ static int a2dp_set_backend_cfg() ALOGD("%s: set backend rx sample rate = %s", __func__, rate_str); ctl_sample_rate = mixer_get_ctl_by_name(a2dp.adev->mixer, MIXER_SAMPLE_RATE_RX); if (!ctl_sample_rate) { ALOGE("%s: ERROR backend sample rate mixer control not identifed", __func__); return -ENOSYS; } if (ctl_sample_rate) { if (mixer_ctl_set_enum_by_string(ctl_sample_rate, rate_str) != 0) { ALOGE("%s: Failed to set backend sample rate = %s", __func__, rate_str); return -ENOSYS; } // Set Tx backend sample rate /* Set Tx backend sample rate */ if (a2dp.abr_config.is_abr_enabled) rate_str = ABR_TX_SAMPLE_RATE; Loading @@ -807,11 +806,26 @@ static int a2dp_set_backend_cfg() ALOGE("%s: ERROR backend sample rate mixer control not identifed", __func__); return -ENOSYS; } if (mixer_ctl_set_enum_by_string(ctl_sample_rate, rate_str) != 0) { ALOGE("%s: Failed to set backend sample rate = %s", __func__, rate_str); return -ENOSYS; } } else { /* Fallback to legacy approch if MIXER_SAMPLE_RATE_RX and MIXER_SAMPLE_RATE_TX is not supported */ ctl_sample_rate = mixer_get_ctl_by_name(a2dp.adev->mixer, MIXER_SAMPLE_RATE_DEFAULT); if (!ctl_sample_rate) { ALOGE("%s: ERROR backend sample rate mixer control not identifed", __func__); return -ENOSYS; } if (mixer_ctl_set_enum_by_string(ctl_sample_rate, rate_str) != 0) { ALOGE("%s: Failed to set backend sample rate = %s", __func__, rate_str); ALOGE("%s: Failed to set backend sample rate = %s", __func__, rate_str); return -ENOSYS; } } //Configure AFE input channels switch (a2dp.enc_channels) { Loading Loading @@ -849,10 +863,8 @@ static int a2dp_reset_backend_cfg() ALOGD("%s: reset backend sample rate = %s", __func__, rate_str); ctl_sample_rate_rx = mixer_get_ctl_by_name(a2dp.adev->mixer, MIXER_SAMPLE_RATE_RX); if (!ctl_sample_rate_rx) { ALOGE("%s: ERROR Rx backend sample rate mixer control not identifed", __func__); return -ENOSYS; } if (ctl_sample_rate_rx) { if (mixer_ctl_set_enum_by_string(ctl_sample_rate_rx, rate_str) != 0) { ALOGE("%s: Failed to reset Rx backend sample rate = %s", __func__, rate_str); return -ENOSYS; Loading @@ -864,10 +876,25 @@ static int a2dp_reset_backend_cfg() ALOGE("%s: ERROR Tx backend sample rate mixer control not identifed", __func__); return -ENOSYS; } if (mixer_ctl_set_enum_by_string(ctl_sample_rate_tx, rate_str) != 0) { ALOGE("%s: Failed to reset Tx backend sample rate = %s", __func__, rate_str); return -ENOSYS; } } else { ctl_sample_rate_rx = mixer_get_ctl_by_name(a2dp.adev->mixer, MIXER_SAMPLE_RATE_DEFAULT); if (!ctl_sample_rate_rx) { ALOGE("%s: ERROR backend sample rate mixer control not identifed", __func__); return -ENOSYS; } if (mixer_ctl_set_enum_by_string(ctl_sample_rate_rx, rate_str) != 0) { ALOGE("%s: Failed to reset backend sample rate = %s", __func__, rate_str); return -ENOSYS; } } // Reset AFE input channels ALOGD("%s: reset AFE input channels = %s", __func__, in_channels); Loading