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

Commit dabb0d91 authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge e3c11a32 on remote branch

Change-Id: I721cb002ab9baf58482f6805589107d7d069dae2
parents eed592f9 e3c11a32
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
 * Not a Contribution.
 *
 * Copyright (C) 2013 The Android Open Source Project
@@ -50,6 +50,7 @@ typedef int (*acdb_init_v3_t)(const char *, char *, struct listnode *);
typedef int  (*acdb_init_v4_t)(void *, int);
typedef void (*acdb_send_audio_cal_t)(int, int, int , int);
typedef void (*acdb_send_audio_cal_v3_t)(int, int, int, int, int);
typedef void (*acdb_send_audio_cal_v4_t)(int, int, int, int, int, int);
typedef void (*acdb_send_voice_cal_t)(int, int);
typedef int (*acdb_reload_vocvoltable_t)(int);
typedef int  (*acdb_get_default_app_type_t)(void);
+9 −4
Original line number Diff line number Diff line
@@ -209,6 +209,7 @@ typedef enum {
    APTX_AD_SR_UNCHANGED = 0x0,
    APTX_AD_48 = 0x1,  // 48 KHz default
    APTX_AD_44_1 = 0x2, // 44.1kHz
    APTX_AD_96 = 0x3,  // 96KHz
} enc_aptx_ad_s_rate;

typedef void (*bt_audio_pre_init_t)(void);
@@ -1794,6 +1795,10 @@ static int update_aptx_ad_dsp_config_r2(struct aptx_ad_enc_cfg_r2_t *aptx_dsp_cf
            a2dp.enc_sampling_rate = SAMPLING_RATE_441K;
            aptx_dsp_cfg->custom_cfg.sample_rate = SAMPLING_RATE_441K;
            break;
        case APTX_AD_96:
            a2dp.enc_sampling_rate = SAMPLING_RATE_96K;
            aptx_dsp_cfg->custom_cfg.sample_rate = SAMPLING_RATE_96K;
            break;
    }
    ALOGV("Successfully updated APTX AD enc format with \
               samplingrate: %d channels:%d",
+3 −18
Original line number Diff line number Diff line
@@ -1764,13 +1764,13 @@ static void check_usecases_capture_codec_backend(struct audio_device *adev,
        if (usecase->type != PCM_PLAYBACK &&
                usecase != uc_info &&
                (usecase->in_snd_device != snd_device || force_routing) &&
                ((uc_info->devices & backend_check_cond) &&
                (((uc_info->devices & backend_check_cond) &&
                 (((usecase->devices & ~AUDIO_DEVICE_BIT_IN) & AUDIO_DEVICE_IN_ALL_CODEC_BACKEND) ||
                  (usecase->type == VOIP_CALL))) &&
                  (usecase->type == VOIP_CALL))) ||
                ((uc_info->type == VOICE_CALL &&
                  usecase->devices == AUDIO_DEVICE_IN_VOICE_CALL) ||
                 platform_check_backends_match(snd_device,\
                                              usecase->in_snd_device)) &&
                                              usecase->in_snd_device))) &&
                (usecase->id != USECASE_AUDIO_SPKR_CALIB_TX)) {
            ALOGV("%s: Usecase (%s) is active on (%s) - disabling ..",
                  __func__, use_case_table[usecase->id],
@@ -8314,21 +8314,6 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs)
                adev->allow_afe_proxy_usage = true;
            }
        }
        if (audio_is_a2dp_out_device(device)) {
           struct audio_usecase *usecase;
           struct listnode *node;
           list_for_each(node, &adev->usecase_list) {
               usecase = node_to_item(node, struct audio_usecase, list);
               if (PCM_PLAYBACK == usecase->type && usecase->stream.out &&
                  (usecase->stream.out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) &&
                   usecase->stream.out->a2dp_compress_mute) {
                   struct stream_out *out = usecase->stream.out;
                   ALOGD("Unmuting the stream when Bt-A2dp disconnected and stream is mute");
                   out->a2dp_compress_mute = false;
                   out_set_compr_volume(&out->stream, out->volume_l, out->volume_r);
               }
           }
        }
    }

    audio_extn_hfp_set_parameters(adev, parms);
