post_proc: Add support for non-tunnel DSP audio effects
Add hw accelerator module to send PCM data to DSP and get
back the effects processed data.
Expose a wrapper library for AudioFlinger to be able use the new
module to apply the DSP audio effects.
Change-Id: I6ee30c11f04a97b35f12201fb61b8cd901921e68
Signed-off-by: Alexy Joseph <alexyj@codeaurora.org>
diff --git a/post_proc/effect_api.h b/post_proc/effect_api.h
index 342c606..d3b1d81 100644
--- a/post_proc/effect_api.h
+++ b/post_proc/effect_api.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -30,10 +30,14 @@
#ifndef OFFLOAD_EFFECT_API_H_
#define OFFLOAD_EFFECT_API_H_
+#if __cplusplus
+extern "C" {
+#endif
+
int offload_update_mixer_and_effects_ctl(int card, int device_id,
- struct mixer *mixer,
- struct mixer_ctl *ctl);
-void offload_close_mixer(struct mixer *mixer);
+ struct mixer **mixer,
+ struct mixer_ctl **ctl);
+void offload_close_mixer(struct mixer **mixer);
#define OFFLOAD_SEND_BASSBOOST_ENABLE_FLAG (1 << 0)
#define OFFLOAD_SEND_BASSBOOST_STRENGTH \
@@ -50,8 +54,11 @@
void offload_bassboost_set_mode(struct bass_boost_params *bassboost,
int mode);
int offload_bassboost_send_params(struct mixer_ctl *ctl,
- struct bass_boost_params bassboost,
+ struct bass_boost_params *bassboost,
unsigned param_send_flags);
+int hw_acc_bassboost_send_params(int fd,
+ struct bass_boost_params *bassboost,
+ unsigned param_send_flags);
#define OFFLOAD_SEND_VIRTUALIZER_ENABLE_FLAG (1 << 0)
#define OFFLOAD_SEND_VIRTUALIZER_STRENGTH \
@@ -72,8 +79,11 @@
void offload_virtualizer_set_gain_adjust(struct virtualizer_params *virtualizer,
int gain_adjust);
int offload_virtualizer_send_params(struct mixer_ctl *ctl,
- struct virtualizer_params virtualizer,
+ struct virtualizer_params *virtualizer,
unsigned param_send_flags);
+int hw_acc_virtualizer_send_params(int fd,
+ struct virtualizer_params *virtualizer,
+ unsigned param_send_flags);
#define OFFLOAD_SEND_EQ_ENABLE_FLAG (1 << 0)
#define OFFLOAD_SEND_EQ_PRESET \
@@ -87,8 +97,10 @@
void offload_eq_set_bands_level(struct eq_params *eq, int num_bands,
const uint16_t *band_freq_list,
int *band_gain_list);
-int offload_eq_send_params(struct mixer_ctl *ctl, struct eq_params eq,
+int offload_eq_send_params(struct mixer_ctl *ctl, struct eq_params *eq,
unsigned param_send_flags);
+int hw_acc_eq_send_params(int fd, struct eq_params *eq,
+ unsigned param_send_flags);
#define OFFLOAD_SEND_REVERB_ENABLE_FLAG (1 << 0)
#define OFFLOAD_SEND_REVERB_MODE \
@@ -145,7 +157,43 @@
void offload_reverb_set_diffusion(struct reverb_params *reverb, int diffusion);
void offload_reverb_set_density(struct reverb_params *reverb, int density);
int offload_reverb_send_params(struct mixer_ctl *ctl,
- struct reverb_params reverb,
+ struct reverb_params *reverb,
unsigned param_send_flags);
+int hw_acc_reverb_send_params(int fd,
+ struct reverb_params *reverb,
+ unsigned param_send_flags);
+
+#define OFFLOAD_SEND_SOFT_VOLUME_ENABLE_FLAG (1 << 0)
+#define OFFLOAD_SEND_SOFT_VOLUME_GAIN_2CH \
+ (OFFLOAD_SEND_SOFT_VOLUME_ENABLE_FLAG << 1)
+#define OFFLOAD_SEND_SOFT_VOLUME_GAIN_MASTER \
+ (OFFLOAD_SEND_SOFT_VOLUME_GAIN_2CH << 1)
+void offload_soft_volume_set_enable(struct soft_volume_params *vol,
+ bool enable);
+void offload_soft_volume_set_gain_master(struct soft_volume_params *vol,
+ int gain);
+void offload_soft_volume_set_gain_2ch(struct soft_volume_params *vol,
+ int l_gain, int r_gain);
+int offload_soft_volume_send_params(struct mixer_ctl *ctl,
+ struct soft_volume_params vol,
+ unsigned param_send_flags);
+
+#define OFFLOAD_SEND_TRANSITION_SOFT_VOLUME_ENABLE_FLAG (1 << 0)
+#define OFFLOAD_SEND_TRANSITION_SOFT_VOLUME_GAIN_2CH \
+ (OFFLOAD_SEND_TRANSITION_SOFT_VOLUME_ENABLE_FLAG << 1)
+#define OFFLOAD_SEND_TRANSITION_SOFT_VOLUME_GAIN_MASTER \
+ (OFFLOAD_SEND_TRANSITION_SOFT_VOLUME_GAIN_2CH << 1)
+void offload_transition_soft_volume_set_enable(struct soft_volume_params *vol,
+ bool enable);
+void offload_transition_soft_volume_set_gain_master(struct soft_volume_params *vol,
+ int gain);
+void offload_transition_soft_volume_set_gain_2ch(struct soft_volume_params *vol,
+ int l_gain, int r_gain);
+int offload_transition_soft_volume_send_params(struct mixer_ctl *ctl,
+ struct soft_volume_params vol,
+ unsigned param_send_flags);
+#if __cplusplus
+} //extern "C"
+#endif
#endif /*OFFLOAD_EFFECT_API_H_*/