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

Commit 413a6f0f authored by Revathi Uddaraju's avatar Revathi Uddaraju Committed by Gerrit - the friendly Code Review server
Browse files

hal: USB headset support for native playback.

Add USB Headset in the list of devices that support native playback.
Also add backend_idx for USB in the condition where it checks for
44.1khz support.

Change-Id: I85c4519d79dce44e0d15e9ea5b7074329fda7334
parent f5baa30a
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -3403,7 +3403,8 @@ int codec_device_supports_native_playback(audio_devices_t out_device)

    if (out_device & AUDIO_DEVICE_OUT_WIRED_HEADPHONE ||
        out_device & AUDIO_DEVICE_OUT_WIRED_HEADSET ||
        out_device & AUDIO_DEVICE_OUT_LINE)
        out_device & AUDIO_DEVICE_OUT_LINE ||
        out_device & AUDIO_DEVICE_OUT_USB_HEADSET)
        ret = true;

    return ret;
@@ -6519,7 +6520,8 @@ static bool platform_check_codec_backend_cfg(struct audio_device* adev,
                       __func__);
        }
        /*reset sample rate to 48khz if sample rate less than 44.1khz, or device backend dose not support 44.1 khz*/
        if ((sample_rate == OUTPUT_SAMPLING_RATE_44100 && backend_idx != HEADPHONE_44_1_BACKEND)
        if ((sample_rate == OUTPUT_SAMPLING_RATE_44100 && backend_idx != HEADPHONE_44_1_BACKEND &&
             backend_idx != USB_AUDIO_RX_BACKEND)
            || sample_rate < OUTPUT_SAMPLING_RATE_44100) {
                sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
            ALOGD("%s:becf: afe: reset sample rate to default Sample Rate(48k)",__func__);