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

Commit a5f61b11 authored by Michael Sky's avatar Michael Sky Committed by Bruno Martins
Browse files

Revert "visualizer: do not apply calibration on audio routed to afe proxy"

* Calibration with hardcoded AFE Proxy acdb_id (45), which is supposed
   to get rid of post-processing, is unnecessary and can cause sudden
   (and unpleasant) volume level change when HW visualizer is shown.
   (e.g. on lockscreen)

* The acdb_id doesn't change, and forces use of the same audio
   calibration for all devices (headphones/speaker/etc...).

This reverts commit 09990978.

Change-Id: I65e2ee82633b478ecfbe9282f849e49147a2e18c
parent 63ac6c78
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ LOCAL_CFLAGS+= -O2 -fvisibility=hidden
LOCAL_SHARED_LIBRARIES := \
	libcutils \
	liblog \
	libdl \
	libtinyalsa

LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/soundfx
+0 −26
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@
#include <string.h>
#include <time.h>
#include <sys/prctl.h>
#include <dlfcn.h>

#include <cutils/list.h>
#include <cutils/log.h>
@@ -30,15 +29,6 @@
#include <tinyalsa/asoundlib.h>
#include <audio_effects/effect_visualizer.h>

#define LIB_ACDB_LOADER "libacdbloader.so"
#define ACDB_DEV_TYPE_OUT 1
#define AFE_PROXY_ACDB_ID 45

static void* acdb_handle;

typedef void (*acdb_send_audio_cal_t)(int, int);

acdb_send_audio_cal_t acdb_send_audio_cal;

enum {
    EFFECT_STATE_UNINITIALIZED,
@@ -304,9 +294,6 @@ int configure_proxy_capture(struct mixer *mixer, int value) {
    const char *proxy_ctl_name = "AFE_PCM_RX Audio Mixer MultiMedia4";
    struct mixer_ctl *ctl;

    if (value && acdb_send_audio_cal)
        acdb_send_audio_cal(AFE_PROXY_ACDB_ID, ACDB_DEV_TYPE_OUT);

    ctl = mixer_get_ctl_by_name(mixer, proxy_ctl_name);
    if (ctl == NULL) {
        ALOGW("%s: could not get %s ctl", __func__, proxy_ctl_name);
@@ -627,19 +614,6 @@ int visualizer_init(effect_context_t *context)

    set_config(context, &context->config);

    if (acdb_handle == NULL) {
        acdb_handle = dlopen(LIB_ACDB_LOADER, RTLD_NOW);
        if (acdb_handle == NULL) {
            ALOGE("%s: DLOPEN failed for %s", __func__, LIB_ACDB_LOADER);
        } else {
            acdb_send_audio_cal = (acdb_send_audio_cal_t)dlsym(acdb_handle,
                                                    "acdb_loader_send_audio_cal");
            if (!acdb_send_audio_cal)
                ALOGE("%s: Could not find the symbol acdb_send_audio_cal from %s",
                      __func__, LIB_ACDB_LOADER);
            }
    }

    return 0;
}