add offloaded audio visualizer

Add library for visualizer effect used when
audio decompression is offloaded to QCOM audio DSP.
The implementation reads PCM back from the proxy port
in the audio DSP.
The audio HAL dynamically loads the effect library if present
and indicates offloaded output activity.
The PCM capture is only active when an offloaded output
is active and at least one effect is enabled on this output.

Bug: 8174410.

Change-Id: Ic78de932f9116e246494f9171c1cc7c3e35a0ea1
diff --git a/hal/audio_hw.h b/hal/audio_hw.h
index 2c7fffd..717c0a6 100644
--- a/hal/audio_hw.h
+++ b/hal/audio_hw.h
@@ -25,6 +25,8 @@
 
 #include <audio_route/audio_route.h>
 
+#define VISUALIZER_LIBRARY_PATH "/system/lib/soundfx/libqcomvisualizer.so"
+
 /* Flags used to initialize acdb_settings variable that goes to ACDB library */
 #define DMIC_FLAG       0x00000002
 #define TTY_MODE_OFF    0x00000010
@@ -110,6 +112,7 @@
     audio_channel_mask_t supported_channel_masks[MAX_SUPPORTED_CHANNEL_MASKS + 1];
     bool muted;
     uint64_t written; /* total frames written, not cleared when entering standby */
+    audio_io_handle_t handle;
 
     int non_blocking;
     int playback_started;
@@ -187,6 +190,10 @@
     bool speaker_lr_swap;
 
     void *platform;
+
+    void *visualizer_lib;
+    int (*visualizer_start_output)(audio_io_handle_t);
+    int (*visualizer_stop_output)(audio_io_handle_t);
 };
 
 /*