summaryrefslogtreecommitdiff
path: root/audio_proxy
diff options
context:
space:
mode:
Diffstat (limited to 'audio_proxy')
-rw-r--r--audio_proxy/Android.bp2
-rw-r--r--audio_proxy/AudioProxyDevice.cpp36
-rw-r--r--audio_proxy/AudioProxyStreamOut.cpp49
-rw-r--r--audio_proxy/AudioProxyStreamOut.h12
-rw-r--r--audio_proxy/OutputStreamImpl.cpp34
-rw-r--r--audio_proxy/OutputStreamImpl.h11
-rw-r--r--audio_proxy/interfaces/aidl/Android.bp25
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/.hash1
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/AudioChannelMask.aidl24
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/AudioConfig.aidl27
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/AudioDrain.aidl24
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/AudioFormat.aidl25
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/AudioOutputFlag.aidl25
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/IAudioProxy.aidl23
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/IOutputStream.aidl32
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/IStreamProvider.aidl23
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/MessageQueueFlag.aidl24
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/PresentationPosition.aidl24
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/TimeSpec.aidl24
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/WriteStatus.aidl24
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/.hash1
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/AudioChannelMask.aidl24
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/AudioConfig.aidl27
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/AudioDrain.aidl24
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/AudioFormat.aidl25
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/AudioOutputFlag.aidl25
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/IAudioProxy.aidl23
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/IOutputStream.aidl36
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/IStreamProvider.aidl23
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/MessageQueueFlag.aidl24
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/MmapBufferInfo.aidl26
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/PresentationPosition.aidl24
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/TimeSpec.aidl24
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/WriteStatus.aidl24
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/current/device/google/atv/audio_proxy/AudioConfig.aidl2
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/current/device/google/atv/audio_proxy/IOutputStream.aidl6
-rw-r--r--audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/current/device/google/atv/audio_proxy/MmapBufferInfo.aidl26
-rw-r--r--audio_proxy/interfaces/aidl/device/google/atv/audio_proxy/AudioConfig.aidl8
-rw-r--r--audio_proxy/interfaces/aidl/device/google/atv/audio_proxy/IOutputStream.aidl24
-rw-r--r--audio_proxy/interfaces/aidl/device/google/atv/audio_proxy/MmapBufferInfo.aidl15
-rw-r--r--audio_proxy/public/audio_proxy.h74
-rw-r--r--audio_proxy/sepolicy/OWNERS2
-rw-r--r--audio_proxy/sepolicy/public/hal_audio_proxy.te1
-rw-r--r--audio_proxy/sepolicy/vendor/dumpstate.te1
-rw-r--r--audio_proxy/sepolicy/vendor/hal_audio_proxy_default.te11
-rw-r--r--audio_proxy/sepolicy/vendor/service.te2
-rw-r--r--audio_proxy/service/AidlTypes.h6
-rw-r--r--audio_proxy/service/Android.bp3
-rw-r--r--audio_proxy/service/AudioUtil.cpp38
-rw-r--r--audio_proxy/service/AudioUtil.h25
-rw-r--r--audio_proxy/service/BusOutputStream.cpp16
-rw-r--r--audio_proxy/service/BusOutputStream.h5
-rw-r--r--audio_proxy/service/BusStreamProvider.cpp38
-rw-r--r--audio_proxy/service/BusStreamProvider.h7
-rw-r--r--audio_proxy/service/DeviceImpl.cpp32
-rw-r--r--audio_proxy/service/DummyBusOutputStream.cpp13
-rw-r--r--audio_proxy/service/DummyBusOutputStream.h5
-rw-r--r--audio_proxy/service/RemoteBusOutputStream.cpp17
-rw-r--r--audio_proxy/service/RemoteBusOutputStream.h5
-rw-r--r--audio_proxy/service/StreamOutImpl.cpp59
-rw-r--r--audio_proxy/service/StreamOutImpl.h5
-rw-r--r--audio_proxy/service/audio_proxy_policy_configuration.xml12
-rw-r--r--audio_proxy/service/audio_proxy_policy_configuration_hw_av_sync.xml57
-rw-r--r--audio_proxy/service/device.google.atv.audio_proxy@5.1-service.rc2
-rw-r--r--audio_proxy/service/device.google.atv.audio_proxy@6.0-service.rc2
-rw-r--r--audio_proxy/service/device.google.atv.audio_proxy@7.0-service.rc2
-rw-r--r--audio_proxy/service/device.google.atv.audio_proxy@7.1-service.rc2
-rw-r--r--audio_proxy/service/manifest_audio_proxy_5_0.xml2
-rw-r--r--audio_proxy/service/manifest_audio_proxy_6_0.xml2
-rw-r--r--audio_proxy/service/manifest_audio_proxy_7_0.xml2
-rw-r--r--audio_proxy/service/manifest_audio_proxy_7_1.xml2
71 files changed, 1204 insertions, 126 deletions
diff --git a/audio_proxy/Android.bp b/audio_proxy/Android.bp
index 2c33cf2..eca5f07 100644
--- a/audio_proxy/Android.bp
+++ b/audio_proxy/Android.bp
@@ -22,7 +22,7 @@ cc_library {
],
shared_libs: [
- "device.google.atv.audio_proxy-aidl-V1-ndk",
+ "device.google.atv.audio_proxy-aidl-V3-ndk",
"libbase",
"libbinder_ndk",
"libcutils",
diff --git a/audio_proxy/AudioProxyDevice.cpp b/audio_proxy/AudioProxyDevice.cpp
index 4c409a1..1721cdd 100644
--- a/audio_proxy/AudioProxyDevice.cpp
+++ b/audio_proxy/AudioProxyDevice.cpp
@@ -20,9 +20,9 @@
using aidl::device::google::atv::audio_proxy::AudioConfig;
-#define CHECK_API(func) \
+#define CHECK_API(st, func) \
do { \
- if (!stream->func) { \
+ if (!st->func) { \
LOG(ERROR) << "Undefined API " << #func; \
return false; \
} \
@@ -31,14 +31,23 @@ using aidl::device::google::atv::audio_proxy::AudioConfig;
namespace audio_proxy {
namespace {
bool isValidStreamOut(const audio_proxy_stream_out_t* stream) {
- CHECK_API(standby);
- CHECK_API(pause);
- CHECK_API(resume);
- CHECK_API(flush);
- CHECK_API(drain);
- CHECK_API(write);
- CHECK_API(get_presentation_position);
- CHECK_API(set_volume);
+ CHECK_API(stream, standby);
+ CHECK_API(stream, pause);
+ CHECK_API(stream, resume);
+ CHECK_API(stream, flush);
+ CHECK_API(stream, drain);
+ CHECK_API(stream, write);
+ CHECK_API(stream, get_presentation_position);
+ CHECK_API(stream, set_volume);
+ CHECK_API(stream, get_buffer_size);
+ CHECK_API(stream, get_latency);
+
+ if (stream->v2) {
+ CHECK_API(stream->v2, start);
+ CHECK_API(stream->v2, stop);
+ CHECK_API(stream->v2, create_mmap_buffer);
+ CHECK_API(stream->v2, get_mmap_position);
+ }
return true;
}
@@ -55,13 +64,18 @@ const char* AudioProxyDevice::getServiceName() {
std::unique_ptr<AudioProxyStreamOut> AudioProxyDevice::openOutputStream(
const std::string& address, const AudioConfig& aidlConfig, int32_t flags) {
+ audio_proxy_config_v2_t config_v2 = {
+ .buffer_size_bytes = aidlConfig.bufferSizeBytes,
+ .latency_ms = aidlConfig.latencyMs,
+ .extension = nullptr};
+
audio_proxy_config_t config = {
.format = static_cast<audio_proxy_format_t>(aidlConfig.format),
.sample_rate = static_cast<uint32_t>(aidlConfig.sampleRateHz),
.channel_mask =
static_cast<audio_proxy_channel_mask_t>(aidlConfig.channelMask),
.frame_count = 0,
- .extension = nullptr};
+ .v2 = &config_v2};
// TODO(yucliu): Pass address to the app. For now, the only client app
// (MediaShell) can use flags to distinguish different streams.
diff --git a/audio_proxy/AudioProxyStreamOut.cpp b/audio_proxy/AudioProxyStreamOut.cpp
index f1f47eb..cb60fe4 100644
--- a/audio_proxy/AudioProxyStreamOut.cpp
+++ b/audio_proxy/AudioProxyStreamOut.cpp
@@ -54,4 +54,53 @@ void AudioProxyStreamOut::setVolume(float left, float right) {
mStream->set_volume(mStream, left, right);
}
+int64_t AudioProxyStreamOut::getBufferSizeBytes() {
+ return mStream->get_buffer_size(mStream);
+}
+
+int32_t AudioProxyStreamOut::getLatencyMs() {
+ return mStream->get_latency(mStream);
+}
+
+void AudioProxyStreamOut::start() {
+ if (mStream->v2) {
+ mStream->v2->start(mStream->v2);
+ }
+}
+
+void AudioProxyStreamOut::stop() {
+ if (mStream->v2) {
+ mStream->v2->stop(mStream->v2);
+ }
+}
+
+MmapBufferInfo AudioProxyStreamOut::createMmapBuffer(
+ int32_t minBufferSizeFrames) {
+ MmapBufferInfo aidlInfo;
+ if (!mStream->v2) {
+ return aidlInfo;
+ }
+
+ audio_proxy_mmap_buffer_info_t info =
+ mStream->v2->create_mmap_buffer(mStream->v2, minBufferSizeFrames);
+ aidlInfo.sharedMemoryFd.set(info.shared_memory_fd);
+ aidlInfo.bufferSizeFrames = info.buffer_size_frames;
+ aidlInfo.burstSizeFrames = info.burst_size_frames;
+ aidlInfo.flags = info.flags;
+ return aidlInfo;
+}
+
+PresentationPosition AudioProxyStreamOut::getMmapPosition() {
+ PresentationPosition position;
+ if (!mStream->v2) {
+ return position;
+ }
+
+ int64_t frames = 0;
+ struct timespec ts = {0, 0};
+ mStream->v2->get_mmap_position(mStream->v2, &frames, &ts);
+ position.frames = frames;
+ position.timestamp = {ts.tv_sec, ts.tv_nsec};
+ return position;
+}
} // namespace audio_proxy
diff --git a/audio_proxy/AudioProxyStreamOut.h b/audio_proxy/AudioProxyStreamOut.h
index 8a773ae..3ecd4fd 100644
--- a/audio_proxy/AudioProxyStreamOut.h
+++ b/audio_proxy/AudioProxyStreamOut.h
@@ -15,6 +15,8 @@
#pragma once
#include <aidl/device/google/atv/audio_proxy/AudioDrain.h>
+#include <aidl/device/google/atv/audio_proxy/MmapBufferInfo.h>
+#include <aidl/device/google/atv/audio_proxy/PresentationPosition.h>
#include <aidl/device/google/atv/audio_proxy/TimeSpec.h>
#include <memory>
@@ -24,6 +26,8 @@
namespace audio_proxy {
using aidl::device::google::atv::audio_proxy::AudioDrain;
+using aidl::device::google::atv::audio_proxy::MmapBufferInfo;
+using aidl::device::google::atv::audio_proxy::PresentationPosition;
using aidl::device::google::atv::audio_proxy::TimeSpec;
// C++ friendly wrapper of audio_proxy_stream_out. It handles type conversion
@@ -45,6 +49,14 @@ class AudioProxyStreamOut final {
void setVolume(float left, float right);
+ int64_t getBufferSizeBytes();
+ int32_t getLatencyMs();
+
+ void start();
+ void stop();
+ MmapBufferInfo createMmapBuffer(int32_t minBufferSizeFrames);
+ PresentationPosition getMmapPosition();
+
private:
audio_proxy_stream_out_t* const mStream;
audio_proxy_device_t* const mDevice;
diff --git a/audio_proxy/OutputStreamImpl.cpp b/audio_proxy/OutputStreamImpl.cpp
index 07eaff6..935a879 100644
--- a/audio_proxy/OutputStreamImpl.cpp
+++ b/audio_proxy/OutputStreamImpl.cpp
@@ -23,7 +23,6 @@
#include "AudioProxyStreamOut.h"
using aidl::device::google::atv::audio_proxy::MessageQueueFlag;
-using aidl::device::google::atv::audio_proxy::PresentationPosition;
using android::status_t;
namespace audio_proxy {
@@ -254,4 +253,37 @@ ndk::ScopedAStatus OutputStreamImpl::setVolume(float left, float right) {
return ndk::ScopedAStatus::ok();
}
+ndk::ScopedAStatus OutputStreamImpl::getBufferSizeBytes(
+ int64_t* bufferSizeBytes) {
+ *bufferSizeBytes = mStream->getBufferSizeBytes();
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus OutputStreamImpl::getLatencyMs(int32_t* latencyMs) {
+ *latencyMs = mStream->getLatencyMs();
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus OutputStreamImpl::start() {
+ mStream->start();
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus OutputStreamImpl::stop() {
+ mStream->stop();
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus OutputStreamImpl::createMmapBuffer(
+ int32_t minBufferSizeFrames, MmapBufferInfo* info) {
+ *info = mStream->createMmapBuffer(minBufferSizeFrames);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus OutputStreamImpl::getMmapPosition(
+ PresentationPosition* position) {
+ *position = mStream->getMmapPosition();
+ return ndk::ScopedAStatus::ok();
+}
+
} // namespace audio_proxy \ No newline at end of file
diff --git a/audio_proxy/OutputStreamImpl.h b/audio_proxy/OutputStreamImpl.h
index c783eb0..7a3f7dc 100644
--- a/audio_proxy/OutputStreamImpl.h
+++ b/audio_proxy/OutputStreamImpl.h
@@ -28,6 +28,8 @@ using android::hardware::EventFlag;
using aidl::device::google::atv::audio_proxy::AudioDrain;
using aidl::device::google::atv::audio_proxy::BnOutputStream;
+using aidl::device::google::atv::audio_proxy::MmapBufferInfo;
+using aidl::device::google::atv::audio_proxy::PresentationPosition;
using aidl::device::google::atv::audio_proxy::WriteStatus;
namespace audio_proxy {
@@ -56,6 +58,15 @@ class OutputStreamImpl : public BnOutputStream {
ndk::ScopedAStatus setVolume(float left, float right) override;
+ ndk::ScopedAStatus getBufferSizeBytes(int64_t* bufferSizeBytes) override;
+ ndk::ScopedAStatus getLatencyMs(int32_t* latencyMs) override;
+
+ ndk::ScopedAStatus start() override;
+ ndk::ScopedAStatus stop() override;
+ ndk::ScopedAStatus createMmapBuffer(int32_t minBufferSizeFrames,
+ MmapBufferInfo* info) override;
+ ndk::ScopedAStatus getMmapPosition(PresentationPosition* position) override;
+
private:
typedef void (*EventFlagDeleter)(EventFlag*);
diff --git a/audio_proxy/interfaces/aidl/Android.bp b/audio_proxy/interfaces/aidl/Android.bp
index 543cb0d..56ad152 100644
--- a/audio_proxy/interfaces/aidl/Android.bp
+++ b/audio_proxy/interfaces/aidl/Android.bp
@@ -14,6 +14,7 @@ aidl_interface {
"android.hardware.common.fmq-V1",
],
stability: "vintf",
+ frozen: true,
backend: {
ndk: {
enabled: true,
@@ -25,5 +26,27 @@ aidl_interface {
enabled: false,
},
},
- versions: ["1"],
+ versions_with_info: [
+ {
+ version: "1",
+ imports: [
+ "android.hardware.common-V2",
+ "android.hardware.common.fmq-V1",
+ ],
+ },
+ {
+ version: "2",
+ imports: [
+ "android.hardware.common-V2",
+ "android.hardware.common.fmq-V1",
+ ],
+ },
+ {
+ version: "3",
+ imports: [
+ "android.hardware.common-V2",
+ "android.hardware.common.fmq-V1",
+ ],
+ },
+ ],
}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/.hash b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/.hash
new file mode 100644
index 0000000..87f9d36
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/.hash
@@ -0,0 +1 @@
+36478e9608536b679d90121e62177577f2aae0b7
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/AudioChannelMask.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/AudioChannelMask.aidl
new file mode 100644
index 0000000..821a29a
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/AudioChannelMask.aidl
@@ -0,0 +1,24 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package device.google.atv.audio_proxy;
+@Backing(type="int") @VintfStability
+enum AudioChannelMask {
+ MONO = 1,
+ STEREO = 3,
+}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/AudioConfig.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/AudioConfig.aidl
new file mode 100644
index 0000000..b75f906
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/AudioConfig.aidl
@@ -0,0 +1,27 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package device.google.atv.audio_proxy;
+@VintfStability
+parcelable AudioConfig {
+ device.google.atv.audio_proxy.AudioFormat format;
+ int sampleRateHz;
+ device.google.atv.audio_proxy.AudioChannelMask channelMask;
+ long bufferSizeBytes;
+ int latencyMs;
+}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/AudioDrain.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/AudioDrain.aidl
new file mode 100644
index 0000000..3b78e78
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/AudioDrain.aidl
@@ -0,0 +1,24 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package device.google.atv.audio_proxy;
+@Backing(type="int") @VintfStability
+enum AudioDrain {
+ ALL = 0,
+ EARLY_NOTIFY = 1,
+}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/AudioFormat.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/AudioFormat.aidl
new file mode 100644
index 0000000..778ce15
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/AudioFormat.aidl
@@ -0,0 +1,25 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package device.google.atv.audio_proxy;
+@Backing(type="int") @VintfStability
+enum AudioFormat {
+ PCM_16_BIT = 1,
+ PCM_8_BIT = 2,
+ PCM_FLOAT = 5,
+}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/AudioOutputFlag.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/AudioOutputFlag.aidl
new file mode 100644
index 0000000..100762a
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/AudioOutputFlag.aidl
@@ -0,0 +1,25 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package device.google.atv.audio_proxy;
+@Backing(type="int") @VintfStability
+enum AudioOutputFlag {
+ NONE = 0,
+ DIRECT = 1,
+ HW_AV_SYNC = 64,
+}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/IAudioProxy.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/IAudioProxy.aidl
new file mode 100644
index 0000000..eadd1a5
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/IAudioProxy.aidl
@@ -0,0 +1,23 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package device.google.atv.audio_proxy;
+@VintfStability
+interface IAudioProxy {
+ void start(in device.google.atv.audio_proxy.IStreamProvider provider);
+}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/IOutputStream.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/IOutputStream.aidl
new file mode 100644
index 0000000..44abe39
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/IOutputStream.aidl
@@ -0,0 +1,32 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package device.google.atv.audio_proxy;
+@VintfStability
+interface IOutputStream {
+ void standby();
+ void close();
+ void pause();
+ void resume();
+ void drain(device.google.atv.audio_proxy.AudioDrain drain);
+ void flush();
+ void prepareForWriting(in int frameSize, in int framesCount, out android.hardware.common.fmq.MQDescriptor<byte,android.hardware.common.fmq.SynchronizedReadWrite> dataMQ, out android.hardware.common.fmq.MQDescriptor<device.google.atv.audio_proxy.WriteStatus,android.hardware.common.fmq.SynchronizedReadWrite> statusMQ);
+ void setVolume(float left, float right);
+ long getBufferSizeBytes();
+ int getLatencyMs();
+}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/IStreamProvider.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/IStreamProvider.aidl
new file mode 100644
index 0000000..4d05698
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/IStreamProvider.aidl
@@ -0,0 +1,23 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package device.google.atv.audio_proxy;
+@VintfStability
+interface IStreamProvider {
+ device.google.atv.audio_proxy.IOutputStream openOutputStream(in String address, in device.google.atv.audio_proxy.AudioConfig config, in int flags);
+}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/MessageQueueFlag.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/MessageQueueFlag.aidl
new file mode 100644
index 0000000..736bfc3
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/MessageQueueFlag.aidl
@@ -0,0 +1,24 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package device.google.atv.audio_proxy;
+@Backing(type="int") @VintfStability
+enum MessageQueueFlag {
+ NOT_EMPTY = 1,
+ NOT_FULL = 2,
+}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/PresentationPosition.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/PresentationPosition.aidl
new file mode 100644
index 0000000..4fa7cb9
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/PresentationPosition.aidl
@@ -0,0 +1,24 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package device.google.atv.audio_proxy;
+@FixedSize @VintfStability
+parcelable PresentationPosition {
+ long frames;
+ device.google.atv.audio_proxy.TimeSpec timestamp;
+}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/TimeSpec.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/TimeSpec.aidl
new file mode 100644
index 0000000..daed6ac
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/TimeSpec.aidl
@@ -0,0 +1,24 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package device.google.atv.audio_proxy;
+@FixedSize @VintfStability
+parcelable TimeSpec {
+ long tvSec;
+ long tvNSec;
+}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/WriteStatus.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/WriteStatus.aidl
new file mode 100644
index 0000000..169163a
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/2/device/google/atv/audio_proxy/WriteStatus.aidl
@@ -0,0 +1,24 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package device.google.atv.audio_proxy;
+@FixedSize @VintfStability
+parcelable WriteStatus {
+ long written;
+ device.google.atv.audio_proxy.PresentationPosition position;
+}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/.hash b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/.hash
new file mode 100644
index 0000000..a5ef705
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/.hash
@@ -0,0 +1 @@
+70fdeee12fa5bd9b169842e36699920dd0283c56
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/AudioChannelMask.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/AudioChannelMask.aidl
new file mode 100644
index 0000000..821a29a
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/AudioChannelMask.aidl
@@ -0,0 +1,24 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package device.google.atv.audio_proxy;
+@Backing(type="int") @VintfStability
+enum AudioChannelMask {
+ MONO = 1,
+ STEREO = 3,
+}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/AudioConfig.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/AudioConfig.aidl
new file mode 100644
index 0000000..b75f906
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/AudioConfig.aidl
@@ -0,0 +1,27 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package device.google.atv.audio_proxy;
+@VintfStability
+parcelable AudioConfig {
+ device.google.atv.audio_proxy.AudioFormat format;
+ int sampleRateHz;
+ device.google.atv.audio_proxy.AudioChannelMask channelMask;
+ long bufferSizeBytes;
+ int latencyMs;
+}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/AudioDrain.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/AudioDrain.aidl
new file mode 100644
index 0000000..3b78e78
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/AudioDrain.aidl
@@ -0,0 +1,24 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package device.google.atv.audio_proxy;
+@Backing(type="int") @VintfStability
+enum AudioDrain {
+ ALL = 0,
+ EARLY_NOTIFY = 1,
+}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/AudioFormat.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/AudioFormat.aidl
new file mode 100644
index 0000000..778ce15
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/AudioFormat.aidl
@@ -0,0 +1,25 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package device.google.atv.audio_proxy;
+@Backing(type="int") @VintfStability
+enum AudioFormat {
+ PCM_16_BIT = 1,
+ PCM_8_BIT = 2,
+ PCM_FLOAT = 5,
+}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/AudioOutputFlag.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/AudioOutputFlag.aidl
new file mode 100644
index 0000000..100762a
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/AudioOutputFlag.aidl
@@ -0,0 +1,25 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package device.google.atv.audio_proxy;
+@Backing(type="int") @VintfStability
+enum AudioOutputFlag {
+ NONE = 0,
+ DIRECT = 1,
+ HW_AV_SYNC = 64,
+}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/IAudioProxy.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/IAudioProxy.aidl
new file mode 100644
index 0000000..eadd1a5
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/IAudioProxy.aidl
@@ -0,0 +1,23 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package device.google.atv.audio_proxy;
+@VintfStability
+interface IAudioProxy {
+ void start(in device.google.atv.audio_proxy.IStreamProvider provider);
+}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/IOutputStream.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/IOutputStream.aidl
new file mode 100644
index 0000000..7b5f9ce
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/IOutputStream.aidl
@@ -0,0 +1,36 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package device.google.atv.audio_proxy;
+@VintfStability
+interface IOutputStream {
+ void standby();
+ void close();
+ void pause();
+ void resume();
+ void drain(device.google.atv.audio_proxy.AudioDrain drain);
+ void flush();
+ void prepareForWriting(in int frameSize, in int framesCount, out android.hardware.common.fmq.MQDescriptor<byte,android.hardware.common.fmq.SynchronizedReadWrite> dataMQ, out android.hardware.common.fmq.MQDescriptor<device.google.atv.audio_proxy.WriteStatus,android.hardware.common.fmq.SynchronizedReadWrite> statusMQ);
+ void setVolume(float left, float right);
+ long getBufferSizeBytes();
+ int getLatencyMs();
+ void start();
+ void stop();
+ device.google.atv.audio_proxy.MmapBufferInfo createMmapBuffer(int minSizeFrames);
+ device.google.atv.audio_proxy.PresentationPosition getMmapPosition();
+}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/IStreamProvider.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/IStreamProvider.aidl
new file mode 100644
index 0000000..4d05698
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/IStreamProvider.aidl
@@ -0,0 +1,23 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package device.google.atv.audio_proxy;
+@VintfStability
+interface IStreamProvider {
+ device.google.atv.audio_proxy.IOutputStream openOutputStream(in String address, in device.google.atv.audio_proxy.AudioConfig config, in int flags);
+}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/MessageQueueFlag.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/MessageQueueFlag.aidl
new file mode 100644
index 0000000..736bfc3
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/MessageQueueFlag.aidl
@@ -0,0 +1,24 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package device.google.atv.audio_proxy;
+@Backing(type="int") @VintfStability
+enum MessageQueueFlag {
+ NOT_EMPTY = 1,
+ NOT_FULL = 2,
+}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/MmapBufferInfo.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/MmapBufferInfo.aidl
new file mode 100644
index 0000000..c205c97
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/MmapBufferInfo.aidl
@@ -0,0 +1,26 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package device.google.atv.audio_proxy;
+@VintfStability
+parcelable MmapBufferInfo {
+ ParcelFileDescriptor sharedMemoryFd;
+ int bufferSizeFrames;
+ int burstSizeFrames;
+ int flags;
+}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/PresentationPosition.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/PresentationPosition.aidl
new file mode 100644
index 0000000..4fa7cb9
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/PresentationPosition.aidl
@@ -0,0 +1,24 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package device.google.atv.audio_proxy;
+@FixedSize @VintfStability
+parcelable PresentationPosition {
+ long frames;
+ device.google.atv.audio_proxy.TimeSpec timestamp;
+}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/TimeSpec.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/TimeSpec.aidl
new file mode 100644
index 0000000..daed6ac
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/TimeSpec.aidl
@@ -0,0 +1,24 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package device.google.atv.audio_proxy;
+@FixedSize @VintfStability
+parcelable TimeSpec {
+ long tvSec;
+ long tvNSec;
+}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/WriteStatus.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/WriteStatus.aidl
new file mode 100644
index 0000000..169163a
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/3/device/google/atv/audio_proxy/WriteStatus.aidl
@@ -0,0 +1,24 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package device.google.atv.audio_proxy;
+@FixedSize @VintfStability
+parcelable WriteStatus {
+ long written;
+ device.google.atv.audio_proxy.PresentationPosition position;
+}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/current/device/google/atv/audio_proxy/AudioConfig.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/current/device/google/atv/audio_proxy/AudioConfig.aidl
index 2c32b79..b75f906 100644
--- a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/current/device/google/atv/audio_proxy/AudioConfig.aidl
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/current/device/google/atv/audio_proxy/AudioConfig.aidl
@@ -22,4 +22,6 @@ parcelable AudioConfig {
device.google.atv.audio_proxy.AudioFormat format;
int sampleRateHz;
device.google.atv.audio_proxy.AudioChannelMask channelMask;
+ long bufferSizeBytes;
+ int latencyMs;
}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/current/device/google/atv/audio_proxy/IOutputStream.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/current/device/google/atv/audio_proxy/IOutputStream.aidl
index 226ebd4..7b5f9ce 100644
--- a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/current/device/google/atv/audio_proxy/IOutputStream.aidl
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/current/device/google/atv/audio_proxy/IOutputStream.aidl
@@ -27,4 +27,10 @@ interface IOutputStream {
void flush();
void prepareForWriting(in int frameSize, in int framesCount, out android.hardware.common.fmq.MQDescriptor<byte,android.hardware.common.fmq.SynchronizedReadWrite> dataMQ, out android.hardware.common.fmq.MQDescriptor<device.google.atv.audio_proxy.WriteStatus,android.hardware.common.fmq.SynchronizedReadWrite> statusMQ);
void setVolume(float left, float right);
+ long getBufferSizeBytes();
+ int getLatencyMs();
+ void start();
+ void stop();
+ device.google.atv.audio_proxy.MmapBufferInfo createMmapBuffer(int minSizeFrames);
+ device.google.atv.audio_proxy.PresentationPosition getMmapPosition();
}
diff --git a/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/current/device/google/atv/audio_proxy/MmapBufferInfo.aidl b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/current/device/google/atv/audio_proxy/MmapBufferInfo.aidl
new file mode 100644
index 0000000..c205c97
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/aidl_api/device.google.atv.audio_proxy-aidl/current/device/google/atv/audio_proxy/MmapBufferInfo.aidl
@@ -0,0 +1,26 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package device.google.atv.audio_proxy;
+@VintfStability
+parcelable MmapBufferInfo {
+ ParcelFileDescriptor sharedMemoryFd;
+ int bufferSizeFrames;
+ int burstSizeFrames;
+ int flags;
+}
diff --git a/audio_proxy/interfaces/aidl/device/google/atv/audio_proxy/AudioConfig.aidl b/audio_proxy/interfaces/aidl/device/google/atv/audio_proxy/AudioConfig.aidl
index 4e7a85f..97b5e17 100644
--- a/audio_proxy/interfaces/aidl/device/google/atv/audio_proxy/AudioConfig.aidl
+++ b/audio_proxy/interfaces/aidl/device/google/atv/audio_proxy/AudioConfig.aidl
@@ -11,4 +11,10 @@ parcelable AudioConfig {
AudioFormat format;
int sampleRateHz;
AudioChannelMask channelMask;
-} \ No newline at end of file
+
+ // Expected buffer size and latency for the stream. If 0, the impl should
+ // provide their own value.
+ long bufferSizeBytes;
+ int latencyMs;
+}
+
diff --git a/audio_proxy/interfaces/aidl/device/google/atv/audio_proxy/IOutputStream.aidl b/audio_proxy/interfaces/aidl/device/google/atv/audio_proxy/IOutputStream.aidl
index cffc255..955d369 100644
--- a/audio_proxy/interfaces/aidl/device/google/atv/audio_proxy/IOutputStream.aidl
+++ b/audio_proxy/interfaces/aidl/device/google/atv/audio_proxy/IOutputStream.aidl
@@ -4,6 +4,8 @@ import android.hardware.common.fmq.MQDescriptor;
import android.hardware.common.fmq.SynchronizedReadWrite;
import device.google.atv.audio_proxy.AudioDrain;
+import device.google.atv.audio_proxy.MmapBufferInfo;
+import device.google.atv.audio_proxy.PresentationPosition;
import device.google.atv.audio_proxy.WriteStatus;
/**
@@ -42,4 +44,26 @@ interface IOutputStream {
* Volume control.
*/
void setVolume(float left, float right);
+
+ /**
+ * Get the buffer size and latency of the stream. They're called before starting the playback.
+ */
+ long getBufferSizeBytes();
+ int getLatencyMs();
+
+ /**
+ * Start/Stop playback for MMAP_NOIRQ stream.
+ */
+ void start();
+ void stop();
+
+ /**
+ * Create a share memory for MMAP_NOIRQ stream.
+ */
+ MmapBufferInfo createMmapBuffer(int minSizeFrames);
+
+ /**
+ * Query the presentation position for MMAP_NOIRQ stream.
+ */
+ PresentationPosition getMmapPosition();
}
diff --git a/audio_proxy/interfaces/aidl/device/google/atv/audio_proxy/MmapBufferInfo.aidl b/audio_proxy/interfaces/aidl/device/google/atv/audio_proxy/MmapBufferInfo.aidl
new file mode 100644
index 0000000..dbc7f70
--- /dev/null
+++ b/audio_proxy/interfaces/aidl/device/google/atv/audio_proxy/MmapBufferInfo.aidl
@@ -0,0 +1,15 @@
+package device.google.atv.audio_proxy;
+
+import android.os.ParcelFileDescriptor;
+
+/**
+ * Shared memory and the associated info for the playback.
+ * This is the corresponding structure of audio HAL MmapBufferInfo.
+ */
+@VintfStability
+parcelable MmapBufferInfo {
+ ParcelFileDescriptor sharedMemoryFd;
+ int bufferSizeFrames;
+ int burstSizeFrames;
+ int flags;
+}
diff --git a/audio_proxy/public/audio_proxy.h b/audio_proxy/public/audio_proxy.h
index 097d33b..f6ea632 100644
--- a/audio_proxy/public/audio_proxy.h
+++ b/audio_proxy/public/audio_proxy.h
@@ -46,7 +46,10 @@ enum {
AUDIO_PROXY_FORMAT_INVALID = 0xFFFFFFFFu,
AUDIO_PROXY_FORMAT_PCM_16_BIT = 0x1u,
AUDIO_PROXY_FORMAT_PCM_8_BIT = 0x2u,
+ AUDIO_PROXY_FORMAT_PCM_32_BIT = 0x3u,
+ AUDIO_PROXY_FORMAT_PCM_8_24_BIT = 0x4u,
AUDIO_PROXY_FORMAT_PCM_FLOAT = 0x5u,
+ AUDIO_PROXY_FORMAT_PCM_24_BIT_PACKED = 0x6u,
};
typedef uint32_t audio_proxy_format_t;
@@ -55,6 +58,35 @@ enum {
AUDIO_PROXY_CHANNEL_INVALID = 0xC0000000u,
AUDIO_PROXY_CHANNEL_OUT_MONO = 0x1u,
AUDIO_PROXY_CHANNEL_OUT_STEREO = 0x3u,
+ AUDIO_PROXY_CHANNEL_OUT_2POINT1 = 0xBu,
+ AUDIO_PROXY_CHANNEL_OUT_TRI = 0x7u,
+ AUDIO_PROXY_CHANNEL_OUT_TRI_BACK = 0x103u,
+ AUDIO_PROXY_CHANNEL_OUT_3POINT1 = 0xFu,
+ AUDIO_PROXY_CHANNEL_OUT_2POINT0POINT2 = 0xC0003u,
+ AUDIO_PROXY_CHANNEL_OUT_2POINT1POINT2 = 0xC000Bu,
+ AUDIO_PROXY_CHANNEL_OUT_3POINT0POINT2 = 0xC0007u,
+ AUDIO_PROXY_CHANNEL_OUT_3POINT1POINT2 = 0xC000Fu,
+ AUDIO_PROXY_CHANNEL_OUT_QUAD = 0x33u,
+ // AUDIO_PROXY_CHANNEL_OUT_QUAD_BACK = 0x33u,
+ AUDIO_PROXY_CHANNEL_OUT_QUAD_SIDE = 0x603u,
+ AUDIO_PROXY_CHANNEL_OUT_SURROUND = 0x107u,
+ AUDIO_PROXY_CHANNEL_OUT_PENTA = 0x37u,
+ AUDIO_PROXY_CHANNEL_OUT_5POINT1 = 0x3Fu,
+ // AUDIO_PROXY_CHANNEL_OUT_5POINT1_BACK = 0x3Fu,
+ AUDIO_PROXY_CHANNEL_OUT_5POINT1_SIDE = 0x60Fu,
+ AUDIO_PROXY_CHANNEL_OUT_5POINT1POINT2 = 0xC003Fu,
+ AUDIO_PROXY_CHANNEL_OUT_5POINT1POINT4 = 0x2D03Fu,
+ AUDIO_PROXY_CHANNEL_OUT_6POINT1 = 0x13Fu,
+ AUDIO_PROXY_CHANNEL_OUT_7POINT1 = 0x63Fu,
+ AUDIO_PROXY_CHANNEL_OUT_7POINT1POINT2 = 0xC063Fu,
+ AUDIO_PROXY_CHANNEL_OUT_7POINT1POINT4 = 0x2D63Fu,
+ AUDIO_PROXY_CHANNEL_OUT_13POINT_360RA = 0x72F607u,
+ AUDIO_PROXY_CHANNEL_OUT_22POINT2 = 0xFFFFFFu,
+ AUDIO_PROXY_CHANNEL_OUT_MONO_HAPTIC_A = 0x20000001u,
+ AUDIO_PROXY_CHANNEL_OUT_STEREO_HAPTIC_A = 0x20000003u,
+ AUDIO_PROXY_CHANNEL_OUT_HAPTIC_AB = 0x30000000u,
+ AUDIO_PROXY_CHANNEL_OUT_MONO_HAPTIC_AB = 0x30000001u,
+ AUDIO_PROXY_CHANNEL_OUT_STEREO_HAPTIC_AB = 0x30000003u,
};
typedef uint32_t audio_proxy_channel_mask_t;
@@ -75,13 +107,21 @@ typedef int32_t audio_proxy_output_flags_t;
// AudioConfig
typedef struct {
+ int64_t buffer_size_bytes;
+ int32_t latency_ms;
+
+ // Points to extra fields defined in the future versions.
+ void* extension;
+} audio_proxy_config_v2_t;
+
+typedef struct {
uint32_t sample_rate;
audio_proxy_channel_mask_t channel_mask;
audio_proxy_format_t format;
uint32_t frame_count;
- // Points to extra fields defined in the future versions.
- void* extension;
+ // Points to extra fields.
+ audio_proxy_config_v2_t* v2;
} audio_proxy_config_t;
// Util structure for key value pair.
@@ -93,10 +133,32 @@ typedef struct {
typedef void (*audio_proxy_get_parameters_callback_t)(
void*, const audio_proxy_key_val_t*);
-// The following struct/functions mirror those definitions in audio HAL. They
-// should have the same requirement as audio HAL interfaces, unless specified.
+enum {
+ AUDIO_PROXY_MMAP_BUFFER_FLAG_NONE = 0x0,
+ AUDIO_PROXY_MMAP_BUFFER_FLAG_APPLICATION_SHAREABLE = 0x1,
+};
+typedef int32_t audio_proxy_mmap_buffer_flag_t;
+
+typedef struct {
+ int shared_memory_fd;
+ int32_t buffer_size_frames;
+ int32_t burst_size_frames;
+ audio_proxy_mmap_buffer_flag_t flags;
+} audio_proxy_mmap_buffer_info_t;
// IStreamOut.
+struct audio_proxy_stream_out_v2 {
+ void (*start)(struct audio_proxy_stream_out_v2* stream);
+ void (*stop)(struct audio_proxy_stream_out_v2* stream);
+ audio_proxy_mmap_buffer_info_t (*create_mmap_buffer)(
+ struct audio_proxy_stream_out_v2* stream, int32_t min_buffer_size_frames);
+ void (*get_mmap_position)(struct audio_proxy_stream_out_v2* stream,
+ int64_t* frames, struct timespec* timestamp);
+ // Pointer to the next version structure, for compatibility.
+ void* extension;
+};
+typedef struct audio_proxy_stream_out_v2 audio_proxy_stream_out_v2_t;
+
struct audio_proxy_stream_out {
size_t (*get_buffer_size)(const struct audio_proxy_stream_out* stream);
uint64_t (*get_frame_count)(const struct audio_proxy_stream_out* stream);
@@ -191,8 +253,8 @@ struct audio_proxy_stream_out {
// optional.
int (*dump)(const struct audio_proxy_stream_out* stream, int fd);
- // Pointer to the next version structure, for compatibility.
- void* extension;
+ // Pointer to the next version structure.
+ audio_proxy_stream_out_v2_t* v2;
};
typedef struct audio_proxy_stream_out audio_proxy_stream_out_t;
diff --git a/audio_proxy/sepolicy/OWNERS b/audio_proxy/sepolicy/OWNERS
new file mode 100644
index 0000000..508598e
--- /dev/null
+++ b/audio_proxy/sepolicy/OWNERS
@@ -0,0 +1,2 @@
+include platform/system/sepolicy:/OWNERS
+
diff --git a/audio_proxy/sepolicy/public/hal_audio_proxy.te b/audio_proxy/sepolicy/public/hal_audio_proxy.te
index 2ebdbfe..8b643b9 100644
--- a/audio_proxy/sepolicy/public/hal_audio_proxy.te
+++ b/audio_proxy/sepolicy/public/hal_audio_proxy.te
@@ -4,4 +4,3 @@ hal_attribute(audio_proxy);
binder_call(hal_audio_proxy_client, hal_audio_proxy_server);
binder_call(hal_audio_proxy_server, hal_audio_proxy_client);
binder_call(hal_audio_proxy_server, servicemanager);
-
diff --git a/audio_proxy/sepolicy/vendor/dumpstate.te b/audio_proxy/sepolicy/vendor/dumpstate.te
new file mode 100644
index 0000000..4fc2358
--- /dev/null
+++ b/audio_proxy/sepolicy/vendor/dumpstate.te
@@ -0,0 +1 @@
+binder_call(dumpstate, hal_audio_proxy_default);
diff --git a/audio_proxy/sepolicy/vendor/hal_audio_proxy_default.te b/audio_proxy/sepolicy/vendor/hal_audio_proxy_default.te
index 5534200..e53bfc5 100644
--- a/audio_proxy/sepolicy/vendor/hal_audio_proxy_default.te
+++ b/audio_proxy/sepolicy/vendor/hal_audio_proxy_default.te
@@ -8,16 +8,5 @@ init_daemon_domain(hal_audio_proxy_default);
hal_server_domain(hal_audio_proxy_default, hal_audio);
hal_server_domain(hal_audio_proxy_default, hal_audio_proxy);
-# allows audio proxy service access audio HAL interfaces.
-hal_client_domain(hal_audio_proxy_default, hal_audio);
-
# allow audioserver to call hal_audio dump with its own fd to retrieve status
allow hal_audio_proxy_default audioserver:fifo_file write;
-
-allow dumpstate hal_audio_proxy_default:binder call;
-
-type hal_audio_proxy_service, vendor_service, protected_service, service_manager_type;
-hal_attribute_service(hal_audio_proxy, hal_audio_proxy_service);
-
-add_service(hal_audio_proxy_default, hal_audio_proxy_service);
-
diff --git a/audio_proxy/sepolicy/vendor/service.te b/audio_proxy/sepolicy/vendor/service.te
new file mode 100644
index 0000000..f96c68d
--- /dev/null
+++ b/audio_proxy/sepolicy/vendor/service.te
@@ -0,0 +1,2 @@
+type hal_audio_proxy_service, hal_service_type, protected_service, service_manager_type;
+hal_attribute_service(hal_audio_proxy, hal_audio_proxy_service);
diff --git a/audio_proxy/service/AidlTypes.h b/audio_proxy/service/AidlTypes.h
index 5e3fc9b..022098b 100644
--- a/audio_proxy/service/AidlTypes.h
+++ b/audio_proxy/service/AidlTypes.h
@@ -18,6 +18,8 @@
#include <aidl/device/google/atv/audio_proxy/AudioConfig.h>
#include <aidl/device/google/atv/audio_proxy/AudioDrain.h>
#include <aidl/device/google/atv/audio_proxy/AudioFormat.h>
+#include <aidl/device/google/atv/audio_proxy/MmapBufferInfo.h>
+#include <aidl/device/google/atv/audio_proxy/PresentationPosition.h>
#include <aidl/device/google/atv/audio_proxy/WriteStatus.h>
namespace audio_proxy::service {
@@ -28,6 +30,10 @@ using AidlAudioChannelMask =
using AidlAudioConfig = aidl::device::google::atv::audio_proxy::AudioConfig;
using AidlAudioDrain = aidl::device::google::atv::audio_proxy::AudioDrain;
using AidlAudioFormat = aidl::device::google::atv::audio_proxy::AudioFormat;
+using AidlMmapBufferInfo =
+ aidl::device::google::atv::audio_proxy::MmapBufferInfo;
+using AidlPresentationPosition =
+ aidl::device::google::atv::audio_proxy::PresentationPosition;
using AidlWriteStatus = aidl::device::google::atv::audio_proxy::WriteStatus;
} // namespace audio_proxy::service \ No newline at end of file
diff --git a/audio_proxy/service/Android.bp b/audio_proxy/service/Android.bp
index 711add8..6dd2cc1 100644
--- a/audio_proxy/service/Android.bp
+++ b/audio_proxy/service/Android.bp
@@ -41,6 +41,7 @@ cc_defaults {
srcs: [
"AudioProxyImpl.cpp",
+ "AudioUtil.cpp",
"BusOutputStream.cpp",
"BusStreamProvider.cpp",
"DeviceImpl.cpp",
@@ -53,7 +54,7 @@ cc_defaults {
],
shared_libs: [
- "device.google.atv.audio_proxy-aidl-V1-ndk",
+ "device.google.atv.audio_proxy-aidl-V3-ndk",
"libbase",
"libbinder_ndk",
"libhidlbase",
diff --git a/audio_proxy/service/AudioUtil.cpp b/audio_proxy/service/AudioUtil.cpp
new file mode 100644
index 0000000..b51c63d
--- /dev/null
+++ b/audio_proxy/service/AudioUtil.cpp
@@ -0,0 +1,38 @@
+// Copyright (C) 2022 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "AudioUtil.h"
+
+#include <system/audio.h>
+
+namespace audio_proxy::service {
+int computeFrameSize(const AidlAudioConfig& config) {
+ audio_format_t format = static_cast<audio_format_t>(config.format);
+
+ if (!audio_has_proportional_frames(format)) {
+ return sizeof(int8_t);
+ }
+
+ size_t channelSampleSize = audio_bytes_per_sample(format);
+ return audio_channel_count_from_out_mask(
+ static_cast<audio_channel_mask_t>(config.channelMask)) *
+ channelSampleSize;
+}
+
+int64_t computeBufferSizeBytes(const AidlAudioConfig& config,
+ int32_t bufferSizeMs) {
+ return static_cast<int64_t>(bufferSizeMs) * config.sampleRateHz *
+ computeFrameSize(config) / 1000;
+}
+} // namespace audio_proxy::service \ No newline at end of file
diff --git a/audio_proxy/service/AudioUtil.h b/audio_proxy/service/AudioUtil.h
new file mode 100644
index 0000000..5430472
--- /dev/null
+++ b/audio_proxy/service/AudioUtil.h
@@ -0,0 +1,25 @@
+// Copyright (C) 2022 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include <cstdint>
+
+#include "AidlTypes.h"
+
+namespace audio_proxy::service {
+int computeFrameSize(const AidlAudioConfig& config);
+int64_t computeBufferSizeBytes(const AidlAudioConfig& config,
+ int32_t bufferSizeMs);
+} // namespace audio_proxy::service \ No newline at end of file
diff --git a/audio_proxy/service/BusOutputStream.cpp b/audio_proxy/service/BusOutputStream.cpp
index 40ac8d4..e456faf 100644
--- a/audio_proxy/service/BusOutputStream.cpp
+++ b/audio_proxy/service/BusOutputStream.cpp
@@ -15,7 +15,8 @@
#include "BusOutputStream.h"
#include <android-base/logging.h>
-#include <system/audio.h>
+
+#include "AudioUtil.h"
namespace audio_proxy::service {
@@ -28,18 +29,7 @@ const std::string& BusOutputStream::getAddress() const { return mAddress; }
const AidlAudioConfig& BusOutputStream::getConfig() const { return mConfig; }
int32_t BusOutputStream::getFlags() const { return mFlags; }
-int BusOutputStream::getFrameSize() const {
- audio_format_t format = static_cast<audio_format_t>(mConfig.format);
-
- if (!audio_has_proportional_frames(format)) {
- return sizeof(int8_t);
- }
-
- size_t channelSampleSize = audio_bytes_per_sample(format);
- return audio_channel_count_from_out_mask(
- static_cast<audio_channel_mask_t>(mConfig.channelMask)) *
- channelSampleSize;
-}
+int BusOutputStream::getFrameSize() const { return computeFrameSize(mConfig); }
bool BusOutputStream::prepareForWriting(uint32_t frameSize,
uint32_t frameCount) {
diff --git a/audio_proxy/service/BusOutputStream.h b/audio_proxy/service/BusOutputStream.h
index f9fb930..2116bca 100644
--- a/audio_proxy/service/BusOutputStream.h
+++ b/audio_proxy/service/BusOutputStream.h
@@ -50,6 +50,11 @@ class BusOutputStream {
const uint8_t* secondMem,
size_t secondLength) = 0;
+ virtual bool start() = 0;
+ virtual bool stop() = 0;
+ virtual AidlMmapBufferInfo createMmapBuffer(int32_t minBufferSizeFrames) = 0;
+ virtual AidlPresentationPosition getMmapPosition() = 0;
+
protected:
virtual bool prepareForWritingImpl(uint32_t frameSize,
uint32_t frameCount) = 0;
diff --git a/audio_proxy/service/BusStreamProvider.cpp b/audio_proxy/service/BusStreamProvider.cpp
index 42e6dda..af2c5b8 100644
--- a/audio_proxy/service/BusStreamProvider.cpp
+++ b/audio_proxy/service/BusStreamProvider.cpp
@@ -34,9 +34,11 @@ void BusStreamProvider::setStreamProvider(
for (auto& weakStream : mStreamOutList) {
if (sp<StreamOutImpl> stream = weakStream.promote()) {
auto oldOutputStream = stream->getOutputStream();
- auto outputStream = openOutputStream_Locked(oldOutputStream->getAddress(),
- oldOutputStream->getConfig(),
- oldOutputStream->getFlags());
+ auto outputStream = openOutputStream_Locked(
+ oldOutputStream->getAddress(), oldOutputStream->getConfig(),
+ oldOutputStream->getFlags(),
+ oldOutputStream->getConfig().bufferSizeBytes,
+ oldOutputStream->getConfig().latencyMs);
stream->updateOutputStream(std::move(outputStream));
}
}
@@ -48,9 +50,11 @@ std::shared_ptr<IStreamProvider> BusStreamProvider::getStreamProvider() {
}
std::shared_ptr<BusOutputStream> BusStreamProvider::openOutputStream(
- const std::string& address, const AidlAudioConfig& config, int32_t flags) {
+ const std::string& address, const AidlAudioConfig& config, int32_t flags,
+ int64_t bufferSizeBytes, int32_t latencyMs) {
std::lock_guard<std::mutex> lock(mLock);
- return openOutputStream_Locked(address, config, flags);
+ return openOutputStream_Locked(address, config, flags, bufferSizeBytes,
+ latencyMs);
}
void BusStreamProvider::onStreamOutCreated(wp<StreamOutImpl> stream) {
@@ -60,9 +64,14 @@ void BusStreamProvider::onStreamOutCreated(wp<StreamOutImpl> stream) {
}
std::shared_ptr<BusOutputStream> BusStreamProvider::openOutputStream_Locked(
- const std::string& address, const AidlAudioConfig& config, int32_t flags) {
+ const std::string& address, const AidlAudioConfig& config, int32_t flags,
+ int64_t bufferSizeBytes, int32_t latencyMs) {
+ AidlAudioConfig newConfig = config;
+ newConfig.bufferSizeBytes = bufferSizeBytes;
+ newConfig.latencyMs = latencyMs;
+
if (!mStreamProvider) {
- return std::make_shared<DummyBusOutputStream>(address, config, flags);
+ return std::make_shared<DummyBusOutputStream>(address, newConfig, flags);
}
std::shared_ptr<IOutputStream> stream;
@@ -70,11 +79,22 @@ std::shared_ptr<BusOutputStream> BusStreamProvider::openOutputStream_Locked(
mStreamProvider->openOutputStream(address, config, flags, &stream);
if (!status.isOk() || !stream) {
LOG(ERROR) << "Failed to open output stream, status " << status.getStatus();
- return std::make_shared<DummyBusOutputStream>(address, config, flags);
+ return std::make_shared<DummyBusOutputStream>(address, newConfig, flags);
+ }
+
+ int64_t aidlBufferSizeInBytes = -1;
+ if (stream->getBufferSizeBytes(&aidlBufferSizeInBytes).isOk() &&
+ aidlBufferSizeInBytes > 0) {
+ newConfig.bufferSizeBytes = aidlBufferSizeInBytes;
+ }
+
+ int32_t aidlLatencyMs = -1;
+ if (stream->getLatencyMs(&aidlLatencyMs).isOk() && aidlLatencyMs > 0) {
+ newConfig.latencyMs = aidlLatencyMs;
}
return std::make_shared<RemoteBusOutputStream>(std::move(stream), address,
- config, flags);
+ newConfig, flags);
}
size_t BusStreamProvider::cleanAndCountStreamOuts() {
diff --git a/audio_proxy/service/BusStreamProvider.h b/audio_proxy/service/BusStreamProvider.h
index abcca8b..8d3ebbb 100644
--- a/audio_proxy/service/BusStreamProvider.h
+++ b/audio_proxy/service/BusStreamProvider.h
@@ -52,15 +52,16 @@ class BusStreamProvider {
// 2. Returns DummyBusOutputStream otherwise.
// This function always return a non null BusOutputStream.
std::shared_ptr<BusOutputStream> openOutputStream(
- const std::string& address, const AidlAudioConfig& config, int32_t flags);
+ const std::string& address, const AidlAudioConfig& config, int32_t flags,
+ int64_t bufferSizeBytes, int32_t latencyMs);
// Clear closed StreamOut and return number of opened StreamOut.
size_t cleanAndCountStreamOuts();
private:
std::shared_ptr<BusOutputStream> openOutputStream_Locked(
- const std::string& address, const AidlAudioConfig& config, int32_t flags)
- REQUIRES(mLock);
+ const std::string& address, const AidlAudioConfig& config, int32_t flags,
+ int64_t bufferSizeBytes, int32_t latencyMs) REQUIRES(mLock);
// Remove the dead dead from mStreamOutList.
void cleanStreamOutList_Locked() REQUIRES(mLock);
diff --git a/audio_proxy/service/DeviceImpl.cpp b/audio_proxy/service/DeviceImpl.cpp
index 15637d5..1cbae5a 100644
--- a/audio_proxy/service/DeviceImpl.cpp
+++ b/audio_proxy/service/DeviceImpl.cpp
@@ -22,6 +22,7 @@
#include <optional>
#include "AidlTypes.h"
+#include "AudioUtil.h"
#include "BusOutputStream.h"
#include "BusStreamProvider.h"
#include "ServiceConfig.h"
@@ -54,7 +55,9 @@ std::optional<AidlAudioConfig> toAidlAudioConfig(
AidlAudioConfig aidlConfig = {
.format = static_cast<AidlAudioFormat>(format),
.sampleRateHz = static_cast<int32_t>(hidl_config.sampleRateHz),
- .channelMask = static_cast<AidlAudioChannelMask>(channelMask)};
+ .channelMask = static_cast<AidlAudioChannelMask>(channelMask),
+ .bufferSizeBytes = 0,
+ .latencyMs = 0};
return aidlConfig;
}
@@ -183,8 +186,9 @@ AidlAudioConfig toAidlAudioConfig(const AudioConfig& hidl_config) {
AidlAudioConfig aidlConfig = {
.format = static_cast<AidlAudioFormat>(hidl_config.format),
.sampleRateHz = static_cast<int32_t>(hidl_config.sampleRateHz),
- .channelMask =
- static_cast<AidlAudioChannelMask>(hidl_config.channelMask)};
+ .channelMask = static_cast<AidlAudioChannelMask>(hidl_config.channelMask),
+ .bufferSizeBytes = 0,
+ .latencyMs = 0};
return aidlConfig;
}
@@ -278,11 +282,13 @@ Return<void> DeviceImpl::openOutputStreamImpl(
}
std::shared_ptr<BusOutputStream> busOutputStream =
- mBusStreamProvider.openOutputStream(address, *aidlConfig, *outputFlags);
+ mBusStreamProvider.openOutputStream(
+ address, *aidlConfig, *outputFlags,
+ computeBufferSizeBytes(*aidlConfig, configIt->second.bufferSizeMs),
+ configIt->second.latencyMs);
DCHECK(busOutputStream);
- auto streamOut = sp<StreamOutImpl>::make(
- std::move(busOutputStream), config.base, configIt->second.bufferSizeMs,
- configIt->second.latencyMs);
+ auto streamOut =
+ sp<StreamOutImpl>::make(std::move(busOutputStream), config.base);
mBusStreamProvider.onStreamOutCreated(streamOut);
_hidl_cb(Result::OK, streamOut, config);
return Void();
@@ -330,14 +336,14 @@ Return<void> DeviceImpl::openOutputStream(int32_t ioHandle,
return Void();
}
+ auto aidlConfig = toAidlAudioConfig(config);
std::shared_ptr<BusOutputStream> busOutputStream =
- mBusStreamProvider.openOutputStream(address,
- toAidlAudioConfig(config),
- static_cast<int32_t>(flags));
+ mBusStreamProvider.openOutputStream(
+ address, aidlConfig, static_cast<int32_t>(flags),
+ computeBufferSizeBytes(aidlConfig, configIt->second.bufferSizeMs),
+ configIt->second.latencyMs);
DCHECK(busOutputStream);
- auto streamOut = sp<StreamOutImpl>::make(std::move(busOutputStream), config,
- configIt->second.bufferSizeMs,
- configIt->second.latencyMs);
+ auto streamOut = sp<StreamOutImpl>::make(std::move(busOutputStream), config);
mBusStreamProvider.onStreamOutCreated(streamOut);
_hidl_cb(Result::OK, streamOut, config);
return Void();
diff --git a/audio_proxy/service/DummyBusOutputStream.cpp b/audio_proxy/service/DummyBusOutputStream.cpp
index b18728f..3b9b56e 100644
--- a/audio_proxy/service/DummyBusOutputStream.cpp
+++ b/audio_proxy/service/DummyBusOutputStream.cpp
@@ -115,4 +115,17 @@ bool DummyBusOutputStream::prepareForWritingImpl(uint32_t frameSize,
return true;
}
+bool DummyBusOutputStream::start() { return false; }
+
+bool DummyBusOutputStream::stop() { return false; };
+
+AidlMmapBufferInfo DummyBusOutputStream::createMmapBuffer(
+ int32_t minBufferSizeFrames) {
+ return AidlMmapBufferInfo();
+}
+
+AidlPresentationPosition DummyBusOutputStream::getMmapPosition() {
+ return AidlPresentationPosition();
+}
+
} // namespace audio_proxy::service
diff --git a/audio_proxy/service/DummyBusOutputStream.h b/audio_proxy/service/DummyBusOutputStream.h
index c5ca47e..0cb8e44 100644
--- a/audio_proxy/service/DummyBusOutputStream.h
+++ b/audio_proxy/service/DummyBusOutputStream.h
@@ -41,6 +41,11 @@ class DummyBusOutputStream : public BusOutputStream {
const uint8_t* secondMem,
size_t secondLength) override;
+ bool start() override;
+ bool stop() override;
+ AidlMmapBufferInfo createMmapBuffer(int32_t minBufferSizeFrames) override;
+ AidlPresentationPosition getMmapPosition() override;
+
protected:
bool prepareForWritingImpl(uint32_t frameSize, uint32_t frameCount) override;
diff --git a/audio_proxy/service/RemoteBusOutputStream.cpp b/audio_proxy/service/RemoteBusOutputStream.cpp
index a5edc76..177cb55 100644
--- a/audio_proxy/service/RemoteBusOutputStream.cpp
+++ b/audio_proxy/service/RemoteBusOutputStream.cpp
@@ -158,5 +158,22 @@ bool RemoteBusOutputStream::prepareForWritingImpl(uint32_t frameSize,
return true;
}
+bool RemoteBusOutputStream::start() { return mStream->start().isOk(); }
+
+bool RemoteBusOutputStream::stop() { return mStream->stop().isOk(); };
+
+AidlMmapBufferInfo RemoteBusOutputStream::createMmapBuffer(
+ int32_t minBufferSizeFrames) {
+ AidlMmapBufferInfo info;
+ mStream->createMmapBuffer(minBufferSizeFrames, &info);
+ return info;
+}
+
+AidlPresentationPosition RemoteBusOutputStream::getMmapPosition() {
+ AidlPresentationPosition position;
+ mStream->getMmapPosition(&position);
+ return position;
+}
+
} // namespace service
} // namespace audio_proxy \ No newline at end of file
diff --git a/audio_proxy/service/RemoteBusOutputStream.h b/audio_proxy/service/RemoteBusOutputStream.h
index 6f663cb..cb7de19 100644
--- a/audio_proxy/service/RemoteBusOutputStream.h
+++ b/audio_proxy/service/RemoteBusOutputStream.h
@@ -49,6 +49,11 @@ class RemoteBusOutputStream : public BusOutputStream {
const uint8_t* secondMem,
size_t secondLength) override;
+ bool start() override;
+ bool stop() override;
+ AidlMmapBufferInfo createMmapBuffer(int32_t minBufferSizeFrames) override;
+ AidlPresentationPosition getMmapPosition() override;
+
protected:
bool prepareForWritingImpl(uint32_t frameSize, uint32_t frameCount) override;
diff --git a/audio_proxy/service/StreamOutImpl.cpp b/audio_proxy/service/StreamOutImpl.cpp
index baf086f..5e4a772 100644
--- a/audio_proxy/service/StreamOutImpl.cpp
+++ b/audio_proxy/service/StreamOutImpl.cpp
@@ -28,6 +28,7 @@
#include "WriteThread.h"
using android::status_t;
+using android::hardware::hidl_memory;
namespace audio_proxy::service {
@@ -73,12 +74,11 @@ uint64_t estimatePlayedFramesSince(const TimeSpec& timestamp,
} // namespace
StreamOutImpl::StreamOutImpl(std::shared_ptr<BusOutputStream> stream,
- const StreamOutConfig& config,
- uint32_t bufferSizeMs, uint32_t latencyMs)
+ const StreamOutConfig& config)
: mStream(std::move(stream)),
mConfig(config),
- mBufferSizeMs(bufferSizeMs),
- mLatencyMs(latencyMs),
+ mBufferSizeBytes(mStream->getConfig().bufferSizeBytes),
+ mLatencyMs(mStream->getConfig().latencyMs),
mEventFlag(nullptr, deleteEventFlag) {}
StreamOutImpl::~StreamOutImpl() {
@@ -98,12 +98,10 @@ Return<uint64_t> StreamOutImpl::getFrameSize() {
}
Return<uint64_t> StreamOutImpl::getFrameCount() {
- return mBufferSizeMs * mConfig.sampleRateHz / 1000;
+ return mBufferSizeBytes / mStream->getFrameSize();
}
-Return<uint64_t> StreamOutImpl::getBufferSize() {
- return mBufferSizeMs * mConfig.sampleRateHz * mStream->getFrameSize() / 1000;
-}
+Return<uint64_t> StreamOutImpl::getBufferSize() { return mBufferSizeBytes; }
#if MAJOR_VERSION >= 7
Return<void> StreamOutImpl::getSupportedProfiles(
@@ -441,18 +439,51 @@ Return<void> StreamOutImpl::getPresentationPosition(
return Void();
}
-Return<Result> StreamOutImpl::start() { return Result::NOT_SUPPORTED; }
+Return<Result> StreamOutImpl::start() {
+ return mStream->start() ? Result::OK : Result::NOT_SUPPORTED;
+}
-Return<Result> StreamOutImpl::stop() { return Result::NOT_SUPPORTED; }
+Return<Result> StreamOutImpl::stop() {
+ return mStream->stop() ? Result::OK : Result::NOT_SUPPORTED;
+}
Return<void> StreamOutImpl::createMmapBuffer(int32_t minSizeFrames,
createMmapBuffer_cb _hidl_cb) {
- _hidl_cb(Result::NOT_SUPPORTED, MmapBufferInfo());
+ MmapBufferInfo hidlInfo;
+ AidlMmapBufferInfo info = mStream->createMmapBuffer(minSizeFrames);
+ int sharedMemoryFd = info.sharedMemoryFd.get();
+ if (sharedMemoryFd == -1) {
+ _hidl_cb(Result::NOT_SUPPORTED, hidlInfo);
+ return Void();
+ }
+
+ native_handle_t* hidlHandle = nullptr;
+ hidlHandle = native_handle_create(1, 0);
+ hidlHandle->data[0] = sharedMemoryFd;
+
+ hidlInfo.sharedMemory =
+ hidl_memory("audio_proxy_mmap_buffer", hidlHandle,
+ mStream->getFrameSize() * info.bufferSizeFrames);
+ hidlInfo.bufferSizeFrames = info.bufferSizeFrames;
+ hidlInfo.burstSizeFrames = info.burstSizeFrames;
+ hidlInfo.flags = static_cast<hidl_bitfield<MmapBufferFlag>>(info.flags);
+ _hidl_cb(Result::OK, hidlInfo);
return Void();
}
Return<void> StreamOutImpl::getMmapPosition(getMmapPosition_cb _hidl_cb) {
- _hidl_cb(Result::NOT_SUPPORTED, MmapPosition());
+ MmapPosition hidlPosition;
+
+ AidlPresentationPosition position = mStream->getMmapPosition();
+ if (position.timestamp.tvSec == 0 && position.timestamp.tvNSec == 0) {
+ _hidl_cb(Result::NOT_SUPPORTED, hidlPosition);
+ return Void();
+ }
+
+ hidlPosition.timeNanoseconds =
+ position.timestamp.tvSec * kOneSecInNs + position.timestamp.tvNSec;
+ hidlPosition.positionFrames = position.frames;
+ _hidl_cb(Result::OK, hidlPosition);
return Void();
}
@@ -505,6 +536,10 @@ uint64_t StreamOutImpl::estimateTotalPlayedFrames() const {
}
auto [frames, timestamp] = mWriteThread->getPresentationPosition();
+ if (frames == 0) {
+ return 0;
+ }
+
return frames + estimatePlayedFramesSince(timestamp, mConfig.sampleRateHz);
}
diff --git a/audio_proxy/service/StreamOutImpl.h b/audio_proxy/service/StreamOutImpl.h
index 80884d9..c1b557d 100644
--- a/audio_proxy/service/StreamOutImpl.h
+++ b/audio_proxy/service/StreamOutImpl.h
@@ -61,8 +61,7 @@ class StreamOutImpl : public IStreamOut {
#endif
StreamOutImpl(std::shared_ptr<BusOutputStream> stream,
- const StreamOutConfig& config, uint32_t bufferSizeMs,
- uint32_t latencyMs);
+ const StreamOutConfig& config);
~StreamOutImpl() override;
std::shared_ptr<BusOutputStream> getOutputStream();
@@ -171,7 +170,7 @@ class StreamOutImpl : public IStreamOut {
std::shared_ptr<BusOutputStream> mStream;
const StreamOutConfig mConfig;
- const uint32_t mBufferSizeMs;
+ const uint64_t mBufferSizeBytes;
const uint32_t mLatencyMs;
std::unique_ptr<CommandMQ> mCommandMQ;
diff --git a/audio_proxy/service/audio_proxy_policy_configuration.xml b/audio_proxy/service/audio_proxy_policy_configuration.xml
index b44ce98..6fddee2 100644
--- a/audio_proxy/service/audio_proxy_policy_configuration.xml
+++ b/audio_proxy/service/audio_proxy_policy_configuration.xml
@@ -10,22 +10,22 @@
flags="AUDIO_OUTPUT_FLAG_DIRECT" maxOpenCount="0">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="16000 22050 44100 48000 96000"
- channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE AUDIO_CHANNEL_OUT_5POINT1POINT2 AUDIO_CHANNEL_OUT_5POINT1POINT4 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1 AUDIO_CHANNEL_OUT_7POINT1POINT2 AUDIO_CHANNEL_OUT_7POINT1POINT4 AUDIO_CHANNEL_OUT_13POINT_360RA AUDIO_CHANNEL_OUT_22POINT2 AUDIO_CHANNEL_OUT_MONO_HAPTIC_A AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A AUDIO_CHANNEL_OUT_HAPTIC_AB AUDIO_CHANNEL_OUT_MONO_HAPTIC_AB AUDIO_CHANNEL_OUT_STEREO_HAPTIC_AB"/>
+ channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE"/>
<profile name="" format="AUDIO_FORMAT_PCM_8_BIT"
samplingRates="16000 22050 44100 48000 96000"
- channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE AUDIO_CHANNEL_OUT_5POINT1POINT2 AUDIO_CHANNEL_OUT_5POINT1POINT4 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1 AUDIO_CHANNEL_OUT_7POINT1POINT2 AUDIO_CHANNEL_OUT_7POINT1POINT4 AUDIO_CHANNEL_OUT_13POINT_360RA AUDIO_CHANNEL_OUT_22POINT2 AUDIO_CHANNEL_OUT_MONO_HAPTIC_A AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A AUDIO_CHANNEL_OUT_HAPTIC_AB AUDIO_CHANNEL_OUT_MONO_HAPTIC_AB AUDIO_CHANNEL_OUT_STEREO_HAPTIC_AB"/>
+ channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE"/>
<profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
samplingRates="16000 22050 44100 48000 96000"
- channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE AUDIO_CHANNEL_OUT_5POINT1POINT2 AUDIO_CHANNEL_OUT_5POINT1POINT4 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1 AUDIO_CHANNEL_OUT_7POINT1POINT2 AUDIO_CHANNEL_OUT_7POINT1POINT4 AUDIO_CHANNEL_OUT_13POINT_360RA AUDIO_CHANNEL_OUT_22POINT2 AUDIO_CHANNEL_OUT_MONO_HAPTIC_A AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A AUDIO_CHANNEL_OUT_HAPTIC_AB AUDIO_CHANNEL_OUT_MONO_HAPTIC_AB AUDIO_CHANNEL_OUT_STEREO_HAPTIC_AB"/>
+ channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE"/>
<profile name="" format="AUDIO_FORMAT_PCM_8_24_BIT"
samplingRates="16000 22050 44100 48000 96000"
- channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE AUDIO_CHANNEL_OUT_5POINT1POINT2 AUDIO_CHANNEL_OUT_5POINT1POINT4 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1 AUDIO_CHANNEL_OUT_7POINT1POINT2 AUDIO_CHANNEL_OUT_7POINT1POINT4 AUDIO_CHANNEL_OUT_13POINT_360RA AUDIO_CHANNEL_OUT_22POINT2 AUDIO_CHANNEL_OUT_MONO_HAPTIC_A AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A AUDIO_CHANNEL_OUT_HAPTIC_AB AUDIO_CHANNEL_OUT_MONO_HAPTIC_AB AUDIO_CHANNEL_OUT_STEREO_HAPTIC_AB"/>
+ channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE"/>
<profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
samplingRates="16000 22050 44100 48000 96000"
- channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE AUDIO_CHANNEL_OUT_5POINT1POINT2 AUDIO_CHANNEL_OUT_5POINT1POINT4 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1 AUDIO_CHANNEL_OUT_7POINT1POINT2 AUDIO_CHANNEL_OUT_7POINT1POINT4 AUDIO_CHANNEL_OUT_13POINT_360RA AUDIO_CHANNEL_OUT_22POINT2 AUDIO_CHANNEL_OUT_MONO_HAPTIC_A AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A AUDIO_CHANNEL_OUT_HAPTIC_AB AUDIO_CHANNEL_OUT_MONO_HAPTIC_AB AUDIO_CHANNEL_OUT_STEREO_HAPTIC_AB"/>
+ channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE"/>
<profile name="" format="AUDIO_FORMAT_PCM_24_BIT_PACKED"
samplingRates="16000 22050 44100 48000 96000"
- channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE AUDIO_CHANNEL_OUT_5POINT1POINT2 AUDIO_CHANNEL_OUT_5POINT1POINT4 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1 AUDIO_CHANNEL_OUT_7POINT1POINT2 AUDIO_CHANNEL_OUT_7POINT1POINT4 AUDIO_CHANNEL_OUT_13POINT_360RA AUDIO_CHANNEL_OUT_22POINT2 AUDIO_CHANNEL_OUT_MONO_HAPTIC_A AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A AUDIO_CHANNEL_OUT_HAPTIC_AB AUDIO_CHANNEL_OUT_MONO_HAPTIC_AB AUDIO_CHANNEL_OUT_STEREO_HAPTIC_AB"/>
+ channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE"/>
</mixPort>
<mixPort name="mixer_mix_port" role="source">
diff --git a/audio_proxy/service/audio_proxy_policy_configuration_hw_av_sync.xml b/audio_proxy/service/audio_proxy_policy_configuration_hw_av_sync.xml
index e73a6e7..b86a897 100644
--- a/audio_proxy/service/audio_proxy_policy_configuration_hw_av_sync.xml
+++ b/audio_proxy/service/audio_proxy_policy_configuration_hw_av_sync.xml
@@ -9,45 +9,52 @@
<mixPort name="direct_mix_port" role="source"
flags="AUDIO_OUTPUT_FLAG_DIRECT" maxOpenCount="0">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
- samplingRates="16000 22050 44100 48000 96000"
- channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE AUDIO_CHANNEL_OUT_5POINT1POINT2 AUDIO_CHANNEL_OUT_5POINT1POINT4 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1 AUDIO_CHANNEL_OUT_7POINT1POINT2 AUDIO_CHANNEL_OUT_7POINT1POINT4 AUDIO_CHANNEL_OUT_13POINT_360RA AUDIO_CHANNEL_OUT_22POINT2 AUDIO_CHANNEL_OUT_MONO_HAPTIC_A AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A AUDIO_CHANNEL_OUT_HAPTIC_AB AUDIO_CHANNEL_OUT_MONO_HAPTIC_AB AUDIO_CHANNEL_OUT_STEREO_HAPTIC_AB"/>
+ samplingRates="16000 22050 24000 32000 44100 48000 96000"
+ channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE"/>
<profile name="" format="AUDIO_FORMAT_PCM_8_BIT"
- samplingRates="16000 22050 44100 48000 96000"
- channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE AUDIO_CHANNEL_OUT_5POINT1POINT2 AUDIO_CHANNEL_OUT_5POINT1POINT4 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1 AUDIO_CHANNEL_OUT_7POINT1POINT2 AUDIO_CHANNEL_OUT_7POINT1POINT4 AUDIO_CHANNEL_OUT_13POINT_360RA AUDIO_CHANNEL_OUT_22POINT2 AUDIO_CHANNEL_OUT_MONO_HAPTIC_A AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A AUDIO_CHANNEL_OUT_HAPTIC_AB AUDIO_CHANNEL_OUT_MONO_HAPTIC_AB AUDIO_CHANNEL_OUT_STEREO_HAPTIC_AB"/>
+ samplingRates="16000 22050 24000 32000 44100 48000 96000"
+ channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE"/>
<profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
- samplingRates="16000 22050 44100 48000 96000"
- channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE AUDIO_CHANNEL_OUT_5POINT1POINT2 AUDIO_CHANNEL_OUT_5POINT1POINT4 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1 AUDIO_CHANNEL_OUT_7POINT1POINT2 AUDIO_CHANNEL_OUT_7POINT1POINT4 AUDIO_CHANNEL_OUT_13POINT_360RA AUDIO_CHANNEL_OUT_22POINT2 AUDIO_CHANNEL_OUT_MONO_HAPTIC_A AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A AUDIO_CHANNEL_OUT_HAPTIC_AB AUDIO_CHANNEL_OUT_MONO_HAPTIC_AB AUDIO_CHANNEL_OUT_STEREO_HAPTIC_AB"/>
+ samplingRates="16000 22050 24000 32000 44100 48000 96000"
+ channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE"/>
<profile name="" format="AUDIO_FORMAT_PCM_8_24_BIT"
- samplingRates="16000 22050 44100 48000 96000"
- channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE AUDIO_CHANNEL_OUT_5POINT1POINT2 AUDIO_CHANNEL_OUT_5POINT1POINT4 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1 AUDIO_CHANNEL_OUT_7POINT1POINT2 AUDIO_CHANNEL_OUT_7POINT1POINT4 AUDIO_CHANNEL_OUT_13POINT_360RA AUDIO_CHANNEL_OUT_22POINT2 AUDIO_CHANNEL_OUT_MONO_HAPTIC_A AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A AUDIO_CHANNEL_OUT_HAPTIC_AB AUDIO_CHANNEL_OUT_MONO_HAPTIC_AB AUDIO_CHANNEL_OUT_STEREO_HAPTIC_AB"/>
+ samplingRates="16000 22050 24000 32000 44100 48000 96000"
+ channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE"/>
<profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
- samplingRates="16000 22050 44100 48000 96000"
- channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE AUDIO_CHANNEL_OUT_5POINT1POINT2 AUDIO_CHANNEL_OUT_5POINT1POINT4 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1 AUDIO_CHANNEL_OUT_7POINT1POINT2 AUDIO_CHANNEL_OUT_7POINT1POINT4 AUDIO_CHANNEL_OUT_13POINT_360RA AUDIO_CHANNEL_OUT_22POINT2 AUDIO_CHANNEL_OUT_MONO_HAPTIC_A AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A AUDIO_CHANNEL_OUT_HAPTIC_AB AUDIO_CHANNEL_OUT_MONO_HAPTIC_AB AUDIO_CHANNEL_OUT_STEREO_HAPTIC_AB"/>
+ samplingRates="16000 22050 24000 32000 44100 48000 96000"
+ channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE"/>
<profile name="" format="AUDIO_FORMAT_PCM_24_BIT_PACKED"
- samplingRates="16000 22050 44100 48000 96000"
- channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE AUDIO_CHANNEL_OUT_5POINT1POINT2 AUDIO_CHANNEL_OUT_5POINT1POINT4 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1 AUDIO_CHANNEL_OUT_7POINT1POINT2 AUDIO_CHANNEL_OUT_7POINT1POINT4 AUDIO_CHANNEL_OUT_13POINT_360RA AUDIO_CHANNEL_OUT_22POINT2 AUDIO_CHANNEL_OUT_MONO_HAPTIC_A AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A AUDIO_CHANNEL_OUT_HAPTIC_AB AUDIO_CHANNEL_OUT_MONO_HAPTIC_AB AUDIO_CHANNEL_OUT_STEREO_HAPTIC_AB"/>
+ samplingRates="16000 22050 24000 32000 44100 48000 96000"
+ channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE"/>
</mixPort>
<mixPort name="tunneling_mix_port" role="source"
flags="AUDIO_OUTPUT_FLAG_DIRECT AUDIO_OUTPUT_FLAG_HW_AV_SYNC" maxOpenCount="0">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
- samplingRates="16000 22050 44100 48000 96000"
- channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE AUDIO_CHANNEL_OUT_5POINT1POINT2 AUDIO_CHANNEL_OUT_5POINT1POINT4 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1 AUDIO_CHANNEL_OUT_7POINT1POINT2 AUDIO_CHANNEL_OUT_7POINT1POINT4 AUDIO_CHANNEL_OUT_13POINT_360RA AUDIO_CHANNEL_OUT_22POINT2 AUDIO_CHANNEL_OUT_MONO_HAPTIC_A AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A AUDIO_CHANNEL_OUT_HAPTIC_AB AUDIO_CHANNEL_OUT_MONO_HAPTIC_AB AUDIO_CHANNEL_OUT_STEREO_HAPTIC_AB"/>
+ samplingRates="16000 22050 24000 32000 44100 48000 96000"
+ channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE"/>
<profile name="" format="AUDIO_FORMAT_PCM_8_BIT"
- samplingRates="16000 22050 44100 48000 96000"
- channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE AUDIO_CHANNEL_OUT_5POINT1POINT2 AUDIO_CHANNEL_OUT_5POINT1POINT4 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1 AUDIO_CHANNEL_OUT_7POINT1POINT2 AUDIO_CHANNEL_OUT_7POINT1POINT4 AUDIO_CHANNEL_OUT_13POINT_360RA AUDIO_CHANNEL_OUT_22POINT2 AUDIO_CHANNEL_OUT_MONO_HAPTIC_A AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A AUDIO_CHANNEL_OUT_HAPTIC_AB AUDIO_CHANNEL_OUT_MONO_HAPTIC_AB AUDIO_CHANNEL_OUT_STEREO_HAPTIC_AB"/>
+ samplingRates="16000 22050 24000 32000 44100 48000 96000"
+ channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE"/>
<profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
- samplingRates="16000 22050 44100 48000 96000"
- channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE AUDIO_CHANNEL_OUT_5POINT1POINT2 AUDIO_CHANNEL_OUT_5POINT1POINT4 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1 AUDIO_CHANNEL_OUT_7POINT1POINT2 AUDIO_CHANNEL_OUT_7POINT1POINT4 AUDIO_CHANNEL_OUT_13POINT_360RA AUDIO_CHANNEL_OUT_22POINT2 AUDIO_CHANNEL_OUT_MONO_HAPTIC_A AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A AUDIO_CHANNEL_OUT_HAPTIC_AB AUDIO_CHANNEL_OUT_MONO_HAPTIC_AB AUDIO_CHANNEL_OUT_STEREO_HAPTIC_AB"/>
+ samplingRates="16000 22050 24000 32000 44100 48000 96000"
+ channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE"/>
<profile name="" format="AUDIO_FORMAT_PCM_8_24_BIT"
- samplingRates="16000 22050 44100 48000 96000"
- channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE AUDIO_CHANNEL_OUT_5POINT1POINT2 AUDIO_CHANNEL_OUT_5POINT1POINT4 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1 AUDIO_CHANNEL_OUT_7POINT1POINT2 AUDIO_CHANNEL_OUT_7POINT1POINT4 AUDIO_CHANNEL_OUT_13POINT_360RA AUDIO_CHANNEL_OUT_22POINT2 AUDIO_CHANNEL_OUT_MONO_HAPTIC_A AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A AUDIO_CHANNEL_OUT_HAPTIC_AB AUDIO_CHANNEL_OUT_MONO_HAPTIC_AB AUDIO_CHANNEL_OUT_STEREO_HAPTIC_AB"/>
+ samplingRates="16000 22050 24000 32000 44100 48000 96000"
+ channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE"/>
<profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
- samplingRates="16000 22050 44100 48000 96000"
- channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE AUDIO_CHANNEL_OUT_5POINT1POINT2 AUDIO_CHANNEL_OUT_5POINT1POINT4 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1 AUDIO_CHANNEL_OUT_7POINT1POINT2 AUDIO_CHANNEL_OUT_7POINT1POINT4 AUDIO_CHANNEL_OUT_13POINT_360RA AUDIO_CHANNEL_OUT_22POINT2 AUDIO_CHANNEL_OUT_MONO_HAPTIC_A AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A AUDIO_CHANNEL_OUT_HAPTIC_AB AUDIO_CHANNEL_OUT_MONO_HAPTIC_AB AUDIO_CHANNEL_OUT_STEREO_HAPTIC_AB"/>
+ samplingRates="16000 22050 24000 32000 44100 48000 96000"
+ channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE"/>
<profile name="" format="AUDIO_FORMAT_PCM_24_BIT_PACKED"
- samplingRates="16000 22050 44100 48000 96000"
- channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE AUDIO_CHANNEL_OUT_5POINT1POINT2 AUDIO_CHANNEL_OUT_5POINT1POINT4 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1 AUDIO_CHANNEL_OUT_7POINT1POINT2 AUDIO_CHANNEL_OUT_7POINT1POINT4 AUDIO_CHANNEL_OUT_13POINT_360RA AUDIO_CHANNEL_OUT_22POINT2 AUDIO_CHANNEL_OUT_MONO_HAPTIC_A AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A AUDIO_CHANNEL_OUT_HAPTIC_AB AUDIO_CHANNEL_OUT_MONO_HAPTIC_AB AUDIO_CHANNEL_OUT_STEREO_HAPTIC_AB"/>
+ samplingRates="16000 22050 24000 32000 44100 48000 96000"
+ channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_TRI AUDIO_CHANNEL_OUT_TRI_BACK AUDIO_CHANNEL_OUT_3POINT1 AUDIO_CHANNEL_OUT_2POINT0POINT2 AUDIO_CHANNEL_OUT_2POINT1POINT2 AUDIO_CHANNEL_OUT_3POINT0POINT2 AUDIO_CHANNEL_OUT_3POINT1POINT2 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_QUAD_BACK AUDIO_CHANNEL_OUT_QUAD_SIDE AUDIO_CHANNEL_OUT_SURROUND AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_5POINT1_BACK AUDIO_CHANNEL_OUT_5POINT1_SIDE"/>
+ </mixPort>
+
+ <mixPort name="mmap_noirq_mix_port" role="source"
+ flags="AUDIO_OUTPUT_FLAG_DIRECT AUDIO_OUTPUT_FLAG_MMAP_NOIRQ" maxOpenCount="0">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="16000 22050 24000 32000 44100 48000 96000"
+ channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO"/>
</mixPort>
<mixPort name="mixer_mix_port" role="source">
@@ -71,7 +78,7 @@
<routes>
<route type="mix" sink="MediaShell Direct Audio Device"
- sources="direct_mix_port,tunneling_mix_port"/>
+ sources="direct_mix_port,tunneling_mix_port,mmap_noirq_mix_port"/>
<route type="mix" sink="MediaShell Mixer Audio Device"
sources="mixer_mix_port"/>
diff --git a/audio_proxy/service/device.google.atv.audio_proxy@5.1-service.rc b/audio_proxy/service/device.google.atv.audio_proxy@5.1-service.rc
index 5ce6140..3b1d713 100644
--- a/audio_proxy/service/device.google.atv.audio_proxy@5.1-service.rc
+++ b/audio_proxy/service/device.google.atv.audio_proxy@5.1-service.rc
@@ -1,6 +1,6 @@
service audio_proxy_service /vendor/bin/hw/device.google.atv.audio_proxy@5.1-service \
--name mediashell \
- --stream MEDIASHELL_AUDIO_DEVICE_ADDR:40:200 \
+ --stream MEDIASHELL_AUDIO_DEVICE_ADDR:40:600 \
--stream MEDIASHELL_MIXER_DEVICE_ADDR:40:40
class hal
user system
diff --git a/audio_proxy/service/device.google.atv.audio_proxy@6.0-service.rc b/audio_proxy/service/device.google.atv.audio_proxy@6.0-service.rc
index e0a9371..fa6ed77 100644
--- a/audio_proxy/service/device.google.atv.audio_proxy@6.0-service.rc
+++ b/audio_proxy/service/device.google.atv.audio_proxy@6.0-service.rc
@@ -1,6 +1,6 @@
service audio_proxy_service /vendor/bin/hw/device.google.atv.audio_proxy@6.0-service \
--name mediashell \
- --stream MEDIASHELL_AUDIO_DEVICE_ADDR:40:200 \
+ --stream MEDIASHELL_AUDIO_DEVICE_ADDR:40:600 \
--stream MEDIASHELL_MIXER_DEVICE_ADDR:40:40
class hal
user system
diff --git a/audio_proxy/service/device.google.atv.audio_proxy@7.0-service.rc b/audio_proxy/service/device.google.atv.audio_proxy@7.0-service.rc
index d8d2298..e8477fb 100644
--- a/audio_proxy/service/device.google.atv.audio_proxy@7.0-service.rc
+++ b/audio_proxy/service/device.google.atv.audio_proxy@7.0-service.rc
@@ -1,6 +1,6 @@
service audio_proxy_service /vendor/bin/hw/device.google.atv.audio_proxy@7.0-service \
--name mediashell \
- --stream MEDIASHELL_AUDIO_DEVICE_ADDR:40:200 \
+ --stream MEDIASHELL_AUDIO_DEVICE_ADDR:40:600 \
--stream MEDIASHELL_MIXER_DEVICE_ADDR:40:40
class hal
user system
diff --git a/audio_proxy/service/device.google.atv.audio_proxy@7.1-service.rc b/audio_proxy/service/device.google.atv.audio_proxy@7.1-service.rc
index 6490f71..37cab1e 100644
--- a/audio_proxy/service/device.google.atv.audio_proxy@7.1-service.rc
+++ b/audio_proxy/service/device.google.atv.audio_proxy@7.1-service.rc
@@ -1,6 +1,6 @@
service audio_proxy_service /vendor/bin/hw/device.google.atv.audio_proxy@7.1-service \
--name mediashell \
- --stream MEDIASHELL_AUDIO_DEVICE_ADDR:40:200 \
+ --stream MEDIASHELL_AUDIO_DEVICE_ADDR:40:600 \
--stream MEDIASHELL_MIXER_DEVICE_ADDR:40:40
class hal
user system
diff --git a/audio_proxy/service/manifest_audio_proxy_5_0.xml b/audio_proxy/service/manifest_audio_proxy_5_0.xml
index 51d3292..176b388 100644
--- a/audio_proxy/service/manifest_audio_proxy_5_0.xml
+++ b/audio_proxy/service/manifest_audio_proxy_5_0.xml
@@ -1,7 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>device.google.atv.audio_proxy</name>
- <version>1</version>
+ <version>3</version>
<fqname>IAudioProxy/mediashell</fqname>
</hal>
diff --git a/audio_proxy/service/manifest_audio_proxy_6_0.xml b/audio_proxy/service/manifest_audio_proxy_6_0.xml
index 0d4009a..fdb5eb1 100644
--- a/audio_proxy/service/manifest_audio_proxy_6_0.xml
+++ b/audio_proxy/service/manifest_audio_proxy_6_0.xml
@@ -1,7 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>device.google.atv.audio_proxy</name>
- <version>1</version>
+ <version>3</version>
<fqname>IAudioProxy/mediashell</fqname>
</hal>
diff --git a/audio_proxy/service/manifest_audio_proxy_7_0.xml b/audio_proxy/service/manifest_audio_proxy_7_0.xml
index 26f1cd9..3adb4b5 100644
--- a/audio_proxy/service/manifest_audio_proxy_7_0.xml
+++ b/audio_proxy/service/manifest_audio_proxy_7_0.xml
@@ -1,7 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>device.google.atv.audio_proxy</name>
- <version>1</version>
+ <version>3</version>
<fqname>IAudioProxy/mediashell</fqname>
</hal>
diff --git a/audio_proxy/service/manifest_audio_proxy_7_1.xml b/audio_proxy/service/manifest_audio_proxy_7_1.xml
index 1b3bc8b..51b93d6 100644
--- a/audio_proxy/service/manifest_audio_proxy_7_1.xml
+++ b/audio_proxy/service/manifest_audio_proxy_7_1.xml
@@ -1,7 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>device.google.atv.audio_proxy</name>
- <version>1</version>
+ <version>3</version>
<fqname>IAudioProxy/mediashell</fqname>
</hal>