Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b39a6a3 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "hal: Fix ADM Sample Rate and echo reference path for HFP"

parents d7e75a49 d730701e
Loading
Loading
Loading
Loading
+0 −32
Original line number Diff line number Diff line
@@ -83,7 +83,6 @@ struct hfp_module {
    struct pcm *hfp_sco_tx;
    struct pcm *hfp_pcm_rx;
    struct pcm *hfp_pcm_tx;
    struct pcm *hfp_ext_ec_tx;
    bool is_hfp_running;
    float hfp_volume;
    int32_t hfp_pcm_dev_id;
@@ -97,7 +96,6 @@ static struct hfp_module hfpmod = {
    .hfp_sco_tx = NULL,
    .hfp_pcm_rx = NULL,
    .hfp_pcm_tx = NULL,
    .hfp_ext_ec_tx = NULL,
    .is_hfp_running = 0,
    .hfp_volume = 0,
    .hfp_pcm_dev_id = HFP_ASM_RX_TX,
@@ -290,7 +288,6 @@ static int32_t start_hfp(struct audio_device *adev,
    int32_t ret = 0;
    struct audio_usecase *uc_info;
    int32_t pcm_dev_rx_id, pcm_dev_tx_id, pcm_dev_asm_rx_id, pcm_dev_asm_tx_id;
    int32_t pcm_ext_ec_ref_id;

    ALOGD("%s: enter", __func__);

@@ -400,27 +397,6 @@ static int32_t start_hfp(struct audio_device *adev,
        goto exit;
    }

#ifdef PLATFORM_AUTO
    /* echo reference path for single-mic/multi-mic surround ECNS hfp calls */
    pcm_ext_ec_ref_id = HFP_EXT_EC_REF_TX;
    ALOGD("%s: Opening PCM capture device card_id(%d) device_id(%d)",
            __func__, adev->snd_card, pcm_ext_ec_ref_id);
    hfpmod.hfp_ext_ec_tx = pcm_open(adev->snd_card,
                                    pcm_ext_ec_ref_id,
                                    PCM_IN, &pcm_config_hfp);
    if (hfpmod.hfp_ext_ec_tx && !pcm_is_ready(hfpmod.hfp_ext_ec_tx)) {
        ALOGE("%s: %s", __func__, pcm_get_error(hfpmod.hfp_ext_ec_tx));
        ret = -EIO;
        goto exit;
    }

    if (pcm_start(hfpmod.hfp_ext_ec_tx) < 0) {
        ALOGE("%s: pcm start for hfp ext ec tx failed", __func__);
        ret = -EINVAL;
        goto exit;
    }
#endif

    hfpmod.is_hfp_running = true;
    hfp_set_volume(adev, hfpmod.hfp_volume);

@@ -465,14 +441,6 @@ static int32_t stop_hfp(struct audio_device *adev)
        hfpmod.hfp_pcm_tx = NULL;
    }

#ifdef PLATFORM_AUTO
    /* echo reference path for single-mic/multi-mic surround ECNS hfp calls */
    if (hfpmod.hfp_ext_ec_tx) {
        pcm_close(hfpmod.hfp_ext_ec_tx);
        hfpmod.hfp_ext_ec_tx = NULL;
    }
#endif

    uc_info = fp_get_usecase_from_list(adev, hfpmod.ucid);
    if (uc_info == NULL) {
        ALOGE("%s: Could not find the usecase (%d) in the list",
+2 −2
Original line number Diff line number Diff line
@@ -910,13 +910,13 @@ void audio_extn_utils_update_stream_app_type_cfg_for_usecase(
        case USECASE_AUDIO_HFP_SCO_WB:
            audio_extn_btsco_get_sample_rate(usecase->out_snd_device,
                                             &usecase->out_app_type_cfg.sample_rate);
            usecase->in_app_type_cfg.sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
            usecase->in_app_type_cfg.sample_rate = usecase->out_app_type_cfg.sample_rate;
            break;
        case USECASE_AUDIO_HFP_SCO_DOWNLINK:
        case USECASE_AUDIO_HFP_SCO_WB_DOWNLINK:
            audio_extn_btsco_get_sample_rate(usecase->in_snd_device,
                                             &usecase->in_app_type_cfg.sample_rate);
            usecase->out_app_type_cfg.sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
            usecase->out_app_type_cfg.sample_rate = usecase->in_app_type_cfg.sample_rate;
            break;
        default:
            ALOGE("%s: usecase id (%d) not supported, use default sample rate",
+0 −3
Original line number Diff line number Diff line
@@ -1911,9 +1911,6 @@ void platform_set_echo_reference(struct audio_device *adev, bool enable,
        else if (compare_device_type(out_devices, AUDIO_DEVICE_OUT_USB_HEADSET))
            strlcat(ec_ref_mixer_path, " usb-headphones",
                    MIXER_PATH_MAX_LENGTH);
        else if (compare_device_type(out_devices, AUDIO_DEVICE_OUT_BUS))
            strlcpy(ec_ref_mixer_path, "multi-mic-echo-reference",
                    MIXER_PATH_MAX_LENGTH);
        else if (adev->snd_dev_ref_cnt[SND_DEVICE_OUT_BT_SCO_WB] > 0)
            strlcat(ec_ref_mixer_path, " bt-sco-wb",
                    MIXER_PATH_MAX_LENGTH);
+0 −1
Original line number Diff line number Diff line
@@ -626,7 +626,6 @@ enum {
#elif PLATFORM_AUTO
#define HFP_SCO_RX 29
#define HFP_ASM_RX_TX 36
#define HFP_EXT_EC_REF_TX 1
#elif defined (PLATFORM_MSMFALCON) || defined (PLATFORM_MSM8937) || \
      defined (PLATFORM_MSM8953)
#define HFP_SCO_RX 17