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

Commit 8c03e67b authored by David Lin's avatar David Lin
Browse files

hal: add usb audio tunnel support



This patch imports the USB audio tunnel feature from QCOM software release
AU_LINUX_ANDROID_LA.UM.5.7.R1.07.00.00.253.

Bug: 33030406
Test: playback, record and path switching

Change-Id: I2479f984c0d72b2f4e9b6a7db22eb4616855b7e7
Signed-off-by: default avatarDavid Lin <dtwlin@google.com>
parent 240fc432
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -74,6 +74,11 @@ ifdef MULTIPLE_HW_VARIANTS_ENABLED
  LOCAL_SRC_FILES +=  $(AUDIO_PLATFORM)/hw_info.c
endif

ifeq ($(strip $(AUDIO_FEATURE_ENABLED_USB_TUNNEL)),true)
    LOCAL_CFLAGS += -DUSB_TUNNEL_ENABLED
    LOCAL_SRC_FILES += audio_extn/usb.c
endif

LOCAL_SHARED_LIBRARIES := \
	liblog \
	libcutils \
+25 −0
Original line number Diff line number Diff line
@@ -70,6 +70,31 @@ int audio_extn_hfp_set_mic_mute(struct audio_device *adev, bool state);

#endif

#ifndef USB_TUNNEL_ENABLED
#define audio_extn_usb_init(adev)                                      (0)
#define audio_extn_usb_deinit()                                        (0)
#define audio_extn_usb_add_device(device, card)                        (0)
#define audio_extn_usb_remove_device(device, card)                     (0)
#define audio_extn_usb_is_config_supported(bit_width, sample_rate, ch, pb) (false)
#define audio_extn_usb_enable_sidetone(device, enable)                 (0)
#define audio_extn_usb_set_sidetone_gain(parms, value, len)            (0)
#define audio_extn_usb_is_capture_supported()                          (false)
#else
void audio_extn_usb_init(void *adev);
void audio_extn_usb_deinit();
void audio_extn_usb_add_device(audio_devices_t device, int card);
void audio_extn_usb_remove_device(audio_devices_t device, int card);
bool audio_extn_usb_is_config_supported(unsigned int *bit_width,
                                        unsigned int *sample_rate,
                                        unsigned int *ch,
                                        bool is_playback);
int audio_extn_usb_enable_sidetone(int device, bool enable);
int audio_extn_usb_set_sidetone_gain(struct str_parms *parms,
                                     char *value, int len);
bool audio_extn_usb_is_capture_supported();
#endif


#ifndef SOUND_TRIGGER_ENABLED
#define audio_extn_sound_trigger_init(adev)                            (0)
#define audio_extn_sound_trigger_deinit(adev)                          (0)
Loading