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

Commit 88891aed authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "hal: Enable ASRC for existing use-case with combo device" into audio-userspace.lnx.2.2-dev

parents 6b8ff7d0 50058f65
Loading
Loading
Loading
Loading
+47 −28
Original line number Diff line number Diff line
@@ -619,13 +619,26 @@ static void check_and_set_asrc_mode(struct audio_device *adev, snd_device_t snd_
        struct audio_usecase *uc = NULL;
        struct stream_out *curr_out = NULL;
        int usecase_backend_idx = DEFAULT_CODEC_BACKEND;
        int i, num_devices, ret = 0;
        snd_device_t split_snd_devices[SND_DEVICE_OUT_END];

        list_for_each(node, &adev->usecase_list) {
            uc = node_to_item(node, struct audio_usecase, list);
            curr_out = (struct stream_out*) uc->stream.out;
            if (curr_out && PCM_PLAYBACK == uc->type) {
                usecase_backend_idx = platform_get_backend_index(uc->out_snd_device);

            if (curr_out && PCM_PLAYBACK == uc->type) {
                ret = platform_split_snd_device(adev->platform,
                                         uc->out_snd_device,
                                         &num_devices,
                                         split_snd_devices);
                if (ret < 0 || num_devices == 0) {
                    ALOGV("%s: Unable to split uc->out_snd_device: %d",__func__, uc->out_snd_device);
                    split_snd_devices[0] = uc->out_snd_device;
                    num_devices = 1;
                }
                for (i = 0; i < num_devices; i++) {
                    usecase_backend_idx = platform_get_backend_index(split_snd_devices[i]);
                    ALOGD("%s:snd_dev %d usecase_backend_idx %d",__func__, split_snd_devices[i],usecase_backend_idx);
                    if((new_backend_idx == HEADPHONE_BACKEND) &&
                           ((usecase_backend_idx == HEADPHONE_44_1_BACKEND) ||
                           (usecase_backend_idx == DSD_NATIVE_BACKEND))) {
@@ -654,6 +667,12 @@ static void check_and_set_asrc_mode(struct audio_device *adev, snd_device_t snd_
                        break;
                    }
                }
                // reset split devices count
                num_devices = 0;
            }
            if (adev->asrc_mode_enabled)
                break;

        }
    }
}