summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com>2023-12-21 20:12:44 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-12-21 20:12:44 +0000
commitd2b8c9316c989509b56a7589f287a4cbcb6d43f7 (patch)
treed31fbbbae560ccc864436b3ee5e90563ca376778
parentf2bab1565548f44764e101cbd72f701fb7d897e1 (diff)
parent16e1d034000cba2d993de762ff9fb0c00fcab375 (diff)
downloadlibhardware-d2b8c9316c989509b56a7589f287a4cbcb6d43f7.tar.gz
Merge "Support 192kHz remote submix paths for E-AC-3(-JOC) IEC 61937" into main am: 16e1d03400
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/2879346 Change-Id: I254dd1013dde7441bfaac9582659e9719e903659 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--modules/audio_remote_submix/audio_hw.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/audio_remote_submix/audio_hw.cpp b/modules/audio_remote_submix/audio_hw.cpp
index 5019ae5b..d6c8c7b6 100644
--- a/modules/audio_remote_submix/audio_hw.cpp
+++ b/modules/audio_remote_submix/audio_hw.cpp
@@ -199,9 +199,9 @@ struct submix_stream_in {
// Determine whether the specified sample rate is supported by the submix module.
static bool sample_rate_supported(const uint32_t sample_rate)
{
- // Set of sample rates supported by Format_from_SR_C() frameworks/av/media/libnbaio/NAIO.cpp.
static const unsigned int supported_sample_rates[] = {
8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000,
+ 192000 /* for IEC 61937 encapsulated E-AC-3(-JOC) */
};
bool return_value;
SUBMIX_VALUE_IN_SET(sample_rate, supported_sample_rates, &return_value);
@@ -1240,6 +1240,10 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
*stream_out = NULL;
// Make sure it's possible to open the device given the current audio config.
+ if (!audio_is_linear_pcm(config->format)) {
+ ALOGD("adev_open_output_stream(): not supported for audio format %#x", config->format);
+ return -EINVAL;
+ }
submix_sanitize_config(config, false);
int route_idx = -1;
@@ -1455,6 +1459,11 @@ static int adev_open_input_stream(struct audio_hw_device *dev,
*stream_in = NULL;
+ if (!audio_is_linear_pcm(config->format)) {
+ ALOGD("adev_open_input_stream(): not supported for audio format %#x", config->format);
+ return -EINVAL;
+ }
+
// Do we already have a route for this address
int route_idx = -1;