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

Commit f928a98e authored by Narsinga Rao Chella's avatar Narsinga Rao Chella
Browse files

hal: add support for source tracking feature

Fluence module on ADSP is upgraded to support source
tracking, sound focus and audio zoom features. This
change adds support for the same in audio HAL and is
needed to support the features end-to-end.

Source Tracking is the capability to identify the
source of speech. Sound Focus is the capability to
configure which sectors in the 360 degrees plane to
listen to. Audio Zoom is the capability to combine
the sound focus with other technologies so that a user
can listen in on a particular source in a scene.

Change-Id: I019b22d6541e6d1a10552d808c3320a998b86e48
parent e0b22e0e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -190,6 +190,11 @@ ifeq ($(strip $(AUDIO_FEATURE_ENABLED_HDMI_PASSTHROUGH)),true)
    LOCAL_CFLAGS += -DHDMI_PASSTHROUGH_ENABLED
endif

ifeq ($(strip $(AUDIO_FEATURE_ENABLED_SOURCE_TRACKING)),true)
    LOCAL_CFLAGS += -DSOURCE_TRACKING_ENABLED
    LOCAL_SRC_FILES += audio_extn/source_track.c
endif

LOCAL_SHARED_LIBRARIES := \
	liblog \
	libcutils \
+13 −0
Original line number Diff line number Diff line
@@ -91,6 +91,17 @@ void audio_extn_hfp_set_parameters(struct audio_device *adev,
                                           struct str_parms *parms);
#endif

#ifndef SOURCE_TRACKING_ENABLED
#define audio_extn_source_track_set_parameters(adev, parms) (0)
#define audio_extn_source_track_get_parameters(adev, query, reply) (0)
#else
void audio_extn_source_track_set_parameters(struct audio_device *adev,
                                            struct str_parms *parms);
void audio_extn_source_track_get_parameters(struct audio_device *adev,
                                            struct str_parms *query,
                                            struct str_parms *reply);
#endif

#ifndef CUSTOM_STEREO_ENABLED
#define audio_extn_customstereo_set_parameters(adev, parms)         (0)
#else
@@ -535,6 +546,7 @@ void audio_extn_set_parameters(struct audio_device *adev,
   audio_extn_customstereo_set_parameters(adev, parms);
   audio_extn_hpx_set_parameters(adev, parms);
   audio_extn_pm_set_parameters(parms);
   audio_extn_source_track_set_parameters(adev, parms);
}

void audio_extn_get_parameters(const struct audio_device *adev,
@@ -547,6 +559,7 @@ void audio_extn_get_parameters(const struct audio_device *adev,
    get_active_offload_usecases(adev, query, reply);
    audio_extn_dts_eagle_get_parameters(adev, query, reply);
    audio_extn_hpx_get_parameters(query, reply);
    audio_extn_source_track_get_parameters(adev, query, reply);

    kv_pairs = str_parms_to_str(reply);
    ALOGD_IF(kv_pairs != NULL, "%s: returns %s", __func__, kv_pairs);
+640 −0

File added.

Preview size limit exceeded, changes collapsed.

+4 −3
Original line number Diff line number Diff line
@@ -731,14 +731,15 @@ static int read_hdmi_channel_masks(struct stream_out *out)
    return ret;
}

static audio_usecase_t get_voice_usecase_id_from_list(struct audio_device *adev)
audio_usecase_t get_usecase_id_from_usecase_type(struct audio_device *adev,
                                                 usecase_type_t type)
{
    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 == VOICE_CALL) {
        if (usecase->type == type) {
            ALOGV("%s: usecase id %d", __func__, usecase->id);
            return usecase->id;
        }
@@ -795,7 +796,7 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id)
         */
        if (voice_is_in_call(adev) && adev->mode == AUDIO_MODE_IN_CALL) {
            vc_usecase = get_usecase_from_list(adev,
                                               get_voice_usecase_id_from_list(adev));
                                               get_usecase_id_from_usecase_type(adev, VOICE_CALL));
            if ((vc_usecase) && ((vc_usecase->devices & AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND) ||
                (usecase->devices == AUDIO_DEVICE_IN_VOICE_CALL))) {
                in_snd_device = vc_usecase->in_snd_device;
+3 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
 * Not a contribution.
 *
 * Copyright (C) 2013 The Android Open Source Project
@@ -342,6 +342,8 @@ bool is_offload_usecase(audio_usecase_t uc_id);
int pcm_ioctl(struct pcm *pcm, int request, ...);

int get_snd_card_state(struct audio_device *adev);
audio_usecase_t get_usecase_id_from_usecase_type(struct audio_device *adev,
                                                 usecase_type_t type);

#define LITERAL_TO_STRING(x) #x
#define CHECK(condition) LOG_ALWAYS_FATAL_IF(!(condition), "%s",\
Loading