Verified Commit 620a61d4 authored by steadfasterX's avatar steadfasterX 😁
Browse files

universal7870: audio: fix audioserver crash



The following happens as we had 2 libaudioroute.so:

- one in /system (build by system/media/audio_route)
- and the other in /vendor (copied as blob)

> E vndksupport: Could not load /vendor/lib/hw/audio.primary.universal7870.so from default namespace: dlopen failed: cannot locate symbol "audio_route_get_mixer_ctl" referenced by "/system/vendor/lib/hw/audio.primary.universal7870.so"....

Removing one of the both causes this error:

> E vndksupport: Could not load /vendor/lib/hw/audio.primary.universal7870.so from default namespace: dlopen failed: cannot locate symbol "mixer_update" referenced by "/system/lib/libaudioroute.so"....

I was not able to find a blob or ref to this symbol
(likely I'm just blind) so I decided to shim this.

Shimming seems to work fine while not very intensively
tested - but at least audio is back.
Signed-off-by: steadfasterX's avatarsteadfasterX <steadfasterX@gmail.com>
parent f4deabb3
......@@ -173,7 +173,8 @@ BOARD_SEPOLICY_VERS := $(PLATFORM_SDK_VERSION).0
# Shim
TARGET_LD_SHIM_LIBS += \
/system/bin/mediaserver|/system/lib/libstagefright_shim.so
/system/bin/mediaserver|/system/lib/libstagefright_shim.so \
/system/lib/libaudioroute.so|/vendor/lib/mixer_update_shim.so
# Wifi
BOARD_HAVE_SAMSUNG_WIFI := true
......@@ -257,7 +257,8 @@ PRODUCT_PACKAGES += \
# Shims
PRODUCT_PACKAGES += \
libexynoscamera_shim \
libstagefright_shim
libstagefright_shim \
mixer_update_shim
# USB
PRODUCT_PACKAGES += \
......
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := mixer_update.c
LOCAL_MODULE := mixer_update_shim
LOCAL_SHARED_LIBRARIES := liblog
LOCAL_MODULE_TAGS := optional
LOCAL_VENDOR_MODULE := true
include $(BUILD_SHARED_LIBRARY)
#define LOG_TAG "mixer_update_shim"
#define LOG_NDEBUG 0
#include <cutils/log.h>
void mixer_update() {
ALOGW("SHIM: hijacking %s!", __func__);
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment