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

Commit e2433c38 authored by Garmond Leung's avatar Garmond Leung Committed by Garmond Leung
Browse files

hal: Add support for Fluence Far Field Voice

Add support for 6mic Fluence pre-processing of
captured stream using Far Field Voice (FFV) algorithm.

Change-Id: I7a643014f3e090482db7772dce2fc812fd469b2d
parent c83207cf
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -115,6 +115,7 @@ AM_CONDITIONAL([AUDIO_HW_LOOPBACK], [test x$AUDIO_FEATURE_ENABLED_AUDIO_HW_LOOPB
AM_CONDITIONAL([AUDIO_PARSER], [test x$AUDIO_FEATURE_ENABLED_PARSER = xtrue])
AM_CONDITIONAL([DTSHD_PARSER], [test x$AUDIO_FEATURE_ENABLED_DTSHD_PARSER = xtrue])
AM_CONDITIONAL([QAP], [test x$AUDIO_FEATURE_ENABLED_QAP = xtrue])
AM_CONDITIONAL([AUDIO_HW_FFV], [test x$AUDIO_FEATURE_ENABLED_FFV = xtrue])

AC_CONFIG_FILES([ \
        Makefile \
+6 −0
Original line number Diff line number Diff line
@@ -189,6 +189,12 @@ AM_CFLAGS += -DAUDIO_HW_LOOPBACK_ENABLED
c_sources += audio_extn/hw_loopback.c
endif

if AUDIO_HW_FFV
AM_CFLAGS += -DFFV_ENABLED \
             -I $(PKG_CONFIG_SYSROOT_DIR)/usr/include/ffv/
c_sources += audio_extn/ffv.c
endif

h_sources = audio_extn/audio_defs.h \
            audio_extn/audio_extn.h \
            audio_hw.h \
+3 −0
Original line number Diff line number Diff line
@@ -838,6 +838,7 @@ void audio_extn_set_parameters(struct audio_device *adev,
   if (adev->offload_effects_set_parameters != NULL)
       adev->offload_effects_set_parameters(parms);
   audio_extn_set_aptx_dec_bt_addr(adev, parms);
   audio_extn_ffv_set_parameters(adev, parms);
}

void audio_extn_get_parameters(const struct audio_device *adev,
@@ -1254,6 +1255,8 @@ int audio_extn_check_and_set_multichannel_usecase(struct audio_device *adev,
    ssr_supported = audio_extn_ssr_check_usecase(in);
    if (ssr_supported) {
        return audio_extn_ssr_set_usecase(in, config, update_params);
    } else if (audio_extn_ffv_check_usecase(in)) {
        return audio_extn_ffv_set_usecase(in);
    } else {
        return audio_extn_set_multichannel_mask(adev, in, config,
                                                update_params);
+40 −0
Original line number Diff line number Diff line
@@ -973,4 +973,44 @@ static void __unused audio_extn_hw_loopback_deinit(struct audio_device *adev __u
{
}
#endif

#ifndef FFV_ENABLED
#define audio_extn_ffv_init(adev) (0)
#define audio_extn_ffv_deinit() (0)
#define audio_extn_ffv_check_usecase(in) (0)
#define audio_extn_ffv_set_usecase(in) (0)
#define audio_extn_ffv_stream_init(in) (0)
#define audio_extn_ffv_stream_deinit() (0)
#define audio_extn_ffv_update_enabled() (0)
#define audio_extn_ffv_get_enabled() (0)
#define audio_extn_ffv_read(stream, buffer, bytes) (0)
#define audio_extn_ffv_set_parameters(adev, parms) (0)
#define audio_extn_ffv_get_stream() (0)
#define audio_extn_ffv_update_pcm_config(config) (0)
#define audio_extn_ffv_init_ec_ref_loopback(adev, snd_device) (0)
#define audio_extn_ffv_deinit_ec_ref_loopback(adev, snd_device) (0)
#define audio_extn_ffv_check_and_append_ec_ref_dev(device_name) (0)
#define audio_extn_ffv_get_capture_snd_device() (0)
#else
int32_t audio_extn_ffv_init(struct audio_device *adev);
int32_t audio_extn_ffv_deinit();
bool audio_extn_ffv_check_usecase(struct stream_in *in);
int audio_extn_ffv_set_usecase(struct stream_in *in);
int32_t audio_extn_ffv_stream_init(struct stream_in *in);
int32_t audio_extn_ffv_stream_deinit();
void audio_extn_ffv_update_enabled();
bool audio_extn_ffv_get_enabled();
int32_t audio_extn_ffv_read(struct audio_stream_in *stream,
                       void *buffer, size_t bytes);
void audio_extn_ffv_set_parameters(struct audio_device *adev,
                                   struct str_parms *parms);
struct stream_in *audio_extn_ffv_get_stream();
void audio_extn_ffv_update_pcm_config(struct pcm_config *config);
int audio_extn_ffv_init_ec_ref_loopback(struct audio_device *adev,
                                        snd_device_t snd_device);
int audio_extn_ffv_deinit_ec_ref_loopback(struct audio_device *adev,
                                          snd_device_t snd_device);
void audio_extn_ffv_check_and_append_ec_ref_dev(char *device_name);
snd_device_t audio_extn_ffv_get_capture_snd_device();
#endif
#endif /* AUDIO_EXTN_H */

hal/audio_extn/ffv.c

0 → 100644
+891 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading