diff --git a/alsa_sound/AudioHardwareALSA.cpp b/alsa_sound/AudioHardwareALSA.cpp index a53f1619..40507778 100644 --- a/alsa_sound/AudioHardwareALSA.cpp +++ b/alsa_sound/AudioHardwareALSA.cpp @@ -57,6 +57,8 @@ extern "C" static void (*acdb_deallocate)(); #endif #ifdef QCOM_CSDCLIENT_ENABLED + static int (*csd_client_init)(); + static int (*csd_client_deinit)(); static int (*csd_start_playback)(); static int (*csd_stop_playback)(); #endif @@ -128,8 +130,16 @@ AudioHardwareALSA::AudioHardwareALSA() : ALOGE("AudioHardware: DLOPEN not successful for CSD CLIENT"); } else { ALOGD("AudioHardware: DLOPEN successful for CSD CLIENT"); + csd_client_init = (int (*)())::dlsym(mCsdHandle,"csd_client_init"); + csd_client_deinit = (int (*)())::dlsym(mCsdHandle,"csd_client_deinit"); csd_start_playback = (int (*)())::dlsym(mCsdHandle,"csd_client_start_playback"); csd_stop_playback = (int (*)())::dlsym(mCsdHandle,"csd_client_stop_playback"); + + if (csd_client_init == NULL) { + ALOGE("dlsym: Error:%s Loading csd_client_init", dlerror()); + } else { + csd_client_init(); + } } mALSADevice->setCsdHandle(mCsdHandle); #endif @@ -179,6 +189,10 @@ AudioHardwareALSA::AudioHardwareALSA() : #ifdef QCOM_ACDB_ENABLED if (mAcdbHandle) { mUcMgr->acdb_handle = static_cast (mAcdbHandle); + if (mFusion3Platform) + mUcMgr->isFusion3Platform = true; + else + mUcMgr->isFusion3Platform = false; } #endif } @@ -221,8 +235,13 @@ AudioHardwareALSA::~AudioHardwareALSA() #ifdef QCOM_CSDCLEINT_ENABLED if (mCsdHandle) { - ::dlclose(mCsdHandle); - mCsdHandle = NULL; + if (csd_client_deinit == NULL) { + ALOGE("dlsym: Error:%s Loading csd_client_deinit", dlerror()); + } else { + csd_client_deinit(); + } + ::dlclose(mCsdHandle); + mCsdHandle = NULL; } #endif } diff --git a/libalsa-intf/alsa_ucm.c b/libalsa-intf/alsa_ucm.c index 3548f67a..e53211f9 100644 --- a/libalsa-intf/alsa_ucm.c +++ b/libalsa-intf/alsa_ucm.c @@ -27,7 +27,7 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define LOG_TAG "alsa_ucm" -#define LOG_NDDEBUG 0 +//#define LOG_NDDEBUG 0 #ifdef ANDROID /* definitions for Android logging */ @@ -673,7 +673,7 @@ int use_case_index) ALOGD("Voice acdb: rx id %d tx id %d", uc_mgr->current_rx_device, uc_mgr->current_tx_device); - if (uc_mgr->acdb_handle) { + if (uc_mgr->acdb_handle && !uc_mgr->isFusion3Platform) { acdb_send_voice_cal = dlsym(uc_mgr->acdb_handle,"acdb_loader_send_voice_cal"); if (acdb_send_voice_cal == NULL) { ALOGE("ucm: dlsym: Error:%s Loading acdb_loader_send_voice_cal", dlerror()); diff --git a/libalsa-intf/msm8960_use_cases.h b/libalsa-intf/msm8960_use_cases.h index ed58d8ab..ba8b6dee 100644 --- a/libalsa-intf/msm8960_use_cases.h +++ b/libalsa-intf/msm8960_use_cases.h @@ -35,6 +35,7 @@ extern "C" { #include "alsa_ucm.h" #include "alsa_audio.h" +#include #include #define SND_UCM_END_OF_LIST "end" @@ -169,6 +170,7 @@ struct snd_use_case_mgr { card_ctxt_t *card_ctxt_ptr; pthread_t thr; void *acdb_handle; + bool isFusion3Platform; }; #define MAX_NUM_CARDS (sizeof(card_list)/sizeof(char *))