diff options
author | Amit Pundir <amit.pundir@linaro.org> | 2021-12-14 19:45:56 +0530 |
---|---|---|
committer | Amit Pundir <amit.pundir@linaro.org> | 2022-02-10 20:57:46 +0530 |
commit | c0ad894bfadcce4be4778e1773aeb09f8f19ef47 (patch) | |
tree | 0b37cba5912518ae69736e8b7aabe6183990a37d /audio | |
parent | bf57637c5bf8889e2ff03792f82b5dbc120ec9d7 (diff) |
db845c: Add rb5 support in db845c-userdebug build target
* Enabled multiple appended DTBs support to allow db845c
boot.img/vendor_boot.img to boot on rb5 as well.
* Introduced a vendor.hw property which will be used to run
device specific services.
* Folded Caleb's HDMI audio routing fix.
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Change-Id: I779d01946ae359d5c405d959419e29460083e5df
Diffstat (limited to 'audio')
-rw-r--r-- | audio/audio_hw.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c index c0cd55d..75d3ff0 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -27,6 +27,7 @@ #include <stdlib.h> #include <sys/time.h> #include <unistd.h> +#include <string.h> #include <log/log.h> #include <cutils/str_parms.h> @@ -41,6 +42,7 @@ #include <audio_utils/clock.h> #include <audio_utils/echo_reference.h> #include <audio_utils/resampler.h> +#include <cutils/properties.h> #include <hardware/audio_alsaops.h> #include <hardware/audio_effect.h> #include <sound/asound.h> @@ -1121,6 +1123,9 @@ static int adev_close(hw_device_t *device) static int adev_open(const hw_module_t* module, const char* name, hw_device_t** device) { + char vendor_hw[PROPERTY_VALUE_MAX] = {0}; + // Prefix for the hdmi path, the board name is the suffix + char path_name[256] = "hdmi_"; ALOGV("adev_open: %s", name); if (strcmp(name, AUDIO_HARDWARE_INTERFACE) != 0) { @@ -1170,6 +1175,15 @@ static int adev_open(const hw_module_t* module, const char* name, goto error_2; } + /* + * To support both the db845c and rb5 we need to used the right mixer path + * we do this by checking the hardware name. Which is set at boot time. + */ + property_get("vendor.hw", vendor_hw, "db845c"); + strlcat(path_name, vendor_hw, 256); + ALOGV("%s: Using mixer path: %s", __func__, path_name); + audio_route_apply_and_update_path(adev->audio_route, path_name); + pthread_mutex_lock(&adev->lock); if (init_aec(CAPTURE_CODEC_SAMPLING_RATE, NUM_AEC_REFERENCE_CHANNELS, CHANNEL_STEREO, &adev->aec)) { |