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

Commit 7de7fd7e authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 4793185 from 04b8cf1d to pi-release

Change-Id: I8fd778ae6720706dfb8a6fe3e3e76625c765df3b
parents ae48a2f7 04b8cf1d
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -51,7 +51,6 @@ endif
ifneq ($(filter sdm845,$(TARGET_BOARD_PLATFORM)),)
  LOCAL_CFLAGS := -DPLATFORM_SDM845
  LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
  LOCAL_CFLAGS += -DKPI_OPTIMIZE_ENABLED
  LOCAL_CFLAGS += -DINCALL_MUSIC_ENABLED
  LOCAL_CFLAGS += -DINCALL_STEREO_CAPTURE_ENABLED
  MULTIPLE_HW_VARIANTS_ENABLED := true
@@ -194,6 +193,10 @@ ifeq ($(strip $(AUDIO_FEATURE_ENABLED_MAXX_AUDIO)), true)
    LOCAL_SRC_FILES += audio_extn/maxxaudio.c
endif

ifeq ($(strip $(AUDIO_FEATURE_ENABLED_BG_CAL)),true)
    LOCAL_CFLAGS += -DBG_CODEC_CAL
endif

LOCAL_SHARED_LIBRARIES += libbase libhidlbase libhwbinder libutils android.hardware.power@1.2 liblog

LOCAL_SRC_FILES += audio_perf.cpp
+1 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ typedef int (*acdb_init_v2_t)(char *);
typedef int  (*acdb_init_t)();
typedef void (*acdb_send_audio_cal_t)(int, int);
typedef void (*acdb_send_voice_cal_t)(int, int);
typedef int (*acdb_get_audio_cal_t) (void *, void *, uint32_t*);
typedef int (*acdb_reload_vocvoltable_t)(int);
typedef int (*acdb_send_gain_dep_cal_t)(int, int, int, int, int);
typedef int (*acdb_send_custom_top_t) (void);
+33 −4
Original line number Diff line number Diff line
@@ -1370,7 +1370,6 @@ int audio_extn_a2dp_start_playback()
        ALOGD("%s: calling Bluetooth module stream start", __func__);
        /* This call indicates Bluetooth IPC lib to start playback */
        ret =  a2dp.audio_stream_start();
        ALOGE("%s: Bluetooth controller start return = %d", __func__, ret);
        if (ret != 0 ) {
           ALOGE("%s: Bluetooth controller start failed", __func__);
           a2dp.a2dp_started = false;
@@ -1457,16 +1456,17 @@ int audio_extn_a2dp_stop_playback()
    return 0;
}

void audio_extn_a2dp_set_parameters(struct str_parms *parms)
int audio_extn_a2dp_set_parameters(struct str_parms *parms, bool *reconfig)
{
     int ret, val;
     int ret = 0, val;
     char value[32] = {0};
     struct audio_usecase *uc_info;
     struct listnode *node;

     if (a2dp.is_a2dp_offload_enabled == false) {
        ALOGV("%s: No supported encoders identified,ignoring A2DP setparam", __func__);
        return;
        ret = -EINVAL;
        goto param_handled;
     }

     ret = str_parms_get_str(parms, AUDIO_PARAMETER_DEVICE_CONNECT, value,
@@ -1562,8 +1562,20 @@ void audio_extn_a2dp_set_parameters(struct str_parms *parms)
        }
        goto param_handled;
     }

     ret = str_parms_get_str(parms, AUDIO_PARAMETER_RECONFIG_A2DP, value,
                         sizeof(value));
     if (ret >= 0) {
         if (a2dp.is_a2dp_offload_enabled &&
                a2dp.bt_state != A2DP_STATE_DISCONNECTED) {
             *reconfig = true;
         }
         goto param_handled;
     }

param_handled:
     ALOGV("%s: end of A2DP setparam", __func__);
     return ret;
}

void audio_extn_a2dp_set_handoff_mode(bool is_on)
@@ -1664,4 +1676,21 @@ uint32_t audio_extn_a2dp_get_encoder_latency()
    }
    return latency;
}

int audio_extn_a2dp_get_parameters(struct str_parms *query,
                                   struct str_parms *reply)
{
    int ret, val = 0;
    char value[32]={0};

    ret = str_parms_get_str(query, AUDIO_PARAMETER_A2DP_RECONFIG_SUPPORTED,
                            value, sizeof(value));
    if (ret >= 0) {
        val = a2dp.is_a2dp_offload_enabled;
        str_parms_add_int(reply, AUDIO_PARAMETER_A2DP_RECONFIG_SUPPORTED, val);
        ALOGV("%s: called ... isReconfigA2dpSupported %d", __func__, val);
    }

