diff options
author | Jiyong Park <jiyong@google.com> | 2019-07-29 11:08:22 +0900 |
---|---|---|
committer | Jiyong Park <jiyong@google.com> | 2019-07-29 21:03:51 +0900 |
commit | 83fde0ec25e15f4aa94deae1e53738c2fe039775 (patch) | |
tree | 2f4397f349ae0ab4463fc3213b0ae5dc96ccea66 /hal | |
parent | aabff62fcb2f9d4f85f0353588b3632cd412615b (diff) | |
download | audio-83fde0ec25e15f4aa94deae1e53738c2fe039775.tar.gz |
Read both vendor.audio_hal.* and audio_hal.* sysprops
Starting from Q-launching devices, all vendor-defined sysprops should be
prefixed with "vendor.". To support such new devices as well as old
devices where the renamining isn't required, audio HAL is using both
properties: vendor.audio_hal.* is read first and then fall backs to
audio_hal.*.
Bug: b/138278883
Test: play some audio
Test: run VtsTrebleSysProp
Change-Id: I15158467f81ac99c36c40f6ca0a6c00cbca7fb24
Diffstat (limited to 'hal')
-rw-r--r-- | hal/audio_extn/utils.c | 4 | ||||
-rw-r--r-- | hal/audio_hw.c | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/hal/audio_extn/utils.c b/hal/audio_extn/utils.c index 3a1877b..0a8e18f 100644 --- a/hal/audio_extn/utils.c +++ b/hal/audio_extn/utils.c @@ -541,7 +541,9 @@ int audio_extn_utils_get_snd_card_num() struct acdb_platform_data *my_data = calloc(1, sizeof(struct acdb_platform_data)); bool card_verifed[MAX_SND_CARD] = {0}; - const int retry_limit = property_get_int32("audio.snd_card.open.retries", RETRY_NUMBER); + const int retry_limit = property_get_int32( + "vendor.audio.snd_card.open.retries", + property_get_int32("audio.snd_card.open.retries", RETRY_NUMBER)); for (;;) { if (snd_card_num >= MAX_SND_CARD) { diff --git a/hal/audio_hw.c b/hal/audio_hw.c index 1fd913a..58d8f85 100644 --- a/hal/audio_hw.c +++ b/hal/audio_hw.c @@ -6568,7 +6568,8 @@ static int adev_open(const hw_module_t *module, const char *name, char value[PROPERTY_VALUE_MAX]; int trial; - if (property_get("audio_hal.period_size", value, NULL) > 0) { + if ((property_get("vendor.audio_hal.period_size", value, NULL) > 0) || + (property_get("audio_hal.period_size", value, NULL) > 0)) { trial = atoi(value); if (period_size_is_plausible_for_low_latency(trial)) { pcm_config_low_latency.period_size = trial; @@ -6577,7 +6578,8 @@ static int adev_open(const hw_module_t *module, const char *name, configured_low_latency_capture_period_size = trial; } } - if (property_get("audio_hal.in_period_size", value, NULL) > 0) { + if ((property_get("vendor.audio_hal.in_period_size", value, NULL) > 0) || + (property_get("audio_hal.in_period_size", value, NULL) > 0)) { trial = atoi(value); if (period_size_is_plausible_for_low_latency(trial)) { configured_low_latency_capture_period_size = trial; @@ -6592,7 +6594,8 @@ static int adev_open(const hw_module_t *module, const char *name, // audio_extn_utils_send_default_app_type_cfg(adev->platform, adev->mixer); audio_device_ref_count++; - if (property_get("audio_hal.period_multiplier", value, NULL) > 0) { + if ((property_get("vendor.audio_hal.period_multiplier", value, NULL) > 0) || + (property_get("audio_hal.period_multiplier", value, NULL) > 0)) { af_period_multiplier = atoi(value); if (af_period_multiplier < 0) { af_period_multiplier = 2; |