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

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

Merge "hal: update bt-sco sample rate before device enable"

parents 98a0a69d 76ecc0de
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -296,6 +296,18 @@ int enable_snd_device(struct audio_device *adev,
        return 0;
    }

    /* Set BT sample rate before enabling the devices. Adding sample rate mixer
     * control in use-case does not work because rate update takes place after
     * AFE port open due to the limitation of mixer control order execution.
     */
    if (snd_device == SND_DEVICE_OUT_BT_SCO) {
        audio_route_apply_path(adev->audio_route, BT_SCO_SAMPLE_RATE);
        audio_route_update_mixer(adev->audio_route);
    } else if (snd_device == SND_DEVICE_OUT_BT_SCO_WB) {
        audio_route_apply_path(adev->audio_route, BT_SCO_WB_SAMPLE_RATE);
        audio_route_update_mixer(adev->audio_route);
    }

    /* start usb playback thread */
    if(SND_DEVICE_OUT_USB_HEADSET == snd_device ||
       SND_DEVICE_OUT_SPEAKER_AND_USB_HEADSET == snd_device)
+4 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
 * Not a contribution.
 *
 * Copyright (C) 2013 The Android Open Source Project
@@ -31,6 +31,9 @@
#define VISUALIZER_LIBRARY_PATH "/system/lib/soundfx/libqcomvisualizer.so"
#define OFFLOAD_EFFECTS_BUNDLE_LIBRARY_PATH "/system/lib/soundfx/libqcompostprocbundle.so"

#define BT_SCO_SAMPLE_RATE "bt-sco-samplerate"
#define BT_SCO_WB_SAMPLE_RATE "bt-sco-wb-samplerate"

/* Flags used to initialize acdb_settings variable that goes to ACDB library */
#define NONE_FLAG            0x00000000
#define DMIC_FLAG            0x00000002
+0 −5
Original line number Diff line number Diff line
@@ -1767,11 +1767,6 @@ int platform_set_parameters(void *platform, struct str_parms *parms)
    if (err >= 0) {
        str_parms_del(parms, AUDIO_PARAMETER_KEY_BTSCO);
        my_data->btsco_sample_rate = val;
        if (val == SAMPLE_RATE_16KHZ) {
            audio_route_apply_path(my_data->adev->audio_route,
                                   "bt-sco-wb-samplerate");
            audio_route_update_mixer(my_data->adev->audio_route);
        }
    }

    err = str_parms_get_str(parms, AUDIO_PARAMETER_KEY_SLOWTALK, value, sizeof(value));