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

Commit 5e7119c5 authored by juyuchen's avatar juyuchen
Browse files

audio: Handle missing / tainted calibration file



Send calibration values to DSP though calibration file can't be opened.

Bug: 79127070
Test: manual audio test on B1

Change-Id: Ia17bf34203095fce26a6780022c922ba3bd43347
Signed-off-by: default avatarjuyuchen <juyuchen@google.com>
parent 1b542ad4
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -284,10 +284,9 @@ static int audio_extn_cirrus_run_calibration() {

        cal_file = fopen(CRUS_CAL_FILE, "wb");
        if (cal_file == NULL) {
            ALOGE("%s: Cannot create Cirrus SP calibration file (%s)",
            ALOGE("%s: Cannot create Cirrus SP calibration file (%s), write cal value to dsp",
                  __func__, strerror(errno));
            ret = -EINVAL;
            goto exit;
            goto write_dsp;
        }

        ret = fwrite(&result, sizeof(result), 1, cal_file);
@@ -306,6 +305,7 @@ static int audio_extn_cirrus_run_calibration() {
              __func__);
    }

write_dsp:
    header.size = sizeof(header);
    header.module_id = CRUS_MODULE_ID_TX;
    header.param_id = 0;