+21 −3
Original line number Diff line number Diff line
@@ -318,6 +318,7 @@ struct platform_data {
    acdb_deallocate_t          acdb_deallocate;
    acdb_send_audio_cal_t      acdb_send_audio_cal;
    acdb_send_audio_cal_v3_t   acdb_send_audio_cal_v3;
    acdb_send_audio_cal_v4_t   acdb_send_audio_cal_v4;
    acdb_set_audio_cal_t       acdb_set_audio_cal;
    acdb_get_audio_cal_t       acdb_get_audio_cal;
    acdb_send_voice_cal_t      acdb_send_voice_cal;
@@ -3266,6 +3267,12 @@ void *platform_init(struct audio_device *adev)
            ALOGE("%s: Could not find the symbol acdb_send_audio_cal_v3 from %s",
                  __func__, LIB_ACDB_LOADER);

        my_data->acdb_send_audio_cal_v4 = (acdb_send_audio_cal_v4_t)dlsym(my_data->acdb_handle,
                                                    "acdb_loader_send_audio_cal_v4");
        if (!my_data->acdb_send_audio_cal_v4)
            ALOGE("%s: Could not find the symbol acdb_send_audio_cal_v4 from %s",
                  __func__, LIB_ACDB_LOADER);

        my_data->acdb_set_audio_cal = (acdb_set_audio_cal_t)dlsym(my_data->acdb_handle,
                                                    "acdb_loader_set_audio_cal_v2");
        if (!my_data->acdb_set_audio_cal)
@@ -4951,6 +4958,7 @@ int platform_send_audio_calibration(void *platform, struct audio_usecase *usecas
    bool is_incall_rec_usecase = false;
    snd_device_t incall_rec_device;
    int sample_rate = DEFAULT_OUTPUT_SAMPLING_RATE;
    struct audio_backend_cfg backend_cfg = {0};

    if (voice_is_in_call(my_data->adev))
        is_incall_rec_usecase = voice_is_in_call_rec_stream(usecase->stream.in);
@@ -4989,11 +4997,13 @@ int platform_send_audio_calibration(void *platform, struct audio_usecase *usecas
            acdb_dev_id = acdb_device_table[platform_get_spkr_prot_snd_device(new_snd_device[i])];
            sample_rate = audio_extn_utils_get_app_sample_rate_for_device(my_data->adev, usecase,
                                                          new_snd_device[i]);
            platform_get_codec_backend_cfg(my_data->adev, new_snd_device[i], &backend_cfg);
        } else {
            // Use in_call_rec snd_device to extract the ACDB device ID instead of split snd devices
            acdb_dev_id = acdb_device_table[platform_get_spkr_prot_snd_device(snd_device)];
            sample_rate = audio_extn_utils_get_app_sample_rate_for_device(my_data->adev, usecase,
                                                          snd_device);
            platform_get_codec_backend_cfg(my_data->adev, snd_device, &backend_cfg);
        }

        // Do not use Rx path default app type for TX path
@@ -5002,6 +5012,12 @@ int platform_send_audio_calibration(void *platform, struct audio_usecase *usecas
            app_type  = DEFAULT_APP_TYPE_TX_PATH;
        }

        /* Override backend cfg sample rate in calibration for vi feedback usecase */
        if (usecase->id == USECASE_AUDIO_SPKR_CALIB_TX) {
            ALOGV("Reset backend cfg sample rate to 8KHz for spkr calib Tx use case");
            backend_cfg.sample_rate = sample_rate;
        }

        if (acdb_dev_id < 0) {
            ALOGE("%s: Could not find acdb id for device(%d)",
                  __func__, new_snd_device[i]);
@@ -5026,7 +5042,11 @@ int platform_send_audio_calibration(void *platform, struct audio_usecase *usecas
        else
            acdb_dev_type = ACDB_DEV_TYPE_IN;

        if (my_data->acdb_send_audio_cal_v3) {
        if (my_data->acdb_send_audio_cal_v4) {
            my_data->acdb_send_audio_cal_v4(acdb_dev_id, acdb_dev_type,
                                            app_type, sample_rate, i,
                                            backend_cfg.sample_rate);
        } else if (my_data->acdb_send_audio_cal_v3) {
            my_data->acdb_send_audio_cal_v3(acdb_dev_id, acdb_dev_type,
                                            app_type, sample_rate, i);
        } else if (my_data->acdb_send_audio_cal) {
@@ -6012,8 +6032,6 @@ snd_device_t platform_get_output_snd_device(void *platform, struct stream_out *o
        } else if (audio_extn_is_hifi_filter_enabled(adev, out, snd_device,
             my_data->codec_variant, channel_count, 1)) {
                snd_device = SND_DEVICE_OUT_HEADPHONES_HIFI_FILTER;
        } else if (devices & SND_DEVICE_OUT_HEADPHONES_HIFI_FILTER) {
                snd_device = SND_DEVICE_OUT_HEADPHONES_HIFI_FILTER;
        } else if (devices & AUDIO_DEVICE_OUT_LINE) {
                snd_device = SND_DEVICE_OUT_LINE;
        } else