From 8dbc51158feef7788d368bab8456a53b3a27e2fa Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Mon, 2 Oct 2023 14:51:50 -0700 Subject: [PATCH] audio: Set 'maxOpenStreamCount' to unlimited for input ports Since libaudiohal@aidl reports that the most current legacy C API version is supported by the HAL, the audio server uses a different logic for telephony scenarios than for the HIDL HAL. This involves opening more streams on the same mix port. Allow opening an unlimited number of streams. However, keep the number of active streams to be `1`. Bug: 302132812 Test: atest CtsMediaAudioTestCases --test-filter=".*AudioNativeTest.*" Test: atest CtsMediaAudioTestCases --test-filter=".*CallAudioInterceptionTest.*" Change-Id: I896398fca73f28d28d9397d00751394c969531b4 --- audio/aidl/default/Configuration.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/audio/aidl/default/Configuration.cpp b/audio/aidl/default/Configuration.cpp index 85e4e245dc..635a25b2c6 100644 --- a/audio/aidl/default/Configuration.cpp +++ b/audio/aidl/default/Configuration.cpp @@ -237,7 +237,7 @@ std::unique_ptr getPrimaryConfiguration() { c.ports.push_back(primaryOutMix); AudioPort primaryInMix = - createPort(c.nextPortId++, "primary input", 0, true, createPortMixExt(0, 0)); + createPort(c.nextPortId++, "primary input", 0, true, createPortMixExt(0, 1)); primaryInMix.profiles.push_back( createProfile(PcmType::INT_16_BIT, {AudioChannelLayout::LAYOUT_MONO, AudioChannelLayout::LAYOUT_STEREO}, @@ -252,14 +252,14 @@ std::unique_ptr getPrimaryConfiguration() { c.ports.push_back(telephonyTxOutMix); AudioPort telephonyRxInMix = - createPort(c.nextPortId++, "telephony_rx", 0, true, createPortMixExt(1, 1)); + createPort(c.nextPortId++, "telephony_rx", 0, true, createPortMixExt(0, 1)); telephonyRxInMix.profiles.insert(telephonyRxInMix.profiles.begin(), standardPcmAudioProfiles.begin(), standardPcmAudioProfiles.end()); c.ports.push_back(telephonyRxInMix); AudioPort fmTunerInMix = - createPort(c.nextPortId++, "fm_tuner", 0, true, createPortMixExt(1, 1)); + createPort(c.nextPortId++, "fm_tuner", 0, true, createPortMixExt(0, 1)); fmTunerInMix.profiles.insert(fmTunerInMix.profiles.begin(), standardPcmAudioProfiles.begin(), standardPcmAudioProfiles.end()); @@ -441,7 +441,7 @@ std::unique_ptr getUsbConfiguration() { c.ports.push_back(usbDeviceOutMix); AudioPort usbDeviceInMix = - createPort(c.nextPortId++, "usb_device input", 0, true, createPortMixExt(1, 1)); + createPort(c.nextPortId++, "usb_device input", 0, true, createPortMixExt(0, 1)); c.ports.push_back(usbDeviceInMix); c.routes.push_back(createRoute({usbDeviceOutMix}, usbOutDevice));