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

Commit 14170ddf authored by Dhananjay Kumar's avatar Dhananjay Kumar
Browse files

hal: fix missing calibration issue for playback on speaker

- ADM calibration is sometimes not sent for playback on speaker
  due to use of unsupported sample rate by send calibration routine.
- Fix the issue by updating app_type sample_rate for output
  to supported value before sending calibration data.

Change-Id: I3a04b6b7dd26aa53c1726d6a9a8e3cb72f7ba74e
parent 908df1ab
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -566,14 +566,13 @@ int audio_extn_utils_send_app_type_cfg(struct audio_device *adev,
    } else if (usecase->type == PCM_PLAYBACK) {
        if ((24 == usecase->stream.out->bit_width) &&
            (usecase->stream.out->devices & AUDIO_DEVICE_OUT_SPEAKER)) {
            sample_rate = DEFAULT_OUTPUT_SAMPLING_RATE;
            usecase->stream.out->app_type_cfg.sample_rate = DEFAULT_OUTPUT_SAMPLING_RATE;
        } else if ((snd_device != SND_DEVICE_OUT_HEADPHONES_44_1 &&
            usecase->stream.out->sample_rate == OUTPUT_SAMPLING_RATE_44100) ||
            (usecase->stream.out->sample_rate < OUTPUT_SAMPLING_RATE_44100)) {
            sample_rate = DEFAULT_OUTPUT_SAMPLING_RATE;
        } else {
            sample_rate = usecase->stream.out->app_type_cfg.sample_rate;
            usecase->stream.out->app_type_cfg.sample_rate = DEFAULT_OUTPUT_SAMPLING_RATE;
        }
        sample_rate = usecase->stream.out->app_type_cfg.sample_rate;

        app_type_cfg[len++] = usecase->stream.out->app_type_cfg.app_type;
        app_type_cfg[len++] = acdb_dev_id;
+1 −1
Original line number Diff line number Diff line
@@ -453,8 +453,8 @@ int enable_audio_route(struct audio_device *adev,
    audio_extn_dolby_ds2_set_endpoint(adev);
    audio_extn_sound_trigger_update_stream_status(usecase, ST_EVENT_STREAM_BUSY);
    audio_extn_listen_update_stream_status(usecase, LISTEN_EVENT_STREAM_BUSY);
    audio_extn_utils_send_audio_calibration(adev, usecase);
    audio_extn_utils_send_app_type_cfg(adev, usecase);
    audio_extn_utils_send_audio_calibration(adev, usecase);
    strcpy(mixer_path, use_case_table[usecase->id]);
    platform_add_backend_name(mixer_path, snd_device, usecase);
    ALOGD("%s: apply mixer and update path: %s", __func__, mixer_path);