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

Commit 4cb8298a authored by vivek mehta's avatar vivek mehta Committed by Eric Laurent
Browse files

hal: send correct ACDB id

- wrong usage of function is resulting in invalid ACDB id to be passed
  to ACDB loader.
- ACDB id for o/p device is incorrectly converted to sound device and
  is passed to get corresponding ACDB id. This results in passing invalid
  ACDB id below.

Bug: 22460430.

Change-Id: I24a470c453daea68ff14a94c03a157487f33ac66
parent 3b86d472
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -463,7 +463,6 @@ bool platform_send_gain_dep_cal(void *platform, int level)
    int mode = CAL_MODE_RTAC;
    struct listnode *node;
    struct audio_usecase *usecase;
    snd_device_t snd_device;

    if (my_data->acdb_send_gain_dep_cal == NULL) {
        ALOGE("%s: dlsym error for acdb_send_gain_dep_cal", __func__);
@@ -484,8 +483,12 @@ bool platform_send_gain_dep_cal(void *platform, int level)
                (usecase->stream.out->devices == AUDIO_DEVICE_OUT_SPEAKER)) {

                ALOGV("%s: out device is %d", __func__,  usecase->out_snd_device);
                snd_device = audio_extn_spkr_prot_get_acdb_id(usecase->out_snd_device);
                acdb_dev_id = acdb_device_table[snd_device];
                if (audio_extn_spkr_prot_is_enabled()) {
                    acdb_dev_id = audio_extn_spkr_prot_get_acdb_id(usecase->out_snd_device);
                } else {
                    acdb_dev_id = acdb_device_table[usecase->out_snd_device];
                }

                if (!my_data->acdb_send_gain_dep_cal(acdb_dev_id, app_type,
                                                     acdb_dev_type, mode, level)) {
                    // set ret_val true if at least one calibration is set successfully