    return 0;
}
#endif // A2DP_OFFLOAD_ENABLED
+5 −2
Original line number Diff line number Diff line
@@ -147,7 +147,8 @@ int audio_extn_sound_trigger_read(struct stream_in *in, void *buffer,
#define audio_extn_a2dp_init(adev)                       (0)
#define audio_extn_a2dp_start_playback()                 (0)
#define audio_extn_a2dp_stop_playback()                  (0)
#define audio_extn_a2dp_set_parameters(parms)            (0)
#define audio_extn_a2dp_set_parameters(parms, reconfig)  (0)
#define audio_extn_a2dp_get_parameters(query, reply)     (0)
#define audio_extn_a2dp_is_force_device_switch()         (0)
#define audio_extn_a2dp_set_handoff_mode(is_on)          (0)
#define audio_extn_a2dp_get_sample_rate(sample_rate)     (0)
@@ -158,7 +159,9 @@ int audio_extn_sound_trigger_read(struct stream_in *in, void *buffer,
void audio_extn_a2dp_init(void *adev);
int audio_extn_a2dp_start_playback();
int audio_extn_a2dp_stop_playback();
void audio_extn_a2dp_set_parameters(struct str_parms *parms);
int audio_extn_a2dp_set_parameters(struct str_parms *parms, bool *reconfig);
int audio_extn_a2dp_get_parameters(struct str_parms *query,
                                   struct str_parms *reply);
bool audio_extn_a2dp_is_force_device_switch();
void audio_extn_a2dp_set_handoff_mode(bool is_on);
void audio_extn_a2dp_get_sample_rate(int *sample_rate);
+17 −13
Original line number Diff line number Diff line
@@ -678,12 +678,6 @@ int enable_snd_device(struct audio_device *adev,

    audio_extn_dsm_feedback_enable(adev, snd_device, true);

    if (is_a2dp_device(snd_device) &&
        (audio_extn_a2dp_start_playback() < 0)) {
           ALOGE("%s: failed to configure A2DP control path", __func__);
           goto on_error;
    }

    if ((snd_device == SND_DEVICE_OUT_SPEAKER ||
        snd_device == SND_DEVICE_OUT_SPEAKER_SAFE ||
        snd_device == SND_DEVICE_OUT_SPEAKER_REVERSE ||
@@ -711,6 +705,13 @@ int enable_snd_device(struct audio_device *adev,
        }

        ALOGD("%s: snd_device(%d: %s)", __func__, snd_device, device_name);

        if (is_a2dp_device(snd_device) &&
            (audio_extn_a2dp_start_playback() < 0)) {
               ALOGE("%s: failed to configure A2DP control path", __func__);
               goto on_error;
        }

        audio_route_apply_and_update_path(adev->audio_route, device_name);
    }
on_success:
@@ -907,7 +908,8 @@ static void check_and_route_playback_usecases(struct audio_device *adev,
     * with new AFE encoder format based on a2dp state
     */
    if ((SND_DEVICE_OUT_BT_A2DP == snd_device ||
         SND_DEVICE_OUT_SPEAKER_AND_BT_A2DP == snd_device) &&
         SND_DEVICE_OUT_SPEAKER_AND_BT_A2DP == snd_device ||
         SND_DEVICE_OUT_SPEAKER_SAFE_AND_BT_A2DP == snd_device) &&
         audio_extn_a2dp_is_force_device_switch()) {
         force_routing = true;
    }
@@ -1361,7 +1363,8 @@ int select_devices(struct audio_device *adev,
          return 0;
    }

    if ((out_snd_device == SND_DEVICE_OUT_SPEAKER_AND_BT_A2DP) &&
    if ((out_snd_device == SND_DEVICE_OUT_SPEAKER_AND_BT_A2DP ||
         out_snd_device == SND_DEVICE_OUT_SPEAKER_SAFE_AND_BT_A2DP) &&
        (!audio_extn_a2dp_is_ready())) {
        ALOGW("%s: A2DP profile is not ready, routing to speaker only", __func__);
        out_snd_device = SND_DEVICE_OUT_SPEAKER;
@@ -4643,6 +4646,7 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs)
    int val;
    int ret;
    int status = 0;
    bool a2dp_reconfig = false;

    ALOGV("%s: enter: %s", __func__, kvpairs);

@@ -4741,18 +4745,16 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs)
    }

    audio_extn_hfp_set_parameters(adev, parms);
    audio_extn_a2dp_set_parameters(parms);
    audio_extn_ma_set_parameters(adev, parms);

    // reconfigure should be done only after updating A2DP state in audio extension
    ret = str_parms_get_str(parms,"reconfigA2dp", value, sizeof(value));
    if (ret >= 0) {
    status = audio_extn_a2dp_set_parameters(parms, &a2dp_reconfig);
    if (status >= 0 && a2dp_reconfig) {
        struct audio_usecase *usecase;
        struct listnode *node;
        list_for_each(node, &adev->usecase_list) {
            usecase = node_to_item(node, struct audio_usecase, list);
            if ((usecase->type == PCM_PLAYBACK) &&
                (usecase->devices & AUDIO_DEVICE_OUT_BLUETOOTH_A2DP)) {
                (usecase->devices & AUDIO_DEVICE_OUT_ALL_A2DP)) {
                ALOGD("%s: reconfigure A2DP... forcing device switch", __func__);

                pthread_mutex_unlock(&adev->lock);
@@ -4786,6 +4788,8 @@ static char* adev_get_parameters(const struct audio_hw_device *dev,
    pthread_mutex_lock(&adev->lock);

    voice_get_parameters(adev, query, reply);
    audio_extn_a2dp_get_parameters(query, reply);

    str = str_parms_to_str(reply);
    str_parms_destroy(query);
    str_parms_destroy(reply);
Loading