Compare commits
10 Commits
aba85b01e9
...
0e394c2a52
Author | SHA1 | Date | |
---|---|---|---|
|
0e394c2a52 | ||
|
44a27db6b3 | ||
|
5b706b31ef | ||
|
a9faf20d1c | ||
|
ad517c5c3a | ||
|
2e5b5934bc | ||
|
32dadb8ceb | ||
|
ab37bd8d7e | ||
|
f2476ca180 | ||
|
53203f3747 |
@@ -5,6 +5,11 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
soong_namespace {
|
soong_namespace {
|
||||||
|
imports: [
|
||||||
|
"hardware/google/interfaces",
|
||||||
|
"hardware/google/pixel",
|
||||||
|
"hardware/qcom-caf/common/libqti-perfd-client",
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
install_symlink {
|
install_symlink {
|
||||||
|
@@ -124,8 +124,10 @@ TARGET_KERNEL_EXT_MODULES := \
|
|||||||
qcom/opensource/mm-drivers/sync_fence \
|
qcom/opensource/mm-drivers/sync_fence \
|
||||||
qcom/opensource/securemsm-kernel \
|
qcom/opensource/securemsm-kernel \
|
||||||
qcom/opensource/audio-kernel \
|
qcom/opensource/audio-kernel \
|
||||||
qcom/opensource/dataipa/drivers/platform/msm \
|
qcom/opensource/synx-kernel \
|
||||||
|
qcom/opensource/camera-kernel \
|
||||||
qcom/opensource/datarmnet-ext/mem \
|
qcom/opensource/datarmnet-ext/mem \
|
||||||
|
qcom/opensource/dataipa/drivers/platform/msm \
|
||||||
qcom/opensource/datarmnet/core \
|
qcom/opensource/datarmnet/core \
|
||||||
qcom/opensource/datarmnet-ext/aps \
|
qcom/opensource/datarmnet-ext/aps \
|
||||||
qcom/opensource/datarmnet-ext/offload \
|
qcom/opensource/datarmnet-ext/offload \
|
||||||
@@ -135,7 +137,6 @@ TARGET_KERNEL_EXT_MODULES := \
|
|||||||
qcom/opensource/datarmnet-ext/sch \
|
qcom/opensource/datarmnet-ext/sch \
|
||||||
qcom/opensource/datarmnet-ext/wlan \
|
qcom/opensource/datarmnet-ext/wlan \
|
||||||
qcom/opensource/display-drivers/msm \
|
qcom/opensource/display-drivers/msm \
|
||||||
qcom/opensource/synx-kernel \
|
|
||||||
qcom/opensource/dsp-kernel \
|
qcom/opensource/dsp-kernel \
|
||||||
qcom/opensource/eva-kernel \
|
qcom/opensource/eva-kernel \
|
||||||
qcom/opensource/video-driver \
|
qcom/opensource/video-driver \
|
||||||
@@ -146,7 +147,6 @@ TARGET_KERNEL_EXT_MODULES := \
|
|||||||
qcom/opensource/spu-kernel \
|
qcom/opensource/spu-kernel \
|
||||||
qcom/opensource/mm-sys-kernel/ubwcp \
|
qcom/opensource/mm-sys-kernel/ubwcp \
|
||||||
qcom/opensource/touch-drivers \
|
qcom/opensource/touch-drivers \
|
||||||
qcom/opensource/camera-kernel \
|
|
||||||
nxp/opensource/driver
|
nxp/opensource/driver
|
||||||
|
|
||||||
# Metadata
|
# Metadata
|
||||||
@@ -197,14 +197,10 @@ BOARD_USES_QCOM_HARDWARE := true
|
|||||||
TARGET_BOARD_PLATFORM := pineapple
|
TARGET_BOARD_PLATFORM := pineapple
|
||||||
|
|
||||||
# Properties
|
# Properties
|
||||||
TARGET_SYSTEM_PROP += $(DEVICE_PATH)/system.prop
|
|
||||||
TARGET_VENDOR_PROP += $(DEVICE_PATH)/vendor.prop
|
TARGET_VENDOR_PROP += $(DEVICE_PATH)/vendor.prop
|
||||||
TARGET_PRODUCT_PROP += $(DEVICE_PATH)/product.prop
|
TARGET_PRODUCT_PROP += $(DEVICE_PATH)/product.prop
|
||||||
TARGET_SYSTEM_EXT_PROP += $(DEVICE_PATH)/system_ext.prop
|
TARGET_SYSTEM_EXT_PROP += $(DEVICE_PATH)/system_ext.prop
|
||||||
TARGET_SYSTEM_DLKM_PROP += $(DEVICE_PATH)/system_dlkm.prop
|
|
||||||
TARGET_ODM_PROP += $(DEVICE_PATH)/odm.prop
|
TARGET_ODM_PROP += $(DEVICE_PATH)/odm.prop
|
||||||
TARGET_ODM_DLKM_PROP += $(DEVICE_PATH)/odm_dlkm.prop
|
|
||||||
TARGET_VENDOR_DLKM_PROP += $(DEVICE_PATH)/vendor_dlkm.prop
|
|
||||||
|
|
||||||
# RIL
|
# RIL
|
||||||
ENABLE_VENDOR_RIL_SERVICE := true
|
ENABLE_VENDOR_RIL_SERVICE := true
|
||||||
@@ -266,8 +262,8 @@ DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := \
|
|||||||
vendor/lineage/config/device_framework_matrix.xml
|
vendor/lineage/config/device_framework_matrix.xml
|
||||||
DEVICE_MATRIX_FILE := hardware/qcom-caf/common/compatibility_matrix.xml
|
DEVICE_MATRIX_FILE := hardware/qcom-caf/common/compatibility_matrix.xml
|
||||||
DEVICE_MANIFEST_FILE := \
|
DEVICE_MANIFEST_FILE := \
|
||||||
hardware/qcom-caf/sm8550/audio/primary-hal/configs/common/manifest_non_qmaa.xml \
|
hardware/qcom-caf/sm8650/audio/primary-hal/configs/common/manifest_non_qmaa.xml \
|
||||||
hardware/qcom-caf/sm8550/audio/primary-hal/configs/common/manifest_non_qmaa_extn.xml \
|
hardware/qcom-caf/sm8650/audio/primary-hal/configs/common/manifest_non_qmaa_extn.xml \
|
||||||
$(DEVICE_PATH)/configs/vintf/manifest.xml \
|
$(DEVICE_PATH)/configs/vintf/manifest.xml \
|
||||||
$(DEVICE_PATH)/configs/vintf/manifest_pineapple.xml \
|
$(DEVICE_PATH)/configs/vintf/manifest_pineapple.xml \
|
||||||
|
|
||||||
|
170
audio/impl/Android.bp
Normal file
170
audio/impl/Android.bp
Normal file
@@ -0,0 +1,170 @@
|
|||||||
|
filegroup {
|
||||||
|
name: "android.hardware.audio-impl_samsung-sm8650_srcs",
|
||||||
|
srcs: [
|
||||||
|
"Device.cpp",
|
||||||
|
"DevicesFactory.cpp",
|
||||||
|
"ParametersUtil.cpp",
|
||||||
|
"PrimaryDevice.cpp",
|
||||||
|
"Stream.cpp",
|
||||||
|
"StreamIn.cpp",
|
||||||
|
"StreamOut.cpp",
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_library_headers {
|
||||||
|
name: "android.hardware.audio-impl_samsung-sm8650_headers",
|
||||||
|
proprietary: true,
|
||||||
|
vendor: true,
|
||||||
|
export_include_dirs: ["include"],
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_defaults {
|
||||||
|
name: "android.hardware.audio-impl_samsung-sm8650",
|
||||||
|
relative_install_path: "hw",
|
||||||
|
proprietary: true,
|
||||||
|
vendor: true,
|
||||||
|
srcs: [":android.hardware.audio-impl_samsung-sm8650_srcs"],
|
||||||
|
|
||||||
|
defaults: ["hidl_defaults"],
|
||||||
|
|
||||||
|
static_libs: [
|
||||||
|
"libaudiofoundation",
|
||||||
|
],
|
||||||
|
|
||||||
|
shared_libs: [
|
||||||
|
"libbase",
|
||||||
|
"libcutils",
|
||||||
|
"libfmq",
|
||||||
|
"libhardware",
|
||||||
|
"libhidlbase",
|
||||||
|
"liblog",
|
||||||
|
"libmedia_helper",
|
||||||
|
"libmediautils_vendor",
|
||||||
|
"libmemunreachable",
|
||||||
|
"libutils",
|
||||||
|
"android.hardware.audio.common-util",
|
||||||
|
],
|
||||||
|
|
||||||
|
header_libs: [
|
||||||
|
"android.hardware.audio-impl_samsung-sm8650_headers",
|
||||||
|
"android.hardware.audio.common.util@all-versions",
|
||||||
|
"libaudioutils_headers",
|
||||||
|
"libaudio_system_headers",
|
||||||
|
"libhardware_headers",
|
||||||
|
"libmedia_headers",
|
||||||
|
"libmediautils_headers",
|
||||||
|
],
|
||||||
|
|
||||||
|
export_header_lib_headers: [
|
||||||
|
"android.hardware.audio-impl_samsung-sm8650_headers",
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_library_shared {
|
||||||
|
name: "android.hardware.audio@2.0-impl.samsung-sm8650",
|
||||||
|
defaults: ["android.hardware.audio-impl_samsung-sm8650"],
|
||||||
|
shared_libs: [
|
||||||
|
"android.hardware.audio@2.0",
|
||||||
|
"android.hardware.audio@2.0-util",
|
||||||
|
"android.hardware.audio.common@2.0",
|
||||||
|
"android.hardware.audio.common@2.0-util",
|
||||||
|
"libcutils",
|
||||||
|
],
|
||||||
|
cflags: [
|
||||||
|
"-DMAJOR_VERSION=2",
|
||||||
|
"-DMINOR_VERSION=0",
|
||||||
|
"-include common/all-versions/VersionMacro.h",
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_library_shared {
|
||||||
|
name: "android.hardware.audio@4.0-impl.samsung-sm8650",
|
||||||
|
defaults: ["android.hardware.audio-impl_samsung-sm8650"],
|
||||||
|
|
||||||
|
shared_libs: [
|
||||||
|
"android.hardware.audio@4.0",
|
||||||
|
"android.hardware.audio@4.0-util",
|
||||||
|
"android.hardware.audio.common@4.0",
|
||||||
|
"android.hardware.audio.common@4.0-util",
|
||||||
|
"libcutils",
|
||||||
|
],
|
||||||
|
cflags: [
|
||||||
|
"-DMAJOR_VERSION=4",
|
||||||
|
"-DMINOR_VERSION=0",
|
||||||
|
"-include common/all-versions/VersionMacro.h",
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_library_shared {
|
||||||
|
name: "android.hardware.audio@5.0-impl.samsung-sm8650",
|
||||||
|
defaults: ["android.hardware.audio-impl_samsung-sm8650"],
|
||||||
|
shared_libs: [
|
||||||
|
"android.hardware.audio@5.0",
|
||||||
|
"android.hardware.audio@5.0-util",
|
||||||
|
"android.hardware.audio.common@5.0",
|
||||||
|
"android.hardware.audio.common@5.0-util",
|
||||||
|
"libcutils",
|
||||||
|
],
|
||||||
|
cflags: [
|
||||||
|
"-DMAJOR_VERSION=5",
|
||||||
|
"-DMINOR_VERSION=0",
|
||||||
|
"-include common/all-versions/VersionMacro.h",
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_library_shared {
|
||||||
|
name: "android.hardware.audio@6.0-impl.samsung-sm8650",
|
||||||
|
defaults: ["android.hardware.audio-impl_samsung-sm8650"],
|
||||||
|
shared_libs: [
|
||||||
|
"android.hardware.audio@6.0",
|
||||||
|
"android.hardware.audio@6.0-util",
|
||||||
|
"android.hardware.audio.common@6.0",
|
||||||
|
"android.hardware.audio.common@6.0-util",
|
||||||
|
"libcutils",
|
||||||
|
],
|
||||||
|
cflags: [
|
||||||
|
"-DMAJOR_VERSION=6",
|
||||||
|
"-DMINOR_VERSION=0",
|
||||||
|
"-include common/all-versions/VersionMacro.h",
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_library_shared {
|
||||||
|
name: "android.hardware.audio@7.0-impl.samsung-sm8650",
|
||||||
|
defaults: ["android.hardware.audio-impl_samsung-sm8650"],
|
||||||
|
shared_libs: [
|
||||||
|
"android.hardware.audio@7.0",
|
||||||
|
"android.hardware.audio@7.0-util",
|
||||||
|
"android.hardware.audio.common@7.0",
|
||||||
|
"android.hardware.audio.common@7.0-enums",
|
||||||
|
"android.hardware.audio.common@7.0-util",
|
||||||
|
"libbase",
|
||||||
|
"libcutils",
|
||||||
|
],
|
||||||
|
cflags: [
|
||||||
|
"-DMAJOR_VERSION=7",
|
||||||
|
"-DMINOR_VERSION=0",
|
||||||
|
"-include common/all-versions/VersionMacro.h",
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_library_shared {
|
||||||
|
name: "android.hardware.audio@7.1-impl.samsung-sm8650",
|
||||||
|
defaults: ["android.hardware.audio-impl_samsung-sm8650"],
|
||||||
|
shared_libs: [
|
||||||
|
"android.hardware.audio@7.0",
|
||||||
|
"android.hardware.audio@7.1",
|
||||||
|
"android.hardware.audio@7.1-util",
|
||||||
|
"android.hardware.audio.common@7.0",
|
||||||
|
"android.hardware.audio.common@7.1-enums",
|
||||||
|
"android.hardware.audio.common@7.1-util",
|
||||||
|
"libbase",
|
||||||
|
],
|
||||||
|
cflags: [
|
||||||
|
"-DMAJOR_VERSION=7",
|
||||||
|
"-DMINOR_VERSION=1",
|
||||||
|
"-DCOMMON_TYPES_MINOR_VERSION=0",
|
||||||
|
"-DCORE_TYPES_MINOR_VERSION=0",
|
||||||
|
"-include common/all-versions/VersionMacro.h",
|
||||||
|
],
|
||||||
|
}
|
635
audio/impl/Device.cpp
Normal file
635
audio/impl/Device.cpp
Normal file
@@ -0,0 +1,635 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define LOG_TAG "DeviceHAL"
|
||||||
|
|
||||||
|
#include "core/default/Device.h"
|
||||||
|
#include "common/all-versions/default/EffectMap.h"
|
||||||
|
#include "core/default/StreamIn.h"
|
||||||
|
#include "core/default/StreamOut.h"
|
||||||
|
#include "core/default/Util.h"
|
||||||
|
|
||||||
|
//#define LOG_NDEBUG 0
|
||||||
|
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <memory.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include <android/log.h>
|
||||||
|
#include <hidl/HidlTransportSupport.h>
|
||||||
|
#include <mediautils/MemoryLeakTrackUtil.h>
|
||||||
|
#include <memunreachable/memunreachable.h>
|
||||||
|
|
||||||
|
#include <HidlUtils.h>
|
||||||
|
|
||||||
|
namespace android {
|
||||||
|
namespace hardware {
|
||||||
|
namespace audio {
|
||||||
|
namespace CPP_VERSION {
|
||||||
|
namespace implementation {
|
||||||
|
|
||||||
|
using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::implementation::HidlUtils;
|
||||||
|
namespace util {
|
||||||
|
using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION::implementation::util;
|
||||||
|
}
|
||||||
|
|
||||||
|
Device::Device(audio_hw_device_t* device) : mIsClosed(false), mDevice(device) {}
|
||||||
|
|
||||||
|
Device::~Device() {
|
||||||
|
(void)doClose();
|
||||||
|
mDevice = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
Result Device::analyzeStatus(const char* funcName, int status,
|
||||||
|
const std::vector<int>& ignoreErrors) {
|
||||||
|
return util::analyzeStatus("Device", funcName, status, ignoreErrors);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Device::closeInputStream(audio_stream_in_t* stream) {
|
||||||
|
mDevice->close_input_stream(mDevice, stream);
|
||||||
|
LOG_ALWAYS_FATAL_IF(mOpenedStreamsCount == 0, "mOpenedStreamsCount is already 0");
|
||||||
|
--mOpenedStreamsCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Device::closeOutputStream(audio_stream_out_t* stream) {
|
||||||
|
mDevice->close_output_stream(mDevice, stream);
|
||||||
|
LOG_ALWAYS_FATAL_IF(mOpenedStreamsCount == 0, "mOpenedStreamsCount is already 0");
|
||||||
|
--mOpenedStreamsCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
char* Device::halGetParameters(const char* keys) {
|
||||||
|
return mDevice->get_parameters(mDevice, keys);
|
||||||
|
}
|
||||||
|
|
||||||
|
int Device::halSetParameters(const char* keysAndValues) {
|
||||||
|
return mDevice->set_parameters(mDevice, keysAndValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Methods from ::android::hardware::audio::CPP_VERSION::IDevice follow.
|
||||||
|
Return<Result> Device::initCheck() {
|
||||||
|
return analyzeStatus("init_check", mDevice->init_check(mDevice));
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> Device::setMasterVolume(float volume) {
|
||||||
|
if (mDevice->set_master_volume == NULL) {
|
||||||
|
return Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
if (!util::isGainNormalized(volume)) {
|
||||||
|
ALOGW("Can not set a master volume (%f) outside [0,1]", volume);
|
||||||
|
return Result::INVALID_ARGUMENTS;
|
||||||
|
}
|
||||||
|
return analyzeStatus("set_master_volume", mDevice->set_master_volume(mDevice, volume),
|
||||||
|
{ENOSYS} /*ignore*/);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> Device::getMasterVolume(getMasterVolume_cb _hidl_cb) {
|
||||||
|
Result retval(Result::NOT_SUPPORTED);
|
||||||
|
float volume = 0;
|
||||||
|
if (mDevice->get_master_volume != NULL) {
|
||||||
|
retval = analyzeStatus("get_master_volume", mDevice->get_master_volume(mDevice, &volume),
|
||||||
|
{ENOSYS} /*ignore*/);
|
||||||
|
}
|
||||||
|
_hidl_cb(retval, volume);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> Device::setMicMute(bool mute) {
|
||||||
|
return analyzeStatus("set_mic_mute", mDevice->set_mic_mute(mDevice, mute), {ENOSYS} /*ignore*/);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> Device::getMicMute(getMicMute_cb _hidl_cb) {
|
||||||
|
bool mute = false;
|
||||||
|
Result retval = analyzeStatus("get_mic_mute", mDevice->get_mic_mute(mDevice, &mute),
|
||||||
|
{ENOSYS} /*ignore*/);
|
||||||
|
_hidl_cb(retval, mute);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> Device::setMasterMute(bool mute) {
|
||||||
|
Result retval(Result::NOT_SUPPORTED);
|
||||||
|
if (mDevice->set_master_mute != NULL) {
|
||||||
|
retval = analyzeStatus("set_master_mute", mDevice->set_master_mute(mDevice, mute),
|
||||||
|
{ENOSYS} /*ignore*/);
|
||||||
|
}
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> Device::getMasterMute(getMasterMute_cb _hidl_cb) {
|
||||||
|
Result retval(Result::NOT_SUPPORTED);
|
||||||
|
bool mute = false;
|
||||||
|
if (mDevice->get_master_mute != NULL) {
|
||||||
|
retval = analyzeStatus("get_master_mute", mDevice->get_master_mute(mDevice, &mute),
|
||||||
|
{ENOSYS} /*ignore*/);
|
||||||
|
}
|
||||||
|
_hidl_cb(retval, mute);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> Device::getInputBufferSize(const AudioConfig& config, getInputBufferSize_cb _hidl_cb) {
|
||||||
|
audio_config_t halConfig;
|
||||||
|
Result retval(Result::INVALID_ARGUMENTS);
|
||||||
|
uint64_t bufferSize = 0;
|
||||||
|
if (HidlUtils::audioConfigToHal(config, &halConfig) == NO_ERROR) {
|
||||||
|
size_t halBufferSize = mDevice->get_input_buffer_size(mDevice, &halConfig);
|
||||||
|
if (halBufferSize != 0) {
|
||||||
|
retval = Result::OK;
|
||||||
|
bufferSize = halBufferSize;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_hidl_cb(retval, bufferSize);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::tuple<Result, sp<IStreamOut>> Device::openOutputStreamCore(int32_t ioHandle,
|
||||||
|
const DeviceAddress& device,
|
||||||
|
const AudioConfig& config,
|
||||||
|
const AudioOutputFlags& flags,
|
||||||
|
AudioConfig* suggestedConfig) {
|
||||||
|
audio_config_t halConfig;
|
||||||
|
if (HidlUtils::audioConfigToHal(config, &halConfig) != NO_ERROR) {
|
||||||
|
return {Result::INVALID_ARGUMENTS, nullptr};
|
||||||
|
}
|
||||||
|
audio_stream_out_t* halStream;
|
||||||
|
audio_devices_t halDevice;
|
||||||
|
char halDeviceAddress[AUDIO_DEVICE_MAX_ADDRESS_LEN];
|
||||||
|
if (CoreUtils::deviceAddressToHal(device, &halDevice, halDeviceAddress) != NO_ERROR) {
|
||||||
|
return {Result::INVALID_ARGUMENTS, nullptr};
|
||||||
|
}
|
||||||
|
audio_output_flags_t halFlags;
|
||||||
|
if (CoreUtils::audioOutputFlagsToHal(flags, &halFlags) != NO_ERROR) {
|
||||||
|
return {Result::INVALID_ARGUMENTS, nullptr};
|
||||||
|
}
|
||||||
|
ALOGV("open_output_stream handle: %d devices: %x flags: %#x "
|
||||||
|
"srate: %d format %#x channels %x address %s",
|
||||||
|
ioHandle, halDevice, halFlags, halConfig.sample_rate, halConfig.format,
|
||||||
|
halConfig.channel_mask, halDeviceAddress);
|
||||||
|
int status = mDevice->open_output_stream(mDevice, ioHandle, halDevice, halFlags, &halConfig,
|
||||||
|
&halStream, halDeviceAddress);
|
||||||
|
ALOGV("open_output_stream status %d stream %p", status, halStream);
|
||||||
|
sp<IStreamOut> streamOut;
|
||||||
|
if (status == OK) {
|
||||||
|
streamOut = new StreamOut(this, halStream);
|
||||||
|
++mOpenedStreamsCount;
|
||||||
|
android::hardware::setMinSchedulerPolicy(streamOut, SCHED_NORMAL, ANDROID_PRIORITY_AUDIO);
|
||||||
|
}
|
||||||
|
status_t convertStatus =
|
||||||
|
HidlUtils::audioConfigFromHal(halConfig, false /*isInput*/, suggestedConfig);
|
||||||
|
ALOGW_IF(convertStatus != OK, "%s: suggested config with incompatible fields", __func__);
|
||||||
|
return {analyzeStatus("open_output_stream", status, {EINVAL} /*ignore*/), streamOut};
|
||||||
|
}
|
||||||
|
|
||||||
|
std::tuple<Result, sp<IStreamIn>> Device::openInputStreamCore(
|
||||||
|
int32_t ioHandle, const DeviceAddress& device, const AudioConfig& config,
|
||||||
|
const AudioInputFlags& flags, AudioSource source, AudioConfig* suggestedConfig) {
|
||||||
|
audio_config_t halConfig;
|
||||||
|
if (HidlUtils::audioConfigToHal(config, &halConfig) != NO_ERROR) {
|
||||||
|
return {Result::INVALID_ARGUMENTS, nullptr};
|
||||||
|
}
|
||||||
|
audio_stream_in_t* halStream;
|
||||||
|
audio_devices_t halDevice;
|
||||||
|
char halDeviceAddress[AUDIO_DEVICE_MAX_ADDRESS_LEN];
|
||||||
|
if (CoreUtils::deviceAddressToHal(device, &halDevice, halDeviceAddress) != NO_ERROR) {
|
||||||
|
return {Result::INVALID_ARGUMENTS, nullptr};
|
||||||
|
}
|
||||||
|
audio_input_flags_t halFlags;
|
||||||
|
audio_source_t halSource;
|
||||||
|
if (CoreUtils::audioInputFlagsToHal(flags, &halFlags) != NO_ERROR ||
|
||||||
|
HidlUtils::audioSourceToHal(source, &halSource) != NO_ERROR) {
|
||||||
|
return {Result::INVALID_ARGUMENTS, nullptr};
|
||||||
|
}
|
||||||
|
ALOGV("open_input_stream handle: %d devices: %x flags: %#x "
|
||||||
|
"srate: %d format %#x channels %x address %s source %d",
|
||||||
|
ioHandle, halDevice, halFlags, halConfig.sample_rate, halConfig.format,
|
||||||
|
halConfig.channel_mask, halDeviceAddress, halSource);
|
||||||
|
int status = mDevice->open_input_stream(mDevice, ioHandle, halDevice, &halConfig, &halStream,
|
||||||
|
halFlags, halDeviceAddress, halSource);
|
||||||
|
ALOGV("open_input_stream status %d stream %p", status, halStream);
|
||||||
|
sp<IStreamIn> streamIn;
|
||||||
|
if (status == OK) {
|
||||||
|
streamIn = new StreamIn(this, halStream);
|
||||||
|
++mOpenedStreamsCount;
|
||||||
|
android::hardware::setMinSchedulerPolicy(streamIn, SCHED_NORMAL, ANDROID_PRIORITY_AUDIO);
|
||||||
|
}
|
||||||
|
status_t convertStatus =
|
||||||
|
HidlUtils::audioConfigFromHal(halConfig, true /*isInput*/, suggestedConfig);
|
||||||
|
ALOGW_IF(convertStatus != OK, "%s: suggested config with incompatible fields", __func__);
|
||||||
|
return {analyzeStatus("open_input_stream", status, {EINVAL} /*ignore*/), streamIn};
|
||||||
|
}
|
||||||
|
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<void> Device::openOutputStream(int32_t ioHandle, const DeviceAddress& device,
|
||||||
|
const AudioConfig& config, AudioOutputFlags flags,
|
||||||
|
openOutputStream_cb _hidl_cb) {
|
||||||
|
AudioConfig suggestedConfig;
|
||||||
|
auto [result, streamOut] =
|
||||||
|
openOutputStreamCore(ioHandle, device, config, flags, &suggestedConfig);
|
||||||
|
_hidl_cb(result, streamOut, suggestedConfig);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> Device::openInputStream(int32_t ioHandle, const DeviceAddress& device,
|
||||||
|
const AudioConfig& config, AudioInputFlags flags,
|
||||||
|
AudioSource source, openInputStream_cb _hidl_cb) {
|
||||||
|
AudioConfig suggestedConfig;
|
||||||
|
auto [result, streamIn] =
|
||||||
|
openInputStreamCore(ioHandle, device, config, flags, source, &suggestedConfig);
|
||||||
|
_hidl_cb(result, streamIn, suggestedConfig);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
#elif MAJOR_VERSION >= 4
|
||||||
|
std::tuple<Result, sp<IStreamOut>, AudioConfig> Device::openOutputStreamImpl(
|
||||||
|
int32_t ioHandle, const DeviceAddress& device, const AudioConfig& config,
|
||||||
|
const SourceMetadata& sourceMetadata,
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
AudioOutputFlags flags) {
|
||||||
|
if (status_t status = CoreUtils::sourceMetadataToHal(sourceMetadata, nullptr);
|
||||||
|
status != NO_ERROR) {
|
||||||
|
#else
|
||||||
|
const AudioOutputFlags& flags) {
|
||||||
|
if (status_t status = CoreUtils::sourceMetadataToHalV7(sourceMetadata,
|
||||||
|
false /*ignoreNonVendorTags*/, nullptr);
|
||||||
|
status != NO_ERROR) {
|
||||||
|
#endif
|
||||||
|
return {analyzeStatus("sourceMetadataToHal", status), nullptr, {}};
|
||||||
|
}
|
||||||
|
AudioConfig suggestedConfig;
|
||||||
|
auto [result, streamOut] =
|
||||||
|
openOutputStreamCore(ioHandle, device, config, flags, &suggestedConfig);
|
||||||
|
if (streamOut) {
|
||||||
|
streamOut->updateSourceMetadata(sourceMetadata);
|
||||||
|
}
|
||||||
|
return {result, streamOut, suggestedConfig};
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> Device::openOutputStream(int32_t ioHandle, const DeviceAddress& device,
|
||||||
|
const AudioConfig& config,
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
AudioOutputFlags flags,
|
||||||
|
#else
|
||||||
|
const AudioOutputFlags& flags,
|
||||||
|
#endif
|
||||||
|
const SourceMetadata& sourceMetadata,
|
||||||
|
openOutputStream_cb _hidl_cb) {
|
||||||
|
auto [result, streamOut, suggestedConfig] =
|
||||||
|
openOutputStreamImpl(ioHandle, device, config, sourceMetadata, flags);
|
||||||
|
_hidl_cb(result, streamOut, suggestedConfig);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::tuple<Result, sp<IStreamIn>, AudioConfig> Device::openInputStreamImpl(
|
||||||
|
int32_t ioHandle, const DeviceAddress& device, const AudioConfig& config,
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
AudioInputFlags flags,
|
||||||
|
#else
|
||||||
|
const AudioInputFlags& flags,
|
||||||
|
#endif
|
||||||
|
const SinkMetadata& sinkMetadata) {
|
||||||
|
if (sinkMetadata.tracks.size() == 0) {
|
||||||
|
// This should never happen, the framework must not create as stream
|
||||||
|
// if there is no client
|
||||||
|
ALOGE("openInputStream called without tracks connected");
|
||||||
|
return {Result::INVALID_ARGUMENTS, nullptr, AudioConfig{}};
|
||||||
|
}
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
if (status_t status = CoreUtils::sinkMetadataToHal(sinkMetadata, nullptr); status != NO_ERROR) {
|
||||||
|
#else
|
||||||
|
if (status_t status = CoreUtils::sinkMetadataToHalV7(sinkMetadata,
|
||||||
|
false /*ignoreNonVendorTags*/, nullptr);
|
||||||
|
status != NO_ERROR) {
|
||||||
|
#endif
|
||||||
|
return {analyzeStatus("sinkMetadataToHal", status), nullptr, AudioConfig{}};
|
||||||
|
}
|
||||||
|
// Pick the first one as the main.
|
||||||
|
AudioSource source = sinkMetadata.tracks[0].source;
|
||||||
|
AudioConfig suggestedConfig;
|
||||||
|
auto [result, streamIn] =
|
||||||
|
openInputStreamCore(ioHandle, device, config, flags, source, &suggestedConfig);
|
||||||
|
if (streamIn) {
|
||||||
|
streamIn->updateSinkMetadata(sinkMetadata);
|
||||||
|
}
|
||||||
|
return {result, streamIn, suggestedConfig};
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> Device::openInputStream(int32_t ioHandle, const DeviceAddress& device,
|
||||||
|
const AudioConfig& config,
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
AudioInputFlags flags,
|
||||||
|
#else
|
||||||
|
const AudioInputFlags& flags,
|
||||||
|
#endif
|
||||||
|
const SinkMetadata& sinkMetadata,
|
||||||
|
openInputStream_cb _hidl_cb) {
|
||||||
|
auto [result, streamIn, suggestedConfig] =
|
||||||
|
openInputStreamImpl(ioHandle, device, config, flags, sinkMetadata);
|
||||||
|
_hidl_cb(result, streamIn, suggestedConfig);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
#endif /* MAJOR_VERSION */
|
||||||
|
|
||||||
|
#if MAJOR_VERSION == 7 && MINOR_VERSION == 1
|
||||||
|
Return<void> Device::openOutputStream_7_1(int32_t ioHandle, const DeviceAddress& device,
|
||||||
|
const AudioConfig& config, const AudioOutputFlags& flags,
|
||||||
|
const SourceMetadata& sourceMetadata,
|
||||||
|
openOutputStream_7_1_cb _hidl_cb) {
|
||||||
|
auto [result, streamOut, suggestedConfig] =
|
||||||
|
openOutputStreamImpl(ioHandle, device, config, sourceMetadata, flags);
|
||||||
|
_hidl_cb(result, streamOut, suggestedConfig);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
#endif // V7.1
|
||||||
|
|
||||||
|
Return<bool> Device::supportsAudioPatches() {
|
||||||
|
return version() >= AUDIO_DEVICE_API_VERSION_3_0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> Device::createAudioPatch(const hidl_vec<AudioPortConfig>& sources,
|
||||||
|
const hidl_vec<AudioPortConfig>& sinks,
|
||||||
|
createAudioPatch_cb _hidl_cb) {
|
||||||
|
auto [retval, patch] = createOrUpdateAudioPatch(AudioPatchHandle{}, sources, sinks);
|
||||||
|
_hidl_cb(retval, patch);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::tuple<Result, AudioPatchHandle> Device::createOrUpdateAudioPatch(
|
||||||
|
AudioPatchHandle patch, const hidl_vec<AudioPortConfig>& sources,
|
||||||
|
const hidl_vec<AudioPortConfig>& sinks) {
|
||||||
|
Result retval(Result::NOT_SUPPORTED);
|
||||||
|
if (version() >= AUDIO_DEVICE_API_VERSION_3_0) {
|
||||||
|
audio_patch_handle_t halPatch = static_cast<audio_patch_handle_t>(patch);
|
||||||
|
std::unique_ptr<audio_port_config[]> halSources;
|
||||||
|
if (status_t status = HidlUtils::audioPortConfigsToHal(sources, &halSources);
|
||||||
|
status != NO_ERROR) {
|
||||||
|
return {analyzeStatus("audioPortConfigsToHal;sources", status), patch};
|
||||||
|
}
|
||||||
|
std::unique_ptr<audio_port_config[]> halSinks;
|
||||||
|
if (status_t status = HidlUtils::audioPortConfigsToHal(sinks, &halSinks);
|
||||||
|
status != NO_ERROR) {
|
||||||
|
return {analyzeStatus("audioPortConfigsToHal;sinks", status), patch};
|
||||||
|
}
|
||||||
|
retval = analyzeStatus("create_audio_patch",
|
||||||
|
mDevice->create_audio_patch(mDevice, sources.size(), &halSources[0],
|
||||||
|
sinks.size(), &halSinks[0], &halPatch));
|
||||||
|
if (retval == Result::OK) {
|
||||||
|
patch = static_cast<AudioPatchHandle>(halPatch);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {retval, patch};
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> Device::releaseAudioPatch(int32_t patch) {
|
||||||
|
if (version() >= AUDIO_DEVICE_API_VERSION_3_0) {
|
||||||
|
return analyzeStatus(
|
||||||
|
"release_audio_patch",
|
||||||
|
mDevice->release_audio_patch(mDevice, static_cast<audio_patch_handle_t>(patch)));
|
||||||
|
}
|
||||||
|
return Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename HalPort>
|
||||||
|
Return<void> Device::getAudioPortImpl(const AudioPort& port, getAudioPort_cb _hidl_cb,
|
||||||
|
int (*halGetter)(audio_hw_device_t*, HalPort*),
|
||||||
|
const char* halGetterName) {
|
||||||
|
if (halGetter == nullptr) {
|
||||||
|
_hidl_cb(Result::NOT_SUPPORTED, port);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
HalPort halPort;
|
||||||
|
if (status_t status = HidlUtils::audioPortToHal(port, &halPort); status != NO_ERROR) {
|
||||||
|
_hidl_cb(analyzeStatus("audioPortToHal", status), port);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
Result retval = analyzeStatus(halGetterName, halGetter(mDevice, &halPort));
|
||||||
|
AudioPort resultPort = port;
|
||||||
|
if (retval == Result::OK) {
|
||||||
|
if (status_t status = HidlUtils::audioPortFromHal(halPort, &resultPort);
|
||||||
|
status != NO_ERROR) {
|
||||||
|
_hidl_cb(analyzeStatus("audioPortFromHal", status), port);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_hidl_cb(retval, resultPort);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
Return<void> Device::getAudioPort(const AudioPort& port, getAudioPort_cb _hidl_cb) {
|
||||||
|
return getAudioPortImpl(port, _hidl_cb, mDevice->get_audio_port, "get_audio_port");
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
Return<void> Device::getAudioPort(const AudioPort& port, getAudioPort_cb _hidl_cb) {
|
||||||
|
if (version() >= AUDIO_DEVICE_API_VERSION_3_2) {
|
||||||
|
// get_audio_port_v7 is mandatory if legacy HAL support this API version.
|
||||||
|
return getAudioPortImpl(port, _hidl_cb, mDevice->get_audio_port_v7, "get_audio_port_v7");
|
||||||
|
} else {
|
||||||
|
return getAudioPortImpl(port, _hidl_cb, mDevice->get_audio_port, "get_audio_port");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Return<Result> Device::setAudioPortConfig(const AudioPortConfig& config) {
|
||||||
|
if (version() >= AUDIO_DEVICE_API_VERSION_3_0) {
|
||||||
|
struct audio_port_config halPortConfig;
|
||||||
|
if (status_t status = HidlUtils::audioPortConfigToHal(config, &halPortConfig);
|
||||||
|
status != NO_ERROR) {
|
||||||
|
return analyzeStatus("audioPortConfigToHal", status);
|
||||||
|
}
|
||||||
|
return analyzeStatus("set_audio_port_config",
|
||||||
|
mDevice->set_audio_port_config(mDevice, &halPortConfig));
|
||||||
|
}
|
||||||
|
return Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<AudioHwSync> Device::getHwAvSync() {
|
||||||
|
int halHwAvSync;
|
||||||
|
Result retval = getParam(AudioParameter::keyHwAvSync, &halHwAvSync);
|
||||||
|
return retval == Result::OK ? halHwAvSync : AUDIO_HW_SYNC_INVALID;
|
||||||
|
}
|
||||||
|
#elif MAJOR_VERSION >= 4
|
||||||
|
Return<void> Device::getHwAvSync(getHwAvSync_cb _hidl_cb) {
|
||||||
|
int halHwAvSync;
|
||||||
|
Result retval = getParam(AudioParameter::keyHwAvSync, &halHwAvSync);
|
||||||
|
_hidl_cb(retval, halHwAvSync);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Return<Result> Device::setScreenState(bool turnedOn) {
|
||||||
|
return setParam(AudioParameter::keyScreenState, turnedOn);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<void> Device::getParameters(const hidl_vec<hidl_string>& keys, getParameters_cb _hidl_cb) {
|
||||||
|
getParametersImpl({}, keys, _hidl_cb);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> Device::setParameters(const hidl_vec<ParameterValue>& parameters) {
|
||||||
|
return setParametersImpl({} /* context */, parameters);
|
||||||
|
}
|
||||||
|
#elif MAJOR_VERSION >= 4
|
||||||
|
Return<void> Device::getParameters(const hidl_vec<ParameterValue>& context,
|
||||||
|
const hidl_vec<hidl_string>& keys, getParameters_cb _hidl_cb) {
|
||||||
|
getParametersImpl(context, keys, _hidl_cb);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
Return<Result> Device::setParameters(const hidl_vec<ParameterValue>& context,
|
||||||
|
const hidl_vec<ParameterValue>& parameters) {
|
||||||
|
return setParametersImpl(context, parameters);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<void> Device::debugDump(const hidl_handle& fd) {
|
||||||
|
return debug(fd, {});
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Return<void> Device::debug(const hidl_handle& fd, const hidl_vec<hidl_string>& options) {
|
||||||
|
if (fd.getNativeHandle() != nullptr && fd->numFds == 1) {
|
||||||
|
const int fd0 = fd->data[0];
|
||||||
|
bool dumpMem = false;
|
||||||
|
bool unreachableMemory = false;
|
||||||
|
for (const auto& option : options) {
|
||||||
|
if (option == "-m") {
|
||||||
|
dumpMem = true;
|
||||||
|
} else if (option == "--unreachable") {
|
||||||
|
unreachableMemory = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dumpMem) {
|
||||||
|
dprintf(fd0, "\nDumping memory:\n");
|
||||||
|
std::string s = dumpMemoryAddresses(100 /* limit */);
|
||||||
|
write(fd0, s.c_str(), s.size());
|
||||||
|
}
|
||||||
|
if (unreachableMemory) {
|
||||||
|
dprintf(fd0, "\nDumping unreachable memory:\n");
|
||||||
|
// TODO - should limit be an argument parameter?
|
||||||
|
std::string s = GetUnreachableMemoryString(true /* contents */, 100 /* limit */);
|
||||||
|
write(fd0, s.c_str(), s.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
analyzeStatus("dump", mDevice->dump(mDevice, fd0));
|
||||||
|
}
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
#if MAJOR_VERSION >= 4
|
||||||
|
Return<void> Device::getMicrophones(getMicrophones_cb _hidl_cb) {
|
||||||
|
Result retval = Result::NOT_SUPPORTED;
|
||||||
|
size_t actual_mics = AUDIO_MICROPHONE_MAX_COUNT;
|
||||||
|
audio_microphone_characteristic_t mic_array[AUDIO_MICROPHONE_MAX_COUNT];
|
||||||
|
|
||||||
|
hidl_vec<MicrophoneInfo> microphones;
|
||||||
|
if (mDevice->get_microphones != NULL &&
|
||||||
|
mDevice->get_microphones(mDevice, &mic_array[0], &actual_mics) == 0) {
|
||||||
|
microphones.resize(actual_mics);
|
||||||
|
for (size_t i = 0; i < actual_mics; ++i) {
|
||||||
|
(void)CoreUtils::microphoneInfoFromHal(mic_array[i], µphones[i]);
|
||||||
|
}
|
||||||
|
retval = Result::OK;
|
||||||
|
}
|
||||||
|
_hidl_cb(retval, microphones);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> Device::setConnectedState(const DeviceAddress& address, bool connected) {
|
||||||
|
auto key = connected ? AudioParameter::keyDeviceConnect : AudioParameter::keyDeviceDisconnect;
|
||||||
|
return setParam(key, address);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Result Device::doClose() {
|
||||||
|
if (mIsClosed || mOpenedStreamsCount != 0) return Result::INVALID_STATE;
|
||||||
|
mIsClosed = true;
|
||||||
|
return analyzeStatus("close", audio_hw_device_close(mDevice));
|
||||||
|
}
|
||||||
|
|
||||||
|
#if MAJOR_VERSION >= 6
|
||||||
|
Return<Result> Device::close() {
|
||||||
|
return doClose();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> Device::addDeviceEffect(AudioPortHandle device, uint64_t effectId) {
|
||||||
|
if (version() < AUDIO_DEVICE_API_VERSION_3_1 || mDevice->add_device_effect == nullptr) {
|
||||||
|
return Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
effect_handle_t halEffect = EffectMap::getInstance().get(effectId);
|
||||||
|
if (halEffect != NULL) {
|
||||||
|
return analyzeStatus("add_device_effect",
|
||||||
|
mDevice->add_device_effect(
|
||||||
|
mDevice, static_cast<audio_port_handle_t>(device), halEffect));
|
||||||
|
} else {
|
||||||
|
ALOGW("%s Invalid effect ID passed from client: %" PRIu64 "", __func__, effectId);
|
||||||
|
return Result::INVALID_ARGUMENTS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> Device::removeDeviceEffect(AudioPortHandle device, uint64_t effectId) {
|
||||||
|
if (version() < AUDIO_DEVICE_API_VERSION_3_1 || mDevice->remove_device_effect == nullptr) {
|
||||||
|
return Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
effect_handle_t halEffect = EffectMap::getInstance().get(effectId);
|
||||||
|
if (halEffect != NULL) {
|
||||||
|
return analyzeStatus("remove_device_effect",
|
||||||
|
mDevice->remove_device_effect(
|
||||||
|
mDevice, static_cast<audio_port_handle_t>(device), halEffect));
|
||||||
|
} else {
|
||||||
|
ALOGW("%s Invalid effect ID passed from client: %" PRIu64 "", __func__, effectId);
|
||||||
|
return Result::INVALID_ARGUMENTS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> Device::updateAudioPatch(int32_t previousPatch,
|
||||||
|
const hidl_vec<AudioPortConfig>& sources,
|
||||||
|
const hidl_vec<AudioPortConfig>& sinks,
|
||||||
|
createAudioPatch_cb _hidl_cb) {
|
||||||
|
if (previousPatch != static_cast<int32_t>(AudioPatchHandle{})) {
|
||||||
|
auto [retval, patch] = createOrUpdateAudioPatch(previousPatch, sources, sinks);
|
||||||
|
_hidl_cb(retval, patch);
|
||||||
|
} else {
|
||||||
|
_hidl_cb(Result::INVALID_ARGUMENTS, previousPatch);
|
||||||
|
}
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if MAJOR_VERSION == 7 && MINOR_VERSION == 1
|
||||||
|
Return<Result> Device::setConnectedState_7_1(const AudioPort& devicePort, bool connected) {
|
||||||
|
if (version() >= AUDIO_DEVICE_API_VERSION_3_2 &&
|
||||||
|
mDevice->set_device_connected_state_v7 != nullptr) {
|
||||||
|
audio_port_v7 halPort;
|
||||||
|
if (status_t status = HidlUtils::audioPortToHal(devicePort, &halPort); status != NO_ERROR) {
|
||||||
|
return analyzeStatus("audioPortToHal", status);
|
||||||
|
}
|
||||||
|
return analyzeStatus("set_device_connected_state_v7",
|
||||||
|
mDevice->set_device_connected_state_v7(mDevice, &halPort, connected));
|
||||||
|
}
|
||||||
|
return Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
} // namespace implementation
|
||||||
|
} // namespace CPP_VERSION
|
||||||
|
} // namespace audio
|
||||||
|
} // namespace hardware
|
||||||
|
} // namespace android
|
155
audio/impl/DevicesFactory.cpp
Normal file
155
audio/impl/DevicesFactory.cpp
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define LOG_TAG "DevicesFactoryHAL"
|
||||||
|
|
||||||
|
#include "core/default/DevicesFactory.h"
|
||||||
|
#include "core/default/Device.h"
|
||||||
|
#include "core/default/PrimaryDevice.h"
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <android/log.h>
|
||||||
|
#include <hidl/HidlTransportSupport.h>
|
||||||
|
#include <system/thread_defs.h>
|
||||||
|
|
||||||
|
namespace android {
|
||||||
|
namespace hardware {
|
||||||
|
namespace audio {
|
||||||
|
namespace CPP_VERSION {
|
||||||
|
namespace implementation {
|
||||||
|
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<void> DevicesFactory::openDevice(IDevicesFactory::Device device, openDevice_cb _hidl_cb) {
|
||||||
|
switch (device) {
|
||||||
|
case IDevicesFactory::Device::PRIMARY:
|
||||||
|
return openDevice<PrimaryDevice>(AUDIO_HARDWARE_MODULE_ID_PRIMARY, _hidl_cb);
|
||||||
|
case IDevicesFactory::Device::A2DP:
|
||||||
|
return openDevice(AUDIO_HARDWARE_MODULE_ID_A2DP, _hidl_cb);
|
||||||
|
case IDevicesFactory::Device::USB:
|
||||||
|
return openDevice(AUDIO_HARDWARE_MODULE_ID_USB, _hidl_cb);
|
||||||
|
case IDevicesFactory::Device::R_SUBMIX:
|
||||||
|
return openDevice(AUDIO_HARDWARE_MODULE_ID_REMOTE_SUBMIX, _hidl_cb);
|
||||||
|
case IDevicesFactory::Device::STUB:
|
||||||
|
return openDevice(AUDIO_HARDWARE_MODULE_ID_STUB, _hidl_cb);
|
||||||
|
}
|
||||||
|
_hidl_cb(Result::INVALID_ARGUMENTS, nullptr);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> DevicesFactory::openDevice(const char* moduleName, openDevice_cb _hidl_cb) {
|
||||||
|
return openDevice<implementation::Device>(moduleName, _hidl_cb);
|
||||||
|
}
|
||||||
|
#elif MAJOR_VERSION >= 4
|
||||||
|
Return<void> DevicesFactory::openDevice(const hidl_string& moduleName, openDevice_cb _hidl_cb) {
|
||||||
|
if (moduleName == AUDIO_HARDWARE_MODULE_ID_PRIMARY) {
|
||||||
|
return openDevice<PrimaryDevice>(moduleName.c_str(), _hidl_cb);
|
||||||
|
}
|
||||||
|
return openDevice<implementation::Device>(moduleName.c_str(), _hidl_cb);
|
||||||
|
}
|
||||||
|
Return<void> DevicesFactory::openPrimaryDevice(openPrimaryDevice_cb _hidl_cb) {
|
||||||
|
return openDevice<PrimaryDevice>(AUDIO_HARDWARE_MODULE_ID_PRIMARY, _hidl_cb);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if MAJOR_VERSION == 7 && MINOR_VERSION == 1
|
||||||
|
Return<void> DevicesFactory::openDevice_7_1(const hidl_string& moduleName,
|
||||||
|
openDevice_7_1_cb _hidl_cb) {
|
||||||
|
if (moduleName == AUDIO_HARDWARE_MODULE_ID_PRIMARY) {
|
||||||
|
Result result;
|
||||||
|
sp<IPrimaryDevice> primary;
|
||||||
|
auto ret = openDevice<PrimaryDevice>(
|
||||||
|
AUDIO_HARDWARE_MODULE_ID_PRIMARY,
|
||||||
|
[&result, &primary](Result r, const sp<IPrimaryDevice>& p) {
|
||||||
|
result = r;
|
||||||
|
primary = p;
|
||||||
|
});
|
||||||
|
if (ret.isOk() && result == Result::OK && primary != nullptr) {
|
||||||
|
auto getDeviceRet = primary->getDevice();
|
||||||
|
if (getDeviceRet.isOk()) {
|
||||||
|
_hidl_cb(result, getDeviceRet);
|
||||||
|
} else {
|
||||||
|
_hidl_cb(Result::NOT_INITIALIZED, nullptr);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
_hidl_cb(result, nullptr);
|
||||||
|
}
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
return openDevice<implementation::Device>(moduleName.c_str(), _hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> DevicesFactory::openPrimaryDevice_7_1(openPrimaryDevice_7_1_cb _hidl_cb) {
|
||||||
|
return openDevice<PrimaryDevice>(AUDIO_HARDWARE_MODULE_ID_PRIMARY, _hidl_cb);
|
||||||
|
}
|
||||||
|
#endif // V7.1
|
||||||
|
|
||||||
|
template <class DeviceShim, class Callback>
|
||||||
|
Return<void> DevicesFactory::openDevice(const char* moduleName, Callback _hidl_cb) {
|
||||||
|
audio_hw_device_t* halDevice;
|
||||||
|
Result retval(Result::INVALID_ARGUMENTS);
|
||||||
|
sp<DeviceShim> result;
|
||||||
|
int halStatus = loadAudioInterface(moduleName, &halDevice);
|
||||||
|
if (halStatus == OK) {
|
||||||
|
result = new DeviceShim(halDevice);
|
||||||
|
android::hardware::setMinSchedulerPolicy(result, SCHED_NORMAL, ANDROID_PRIORITY_AUDIO);
|
||||||
|
retval = Result::OK;
|
||||||
|
} else if (halStatus == -EINVAL) {
|
||||||
|
retval = Result::NOT_INITIALIZED;
|
||||||
|
}
|
||||||
|
_hidl_cb(retval, result);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
|
int DevicesFactory::loadAudioInterface(const char* if_name, audio_hw_device_t** dev) {
|
||||||
|
const hw_module_t* mod;
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
rc = hw_get_module_by_class(AUDIO_HARDWARE_MODULE_ID, if_name, &mod);
|
||||||
|
if (rc) {
|
||||||
|
ALOGE("%s couldn't load audio hw module %s.%s (%s)", __func__, AUDIO_HARDWARE_MODULE_ID,
|
||||||
|
if_name, strerror(-rc));
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
rc = audio_hw_device_open(mod, dev);
|
||||||
|
if (rc) {
|
||||||
|
ALOGE("%s couldn't open audio hw device in %s.%s (%s)", __func__, AUDIO_HARDWARE_MODULE_ID,
|
||||||
|
if_name, strerror(-rc));
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
if ((*dev)->common.version < AUDIO_DEVICE_API_VERSION_MIN) {
|
||||||
|
ALOGE("%s wrong audio hw device version %04x", __func__, (*dev)->common.version);
|
||||||
|
rc = -EINVAL;
|
||||||
|
audio_hw_device_close(*dev);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
return OK;
|
||||||
|
|
||||||
|
out:
|
||||||
|
*dev = NULL;
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
IDevicesFactory* HIDL_FETCH_IDevicesFactory(const char* name) {
|
||||||
|
return strcmp(name, "default") == 0 ? new DevicesFactory() : nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace implementation
|
||||||
|
} // namespace CPP_VERSION
|
||||||
|
} // namespace audio
|
||||||
|
} // namespace hardware
|
||||||
|
} // namespace android
|
178
audio/impl/ParametersUtil.cpp
Normal file
178
audio/impl/ParametersUtil.cpp
Normal file
@@ -0,0 +1,178 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 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 "core/default/ParametersUtil.h"
|
||||||
|
#include "core/default/Util.h"
|
||||||
|
|
||||||
|
#include <system/audio.h>
|
||||||
|
|
||||||
|
#include <util/CoreUtils.h>
|
||||||
|
|
||||||
|
namespace android {
|
||||||
|
namespace hardware {
|
||||||
|
namespace audio {
|
||||||
|
namespace CORE_TYPES_CPP_VERSION {
|
||||||
|
namespace implementation {
|
||||||
|
|
||||||
|
/** Converts a status_t in Result according to the rules of AudioParameter::get*
|
||||||
|
* Note: Static method and not private method to avoid leaking status_t dependency
|
||||||
|
*/
|
||||||
|
static Result getHalStatusToResult(status_t status) {
|
||||||
|
switch (status) {
|
||||||
|
case OK:
|
||||||
|
return Result::OK;
|
||||||
|
case BAD_VALUE: // Nothing was returned, probably because the HAL does
|
||||||
|
// not handle it
|
||||||
|
return Result::NOT_SUPPORTED;
|
||||||
|
case INVALID_OPERATION: // Conversion from string to the requested type
|
||||||
|
// failed
|
||||||
|
return Result::INVALID_ARGUMENTS;
|
||||||
|
default: // Should not happen
|
||||||
|
ALOGW("Unexpected status returned by getParam: %u", status);
|
||||||
|
return Result::INVALID_ARGUMENTS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ParametersUtil::getParam(const char* name, bool* value) {
|
||||||
|
String8 halValue;
|
||||||
|
Result retval = getParam(name, &halValue);
|
||||||
|
*value = false;
|
||||||
|
if (retval == Result::OK) {
|
||||||
|
if (halValue.length() == 0) {
|
||||||
|
return Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
*value = !(halValue == AudioParameter::valueOff);
|
||||||
|
}
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ParametersUtil::getParam(const char* name, int* value) {
|
||||||
|
const String8 halName(name);
|
||||||
|
AudioParameter keys;
|
||||||
|
keys.addKey(halName);
|
||||||
|
std::unique_ptr<AudioParameter> params = getParams(keys);
|
||||||
|
return getHalStatusToResult(params->getInt(halName, *value));
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ParametersUtil::getParam(const char* name, String8* value, AudioParameter context) {
|
||||||
|
const String8 halName(name);
|
||||||
|
context.addKey(halName);
|
||||||
|
std::unique_ptr<AudioParameter> params = getParams(context);
|
||||||
|
return getHalStatusToResult(params->get(halName, *value));
|
||||||
|
}
|
||||||
|
|
||||||
|
void ParametersUtil::getParametersImpl(
|
||||||
|
const hidl_vec<ParameterValue>& context, const hidl_vec<hidl_string>& keys,
|
||||||
|
std::function<void(Result retval, const hidl_vec<ParameterValue>& parameters)> cb) {
|
||||||
|
AudioParameter halKeys;
|
||||||
|
for (auto& pair : context) {
|
||||||
|
halKeys.add(String8(pair.key.c_str()), String8(pair.value.c_str()));
|
||||||
|
}
|
||||||
|
for (size_t i = 0; i < keys.size(); ++i) {
|
||||||
|
halKeys.addKey(String8(keys[i].c_str()));
|
||||||
|
}
|
||||||
|
std::unique_ptr<AudioParameter> halValues = getParams(halKeys);
|
||||||
|
Result retval =
|
||||||
|
(keys.size() == 0 || halValues->size() != 0) ? Result::OK : Result::NOT_SUPPORTED;
|
||||||
|
hidl_vec<ParameterValue> result;
|
||||||
|
result.resize(halValues->size());
|
||||||
|
String8 halKey, halValue;
|
||||||
|
for (size_t i = 0; i < halValues->size(); ++i) {
|
||||||
|
status_t status = halValues->getAt(i, halKey, halValue);
|
||||||
|
if (status != OK) {
|
||||||
|
result.resize(0);
|
||||||
|
retval = getHalStatusToResult(status);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
result[i].key = halKey.c_str();
|
||||||
|
result[i].value = halValue.c_str();
|
||||||
|
}
|
||||||
|
cb(retval, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<AudioParameter> ParametersUtil::getParams(const AudioParameter& keys) {
|
||||||
|
String8 paramsAndValues;
|
||||||
|
char* halValues = halGetParameters(keys.keysToString().c_str());
|
||||||
|
if (halValues != NULL) {
|
||||||
|
paramsAndValues = halValues;
|
||||||
|
free(halValues);
|
||||||
|
} else {
|
||||||
|
paramsAndValues.clear();
|
||||||
|
}
|
||||||
|
return std::unique_ptr<AudioParameter>(new AudioParameter(paramsAndValues));
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ParametersUtil::setParam(const char* name, const char* value) {
|
||||||
|
AudioParameter param;
|
||||||
|
param.add(String8(name), String8(value));
|
||||||
|
return setParams(param);
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ParametersUtil::setParam(const char* name, bool value) {
|
||||||
|
AudioParameter param;
|
||||||
|
param.add(String8(name), String8(value ? AudioParameter::valueOn : AudioParameter::valueOff));
|
||||||
|
return setParams(param);
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ParametersUtil::setParam(const char* name, int value) {
|
||||||
|
AudioParameter param;
|
||||||
|
param.addInt(String8(name), value);
|
||||||
|
return setParams(param);
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ParametersUtil::setParam(const char* name, float value) {
|
||||||
|
AudioParameter param;
|
||||||
|
param.addFloat(String8(name), value);
|
||||||
|
return setParams(param);
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ParametersUtil::setParametersImpl(const hidl_vec<ParameterValue>& context,
|
||||||
|
const hidl_vec<ParameterValue>& parameters) {
|
||||||
|
AudioParameter params;
|
||||||
|
for (auto& pair : context) {
|
||||||
|
params.add(String8(pair.key.c_str()), String8(pair.value.c_str()));
|
||||||
|
}
|
||||||
|
for (size_t i = 0; i < parameters.size(); ++i) {
|
||||||
|
if (parameters[i].key == "bt_wbs") {
|
||||||
|
params.add(String8("g_sco_samplerate"),
|
||||||
|
String8(parameters[i].value == AudioParameter::valueOn ? "16000" : "8000"));
|
||||||
|
}
|
||||||
|
params.add(String8(parameters[i].key.c_str()), String8(parameters[i].value.c_str()));
|
||||||
|
}
|
||||||
|
return setParams(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ParametersUtil::setParam(const char* name, const DeviceAddress& address) {
|
||||||
|
audio_devices_t halDeviceType;
|
||||||
|
char halDeviceAddress[AUDIO_DEVICE_MAX_ADDRESS_LEN];
|
||||||
|
if (CoreUtils::deviceAddressToHal(address, &halDeviceType, halDeviceAddress) != NO_ERROR) {
|
||||||
|
return Result::INVALID_ARGUMENTS;
|
||||||
|
}
|
||||||
|
AudioParameter params{String8(halDeviceAddress)};
|
||||||
|
params.addInt(String8(name), halDeviceType);
|
||||||
|
return setParams(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ParametersUtil::setParams(const AudioParameter& param) {
|
||||||
|
int halStatus = halSetParameters(param.toString().c_str());
|
||||||
|
return util::analyzeStatus(halStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace implementation
|
||||||
|
} // namespace CORE_TYPES_CPP_VERSION
|
||||||
|
} // namespace audio
|
||||||
|
} // namespace hardware
|
||||||
|
} // namespace android
|
387
audio/impl/PrimaryDevice.cpp
Normal file
387
audio/impl/PrimaryDevice.cpp
Normal file
@@ -0,0 +1,387 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define LOG_TAG "PrimaryDeviceHAL"
|
||||||
|
|
||||||
|
#include "core/default/PrimaryDevice.h"
|
||||||
|
#include "core/default/Util.h"
|
||||||
|
|
||||||
|
#include <cutils/properties.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#if MAJOR_VERSION >= 4
|
||||||
|
#include <cmath>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace android {
|
||||||
|
namespace hardware {
|
||||||
|
namespace audio {
|
||||||
|
namespace CPP_VERSION {
|
||||||
|
namespace implementation {
|
||||||
|
|
||||||
|
namespace util {
|
||||||
|
using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION::implementation::util;
|
||||||
|
}
|
||||||
|
|
||||||
|
PrimaryDevice::PrimaryDevice(audio_hw_device_t* device) : mDevice(new Device(device)) {}
|
||||||
|
|
||||||
|
PrimaryDevice::~PrimaryDevice() {
|
||||||
|
// Do not call mDevice->close here. If there are any unclosed streams,
|
||||||
|
// they only hold IDevice instance, not IPrimaryDevice, thus IPrimaryDevice
|
||||||
|
// "part" of a device can be destroyed before the streams.
|
||||||
|
}
|
||||||
|
|
||||||
|
// Methods from ::android::hardware::audio::CPP_VERSION::IDevice follow.
|
||||||
|
Return<Result> PrimaryDevice::initCheck() {
|
||||||
|
return mDevice->initCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> PrimaryDevice::setMasterVolume(float volume) {
|
||||||
|
return mDevice->setMasterVolume(volume);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> PrimaryDevice::getMasterVolume(getMasterVolume_cb _hidl_cb) {
|
||||||
|
return mDevice->getMasterVolume(_hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> PrimaryDevice::setMicMute(bool mute) {
|
||||||
|
return mDevice->setMicMute(mute);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> PrimaryDevice::getMicMute(getMicMute_cb _hidl_cb) {
|
||||||
|
return mDevice->getMicMute(_hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> PrimaryDevice::setMasterMute(bool mute) {
|
||||||
|
return mDevice->setMasterMute(mute);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> PrimaryDevice::getMasterMute(getMasterMute_cb _hidl_cb) {
|
||||||
|
return mDevice->getMasterMute(_hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> PrimaryDevice::getInputBufferSize(const AudioConfig& config,
|
||||||
|
getInputBufferSize_cb _hidl_cb) {
|
||||||
|
return mDevice->getInputBufferSize(config, _hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<void> PrimaryDevice::openOutputStream(int32_t ioHandle, const DeviceAddress& device,
|
||||||
|
const AudioConfig& config, AudioOutputFlags flags,
|
||||||
|
openOutputStream_cb _hidl_cb) {
|
||||||
|
return mDevice->openOutputStream(ioHandle, device, config, flags, _hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> PrimaryDevice::openInputStream(int32_t ioHandle, const DeviceAddress& device,
|
||||||
|
const AudioConfig& config, AudioInputFlags flags,
|
||||||
|
AudioSource source, openInputStream_cb _hidl_cb) {
|
||||||
|
return mDevice->openInputStream(ioHandle, device, config, flags, source, _hidl_cb);
|
||||||
|
}
|
||||||
|
#elif MAJOR_VERSION >= 4
|
||||||
|
Return<void> PrimaryDevice::openOutputStream(int32_t ioHandle, const DeviceAddress& device,
|
||||||
|
const AudioConfig& config,
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
AudioOutputFlags flags,
|
||||||
|
#else
|
||||||
|
const AudioOutputFlags& flags,
|
||||||
|
#endif
|
||||||
|
const SourceMetadata& sourceMetadata,
|
||||||
|
openOutputStream_cb _hidl_cb) {
|
||||||
|
return mDevice->openOutputStream(ioHandle, device, config, flags, sourceMetadata, _hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> PrimaryDevice::openInputStream(int32_t ioHandle, const DeviceAddress& device,
|
||||||
|
const AudioConfig& config,
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
AudioInputFlags flags,
|
||||||
|
#else
|
||||||
|
const AudioInputFlags& flags,
|
||||||
|
#endif
|
||||||
|
const SinkMetadata& sinkMetadata,
|
||||||
|
openInputStream_cb _hidl_cb) {
|
||||||
|
return mDevice->openInputStream(ioHandle, device, config, flags, sinkMetadata, _hidl_cb);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Return<bool> PrimaryDevice::supportsAudioPatches() {
|
||||||
|
return mDevice->supportsAudioPatches();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> PrimaryDevice::createAudioPatch(const hidl_vec<AudioPortConfig>& sources,
|
||||||
|
const hidl_vec<AudioPortConfig>& sinks,
|
||||||
|
createAudioPatch_cb _hidl_cb) {
|
||||||
|
return mDevice->createAudioPatch(sources, sinks, _hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> PrimaryDevice::releaseAudioPatch(int32_t patch) {
|
||||||
|
return mDevice->releaseAudioPatch(patch);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> PrimaryDevice::getAudioPort(const AudioPort& port, getAudioPort_cb _hidl_cb) {
|
||||||
|
return mDevice->getAudioPort(port, _hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> PrimaryDevice::setAudioPortConfig(const AudioPortConfig& config) {
|
||||||
|
return mDevice->setAudioPortConfig(config);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> PrimaryDevice::setScreenState(bool turnedOn) {
|
||||||
|
return mDevice->setScreenState(turnedOn);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<AudioHwSync> PrimaryDevice::getHwAvSync() {
|
||||||
|
return mDevice->getHwAvSync();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> PrimaryDevice::getParameters(const hidl_vec<hidl_string>& keys,
|
||||||
|
getParameters_cb _hidl_cb) {
|
||||||
|
return mDevice->getParameters(keys, _hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> PrimaryDevice::setParameters(const hidl_vec<ParameterValue>& parameters) {
|
||||||
|
return mDevice->setParameters(parameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> PrimaryDevice::debugDump(const hidl_handle& fd) {
|
||||||
|
return mDevice->debugDump(fd);
|
||||||
|
}
|
||||||
|
#elif MAJOR_VERSION >= 4
|
||||||
|
Return<void> PrimaryDevice::getHwAvSync(getHwAvSync_cb _hidl_cb) {
|
||||||
|
return mDevice->getHwAvSync(_hidl_cb);
|
||||||
|
}
|
||||||
|
Return<void> PrimaryDevice::getParameters(const hidl_vec<ParameterValue>& context,
|
||||||
|
const hidl_vec<hidl_string>& keys,
|
||||||
|
getParameters_cb _hidl_cb) {
|
||||||
|
return mDevice->getParameters(context, keys, _hidl_cb);
|
||||||
|
}
|
||||||
|
Return<Result> PrimaryDevice::setParameters(const hidl_vec<ParameterValue>& context,
|
||||||
|
const hidl_vec<ParameterValue>& parameters) {
|
||||||
|
return mDevice->setParameters(context, parameters);
|
||||||
|
}
|
||||||
|
Return<void> PrimaryDevice::getMicrophones(getMicrophones_cb _hidl_cb) {
|
||||||
|
return mDevice->getMicrophones(_hidl_cb);
|
||||||
|
}
|
||||||
|
Return<Result> PrimaryDevice::setConnectedState(const DeviceAddress& address, bool connected) {
|
||||||
|
return mDevice->setConnectedState(address, connected);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#if MAJOR_VERSION >= 6
|
||||||
|
Return<Result> PrimaryDevice::close() {
|
||||||
|
return mDevice->close();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> PrimaryDevice::addDeviceEffect(AudioPortHandle device, uint64_t effectId) {
|
||||||
|
return mDevice->addDeviceEffect(device, effectId);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> PrimaryDevice::removeDeviceEffect(AudioPortHandle device, uint64_t effectId) {
|
||||||
|
return mDevice->removeDeviceEffect(device, effectId);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> PrimaryDevice::updateAudioPatch(int32_t previousPatch,
|
||||||
|
const hidl_vec<AudioPortConfig>& sources,
|
||||||
|
const hidl_vec<AudioPortConfig>& sinks,
|
||||||
|
updateAudioPatch_cb _hidl_cb) {
|
||||||
|
return mDevice->updateAudioPatch(previousPatch, sources, sinks, _hidl_cb);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Methods from ::android::hardware::audio::CPP_VERSION::IPrimaryDevice follow.
|
||||||
|
Return<Result> PrimaryDevice::setVoiceVolume(float volume) {
|
||||||
|
if (!util::isGainNormalized(volume)) {
|
||||||
|
ALOGW("Can not set a voice volume (%f) outside [0,1]", volume);
|
||||||
|
return Result::INVALID_ARGUMENTS;
|
||||||
|
}
|
||||||
|
return mDevice->analyzeStatus("set_voice_volume",
|
||||||
|
mDevice->device()->set_voice_volume(mDevice->device(), volume));
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> PrimaryDevice::setMode(AudioMode mode) {
|
||||||
|
/* On stock ROM Samsung sets the g_call_state and g_call_sim_slot audio parameters
|
||||||
|
* in the framework, breaking it on AOSP ROMs. For the audio params call_state and
|
||||||
|
* g_call_state 2 corresponds to CALL_ACTIVE and 1 to CALL_INACTIVE respectively.
|
||||||
|
* For the g_call_sim_slot parameter 0x01 describes SIM1 and 0x02 SIM2.
|
||||||
|
*/
|
||||||
|
|
||||||
|
char simSlot1[92], simSlot2[92];
|
||||||
|
|
||||||
|
// These props return either 0 (not calling),
|
||||||
|
// or 1 (SIM is calling)
|
||||||
|
property_get("vendor.calls.slot_id0", simSlot1, "");
|
||||||
|
property_get("vendor.calls.slot_id1", simSlot2, "");
|
||||||
|
|
||||||
|
// Wait until one sim slot reports a call
|
||||||
|
if (mode == AudioMode::IN_CALL) {
|
||||||
|
while (strcmp(simSlot1, "0") == 0 && strcmp(simSlot2, "0") == 0) {
|
||||||
|
property_get("vendor.calls.slot_id0", simSlot1, "");
|
||||||
|
property_get("vendor.calls.slot_id1", simSlot2, "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strcmp(simSlot1, "1") == 0) {
|
||||||
|
// SIM1
|
||||||
|
mDevice->halSetParameters("g_call_sim_slot=0x01");
|
||||||
|
} else if (strcmp(simSlot2, "1") == 0) {
|
||||||
|
// SIM2
|
||||||
|
mDevice->halSetParameters("g_call_sim_slot=0x02");
|
||||||
|
}
|
||||||
|
|
||||||
|
// INVALID, CURRENT, CNT, MAX are reserved for internal use.
|
||||||
|
// TODO: remove the values from the HIDL interface
|
||||||
|
switch (mode) {
|
||||||
|
case AudioMode::NORMAL:
|
||||||
|
case AudioMode::RINGTONE:
|
||||||
|
case AudioMode::IN_CALL:
|
||||||
|
case AudioMode::IN_COMMUNICATION:
|
||||||
|
#if MAJOR_VERSION >= 6
|
||||||
|
case AudioMode::CALL_SCREEN:
|
||||||
|
#endif
|
||||||
|
break; // Valid values
|
||||||
|
default:
|
||||||
|
return Result::INVALID_ARGUMENTS;
|
||||||
|
};
|
||||||
|
|
||||||
|
return mDevice->analyzeStatus(
|
||||||
|
"set_mode",
|
||||||
|
mDevice->device()->set_mode(mDevice->device(), static_cast<audio_mode_t>(mode)));
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> PrimaryDevice::getBtScoNrecEnabled(getBtScoNrecEnabled_cb _hidl_cb) {
|
||||||
|
bool enabled;
|
||||||
|
Result retval = mDevice->getParam(AudioParameter::keyBtNrec, &enabled);
|
||||||
|
_hidl_cb(retval, enabled);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> PrimaryDevice::setBtScoNrecEnabled(bool enabled) {
|
||||||
|
return mDevice->setParam(AudioParameter::keyBtNrec, enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> PrimaryDevice::getBtScoWidebandEnabled(getBtScoWidebandEnabled_cb _hidl_cb) {
|
||||||
|
bool enabled;
|
||||||
|
Result retval = mDevice->getParam(AUDIO_PARAMETER_KEY_BT_SCO_WB, &enabled);
|
||||||
|
_hidl_cb(retval, enabled);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> PrimaryDevice::setBtScoWidebandEnabled(bool enabled) {
|
||||||
|
return mDevice->setParam(AUDIO_PARAMETER_KEY_BT_SCO_WB, enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
static const char* convertTtyModeFromHIDL(IPrimaryDevice::TtyMode mode) {
|
||||||
|
switch (mode) {
|
||||||
|
case IPrimaryDevice::TtyMode::OFF:
|
||||||
|
return AUDIO_PARAMETER_VALUE_TTY_OFF;
|
||||||
|
case IPrimaryDevice::TtyMode::VCO:
|
||||||
|
return AUDIO_PARAMETER_VALUE_TTY_VCO;
|
||||||
|
case IPrimaryDevice::TtyMode::HCO:
|
||||||
|
return AUDIO_PARAMETER_VALUE_TTY_HCO;
|
||||||
|
case IPrimaryDevice::TtyMode::FULL:
|
||||||
|
return AUDIO_PARAMETER_VALUE_TTY_FULL;
|
||||||
|
default:
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static IPrimaryDevice::TtyMode convertTtyModeToHIDL(const char* halMode) {
|
||||||
|
if (strcmp(halMode, AUDIO_PARAMETER_VALUE_TTY_OFF) == 0)
|
||||||
|
return IPrimaryDevice::TtyMode::OFF;
|
||||||
|
else if (strcmp(halMode, AUDIO_PARAMETER_VALUE_TTY_VCO) == 0)
|
||||||
|
return IPrimaryDevice::TtyMode::VCO;
|
||||||
|
else if (strcmp(halMode, AUDIO_PARAMETER_VALUE_TTY_HCO) == 0)
|
||||||
|
return IPrimaryDevice::TtyMode::HCO;
|
||||||
|
else if (strcmp(halMode, AUDIO_PARAMETER_VALUE_TTY_FULL) == 0)
|
||||||
|
return IPrimaryDevice::TtyMode::FULL;
|
||||||
|
return IPrimaryDevice::TtyMode(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> PrimaryDevice::getTtyMode(getTtyMode_cb _hidl_cb) {
|
||||||
|
String8 halMode;
|
||||||
|
Result retval = mDevice->getParam(AUDIO_PARAMETER_KEY_TTY_MODE, &halMode);
|
||||||
|
if (retval != Result::OK) {
|
||||||
|
_hidl_cb(retval, TtyMode::OFF);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
TtyMode mode = convertTtyModeToHIDL(halMode.c_str());
|
||||||
|
if (mode == TtyMode(-1)) {
|
||||||
|
ALOGE("HAL returned invalid TTY value: %s", halMode.c_str());
|
||||||
|
_hidl_cb(Result::INVALID_STATE, TtyMode::OFF);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
_hidl_cb(Result::OK, mode);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> PrimaryDevice::setTtyMode(IPrimaryDevice::TtyMode mode) {
|
||||||
|
const char* modeStr = convertTtyModeFromHIDL(mode);
|
||||||
|
if (modeStr == nullptr) {
|
||||||
|
ALOGW("Can not set an invalid TTY value: %d", mode);
|
||||||
|
return Result::INVALID_ARGUMENTS;
|
||||||
|
}
|
||||||
|
return mDevice->setParam(AUDIO_PARAMETER_KEY_TTY_MODE, modeStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> PrimaryDevice::getHacEnabled(getHacEnabled_cb _hidl_cb) {
|
||||||
|
bool enabled;
|
||||||
|
Result retval = mDevice->getParam(AUDIO_PARAMETER_KEY_HAC, &enabled);
|
||||||
|
_hidl_cb(retval, enabled);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> PrimaryDevice::setHacEnabled(bool enabled) {
|
||||||
|
return mDevice->setParam(AUDIO_PARAMETER_KEY_HAC, enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if MAJOR_VERSION >= 4
|
||||||
|
Return<Result> PrimaryDevice::setBtScoHeadsetDebugName(const hidl_string& name) {
|
||||||
|
return mDevice->setParam(AUDIO_PARAMETER_KEY_BT_SCO_HEADSET_NAME, name.c_str());
|
||||||
|
}
|
||||||
|
Return<void> PrimaryDevice::getBtHfpEnabled(getBtHfpEnabled_cb _hidl_cb) {
|
||||||
|
bool enabled;
|
||||||
|
Result retval = mDevice->getParam(AUDIO_PARAMETER_KEY_HFP_ENABLE, &enabled);
|
||||||
|
_hidl_cb(retval, enabled);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
Return<Result> PrimaryDevice::setBtHfpEnabled(bool enabled) {
|
||||||
|
return mDevice->setParam(AUDIO_PARAMETER_KEY_HFP_ENABLE, enabled);
|
||||||
|
}
|
||||||
|
Return<Result> PrimaryDevice::setBtHfpSampleRate(uint32_t sampleRateHz) {
|
||||||
|
return mDevice->setParam(AUDIO_PARAMETER_KEY_HFP_SET_SAMPLING_RATE, int(sampleRateHz));
|
||||||
|
}
|
||||||
|
Return<Result> PrimaryDevice::setBtHfpVolume(float volume) {
|
||||||
|
if (!util::isGainNormalized(volume)) {
|
||||||
|
ALOGW("Can not set BT HFP volume (%f) outside [0,1]", volume);
|
||||||
|
return Result::INVALID_ARGUMENTS;
|
||||||
|
}
|
||||||
|
// Map the normalized volume onto the range of [0, 15]
|
||||||
|
return mDevice->setParam(AUDIO_PARAMETER_KEY_HFP_VOLUME,
|
||||||
|
static_cast<int>(std::round(volume * 15)));
|
||||||
|
}
|
||||||
|
Return<Result> PrimaryDevice::updateRotation(IPrimaryDevice::Rotation rotation) {
|
||||||
|
// legacy API expects the rotation in degree
|
||||||
|
return mDevice->setParam(AUDIO_PARAMETER_KEY_ROTATION, int(rotation) * 90);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Return<void> PrimaryDevice::debug(const hidl_handle& fd, const hidl_vec<hidl_string>& options) {
|
||||||
|
return mDevice->debug(fd, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace implementation
|
||||||
|
} // namespace CPP_VERSION
|
||||||
|
} // namespace audio
|
||||||
|
} // namespace hardware
|
||||||
|
} // namespace android
|
457
audio/impl/Stream.cpp
Normal file
457
audio/impl/Stream.cpp
Normal file
@@ -0,0 +1,457 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define LOG_TAG "StreamHAL"
|
||||||
|
|
||||||
|
#include "core/default/Stream.h"
|
||||||
|
#include "common/all-versions/HidlSupport.h"
|
||||||
|
#include "common/all-versions/default/EffectMap.h"
|
||||||
|
#include "core/default/Util.h"
|
||||||
|
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
|
#include <HidlUtils.h>
|
||||||
|
#include <android/log.h>
|
||||||
|
#include <hardware/audio.h>
|
||||||
|
#include <hardware/audio_effect.h>
|
||||||
|
#include <media/AudioContainers.h>
|
||||||
|
#include <media/TypeConverter.h>
|
||||||
|
#include <util/CoreUtils.h>
|
||||||
|
|
||||||
|
namespace android {
|
||||||
|
namespace hardware {
|
||||||
|
namespace audio {
|
||||||
|
namespace CPP_VERSION {
|
||||||
|
namespace implementation {
|
||||||
|
|
||||||
|
using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::implementation::HidlUtils;
|
||||||
|
using ::android::hardware::audio::common::utils::splitString;
|
||||||
|
using ::android::hardware::audio::CORE_TYPES_CPP_VERSION::implementation::CoreUtils;
|
||||||
|
namespace util {
|
||||||
|
using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION::implementation::util;
|
||||||
|
}
|
||||||
|
|
||||||
|
Stream::Stream(bool isInput, audio_stream_t* stream) : mIsInput(isInput), mStream(stream) {
|
||||||
|
(void)mIsInput; // prevent 'unused field' warnings in pre-V7 versions.
|
||||||
|
}
|
||||||
|
|
||||||
|
Stream::~Stream() {
|
||||||
|
mStream = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
|
Result Stream::analyzeStatus(const char* funcName, int status) {
|
||||||
|
return util::analyzeStatus("stream", funcName, status);
|
||||||
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
|
Result Stream::analyzeStatus(const char* funcName, int status,
|
||||||
|
const std::vector<int>& ignoreErrors) {
|
||||||
|
return util::analyzeStatus("stream", funcName, status, ignoreErrors);
|
||||||
|
}
|
||||||
|
|
||||||
|
char* Stream::halGetParameters(const char* keys) {
|
||||||
|
return mStream->get_parameters(mStream, keys);
|
||||||
|
}
|
||||||
|
|
||||||
|
int Stream::halSetParameters(const char* keysAndValues) {
|
||||||
|
return mStream->set_parameters(mStream, keysAndValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Methods from ::android::hardware::audio::CPP_VERSION::IStream follow.
|
||||||
|
Return<uint64_t> Stream::getFrameSize() {
|
||||||
|
// Needs to be implemented by interface subclasses. But can't be declared as pure virtual,
|
||||||
|
// since interface subclasses implementation do not inherit from this class.
|
||||||
|
LOG_ALWAYS_FATAL("Stream::getFrameSize is pure abstract");
|
||||||
|
return uint64_t{};
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<uint64_t> Stream::getFrameCount() {
|
||||||
|
int halFrameCount;
|
||||||
|
Result retval = getParam(AudioParameter::keyFrameCount, &halFrameCount);
|
||||||
|
return retval == Result::OK ? halFrameCount : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<uint64_t> Stream::getBufferSize() {
|
||||||
|
return mStream->get_buffer_size(mStream);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
Return<uint32_t> Stream::getSampleRate() {
|
||||||
|
return mStream->get_sample_rate(mStream);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<void> Stream::getSupportedSampleRates(getSupportedSampleRates_cb _hidl_cb) {
|
||||||
|
return getSupportedSampleRates(getFormat(), _hidl_cb);
|
||||||
|
}
|
||||||
|
Return<void> Stream::getSupportedChannelMasks(getSupportedChannelMasks_cb _hidl_cb) {
|
||||||
|
return getSupportedChannelMasks(getFormat(), _hidl_cb);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Return<void> Stream::getSupportedSampleRates(AudioFormat format,
|
||||||
|
getSupportedSampleRates_cb _hidl_cb) {
|
||||||
|
AudioParameter context;
|
||||||
|
context.addInt(String8(AUDIO_PARAMETER_STREAM_FORMAT), int(format));
|
||||||
|
String8 halListValue;
|
||||||
|
Result result =
|
||||||
|
getParam(AudioParameter::keyStreamSupportedSamplingRates, &halListValue, context);
|
||||||
|
hidl_vec<uint32_t> sampleRates;
|
||||||
|
SampleRateSet halSampleRates;
|
||||||
|
if (result == Result::OK) {
|
||||||
|
halSampleRates =
|
||||||
|
samplingRatesFromString(halListValue.c_str(), AudioParameter::valueListSeparator);
|
||||||
|
sampleRates = hidl_vec<uint32_t>(halSampleRates.begin(), halSampleRates.end());
|
||||||
|
// Legacy get_parameter does not return a status_t, thus can not advertise of failure.
|
||||||
|
// Note that this method must succeed (non empty list) if the format is supported.
|
||||||
|
if (sampleRates.size() == 0) {
|
||||||
|
result = Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
_hidl_cb(sampleRates);
|
||||||
|
#elif MAJOR_VERSION >= 4
|
||||||
|
_hidl_cb(result, sampleRates);
|
||||||
|
#endif
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> Stream::getSupportedChannelMasks(AudioFormat format,
|
||||||
|
getSupportedChannelMasks_cb _hidl_cb) {
|
||||||
|
AudioParameter context;
|
||||||
|
context.addInt(String8(AUDIO_PARAMETER_STREAM_FORMAT), int(format));
|
||||||
|
String8 halListValue;
|
||||||
|
Result result = getParam(AudioParameter::keyStreamSupportedChannels, &halListValue, context);
|
||||||
|
hidl_vec<AudioChannelBitfield> channelMasks;
|
||||||
|
ChannelMaskSet halChannelMasks;
|
||||||
|
if (result == Result::OK) {
|
||||||
|
halChannelMasks =
|
||||||
|
channelMasksFromString(halListValue.c_str(), AudioParameter::valueListSeparator);
|
||||||
|
channelMasks.resize(halChannelMasks.size());
|
||||||
|
size_t i = 0;
|
||||||
|
for (auto channelMask : halChannelMasks) {
|
||||||
|
channelMasks[i++] = AudioChannelBitfield(channelMask);
|
||||||
|
}
|
||||||
|
// Legacy get_parameter does not return a status_t, thus can not advertise of failure.
|
||||||
|
// Note that this method must succeed (non empty list) if the format is supported.
|
||||||
|
if (channelMasks.size() == 0) {
|
||||||
|
result = Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
_hidl_cb(channelMasks);
|
||||||
|
#elif MAJOR_VERSION >= 4
|
||||||
|
_hidl_cb(result, channelMasks);
|
||||||
|
#endif
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> Stream::setSampleRate(uint32_t sampleRateHz) {
|
||||||
|
return setParam(AudioParameter::keySamplingRate, static_cast<int>(sampleRateHz));
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<AudioChannelBitfield> Stream::getChannelMask() {
|
||||||
|
return AudioChannelBitfield(mStream->get_channels(mStream));
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> Stream::setChannelMask(AudioChannelBitfield mask) {
|
||||||
|
return setParam(AudioParameter::keyChannels, static_cast<int>(mask));
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<AudioFormat> Stream::getFormat() {
|
||||||
|
return AudioFormat(mStream->get_format(mStream));
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> Stream::getSupportedFormats(getSupportedFormats_cb _hidl_cb) {
|
||||||
|
String8 halListValue;
|
||||||
|
Result result = getParam(AudioParameter::keyStreamSupportedFormats, &halListValue);
|
||||||
|
hidl_vec<AudioFormat> formats;
|
||||||
|
FormatVector halFormats;
|
||||||
|
if (result == Result::OK) {
|
||||||
|
halFormats = formatsFromString(halListValue.c_str(), AudioParameter::valueListSeparator);
|
||||||
|
formats.resize(halFormats.size());
|
||||||
|
for (size_t i = 0; i < halFormats.size(); ++i) {
|
||||||
|
formats[i] = AudioFormat(halFormats[i]);
|
||||||
|
}
|
||||||
|
// Legacy get_parameter does not return a status_t, thus can not advertise of failure.
|
||||||
|
// Note that the method must not return an empty list if this capability is supported.
|
||||||
|
if (formats.size() == 0) {
|
||||||
|
result = Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#if MAJOR_VERSION <= 5
|
||||||
|
_hidl_cb(formats);
|
||||||
|
#elif MAJOR_VERSION >= 6
|
||||||
|
_hidl_cb(result, formats);
|
||||||
|
#endif
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> Stream::setFormat(AudioFormat format) {
|
||||||
|
return setParam(AudioParameter::keyFormat, static_cast<int>(format));
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> Stream::getAudioProperties(getAudioProperties_cb _hidl_cb) {
|
||||||
|
uint32_t halSampleRate = mStream->get_sample_rate(mStream);
|
||||||
|
audio_channel_mask_t halMask = mStream->get_channels(mStream);
|
||||||
|
audio_format_t halFormat = mStream->get_format(mStream);
|
||||||
|
_hidl_cb(halSampleRate, AudioChannelBitfield(halMask), AudioFormat(halFormat));
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
#else // MAJOR_VERSION <= 6
|
||||||
|
|
||||||
|
Return<void> Stream::getSupportedProfiles(getSupportedProfiles_cb _hidl_cb) {
|
||||||
|
String8 halListValue;
|
||||||
|
Result result = getParam(AudioParameter::keyStreamSupportedFormats, &halListValue);
|
||||||
|
hidl_vec<AudioProfile> profiles;
|
||||||
|
if (result != Result::OK) {
|
||||||
|
_hidl_cb(result, profiles);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
// Ensure that the separator is one character, despite that it's defined as a C string.
|
||||||
|
static_assert(sizeof(AUDIO_PARAMETER_VALUE_LIST_SEPARATOR) == 2);
|
||||||
|
std::vector<std::string> halFormats =
|
||||||
|
splitString(halListValue.c_str(), AUDIO_PARAMETER_VALUE_LIST_SEPARATOR[0]);
|
||||||
|
hidl_vec<AudioFormat> formats;
|
||||||
|
(void)HidlUtils::audioFormatsFromHal(halFormats, &formats);
|
||||||
|
std::vector<AudioProfile> tempProfiles;
|
||||||
|
for (const auto& format : formats) {
|
||||||
|
audio_format_t halFormat;
|
||||||
|
if (status_t status = HidlUtils::audioFormatToHal(format, &halFormat); status != NO_ERROR) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
AudioParameter context;
|
||||||
|
context.addInt(String8(AUDIO_PARAMETER_STREAM_FORMAT), int(halFormat));
|
||||||
|
// Query supported sample rates for the format.
|
||||||
|
result = getParam(AudioParameter::keyStreamSupportedSamplingRates, &halListValue, context);
|
||||||
|
if (result != Result::OK) break;
|
||||||
|
std::vector<std::string> halSampleRates =
|
||||||
|
splitString(halListValue.c_str(), AUDIO_PARAMETER_VALUE_LIST_SEPARATOR[0]);
|
||||||
|
hidl_vec<uint32_t> sampleRates;
|
||||||
|
sampleRates.resize(halSampleRates.size());
|
||||||
|
for (size_t i = 0; i < sampleRates.size(); ++i) {
|
||||||
|
sampleRates[i] = std::stoi(halSampleRates[i]);
|
||||||
|
}
|
||||||
|
// Query supported channel masks for the format.
|
||||||
|
result = getParam(AudioParameter::keyStreamSupportedChannels, &halListValue, context);
|
||||||
|
if (result != Result::OK) break;
|
||||||
|
std::vector<std::string> halChannelMasks =
|
||||||
|
splitString(halListValue.c_str(), AUDIO_PARAMETER_VALUE_LIST_SEPARATOR[0]);
|
||||||
|
hidl_vec<AudioChannelMask> channelMasks;
|
||||||
|
(void)HidlUtils::audioChannelMasksFromHal(halChannelMasks, &channelMasks);
|
||||||
|
// Create a profile.
|
||||||
|
if (channelMasks.size() != 0 && sampleRates.size() != 0) {
|
||||||
|
tempProfiles.push_back({.format = format,
|
||||||
|
.sampleRates = std::move(sampleRates),
|
||||||
|
.channelMasks = std::move(channelMasks)});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Legacy get_parameter does not return a status_t, thus can not advertise of failure.
|
||||||
|
// Note that the method must not return an empty list if this capability is supported.
|
||||||
|
if (!tempProfiles.empty()) {
|
||||||
|
profiles = tempProfiles;
|
||||||
|
} else {
|
||||||
|
result = Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
_hidl_cb(result, profiles);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> Stream::getAudioProperties(getAudioProperties_cb _hidl_cb) {
|
||||||
|
audio_config_base_t halConfigBase = {mStream->get_sample_rate(mStream),
|
||||||
|
mStream->get_channels(mStream),
|
||||||
|
mStream->get_format(mStream)};
|
||||||
|
AudioConfigBase configBase = {};
|
||||||
|
status_t status = HidlUtils::audioConfigBaseFromHal(halConfigBase, mIsInput, &configBase);
|
||||||
|
_hidl_cb(Stream::analyzeStatus("get_audio_properties", status), configBase);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> Stream::setAudioProperties(const AudioConfigBaseOptional& config) {
|
||||||
|
audio_config_base_t halConfigBase = AUDIO_CONFIG_BASE_INITIALIZER;
|
||||||
|
bool formatSpecified, sRateSpecified, channelMaskSpecified;
|
||||||
|
status_t status = HidlUtils::audioConfigBaseOptionalToHal(
|
||||||
|
config, &halConfigBase, &formatSpecified, &sRateSpecified, &channelMaskSpecified);
|
||||||
|
if (status != NO_ERROR) {
|
||||||
|
return Stream::analyzeStatus("set_audio_properties", status);
|
||||||
|
}
|
||||||
|
if (sRateSpecified) {
|
||||||
|
if (Result result = setParam(AudioParameter::keySamplingRate,
|
||||||
|
static_cast<int>(halConfigBase.sample_rate));
|
||||||
|
result != Result::OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (channelMaskSpecified) {
|
||||||
|
if (Result result = setParam(AudioParameter::keyChannels,
|
||||||
|
static_cast<int>(halConfigBase.channel_mask));
|
||||||
|
result != Result::OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (formatSpecified) {
|
||||||
|
if (Result result =
|
||||||
|
setParam(AudioParameter::keyFormat, static_cast<int>(halConfigBase.format));
|
||||||
|
result != Result::OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Result::OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // MAJOR_VERSION <= 6
|
||||||
|
|
||||||
|
Return<Result> Stream::addEffect(uint64_t effectId) {
|
||||||
|
effect_handle_t halEffect = EffectMap::getInstance().get(effectId);
|
||||||
|
if (halEffect != NULL) {
|
||||||
|
return analyzeStatus("add_audio_effect", mStream->add_audio_effect(mStream, halEffect));
|
||||||
|
} else {
|
||||||
|
ALOGW("Invalid effect ID passed from client: %" PRIu64, effectId);
|
||||||
|
return Result::INVALID_ARGUMENTS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> Stream::removeEffect(uint64_t effectId) {
|
||||||
|
effect_handle_t halEffect = EffectMap::getInstance().get(effectId);
|
||||||
|
if (halEffect != NULL) {
|
||||||
|
return analyzeStatus("remove_audio_effect",
|
||||||
|
mStream->remove_audio_effect(mStream, halEffect));
|
||||||
|
} else {
|
||||||
|
ALOGW("Invalid effect ID passed from client: %" PRIu64, effectId);
|
||||||
|
return Result::INVALID_ARGUMENTS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> Stream::standby() {
|
||||||
|
return analyzeStatus("standby", mStream->standby(mStream));
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> Stream::setHwAvSync(uint32_t hwAvSync) {
|
||||||
|
return setParam(AudioParameter::keyStreamHwAvSync, static_cast<int>(hwAvSync));
|
||||||
|
}
|
||||||
|
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<AudioDevice> Stream::getDevice() {
|
||||||
|
int device = 0;
|
||||||
|
Result retval = getParam(AudioParameter::keyRouting, &device);
|
||||||
|
return retval == Result::OK ? static_cast<AudioDevice>(device) : AudioDevice::NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> Stream::setDevice(const DeviceAddress& address) {
|
||||||
|
return setParam(AudioParameter::keyRouting, address);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> Stream::getParameters(const hidl_vec<hidl_string>& keys, getParameters_cb _hidl_cb) {
|
||||||
|
getParametersImpl({} /* context */, keys, _hidl_cb);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> Stream::setParameters(const hidl_vec<ParameterValue>& parameters) {
|
||||||
|
return setParametersImpl({} /* context */, parameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> Stream::setConnectedState(const DeviceAddress& address, bool connected) {
|
||||||
|
return setParam(
|
||||||
|
connected ? AudioParameter::keyDeviceConnect : AudioParameter::keyDeviceDisconnect,
|
||||||
|
address);
|
||||||
|
}
|
||||||
|
#elif MAJOR_VERSION >= 4
|
||||||
|
Return<void> Stream::getDevices(getDevices_cb _hidl_cb) {
|
||||||
|
int halDevice = 0;
|
||||||
|
Result retval = getParam(AudioParameter::keyRouting, &halDevice);
|
||||||
|
hidl_vec<DeviceAddress> devices;
|
||||||
|
if (retval == Result::OK) {
|
||||||
|
devices.resize(1);
|
||||||
|
retval = Stream::analyzeStatus(
|
||||||
|
"get_devices",
|
||||||
|
CoreUtils::deviceAddressFromHal(static_cast<audio_devices_t>(halDevice), nullptr,
|
||||||
|
&devices[0]));
|
||||||
|
}
|
||||||
|
_hidl_cb(retval, devices);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> Stream::setDevices(const hidl_vec<DeviceAddress>& devices) {
|
||||||
|
// FIXME: can the legacy API set multiple device with address ?
|
||||||
|
if (devices.size() > 1) {
|
||||||
|
return Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
DeviceAddress address{};
|
||||||
|
if (devices.size() == 1) {
|
||||||
|
address = devices[0];
|
||||||
|
}
|
||||||
|
return setParam(AudioParameter::keyRouting, address);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> Stream::getParameters(const hidl_vec<ParameterValue>& context,
|
||||||
|
const hidl_vec<hidl_string>& keys, getParameters_cb _hidl_cb) {
|
||||||
|
getParametersImpl(context, keys, _hidl_cb);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> Stream::setParameters(const hidl_vec<ParameterValue>& context,
|
||||||
|
const hidl_vec<ParameterValue>& parameters) {
|
||||||
|
return setParametersImpl(context, parameters);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Return<Result> Stream::start() {
|
||||||
|
return Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> Stream::stop() {
|
||||||
|
return Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> Stream::createMmapBuffer(int32_t minSizeFrames __unused,
|
||||||
|
createMmapBuffer_cb _hidl_cb) {
|
||||||
|
Result retval(Result::NOT_SUPPORTED);
|
||||||
|
MmapBufferInfo info;
|
||||||
|
_hidl_cb(retval, info);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> Stream::getMmapPosition(getMmapPosition_cb _hidl_cb) {
|
||||||
|
Result retval(Result::NOT_SUPPORTED);
|
||||||
|
MmapPosition position;
|
||||||
|
_hidl_cb(retval, position);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> Stream::close() {
|
||||||
|
return Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> Stream::debug(const hidl_handle& fd, const hidl_vec<hidl_string>& /* options */) {
|
||||||
|
if (fd.getNativeHandle() != nullptr && fd->numFds == 1) {
|
||||||
|
analyzeStatus("dump", mStream->dump(mStream, fd->data[0]));
|
||||||
|
}
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<void> Stream::debugDump(const hidl_handle& fd) {
|
||||||
|
return debug(fd, {} /* options */);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
} // namespace implementation
|
||||||
|
} // namespace CPP_VERSION
|
||||||
|
} // namespace audio
|
||||||
|
} // namespace hardware
|
||||||
|
} // namespace android
|
607
audio/impl/StreamIn.cpp
Normal file
607
audio/impl/StreamIn.cpp
Normal file
@@ -0,0 +1,607 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define LOG_TAG "StreamInHAL"
|
||||||
|
|
||||||
|
#include "core/default/StreamIn.h"
|
||||||
|
#include "core/default/Util.h"
|
||||||
|
#include "common/all-versions/HidlSupport.h"
|
||||||
|
|
||||||
|
//#define LOG_NDEBUG 0
|
||||||
|
#define ATRACE_TAG ATRACE_TAG_AUDIO
|
||||||
|
|
||||||
|
#include <HidlUtils.h>
|
||||||
|
#include <android/log.h>
|
||||||
|
#include <hardware/audio.h>
|
||||||
|
#include <util/CoreUtils.h>
|
||||||
|
#include <utils/Trace.h>
|
||||||
|
#include <cmath>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
namespace android {
|
||||||
|
namespace hardware {
|
||||||
|
namespace audio {
|
||||||
|
namespace CPP_VERSION {
|
||||||
|
namespace implementation {
|
||||||
|
|
||||||
|
using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::implementation::HidlUtils;
|
||||||
|
using ::android::hardware::audio::CORE_TYPES_CPP_VERSION::implementation::CoreUtils;
|
||||||
|
namespace util {
|
||||||
|
using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION::implementation::util;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
class ReadThread : public Thread {
|
||||||
|
public:
|
||||||
|
// ReadThread's lifespan never exceeds StreamIn's lifespan.
|
||||||
|
ReadThread(std::atomic<bool>* stop, audio_stream_in_t* stream, StreamIn::CommandMQ* commandMQ,
|
||||||
|
StreamIn::DataMQ* dataMQ, StreamIn::StatusMQ* statusMQ, EventFlag* efGroup)
|
||||||
|
: Thread(false /*canCallJava*/),
|
||||||
|
mStop(stop),
|
||||||
|
mStream(stream),
|
||||||
|
mCommandMQ(commandMQ),
|
||||||
|
mDataMQ(dataMQ),
|
||||||
|
mStatusMQ(statusMQ),
|
||||||
|
mEfGroup(efGroup),
|
||||||
|
mBuffer(nullptr) {}
|
||||||
|
bool init() {
|
||||||
|
mBuffer.reset(new (std::nothrow) uint8_t[mDataMQ->getQuantumCount()]);
|
||||||
|
return mBuffer != nullptr;
|
||||||
|
}
|
||||||
|
virtual ~ReadThread() {}
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::atomic<bool>* mStop;
|
||||||
|
audio_stream_in_t* mStream;
|
||||||
|
StreamIn::CommandMQ* mCommandMQ;
|
||||||
|
StreamIn::DataMQ* mDataMQ;
|
||||||
|
StreamIn::StatusMQ* mStatusMQ;
|
||||||
|
EventFlag* mEfGroup;
|
||||||
|
std::unique_ptr<uint8_t[]> mBuffer;
|
||||||
|
IStreamIn::ReadParameters mParameters;
|
||||||
|
IStreamIn::ReadStatus mStatus;
|
||||||
|
|
||||||
|
bool threadLoop() override;
|
||||||
|
|
||||||
|
void doGetCapturePosition();
|
||||||
|
void doRead();
|
||||||
|
};
|
||||||
|
|
||||||
|
void ReadThread::doRead() {
|
||||||
|
size_t availableToWrite = mDataMQ->availableToWrite();
|
||||||
|
size_t requestedToRead = mParameters.params.read;
|
||||||
|
if (requestedToRead > availableToWrite) {
|
||||||
|
ALOGW(
|
||||||
|
"truncating read data from %d to %d due to insufficient data queue "
|
||||||
|
"space",
|
||||||
|
(int32_t)requestedToRead, (int32_t)availableToWrite);
|
||||||
|
requestedToRead = availableToWrite;
|
||||||
|
}
|
||||||
|
ssize_t readResult = mStream->read(mStream, &mBuffer[0], requestedToRead);
|
||||||
|
mStatus.retval = Result::OK;
|
||||||
|
if (readResult >= 0) {
|
||||||
|
mStatus.reply.read = readResult;
|
||||||
|
if (!mDataMQ->write(&mBuffer[0], readResult)) {
|
||||||
|
ALOGW("data message queue write failed");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
mStatus.retval = Stream::analyzeStatus("read", readResult);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReadThread::doGetCapturePosition() {
|
||||||
|
mStatus.retval = StreamIn::getCapturePositionImpl(
|
||||||
|
mStream, &mStatus.reply.capturePosition.frames, &mStatus.reply.capturePosition.time);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ReadThread::threadLoop() {
|
||||||
|
// This implementation doesn't return control back to the Thread until it
|
||||||
|
// decides to stop,
|
||||||
|
// as the Thread uses mutexes, and this can lead to priority inversion.
|
||||||
|
while (!std::atomic_load_explicit(mStop, std::memory_order_acquire)) {
|
||||||
|
uint32_t efState = 0;
|
||||||
|
mEfGroup->wait(static_cast<uint32_t>(MessageQueueFlagBits::NOT_FULL), &efState);
|
||||||
|
if (!(efState & static_cast<uint32_t>(MessageQueueFlagBits::NOT_FULL))) {
|
||||||
|
continue; // Nothing to do.
|
||||||
|
}
|
||||||
|
if (!mCommandMQ->read(&mParameters)) {
|
||||||
|
continue; // Nothing to do.
|
||||||
|
}
|
||||||
|
mStatus.replyTo = mParameters.command;
|
||||||
|
switch (mParameters.command) {
|
||||||
|
case IStreamIn::ReadCommand::READ:
|
||||||
|
doRead();
|
||||||
|
break;
|
||||||
|
case IStreamIn::ReadCommand::GET_CAPTURE_POSITION:
|
||||||
|
doGetCapturePosition();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ALOGE("Unknown read thread command code %d", mParameters.command);
|
||||||
|
mStatus.retval = Result::NOT_SUPPORTED;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (!mStatusMQ->write(&mStatus)) {
|
||||||
|
ALOGW("status message queue write failed");
|
||||||
|
}
|
||||||
|
mEfGroup->wake(static_cast<uint32_t>(MessageQueueFlagBits::NOT_EMPTY));
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
StreamIn::StreamIn(const sp<Device>& device, audio_stream_in_t* stream)
|
||||||
|
: mDevice(device),
|
||||||
|
mStream(stream),
|
||||||
|
mStreamCommon(new Stream(true /*isInput*/, &stream->common)),
|
||||||
|
mStreamMmap(new StreamMmap<audio_stream_in_t>(stream)),
|
||||||
|
mEfGroup(nullptr),
|
||||||
|
mStopReadThread(false) {}
|
||||||
|
|
||||||
|
StreamIn::~StreamIn() {
|
||||||
|
ATRACE_CALL();
|
||||||
|
close();
|
||||||
|
if (mReadThread.get()) {
|
||||||
|
ATRACE_NAME("mReadThread->join");
|
||||||
|
status_t status = mReadThread->join();
|
||||||
|
ALOGE_IF(status, "read thread exit error: %s", strerror(-status));
|
||||||
|
}
|
||||||
|
if (mEfGroup) {
|
||||||
|
status_t status = EventFlag::deleteEventFlag(&mEfGroup);
|
||||||
|
ALOGE_IF(status, "read MQ event flag deletion error: %s", strerror(-status));
|
||||||
|
}
|
||||||
|
#if MAJOR_VERSION <= 5
|
||||||
|
mDevice->closeInputStream(mStream);
|
||||||
|
#endif
|
||||||
|
mStream = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Methods from ::android::hardware::audio::CPP_VERSION::IStream follow.
|
||||||
|
Return<uint64_t> StreamIn::getFrameSize() {
|
||||||
|
return audio_stream_in_frame_size(mStream);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<uint64_t> StreamIn::getFrameCount() {
|
||||||
|
return mStreamCommon->getFrameCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<uint64_t> StreamIn::getBufferSize() {
|
||||||
|
return mStreamCommon->getBufferSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
Return<uint32_t> StreamIn::getSampleRate() {
|
||||||
|
return mStreamCommon->getSampleRate();
|
||||||
|
}
|
||||||
|
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<void> StreamIn::getSupportedChannelMasks(getSupportedChannelMasks_cb _hidl_cb) {
|
||||||
|
return mStreamCommon->getSupportedChannelMasks(_hidl_cb);
|
||||||
|
}
|
||||||
|
Return<void> StreamIn::getSupportedSampleRates(getSupportedSampleRates_cb _hidl_cb) {
|
||||||
|
return mStreamCommon->getSupportedSampleRates(_hidl_cb);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Return<void> StreamIn::getSupportedChannelMasks(AudioFormat format,
|
||||||
|
getSupportedChannelMasks_cb _hidl_cb) {
|
||||||
|
return mStreamCommon->getSupportedChannelMasks(format, _hidl_cb);
|
||||||
|
}
|
||||||
|
Return<void> StreamIn::getSupportedSampleRates(AudioFormat format,
|
||||||
|
getSupportedSampleRates_cb _hidl_cb) {
|
||||||
|
return mStreamCommon->getSupportedSampleRates(format, _hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamIn::setSampleRate(uint32_t sampleRateHz) {
|
||||||
|
return mStreamCommon->setSampleRate(sampleRateHz);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<AudioChannelBitfield> StreamIn::getChannelMask() {
|
||||||
|
return mStreamCommon->getChannelMask();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamIn::setChannelMask(AudioChannelBitfield mask) {
|
||||||
|
return mStreamCommon->setChannelMask(mask);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<AudioFormat> StreamIn::getFormat() {
|
||||||
|
return mStreamCommon->getFormat();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> StreamIn::getSupportedFormats(getSupportedFormats_cb _hidl_cb) {
|
||||||
|
return mStreamCommon->getSupportedFormats(_hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamIn::setFormat(AudioFormat format) {
|
||||||
|
return mStreamCommon->setFormat(format);
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
Return<void> StreamIn::getSupportedProfiles(getSupportedProfiles_cb _hidl_cb) {
|
||||||
|
return mStreamCommon->getSupportedProfiles(_hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamIn::setAudioProperties(const AudioConfigBaseOptional& config) {
|
||||||
|
return mStreamCommon->setAudioProperties(config);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // MAJOR_VERSION <= 6
|
||||||
|
|
||||||
|
Return<void> StreamIn::getAudioProperties(getAudioProperties_cb _hidl_cb) {
|
||||||
|
return mStreamCommon->getAudioProperties(_hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamIn::addEffect(uint64_t effectId) {
|
||||||
|
return mStreamCommon->addEffect(effectId);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamIn::removeEffect(uint64_t effectId) {
|
||||||
|
return mStreamCommon->removeEffect(effectId);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamIn::standby() {
|
||||||
|
return mStreamCommon->standby();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamIn::setHwAvSync(uint32_t hwAvSync) {
|
||||||
|
return mStreamCommon->setHwAvSync(hwAvSync);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<Result> StreamIn::setConnectedState(const DeviceAddress& address, bool connected) {
|
||||||
|
return mStreamCommon->setConnectedState(address, connected);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<AudioDevice> StreamIn::getDevice() {
|
||||||
|
return mStreamCommon->getDevice();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamIn::setDevice(const DeviceAddress& address) {
|
||||||
|
return mStreamCommon->setDevice(address);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> StreamIn::getParameters(const hidl_vec<hidl_string>& keys, getParameters_cb _hidl_cb) {
|
||||||
|
return mStreamCommon->getParameters(keys, _hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamIn::setParameters(const hidl_vec<ParameterValue>& parameters) {
|
||||||
|
return mStreamCommon->setParameters(parameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> StreamIn::debugDump(const hidl_handle& fd) {
|
||||||
|
return mStreamCommon->debugDump(fd);
|
||||||
|
}
|
||||||
|
#elif MAJOR_VERSION >= 4
|
||||||
|
Return<void> StreamIn::getDevices(getDevices_cb _hidl_cb) {
|
||||||
|
return mStreamCommon->getDevices(_hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamIn::setDevices(const hidl_vec<DeviceAddress>& devices) {
|
||||||
|
return mStreamCommon->setDevices(devices);
|
||||||
|
}
|
||||||
|
Return<void> StreamIn::getParameters(const hidl_vec<ParameterValue>& context,
|
||||||
|
const hidl_vec<hidl_string>& keys, getParameters_cb _hidl_cb) {
|
||||||
|
return mStreamCommon->getParameters(context, keys, _hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamIn::setParameters(const hidl_vec<ParameterValue>& context,
|
||||||
|
const hidl_vec<ParameterValue>& parameters) {
|
||||||
|
return mStreamCommon->setParameters(context, parameters);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Return<Result> StreamIn::start() {
|
||||||
|
return mStreamMmap->start();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamIn::stop() {
|
||||||
|
return mStreamMmap->stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> StreamIn::createMmapBuffer(int32_t minSizeFrames, createMmapBuffer_cb _hidl_cb) {
|
||||||
|
return mStreamMmap->createMmapBuffer(minSizeFrames, audio_stream_in_frame_size(mStream),
|
||||||
|
_hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> StreamIn::getMmapPosition(getMmapPosition_cb _hidl_cb) {
|
||||||
|
return mStreamMmap->getMmapPosition(_hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamIn::close() {
|
||||||
|
if (mStopReadThread.load(std::memory_order_relaxed)) { // only this thread writes
|
||||||
|
return Result::INVALID_STATE;
|
||||||
|
}
|
||||||
|
mStopReadThread.store(true, std::memory_order_release);
|
||||||
|
if (mEfGroup) {
|
||||||
|
mEfGroup->wake(static_cast<uint32_t>(MessageQueueFlagBits::NOT_FULL));
|
||||||
|
}
|
||||||
|
#if MAJOR_VERSION >= 6
|
||||||
|
mDevice->closeInputStream(mStream);
|
||||||
|
#endif
|
||||||
|
return Result::OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Methods from ::android::hardware::audio::CPP_VERSION::IStreamIn follow.
|
||||||
|
Return<void> StreamIn::getAudioSource(getAudioSource_cb _hidl_cb) {
|
||||||
|
int halSource;
|
||||||
|
Result retval = mStreamCommon->getParam(AudioParameter::keyInputSource, &halSource);
|
||||||
|
AudioSource source = {};
|
||||||
|
if (retval == Result::OK) {
|
||||||
|
retval = Stream::analyzeStatus(
|
||||||
|
"get_audio_source",
|
||||||
|
HidlUtils::audioSourceFromHal(static_cast<audio_source_t>(halSource), &source));
|
||||||
|
}
|
||||||
|
_hidl_cb(retval, source);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamIn::setGain(float gain) {
|
||||||
|
if (!util::isGainNormalized(gain)) {
|
||||||
|
ALOGW("Can not set a stream input gain (%f) outside [0,1]", gain);
|
||||||
|
return Result::INVALID_ARGUMENTS;
|
||||||
|
}
|
||||||
|
return Stream::analyzeStatus("set_gain", mStream->set_gain(mStream, gain));
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> StreamIn::prepareForReading(uint32_t frameSize, uint32_t framesCount,
|
||||||
|
prepareForReading_cb _hidl_cb) {
|
||||||
|
status_t status;
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
ThreadInfo threadInfo = {0, 0};
|
||||||
|
#else
|
||||||
|
int32_t threadInfo = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Wrap the _hidl_cb to return an error
|
||||||
|
auto sendError = [&threadInfo, &_hidl_cb](Result result) {
|
||||||
|
_hidl_cb(result, CommandMQ::Descriptor(), DataMQ::Descriptor(), StatusMQ::Descriptor(),
|
||||||
|
threadInfo);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Create message queues.
|
||||||
|
if (mDataMQ) {
|
||||||
|
ALOGE("the client attempts to call prepareForReading twice");
|
||||||
|
sendError(Result::INVALID_STATE);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
std::unique_ptr<CommandMQ> tempCommandMQ(new CommandMQ(1));
|
||||||
|
|
||||||
|
// Check frameSize and framesCount
|
||||||
|
if (frameSize == 0 || framesCount == 0) {
|
||||||
|
ALOGE("Null frameSize (%u) or framesCount (%u)", frameSize, framesCount);
|
||||||
|
sendError(Result::INVALID_ARGUMENTS);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (frameSize > Stream::MAX_BUFFER_SIZE / framesCount) {
|
||||||
|
ALOGE("Buffer too big: %u*%u bytes > MAX_BUFFER_SIZE (%u)", frameSize, framesCount,
|
||||||
|
Stream::MAX_BUFFER_SIZE);
|
||||||
|
sendError(Result::INVALID_ARGUMENTS);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
std::unique_ptr<DataMQ> tempDataMQ(new DataMQ(frameSize * framesCount, true /* EventFlag */));
|
||||||
|
|
||||||
|
std::unique_ptr<StatusMQ> tempStatusMQ(new StatusMQ(1));
|
||||||
|
if (!tempCommandMQ->isValid() || !tempDataMQ->isValid() || !tempStatusMQ->isValid()) {
|
||||||
|
ALOGE_IF(!tempCommandMQ->isValid(), "command MQ is invalid");
|
||||||
|
ALOGE_IF(!tempDataMQ->isValid(), "data MQ is invalid");
|
||||||
|
ALOGE_IF(!tempStatusMQ->isValid(), "status MQ is invalid");
|
||||||
|
sendError(Result::INVALID_ARGUMENTS);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
EventFlag* tempRawEfGroup{};
|
||||||
|
status = EventFlag::createEventFlag(tempDataMQ->getEventFlagWord(), &tempRawEfGroup);
|
||||||
|
std::unique_ptr<EventFlag, void (*)(EventFlag*)> tempElfGroup(
|
||||||
|
tempRawEfGroup, [](auto* ef) { EventFlag::deleteEventFlag(&ef); });
|
||||||
|
if (status != OK || !tempElfGroup) {
|
||||||
|
ALOGE("failed creating event flag for data MQ: %s", strerror(-status));
|
||||||
|
sendError(Result::INVALID_ARGUMENTS);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create and launch the thread.
|
||||||
|
auto tempReadThread =
|
||||||
|
sp<ReadThread>::make(&mStopReadThread, mStream, tempCommandMQ.get(), tempDataMQ.get(),
|
||||||
|
tempStatusMQ.get(), tempElfGroup.get());
|
||||||
|
if (!tempReadThread->init()) {
|
||||||
|
ALOGW("failed to start reader thread: %s", strerror(-status));
|
||||||
|
sendError(Result::INVALID_ARGUMENTS);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
status = tempReadThread->run("reader", PRIORITY_URGENT_AUDIO);
|
||||||
|
if (status != OK) {
|
||||||
|
ALOGW("failed to start reader thread: %s", strerror(-status));
|
||||||
|
sendError(Result::INVALID_ARGUMENTS);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
mCommandMQ = std::move(tempCommandMQ);
|
||||||
|
mDataMQ = std::move(tempDataMQ);
|
||||||
|
mStatusMQ = std::move(tempStatusMQ);
|
||||||
|
mReadThread = tempReadThread;
|
||||||
|
mEfGroup = tempElfGroup.release();
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
threadInfo.pid = getpid();
|
||||||
|
threadInfo.tid = mReadThread->getTid();
|
||||||
|
#else
|
||||||
|
threadInfo = mReadThread->getTid();
|
||||||
|
#endif
|
||||||
|
_hidl_cb(Result::OK, *mCommandMQ->getDesc(), *mDataMQ->getDesc(), *mStatusMQ->getDesc(),
|
||||||
|
threadInfo);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<uint32_t> StreamIn::getInputFramesLost() {
|
||||||
|
return mStream->get_input_frames_lost(mStream);
|
||||||
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
|
Result StreamIn::getCapturePositionImpl(audio_stream_in_t* stream, uint64_t* frames,
|
||||||
|
uint64_t* time) {
|
||||||
|
// HAL may have a stub function, always returning ENOSYS, don't
|
||||||
|
// spam the log in this case.
|
||||||
|
static const std::vector<int> ignoredErrors{ENOSYS};
|
||||||
|
Result retval(Result::NOT_SUPPORTED);
|
||||||
|
if (stream->get_capture_position == NULL) return retval;
|
||||||
|
int64_t halFrames, halTime;
|
||||||
|
retval = Stream::analyzeStatus("get_capture_position",
|
||||||
|
stream->get_capture_position(stream, &halFrames, &halTime),
|
||||||
|
ignoredErrors);
|
||||||
|
if (retval == Result::OK) {
|
||||||
|
*frames = halFrames;
|
||||||
|
*time = halTime;
|
||||||
|
}
|
||||||
|
return retval;
|
||||||
|
};
|
||||||
|
|
||||||
|
Return<void> StreamIn::getCapturePosition(getCapturePosition_cb _hidl_cb) {
|
||||||
|
uint64_t frames = 0, time = 0;
|
||||||
|
Result retval = getCapturePositionImpl(mStream, &frames, &time);
|
||||||
|
_hidl_cb(retval, frames, time);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> StreamIn::debug(const hidl_handle& fd, const hidl_vec<hidl_string>& options) {
|
||||||
|
return mStreamCommon->debug(fd, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if MAJOR_VERSION >= 4
|
||||||
|
Result StreamIn::doUpdateSinkMetadata(const SinkMetadata& sinkMetadata) {
|
||||||
|
std::vector<record_track_metadata> halTracks;
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
(void)CoreUtils::sinkMetadataToHal(sinkMetadata, &halTracks);
|
||||||
|
#else
|
||||||
|
// Validate whether a conversion to V7 is possible. This is needed
|
||||||
|
// to have a consistent behavior of the HAL regardless of the API
|
||||||
|
// version of the legacy HAL (and also to be consistent with openInputStream).
|
||||||
|
std::vector<record_track_metadata_v7> halTracksV7;
|
||||||
|
if (status_t status = CoreUtils::sinkMetadataToHalV7(
|
||||||
|
sinkMetadata, false /*ignoreNonVendorTags*/, &halTracksV7);
|
||||||
|
status == NO_ERROR) {
|
||||||
|
halTracks.reserve(halTracksV7.size());
|
||||||
|
for (auto metadata_v7 : halTracksV7) {
|
||||||
|
halTracks.push_back(std::move(metadata_v7.base));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return Stream::analyzeStatus("sinkMetadataToHal", status);
|
||||||
|
}
|
||||||
|
#endif // MAJOR_VERSION <= 6
|
||||||
|
const sink_metadata_t halMetadata = {
|
||||||
|
.track_count = halTracks.size(),
|
||||||
|
.tracks = halTracks.data(),
|
||||||
|
};
|
||||||
|
mStream->update_sink_metadata(mStream, &halMetadata);
|
||||||
|
return Result::OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if MAJOR_VERSION >= 7
|
||||||
|
Result StreamIn::doUpdateSinkMetadataV7(const SinkMetadata& sinkMetadata) {
|
||||||
|
std::vector<record_track_metadata_v7> halTracks;
|
||||||
|
if (status_t status = CoreUtils::sinkMetadataToHalV7(sinkMetadata,
|
||||||
|
false /*ignoreNonVendorTags*/, &halTracks);
|
||||||
|
status != NO_ERROR) {
|
||||||
|
return Stream::analyzeStatus("sinkMetadataToHal", status);
|
||||||
|
}
|
||||||
|
const sink_metadata_v7_t halMetadata = {
|
||||||
|
.track_count = halTracks.size(),
|
||||||
|
.tracks = halTracks.data(),
|
||||||
|
};
|
||||||
|
mStream->update_sink_metadata_v7(mStream, &halMetadata);
|
||||||
|
return Result::OK;
|
||||||
|
}
|
||||||
|
#endif // MAJOR_VERSION >= 7
|
||||||
|
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
Return<void> StreamIn::updateSinkMetadata(const SinkMetadata& sinkMetadata) {
|
||||||
|
if (mStream->update_sink_metadata == nullptr) {
|
||||||
|
return Void(); // not supported by the HAL
|
||||||
|
}
|
||||||
|
(void)doUpdateSinkMetadata(sinkMetadata);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
#elif MAJOR_VERSION >= 7
|
||||||
|
Return<Result> StreamIn::updateSinkMetadata(const SinkMetadata& sinkMetadata) {
|
||||||
|
if (mDevice->version() < AUDIO_DEVICE_API_VERSION_3_2) {
|
||||||
|
if (mStream->update_sink_metadata == nullptr) {
|
||||||
|
return Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
return doUpdateSinkMetadata(sinkMetadata);
|
||||||
|
} else {
|
||||||
|
if (mStream->update_sink_metadata_v7 == nullptr) {
|
||||||
|
return Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
return doUpdateSinkMetadataV7(sinkMetadata);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Return<void> StreamIn::getActiveMicrophones(getActiveMicrophones_cb _hidl_cb) {
|
||||||
|
Result retval = Result::NOT_SUPPORTED;
|
||||||
|
size_t actual_mics = AUDIO_MICROPHONE_MAX_COUNT;
|
||||||
|
audio_microphone_characteristic_t mic_array[AUDIO_MICROPHONE_MAX_COUNT];
|
||||||
|
|
||||||
|
hidl_vec<MicrophoneInfo> microphones;
|
||||||
|
if (mStream->get_active_microphones != NULL &&
|
||||||
|
mStream->get_active_microphones(mStream, &mic_array[0], &actual_mics) == 0) {
|
||||||
|
microphones.resize(actual_mics);
|
||||||
|
for (size_t i = 0; i < actual_mics; ++i) {
|
||||||
|
(void)CoreUtils::microphoneInfoFromHal(mic_array[i], µphones[i]);
|
||||||
|
}
|
||||||
|
retval = Result::OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
_hidl_cb(retval, microphones);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if MAJOR_VERSION >= 5
|
||||||
|
Return<Result> StreamIn::setMicrophoneDirection(MicrophoneDirection direction) {
|
||||||
|
if (mStream->set_microphone_direction == nullptr) {
|
||||||
|
return Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
if (!common::utils::isValidHidlEnum(direction)) {
|
||||||
|
ALOGE("%s: Invalid direction %d", __func__, direction);
|
||||||
|
return Result::INVALID_ARGUMENTS;
|
||||||
|
}
|
||||||
|
return Stream::analyzeStatus(
|
||||||
|
"set_microphone_direction",
|
||||||
|
mStream->set_microphone_direction(
|
||||||
|
mStream, static_cast<audio_microphone_direction_t>(direction)));
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamIn::setMicrophoneFieldDimension(float zoom) {
|
||||||
|
if (mStream->set_microphone_field_dimension == nullptr) {
|
||||||
|
return Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
if (std::isnan(zoom) || zoom < -1 || zoom > 1) {
|
||||||
|
ALOGE("%s: Invalid zoom %f", __func__, zoom);
|
||||||
|
return Result::INVALID_ARGUMENTS;
|
||||||
|
}
|
||||||
|
return Stream::analyzeStatus("set_microphone_field_dimension",
|
||||||
|
mStream->set_microphone_field_dimension(mStream, zoom));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
} // namespace implementation
|
||||||
|
} // namespace CPP_VERSION
|
||||||
|
} // namespace audio
|
||||||
|
} // namespace hardware
|
||||||
|
} // namespace android
|
837
audio/impl/StreamOut.cpp
Normal file
837
audio/impl/StreamOut.cpp
Normal file
@@ -0,0 +1,837 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define LOG_TAG "StreamOutHAL"
|
||||||
|
|
||||||
|
#include "core/default/StreamOut.h"
|
||||||
|
#include "core/default/Util.h"
|
||||||
|
|
||||||
|
//#define LOG_NDEBUG 0
|
||||||
|
#define ATRACE_TAG ATRACE_TAG_AUDIO
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
#include <HidlUtils.h>
|
||||||
|
#include <android/log.h>
|
||||||
|
#include <audio_utils/Metadata.h>
|
||||||
|
#include <hardware/audio.h>
|
||||||
|
#include <util/CoreUtils.h>
|
||||||
|
#include <utils/Trace.h>
|
||||||
|
|
||||||
|
namespace android {
|
||||||
|
namespace hardware {
|
||||||
|
namespace audio {
|
||||||
|
namespace CPP_VERSION {
|
||||||
|
namespace implementation {
|
||||||
|
|
||||||
|
using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::implementation::HidlUtils;
|
||||||
|
using ::android::hardware::audio::CORE_TYPES_CPP_VERSION::implementation::CoreUtils;
|
||||||
|
namespace util {
|
||||||
|
using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION::implementation::util;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
class WriteThread : public Thread {
|
||||||
|
public:
|
||||||
|
// WriteThread's lifespan never exceeds StreamOut's lifespan.
|
||||||
|
WriteThread(std::atomic<bool>* stop, audio_stream_out_t* stream,
|
||||||
|
StreamOut::CommandMQ* commandMQ, StreamOut::DataMQ* dataMQ,
|
||||||
|
StreamOut::StatusMQ* statusMQ, EventFlag* efGroup)
|
||||||
|
: Thread(false /*canCallJava*/),
|
||||||
|
mStop(stop),
|
||||||
|
mStream(stream),
|
||||||
|
mCommandMQ(commandMQ),
|
||||||
|
mDataMQ(dataMQ),
|
||||||
|
mStatusMQ(statusMQ),
|
||||||
|
mEfGroup(efGroup),
|
||||||
|
mBuffer(nullptr) {}
|
||||||
|
bool init() {
|
||||||
|
mBuffer.reset(new (std::nothrow) uint8_t[mDataMQ->getQuantumCount()]);
|
||||||
|
return mBuffer != nullptr;
|
||||||
|
}
|
||||||
|
virtual ~WriteThread() {}
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::atomic<bool>* mStop;
|
||||||
|
audio_stream_out_t* mStream;
|
||||||
|
StreamOut::CommandMQ* mCommandMQ;
|
||||||
|
StreamOut::DataMQ* mDataMQ;
|
||||||
|
StreamOut::StatusMQ* mStatusMQ;
|
||||||
|
EventFlag* mEfGroup;
|
||||||
|
std::unique_ptr<uint8_t[]> mBuffer;
|
||||||
|
IStreamOut::WriteStatus mStatus;
|
||||||
|
|
||||||
|
bool threadLoop() override;
|
||||||
|
|
||||||
|
void doGetLatency();
|
||||||
|
void doGetPresentationPosition();
|
||||||
|
void doWrite();
|
||||||
|
};
|
||||||
|
|
||||||
|
void WriteThread::doWrite() {
|
||||||
|
const size_t availToRead = mDataMQ->availableToRead();
|
||||||
|
mStatus.retval = Result::OK;
|
||||||
|
mStatus.reply.written = 0;
|
||||||
|
if (mDataMQ->read(&mBuffer[0], availToRead)) {
|
||||||
|
ssize_t writeResult = mStream->write(mStream, &mBuffer[0], availToRead);
|
||||||
|
if (writeResult >= 0) {
|
||||||
|
mStatus.reply.written = writeResult;
|
||||||
|
} else {
|
||||||
|
mStatus.retval = Stream::analyzeStatus("write", writeResult);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void WriteThread::doGetPresentationPosition() {
|
||||||
|
mStatus.retval =
|
||||||
|
StreamOut::getPresentationPositionImpl(mStream, &mStatus.reply.presentationPosition.frames,
|
||||||
|
&mStatus.reply.presentationPosition.timeStamp);
|
||||||
|
}
|
||||||
|
|
||||||
|
void WriteThread::doGetLatency() {
|
||||||
|
mStatus.retval = Result::OK;
|
||||||
|
mStatus.reply.latencyMs = mStream->get_latency(mStream);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool WriteThread::threadLoop() {
|
||||||
|
// This implementation doesn't return control back to the Thread until it
|
||||||
|
// decides to stop,
|
||||||
|
// as the Thread uses mutexes, and this can lead to priority inversion.
|
||||||
|
while (!std::atomic_load_explicit(mStop, std::memory_order_acquire)) {
|
||||||
|
uint32_t efState = 0;
|
||||||
|
mEfGroup->wait(static_cast<uint32_t>(MessageQueueFlagBits::NOT_EMPTY), &efState);
|
||||||
|
if (!(efState & static_cast<uint32_t>(MessageQueueFlagBits::NOT_EMPTY))) {
|
||||||
|
continue; // Nothing to do.
|
||||||
|
}
|
||||||
|
if (!mCommandMQ->read(&mStatus.replyTo)) {
|
||||||
|
continue; // Nothing to do.
|
||||||
|
}
|
||||||
|
switch (mStatus.replyTo) {
|
||||||
|
case IStreamOut::WriteCommand::WRITE:
|
||||||
|
doWrite();
|
||||||
|
break;
|
||||||
|
case IStreamOut::WriteCommand::GET_PRESENTATION_POSITION:
|
||||||
|
doGetPresentationPosition();
|
||||||
|
break;
|
||||||
|
case IStreamOut::WriteCommand::GET_LATENCY:
|
||||||
|
doGetLatency();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ALOGE("Unknown write thread command code %d", mStatus.replyTo);
|
||||||
|
mStatus.retval = Result::NOT_SUPPORTED;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (!mStatusMQ->write(&mStatus)) {
|
||||||
|
ALOGE("status message queue write failed");
|
||||||
|
}
|
||||||
|
mEfGroup->wake(static_cast<uint32_t>(MessageQueueFlagBits::NOT_FULL));
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
StreamOut::StreamOut(const sp<Device>& device, audio_stream_out_t* stream)
|
||||||
|
: mDevice(device),
|
||||||
|
mStream(stream),
|
||||||
|
mStreamCommon(new Stream(false /*isInput*/, &stream->common)),
|
||||||
|
mStreamMmap(new StreamMmap<audio_stream_out_t>(stream)),
|
||||||
|
mEfGroup(nullptr),
|
||||||
|
mStopWriteThread(false) {}
|
||||||
|
|
||||||
|
StreamOut::~StreamOut() {
|
||||||
|
ATRACE_CALL();
|
||||||
|
(void)close();
|
||||||
|
if (mWriteThread.get()) {
|
||||||
|
ATRACE_NAME("mWriteThread->join");
|
||||||
|
status_t status = mWriteThread->join();
|
||||||
|
ALOGE_IF(status, "write thread exit error: %s", strerror(-status));
|
||||||
|
}
|
||||||
|
if (mEfGroup) {
|
||||||
|
status_t status = EventFlag::deleteEventFlag(&mEfGroup);
|
||||||
|
ALOGE_IF(status, "write MQ event flag deletion error: %s", strerror(-status));
|
||||||
|
}
|
||||||
|
mCallback = nullptr;
|
||||||
|
#if MAJOR_VERSION <= 5
|
||||||
|
mDevice->closeOutputStream(mStream);
|
||||||
|
// Closing the output stream in the HAL waits for the callback to finish,
|
||||||
|
// and joins the callback thread. Thus is it guaranteed that the callback
|
||||||
|
// thread will not be accessing our object anymore.
|
||||||
|
#endif
|
||||||
|
mStream = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Methods from ::android::hardware::audio::CPP_VERSION::IStream follow.
|
||||||
|
Return<uint64_t> StreamOut::getFrameSize() {
|
||||||
|
return audio_stream_out_frame_size(mStream);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<uint64_t> StreamOut::getFrameCount() {
|
||||||
|
return mStreamCommon->getFrameCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<uint64_t> StreamOut::getBufferSize() {
|
||||||
|
return mStreamCommon->getBufferSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
Return<uint32_t> StreamOut::getSampleRate() {
|
||||||
|
return mStreamCommon->getSampleRate();
|
||||||
|
}
|
||||||
|
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<void> StreamOut::getSupportedChannelMasks(getSupportedChannelMasks_cb _hidl_cb) {
|
||||||
|
return mStreamCommon->getSupportedChannelMasks(_hidl_cb);
|
||||||
|
}
|
||||||
|
Return<void> StreamOut::getSupportedSampleRates(getSupportedSampleRates_cb _hidl_cb) {
|
||||||
|
return mStreamCommon->getSupportedSampleRates(_hidl_cb);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Return<void> StreamOut::getSupportedChannelMasks(AudioFormat format,
|
||||||
|
getSupportedChannelMasks_cb _hidl_cb) {
|
||||||
|
return mStreamCommon->getSupportedChannelMasks(format, _hidl_cb);
|
||||||
|
}
|
||||||
|
Return<void> StreamOut::getSupportedSampleRates(AudioFormat format,
|
||||||
|
getSupportedSampleRates_cb _hidl_cb) {
|
||||||
|
return mStreamCommon->getSupportedSampleRates(format, _hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamOut::setSampleRate(uint32_t sampleRateHz) {
|
||||||
|
return mStreamCommon->setSampleRate(sampleRateHz);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<AudioChannelBitfield> StreamOut::getChannelMask() {
|
||||||
|
return mStreamCommon->getChannelMask();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamOut::setChannelMask(AudioChannelBitfield mask) {
|
||||||
|
return mStreamCommon->setChannelMask(mask);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<AudioFormat> StreamOut::getFormat() {
|
||||||
|
return mStreamCommon->getFormat();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> StreamOut::getSupportedFormats(getSupportedFormats_cb _hidl_cb) {
|
||||||
|
return mStreamCommon->getSupportedFormats(_hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamOut::setFormat(AudioFormat format) {
|
||||||
|
return mStreamCommon->setFormat(format);
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
Return<void> StreamOut::getSupportedProfiles(getSupportedProfiles_cb _hidl_cb) {
|
||||||
|
return mStreamCommon->getSupportedProfiles(_hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamOut::setAudioProperties(const AudioConfigBaseOptional& config) {
|
||||||
|
return mStreamCommon->setAudioProperties(config);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // MAJOR_VERSION <= 6
|
||||||
|
|
||||||
|
Return<void> StreamOut::getAudioProperties(getAudioProperties_cb _hidl_cb) {
|
||||||
|
return mStreamCommon->getAudioProperties(_hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamOut::addEffect(uint64_t effectId) {
|
||||||
|
return mStreamCommon->addEffect(effectId);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamOut::removeEffect(uint64_t effectId) {
|
||||||
|
return mStreamCommon->removeEffect(effectId);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamOut::standby() {
|
||||||
|
return mStreamCommon->standby();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamOut::setHwAvSync(uint32_t hwAvSync) {
|
||||||
|
return mStreamCommon->setHwAvSync(hwAvSync);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<Result> StreamOut::setConnectedState(const DeviceAddress& address, bool connected) {
|
||||||
|
return mStreamCommon->setConnectedState(address, connected);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<AudioDevice> StreamOut::getDevice() {
|
||||||
|
return mStreamCommon->getDevice();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamOut::setDevice(const DeviceAddress& address) {
|
||||||
|
return mStreamCommon->setDevice(address);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> StreamOut::getParameters(const hidl_vec<hidl_string>& keys,
|
||||||
|
getParameters_cb _hidl_cb) {
|
||||||
|
return mStreamCommon->getParameters(keys, _hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamOut::setParameters(const hidl_vec<ParameterValue>& parameters) {
|
||||||
|
return mStreamCommon->setParameters(parameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> StreamOut::debugDump(const hidl_handle& fd) {
|
||||||
|
return mStreamCommon->debugDump(fd);
|
||||||
|
}
|
||||||
|
#elif MAJOR_VERSION >= 4
|
||||||
|
Return<void> StreamOut::getDevices(getDevices_cb _hidl_cb) {
|
||||||
|
return mStreamCommon->getDevices(_hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamOut::setDevices(const hidl_vec<DeviceAddress>& devices) {
|
||||||
|
return mStreamCommon->setDevices(devices);
|
||||||
|
}
|
||||||
|
Return<void> StreamOut::getParameters(const hidl_vec<ParameterValue>& context,
|
||||||
|
const hidl_vec<hidl_string>& keys,
|
||||||
|
getParameters_cb _hidl_cb) {
|
||||||
|
return mStreamCommon->getParameters(context, keys, _hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamOut::setParameters(const hidl_vec<ParameterValue>& context,
|
||||||
|
const hidl_vec<ParameterValue>& parameters) {
|
||||||
|
return mStreamCommon->setParameters(context, parameters);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Return<Result> StreamOut::close() {
|
||||||
|
if (mStopWriteThread.load(std::memory_order_relaxed)) { // only this thread writes
|
||||||
|
return Result::INVALID_STATE;
|
||||||
|
}
|
||||||
|
mStopWriteThread.store(true, std::memory_order_release);
|
||||||
|
if (mEfGroup) {
|
||||||
|
mEfGroup->wake(static_cast<uint32_t>(MessageQueueFlagBits::NOT_EMPTY));
|
||||||
|
}
|
||||||
|
#if MAJOR_VERSION >= 6
|
||||||
|
mDevice->closeOutputStream(mStream);
|
||||||
|
#endif
|
||||||
|
return Result::OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Methods from ::android::hardware::audio::CPP_VERSION::IStreamOut follow.
|
||||||
|
Return<uint32_t> StreamOut::getLatency() {
|
||||||
|
return mStream->get_latency(mStream);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamOut::setVolume(float left, float right) {
|
||||||
|
if (mStream->set_volume == NULL) {
|
||||||
|
return Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
if (!util::isGainNormalized(left)) {
|
||||||
|
ALOGW("Can not set a stream output volume {%f, %f} outside [0,1]", left, right);
|
||||||
|
return Result::INVALID_ARGUMENTS;
|
||||||
|
}
|
||||||
|
return Stream::analyzeStatus("set_volume", mStream->set_volume(mStream, left, right),
|
||||||
|
{ENOSYS} /*ignore*/);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> StreamOut::prepareForWriting(uint32_t frameSize, uint32_t framesCount,
|
||||||
|
prepareForWriting_cb _hidl_cb) {
|
||||||
|
status_t status;
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
ThreadInfo threadInfo = {0, 0};
|
||||||
|
#else
|
||||||
|
int32_t threadInfo = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Wrap the _hidl_cb to return an error
|
||||||
|
auto sendError = [&threadInfo, &_hidl_cb](Result result) {
|
||||||
|
_hidl_cb(result, CommandMQ::Descriptor(), DataMQ::Descriptor(), StatusMQ::Descriptor(),
|
||||||
|
threadInfo);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Create message queues.
|
||||||
|
if (mDataMQ) {
|
||||||
|
ALOGE("the client attempts to call prepareForWriting twice");
|
||||||
|
sendError(Result::INVALID_STATE);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
std::unique_ptr<CommandMQ> tempCommandMQ(new CommandMQ(1));
|
||||||
|
|
||||||
|
// Check frameSize and framesCount
|
||||||
|
if (frameSize == 0 || framesCount == 0) {
|
||||||
|
ALOGE("Null frameSize (%u) or framesCount (%u)", frameSize, framesCount);
|
||||||
|
sendError(Result::INVALID_ARGUMENTS);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
if (frameSize > Stream::MAX_BUFFER_SIZE / framesCount) {
|
||||||
|
ALOGE("Buffer too big: %u*%u bytes > MAX_BUFFER_SIZE (%u)", frameSize, framesCount,
|
||||||
|
Stream::MAX_BUFFER_SIZE);
|
||||||
|
sendError(Result::INVALID_ARGUMENTS);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
std::unique_ptr<DataMQ> tempDataMQ(new DataMQ(frameSize * framesCount, true /* EventFlag */));
|
||||||
|
|
||||||
|
std::unique_ptr<StatusMQ> tempStatusMQ(new StatusMQ(1));
|
||||||
|
if (!tempCommandMQ->isValid() || !tempDataMQ->isValid() || !tempStatusMQ->isValid()) {
|
||||||
|
ALOGE_IF(!tempCommandMQ->isValid(), "command MQ is invalid");
|
||||||
|
ALOGE_IF(!tempDataMQ->isValid(), "data MQ is invalid");
|
||||||
|
ALOGE_IF(!tempStatusMQ->isValid(), "status MQ is invalid");
|
||||||
|
sendError(Result::INVALID_ARGUMENTS);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
EventFlag* tempRawEfGroup{};
|
||||||
|
status = EventFlag::createEventFlag(tempDataMQ->getEventFlagWord(), &tempRawEfGroup);
|
||||||
|
std::unique_ptr<EventFlag, void (*)(EventFlag*)> tempElfGroup(
|
||||||
|
tempRawEfGroup, [](auto* ef) { EventFlag::deleteEventFlag(&ef); });
|
||||||
|
if (status != OK || !tempElfGroup) {
|
||||||
|
ALOGE("failed creating event flag for data MQ: %s", strerror(-status));
|
||||||
|
sendError(Result::INVALID_ARGUMENTS);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create and launch the thread.
|
||||||
|
auto tempWriteThread =
|
||||||
|
sp<WriteThread>::make(&mStopWriteThread, mStream, tempCommandMQ.get(), tempDataMQ.get(),
|
||||||
|
tempStatusMQ.get(), tempElfGroup.get());
|
||||||
|
if (!tempWriteThread->init()) {
|
||||||
|
ALOGW("failed to start writer thread: %s", strerror(-status));
|
||||||
|
sendError(Result::INVALID_ARGUMENTS);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
status = tempWriteThread->run("writer", PRIORITY_URGENT_AUDIO);
|
||||||
|
if (status != OK) {
|
||||||
|
ALOGW("failed to start writer thread: %s", strerror(-status));
|
||||||
|
sendError(Result::INVALID_ARGUMENTS);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
mCommandMQ = std::move(tempCommandMQ);
|
||||||
|
mDataMQ = std::move(tempDataMQ);
|
||||||
|
mStatusMQ = std::move(tempStatusMQ);
|
||||||
|
mWriteThread = tempWriteThread;
|
||||||
|
mEfGroup = tempElfGroup.release();
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
threadInfo.pid = getpid();
|
||||||
|
threadInfo.tid = mWriteThread->getTid();
|
||||||
|
#else
|
||||||
|
threadInfo = mWriteThread->getTid();
|
||||||
|
#endif
|
||||||
|
_hidl_cb(Result::OK, *mCommandMQ->getDesc(), *mDataMQ->getDesc(), *mStatusMQ->getDesc(),
|
||||||
|
threadInfo);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> StreamOut::getRenderPosition(getRenderPosition_cb _hidl_cb) {
|
||||||
|
uint32_t halDspFrames;
|
||||||
|
Result retval = Stream::analyzeStatus("get_render_position",
|
||||||
|
mStream->get_render_position(mStream, &halDspFrames),
|
||||||
|
{ENOSYS} /*ignore*/);
|
||||||
|
_hidl_cb(retval, halDspFrames);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> StreamOut::getNextWriteTimestamp(getNextWriteTimestamp_cb _hidl_cb) {
|
||||||
|
Result retval(Result::NOT_SUPPORTED);
|
||||||
|
int64_t timestampUs = 0;
|
||||||
|
if (mStream->get_next_write_timestamp != NULL) {
|
||||||
|
retval = Stream::analyzeStatus("get_next_write_timestamp",
|
||||||
|
mStream->get_next_write_timestamp(mStream, ×tampUs),
|
||||||
|
{ENOSYS} /*ignore*/);
|
||||||
|
}
|
||||||
|
_hidl_cb(retval, timestampUs);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamOut::setCallback(const sp<IStreamOutCallback>& callback) {
|
||||||
|
if (mStream->set_callback == NULL) return Result::NOT_SUPPORTED;
|
||||||
|
// Safe to pass 'this' because it is guaranteed that the callback thread
|
||||||
|
// is joined prior to exit from StreamOut's destructor.
|
||||||
|
int result = mStream->set_callback(mStream, StreamOut::asyncCallback, this);
|
||||||
|
if (result == 0) {
|
||||||
|
mCallback = callback;
|
||||||
|
}
|
||||||
|
return Stream::analyzeStatus("set_callback", result, {ENOSYS} /*ignore*/);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamOut::clearCallback() {
|
||||||
|
if (mStream->set_callback == NULL) return Result::NOT_SUPPORTED;
|
||||||
|
mCallback = nullptr;
|
||||||
|
return Result::OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
|
int StreamOut::asyncCallback(stream_callback_event_t event, void*, void* cookie) {
|
||||||
|
// It is guaranteed that the callback thread is joined prior
|
||||||
|
// to exiting from StreamOut's destructor. Must *not* use sp<StreamOut>
|
||||||
|
// here because it can make this code the last owner of StreamOut,
|
||||||
|
// and an attempt to run the destructor on the callback thread
|
||||||
|
// will cause a deadlock in the legacy HAL code.
|
||||||
|
StreamOut* self = reinterpret_cast<StreamOut*>(cookie);
|
||||||
|
// It's correct to hold an sp<> to callback because the reference
|
||||||
|
// in the StreamOut instance can be cleared in the meantime. There is
|
||||||
|
// no difference on which thread to run IStreamOutCallback's destructor.
|
||||||
|
sp<IStreamOutCallback> callback = self->mCallback.load();
|
||||||
|
if (callback.get() == nullptr) return 0;
|
||||||
|
ALOGV("asyncCallback() event %d", event);
|
||||||
|
Return<void> result;
|
||||||
|
switch (event) {
|
||||||
|
case STREAM_CBK_EVENT_WRITE_READY:
|
||||||
|
result = callback->onWriteReady();
|
||||||
|
break;
|
||||||
|
case STREAM_CBK_EVENT_DRAIN_READY:
|
||||||
|
result = callback->onDrainReady();
|
||||||
|
break;
|
||||||
|
case STREAM_CBK_EVENT_ERROR:
|
||||||
|
result = callback->onError();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ALOGW("asyncCallback() unknown event %d", event);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
ALOGW_IF(!result.isOk(), "Client callback failed: %s", result.description().c_str());
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> StreamOut::supportsPauseAndResume(supportsPauseAndResume_cb _hidl_cb) {
|
||||||
|
_hidl_cb(mStream->pause != NULL, mStream->resume != NULL);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamOut::pause() {
|
||||||
|
return mStream->pause != NULL
|
||||||
|
? Stream::analyzeStatus("pause", mStream->pause(mStream), {ENOSYS} /*ignore*/)
|
||||||
|
: Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamOut::resume() {
|
||||||
|
return mStream->resume != NULL
|
||||||
|
? Stream::analyzeStatus("resume", mStream->resume(mStream), {ENOSYS} /*ignore*/)
|
||||||
|
: Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<bool> StreamOut::supportsDrain() {
|
||||||
|
return mStream->drain != NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamOut::drain(AudioDrain type) {
|
||||||
|
audio_drain_type_t halDrainType =
|
||||||
|
type == AudioDrain::EARLY_NOTIFY ? AUDIO_DRAIN_EARLY_NOTIFY : AUDIO_DRAIN_ALL;
|
||||||
|
return mStream->drain != NULL
|
||||||
|
? Stream::analyzeStatus("drain", mStream->drain(mStream, halDrainType),
|
||||||
|
{ENOSYS} /*ignore*/)
|
||||||
|
: Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamOut::flush() {
|
||||||
|
return mStream->flush != NULL
|
||||||
|
? Stream::analyzeStatus("flush", mStream->flush(mStream), {ENOSYS} /*ignore*/)
|
||||||
|
: Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
|
Result StreamOut::getPresentationPositionImpl(audio_stream_out_t* stream, uint64_t* frames,
|
||||||
|
TimeSpec* timeStamp) {
|
||||||
|
// Don't logspam on EINVAL--it's normal for get_presentation_position
|
||||||
|
// to return it sometimes. EAGAIN may be returned by A2DP audio HAL
|
||||||
|
// implementation. ENODATA can also be reported while the writer is
|
||||||
|
// continuously querying it, but the stream has been stopped.
|
||||||
|
static const std::vector<int> ignoredErrors{EINVAL, EAGAIN, ENODATA, ENOSYS};
|
||||||
|
Result retval(Result::NOT_SUPPORTED);
|
||||||
|
if (stream->get_presentation_position == NULL) return retval;
|
||||||
|
struct timespec halTimeStamp;
|
||||||
|
retval = Stream::analyzeStatus("get_presentation_position",
|
||||||
|
stream->get_presentation_position(stream, frames, &halTimeStamp),
|
||||||
|
ignoredErrors);
|
||||||
|
if (retval == Result::OK) {
|
||||||
|
timeStamp->tvSec = halTimeStamp.tv_sec;
|
||||||
|
timeStamp->tvNSec = halTimeStamp.tv_nsec;
|
||||||
|
}
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> StreamOut::getPresentationPosition(getPresentationPosition_cb _hidl_cb) {
|
||||||
|
uint64_t frames = 0;
|
||||||
|
TimeSpec timeStamp = {0, 0};
|
||||||
|
Result retval = getPresentationPositionImpl(mStream, &frames, &timeStamp);
|
||||||
|
_hidl_cb(retval, frames, timeStamp);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamOut::start() {
|
||||||
|
return mStreamMmap->start();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamOut::stop() {
|
||||||
|
return mStreamMmap->stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> StreamOut::createMmapBuffer(int32_t minSizeFrames, createMmapBuffer_cb _hidl_cb) {
|
||||||
|
return mStreamMmap->createMmapBuffer(minSizeFrames, audio_stream_out_frame_size(mStream),
|
||||||
|
_hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> StreamOut::getMmapPosition(getMmapPosition_cb _hidl_cb) {
|
||||||
|
return mStreamMmap->getMmapPosition(_hidl_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> StreamOut::debug(const hidl_handle& fd, const hidl_vec<hidl_string>& options) {
|
||||||
|
return mStreamCommon->debug(fd, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if MAJOR_VERSION >= 4
|
||||||
|
Result StreamOut::doUpdateSourceMetadata(const SourceMetadata& sourceMetadata) {
|
||||||
|
std::vector<playback_track_metadata_t> halTracks;
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
(void)CoreUtils::sourceMetadataToHal(sourceMetadata, &halTracks);
|
||||||
|
#else
|
||||||
|
// Validate whether a conversion to V7 is possible. This is needed
|
||||||
|
// to have a consistent behavior of the HAL regardless of the API
|
||||||
|
// version of the legacy HAL (and also to be consistent with openOutputStream).
|
||||||
|
std::vector<playback_track_metadata_v7> halTracksV7;
|
||||||
|
if (status_t status = CoreUtils::sourceMetadataToHalV7(
|
||||||
|
sourceMetadata, false /*ignoreNonVendorTags*/, &halTracksV7);
|
||||||
|
status == NO_ERROR) {
|
||||||
|
halTracks.reserve(halTracksV7.size());
|
||||||
|
for (auto metadata_v7 : halTracksV7) {
|
||||||
|
halTracks.push_back(std::move(metadata_v7.base));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return Stream::analyzeStatus("sourceMetadataToHal", status);
|
||||||
|
}
|
||||||
|
#endif // MAJOR_VERSION <= 6
|
||||||
|
const source_metadata_t halMetadata = {
|
||||||
|
.track_count = halTracks.size(),
|
||||||
|
.tracks = halTracks.data(),
|
||||||
|
};
|
||||||
|
mStream->update_source_metadata(mStream, &halMetadata);
|
||||||
|
return Result::OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if MAJOR_VERSION >= 7
|
||||||
|
Result StreamOut::doUpdateSourceMetadataV7(const SourceMetadata& sourceMetadata) {
|
||||||
|
std::vector<playback_track_metadata_v7> halTracks;
|
||||||
|
if (status_t status = CoreUtils::sourceMetadataToHalV7(
|
||||||
|
sourceMetadata, false /*ignoreNonVendorTags*/, &halTracks);
|
||||||
|
status != NO_ERROR) {
|
||||||
|
return Stream::analyzeStatus("sourceMetadataToHal", status);
|
||||||
|
}
|
||||||
|
const source_metadata_v7_t halMetadata = {
|
||||||
|
.track_count = halTracks.size(),
|
||||||
|
.tracks = halTracks.data(),
|
||||||
|
};
|
||||||
|
mStream->update_source_metadata_v7(mStream, &halMetadata);
|
||||||
|
return Result::OK;
|
||||||
|
}
|
||||||
|
#endif // MAJOR_VERSION >= 7
|
||||||
|
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
Return<void> StreamOut::updateSourceMetadata(const SourceMetadata& sourceMetadata) {
|
||||||
|
if (mStream->update_source_metadata == nullptr) {
|
||||||
|
return Void(); // not supported by the HAL
|
||||||
|
}
|
||||||
|
(void)doUpdateSourceMetadata(sourceMetadata);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
#elif MAJOR_VERSION >= 7
|
||||||
|
Return<Result> StreamOut::updateSourceMetadata(const SourceMetadata& sourceMetadata) {
|
||||||
|
if (mDevice->version() < AUDIO_DEVICE_API_VERSION_3_2) {
|
||||||
|
if (mStream->update_source_metadata == nullptr) {
|
||||||
|
return Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
return doUpdateSourceMetadata(sourceMetadata);
|
||||||
|
} else {
|
||||||
|
if (mStream->update_source_metadata_v7 == nullptr) {
|
||||||
|
return Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
return doUpdateSourceMetadataV7(sourceMetadata);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Return<Result> StreamOut::selectPresentation(int32_t /*presentationId*/, int32_t /*programId*/) {
|
||||||
|
return Result::NOT_SUPPORTED; // TODO: propagate to legacy
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if MAJOR_VERSION >= 6
|
||||||
|
Return<void> StreamOut::getDualMonoMode(getDualMonoMode_cb _hidl_cb) {
|
||||||
|
audio_dual_mono_mode_t mode = AUDIO_DUAL_MONO_MODE_OFF;
|
||||||
|
Result retval = mStream->get_dual_mono_mode != nullptr
|
||||||
|
? Stream::analyzeStatus("get_dual_mono_mode",
|
||||||
|
mStream->get_dual_mono_mode(mStream, &mode))
|
||||||
|
: Result::NOT_SUPPORTED;
|
||||||
|
_hidl_cb(retval, DualMonoMode(mode));
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamOut::setDualMonoMode(DualMonoMode mode) {
|
||||||
|
return mStream->set_dual_mono_mode != nullptr
|
||||||
|
? Stream::analyzeStatus(
|
||||||
|
"set_dual_mono_mode",
|
||||||
|
mStream->set_dual_mono_mode(mStream,
|
||||||
|
static_cast<audio_dual_mono_mode_t>(mode)))
|
||||||
|
: Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> StreamOut::getAudioDescriptionMixLevel(getAudioDescriptionMixLevel_cb _hidl_cb) {
|
||||||
|
float leveldB = -std::numeric_limits<float>::infinity();
|
||||||
|
Result retval = mStream->get_audio_description_mix_level != nullptr
|
||||||
|
? Stream::analyzeStatus(
|
||||||
|
"get_audio_description_mix_level",
|
||||||
|
mStream->get_audio_description_mix_level(mStream, &leveldB))
|
||||||
|
: Result::NOT_SUPPORTED;
|
||||||
|
_hidl_cb(retval, leveldB);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamOut::setAudioDescriptionMixLevel(float leveldB) {
|
||||||
|
return mStream->set_audio_description_mix_level != nullptr
|
||||||
|
? Stream::analyzeStatus(
|
||||||
|
"set_audio_description_mix_level",
|
||||||
|
mStream->set_audio_description_mix_level(mStream, leveldB))
|
||||||
|
: Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<void> StreamOut::getPlaybackRateParameters(getPlaybackRateParameters_cb _hidl_cb) {
|
||||||
|
audio_playback_rate_t rate = AUDIO_PLAYBACK_RATE_INITIALIZER;
|
||||||
|
Result retval =
|
||||||
|
mStream->get_playback_rate_parameters != nullptr
|
||||||
|
? Stream::analyzeStatus("get_playback_rate_parameters",
|
||||||
|
mStream->get_playback_rate_parameters(mStream, &rate))
|
||||||
|
: Result::NOT_SUPPORTED;
|
||||||
|
_hidl_cb(retval,
|
||||||
|
PlaybackRate{rate.mSpeed, rate.mPitch, static_cast<TimestretchMode>(rate.mStretchMode),
|
||||||
|
static_cast<TimestretchFallbackMode>(rate.mFallbackMode)});
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamOut::setPlaybackRateParameters(const PlaybackRate& playbackRate) {
|
||||||
|
audio_playback_rate_t rate = {
|
||||||
|
playbackRate.speed, playbackRate.pitch,
|
||||||
|
static_cast<audio_timestretch_stretch_mode_t>(playbackRate.timestretchMode),
|
||||||
|
static_cast<audio_timestretch_fallback_mode_t>(playbackRate.fallbackMode)};
|
||||||
|
return mStream->set_playback_rate_parameters != nullptr
|
||||||
|
? Stream::analyzeStatus("set_playback_rate_parameters",
|
||||||
|
mStream->set_playback_rate_parameters(mStream, &rate))
|
||||||
|
: Result::NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamOut::setEventCallback(const sp<IStreamOutEventCallback>& callback) {
|
||||||
|
if (mStream->set_event_callback == nullptr) return Result::NOT_SUPPORTED;
|
||||||
|
int result = mStream->set_event_callback(mStream, StreamOut::asyncEventCallback, this);
|
||||||
|
if (result == 0) {
|
||||||
|
mEventCallback = callback;
|
||||||
|
}
|
||||||
|
return Stream::analyzeStatus("set_stream_out_callback", result, {ENOSYS} /*ignore*/);
|
||||||
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
|
int StreamOut::asyncEventCallback(stream_event_callback_type_t event, void* param, void* cookie) {
|
||||||
|
StreamOut* self = reinterpret_cast<StreamOut*>(cookie);
|
||||||
|
sp<IStreamOutEventCallback> eventCallback = self->mEventCallback.load();
|
||||||
|
if (eventCallback.get() == nullptr) return 0;
|
||||||
|
ALOGV("%s event %d", __func__, event);
|
||||||
|
Return<void> result;
|
||||||
|
switch (event) {
|
||||||
|
case STREAM_EVENT_CBK_TYPE_CODEC_FORMAT_CHANGED: {
|
||||||
|
hidl_vec<uint8_t> audioMetadata;
|
||||||
|
// void* param is the byte string buffer from byte_string_from_audio_metadata().
|
||||||
|
// As the byte string buffer may have embedded zeroes, we cannot use strlen()
|
||||||
|
// but instead use audio_utils::metadata::dataByteStringLen().
|
||||||
|
audioMetadata.setToExternal((uint8_t*)param, audio_utils::metadata::dataByteStringLen(
|
||||||
|
(const uint8_t*)param));
|
||||||
|
result = eventCallback->onCodecFormatChanged(audioMetadata);
|
||||||
|
} break;
|
||||||
|
default:
|
||||||
|
ALOGW("%s unknown event %d", __func__, event);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
ALOGW_IF(!result.isOk(), "Client callback failed: %s", result.description().c_str());
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if MAJOR_VERSION == 7 && MINOR_VERSION == 1
|
||||||
|
Return<Result> StreamOut::setLatencyMode(LatencyMode mode) {
|
||||||
|
return mStream->set_latency_mode != nullptr
|
||||||
|
? Stream::analyzeStatus(
|
||||||
|
"set_latency_mode",
|
||||||
|
mStream->set_latency_mode(mStream,
|
||||||
|
static_cast<audio_latency_mode_t>(mode)))
|
||||||
|
: Result::NOT_SUPPORTED;
|
||||||
|
};
|
||||||
|
|
||||||
|
Return<void> StreamOut::getRecommendedLatencyModes(getRecommendedLatencyModes_cb _hidl_cb) {
|
||||||
|
Result retval = Result::NOT_SUPPORTED;
|
||||||
|
hidl_vec<LatencyMode> hidlModes;
|
||||||
|
size_t num_modes = AUDIO_LATENCY_MODE_CNT;
|
||||||
|
audio_latency_mode_t modes[AUDIO_LATENCY_MODE_CNT];
|
||||||
|
|
||||||
|
if (mStream->get_recommended_latency_modes != nullptr &&
|
||||||
|
mStream->get_recommended_latency_modes(mStream, &modes[0], &num_modes) == 0) {
|
||||||
|
if (num_modes == 0 || num_modes > AUDIO_LATENCY_MODE_CNT) {
|
||||||
|
ALOGW("%s invalid number of modes returned: %zu", __func__, num_modes);
|
||||||
|
retval = Result::INVALID_STATE;
|
||||||
|
} else {
|
||||||
|
hidlModes.resize(num_modes);
|
||||||
|
for (size_t i = 0; i < num_modes; ++i) {
|
||||||
|
hidlModes[i] = static_cast<LatencyMode>(modes[i]);
|
||||||
|
}
|
||||||
|
retval = Result::OK;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_hidl_cb(retval, hidlModes);
|
||||||
|
return Void();
|
||||||
|
};
|
||||||
|
|
||||||
|
// static
|
||||||
|
void StreamOut::latencyModeCallback(audio_latency_mode_t* modes, size_t num_modes, void* cookie) {
|
||||||
|
StreamOut* self = reinterpret_cast<StreamOut*>(cookie);
|
||||||
|
sp<IStreamOutLatencyModeCallback> callback = self->mLatencyModeCallback.load();
|
||||||
|
if (callback.get() == nullptr) return;
|
||||||
|
|
||||||
|
ALOGV("%s", __func__);
|
||||||
|
|
||||||
|
if (num_modes == 0 || num_modes > AUDIO_LATENCY_MODE_CNT) {
|
||||||
|
ALOGW("%s invalid number of modes returned: %zu", __func__, num_modes);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
hidl_vec<LatencyMode> hidlModes(num_modes);
|
||||||
|
for (size_t i = 0; i < num_modes; ++i) {
|
||||||
|
hidlModes[i] = static_cast<LatencyMode>(modes[i]);
|
||||||
|
}
|
||||||
|
Return<void> result = callback->onRecommendedLatencyModeChanged(hidlModes);
|
||||||
|
ALOGW_IF(!result.isOk(), "Client callback failed: %s", result.description().c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
Return<Result> StreamOut::setLatencyModeCallback(
|
||||||
|
const sp<IStreamOutLatencyModeCallback>& callback) {
|
||||||
|
if (mStream->set_latency_mode_callback == nullptr) return Result::NOT_SUPPORTED;
|
||||||
|
int result = mStream->set_latency_mode_callback(mStream, StreamOut::latencyModeCallback, this);
|
||||||
|
if (result == 0) {
|
||||||
|
mLatencyModeCallback = callback;
|
||||||
|
}
|
||||||
|
return Stream::analyzeStatus("set_latency_mode_callback", result, {ENOSYS} /*ignore*/);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
} // namespace implementation
|
||||||
|
} // namespace CPP_VERSION
|
||||||
|
} // namespace audio
|
||||||
|
} // namespace hardware
|
||||||
|
} // namespace android
|
204
audio/impl/include/core/default/Device.h
Normal file
204
audio/impl/include/core/default/Device.h
Normal file
@@ -0,0 +1,204 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ANDROID_HARDWARE_AUDIO_DEVICE_H
|
||||||
|
#define ANDROID_HARDWARE_AUDIO_DEVICE_H
|
||||||
|
|
||||||
|
#include PATH(android/hardware/audio/FILE_VERSION/IDevice.h)
|
||||||
|
|
||||||
|
#include "ParametersUtil.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
#include <hardware/audio.h>
|
||||||
|
#include <media/AudioParameter.h>
|
||||||
|
|
||||||
|
#include <hidl/Status.h>
|
||||||
|
|
||||||
|
#include <hidl/MQDescriptor.h>
|
||||||
|
|
||||||
|
#include <VersionUtils.h>
|
||||||
|
#include <util/CoreUtils.h>
|
||||||
|
|
||||||
|
namespace android {
|
||||||
|
namespace hardware {
|
||||||
|
namespace audio {
|
||||||
|
namespace CPP_VERSION {
|
||||||
|
namespace implementation {
|
||||||
|
|
||||||
|
using ::android::sp;
|
||||||
|
using ::android::hardware::hidl_string;
|
||||||
|
using ::android::hardware::hidl_vec;
|
||||||
|
using ::android::hardware::Return;
|
||||||
|
using ::android::hardware::Void;
|
||||||
|
using ::android::hardware::audio::CORE_TYPES_CPP_VERSION::implementation::CoreUtils;
|
||||||
|
using ::android::hardware::audio::CORE_TYPES_CPP_VERSION::implementation::ParametersUtil;
|
||||||
|
using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION;
|
||||||
|
using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION;
|
||||||
|
using namespace ::android::hardware::audio::CPP_VERSION;
|
||||||
|
using AudioInputFlags = CoreUtils::AudioInputFlags;
|
||||||
|
using AudioOutputFlags = CoreUtils::AudioOutputFlags;
|
||||||
|
|
||||||
|
struct Device : public IDevice, public ParametersUtil {
|
||||||
|
explicit Device(audio_hw_device_t* device);
|
||||||
|
|
||||||
|
// Methods from ::android::hardware::audio::CPP_VERSION::IDevice follow.
|
||||||
|
Return<Result> initCheck() override;
|
||||||
|
Return<Result> setMasterVolume(float volume) override;
|
||||||
|
Return<void> getMasterVolume(getMasterVolume_cb _hidl_cb) override;
|
||||||
|
Return<Result> setMicMute(bool mute) override;
|
||||||
|
Return<void> getMicMute(getMicMute_cb _hidl_cb) override;
|
||||||
|
Return<Result> setMasterMute(bool mute) override;
|
||||||
|
Return<void> getMasterMute(getMasterMute_cb _hidl_cb) override;
|
||||||
|
Return<void> getInputBufferSize(const AudioConfig& config,
|
||||||
|
getInputBufferSize_cb _hidl_cb) override;
|
||||||
|
|
||||||
|
std::tuple<Result, sp<IStreamOut>> openOutputStreamCore(int32_t ioHandle,
|
||||||
|
const DeviceAddress& device,
|
||||||
|
const AudioConfig& config,
|
||||||
|
const AudioOutputFlags& flags,
|
||||||
|
AudioConfig* suggestedConfig);
|
||||||
|
std::tuple<Result, sp<IStreamIn>> openInputStreamCore(
|
||||||
|
int32_t ioHandle, const DeviceAddress& device, const AudioConfig& config,
|
||||||
|
const AudioInputFlags& flags, AudioSource source, AudioConfig* suggestedConfig);
|
||||||
|
#if MAJOR_VERSION >= 4
|
||||||
|
std::tuple<Result, sp<IStreamOut>, AudioConfig> openOutputStreamImpl(
|
||||||
|
int32_t ioHandle, const DeviceAddress& device, const AudioConfig& config,
|
||||||
|
const SourceMetadata& sourceMetadata,
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
AudioOutputFlags flags);
|
||||||
|
#else
|
||||||
|
const AudioOutputFlags& flags);
|
||||||
|
#endif
|
||||||
|
std::tuple<Result, sp<IStreamIn>, AudioConfig> openInputStreamImpl(
|
||||||
|
int32_t ioHandle, const DeviceAddress& device, const AudioConfig& config,
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
AudioInputFlags flags,
|
||||||
|
#else
|
||||||
|
const AudioInputFlags& flags,
|
||||||
|
#endif
|
||||||
|
const SinkMetadata& sinkMetadata);
|
||||||
|
#endif // MAJOR_VERSION >= 4
|
||||||
|
|
||||||
|
Return<void> openOutputStream(int32_t ioHandle, const DeviceAddress& device,
|
||||||
|
const AudioConfig& config,
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
AudioOutputFlags flags,
|
||||||
|
#else
|
||||||
|
const AudioOutputFlags& flags,
|
||||||
|
#endif
|
||||||
|
#if MAJOR_VERSION >= 4
|
||||||
|
const SourceMetadata& sourceMetadata,
|
||||||
|
#endif
|
||||||
|
openOutputStream_cb _hidl_cb) override;
|
||||||
|
Return<void> openInputStream(int32_t ioHandle, const DeviceAddress& device,
|
||||||
|
const AudioConfig& config,
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
AudioInputFlags flags,
|
||||||
|
#else
|
||||||
|
const AudioInputFlags& flags,
|
||||||
|
#endif
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
AudioSource source,
|
||||||
|
#elif MAJOR_VERSION >= 4
|
||||||
|
const SinkMetadata& sinkMetadata,
|
||||||
|
#endif
|
||||||
|
openInputStream_cb _hidl_cb) override;
|
||||||
|
|
||||||
|
#if MAJOR_VERSION == 7 && MINOR_VERSION == 1
|
||||||
|
Return<void> openOutputStream_7_1(int32_t ioHandle, const DeviceAddress& device,
|
||||||
|
const AudioConfig& config, const AudioOutputFlags& flags,
|
||||||
|
const SourceMetadata& sourceMetadata,
|
||||||
|
openOutputStream_7_1_cb _hidl_cb) override;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Return<bool> supportsAudioPatches() override;
|
||||||
|
Return<void> createAudioPatch(const hidl_vec<AudioPortConfig>& sources,
|
||||||
|
const hidl_vec<AudioPortConfig>& sinks,
|
||||||
|
createAudioPatch_cb _hidl_cb) override;
|
||||||
|
Return<Result> releaseAudioPatch(int32_t patch) override;
|
||||||
|
Return<void> getAudioPort(const AudioPort& port, getAudioPort_cb _hidl_cb) override;
|
||||||
|
Return<Result> setAudioPortConfig(const AudioPortConfig& config) override;
|
||||||
|
|
||||||
|
Return<Result> setScreenState(bool turnedOn) override;
|
||||||
|
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<AudioHwSync> getHwAvSync() override;
|
||||||
|
Return<void> getParameters(const hidl_vec<hidl_string>& keys,
|
||||||
|
getParameters_cb _hidl_cb) override;
|
||||||
|
Return<Result> setParameters(const hidl_vec<ParameterValue>& parameters) override;
|
||||||
|
Return<void> debugDump(const hidl_handle& fd) override;
|
||||||
|
#elif MAJOR_VERSION >= 4
|
||||||
|
Return<void> getHwAvSync(getHwAvSync_cb _hidl_cb) override;
|
||||||
|
Return<void> getParameters(const hidl_vec<ParameterValue>& context,
|
||||||
|
const hidl_vec<hidl_string>& keys,
|
||||||
|
getParameters_cb _hidl_cb) override;
|
||||||
|
Return<Result> setParameters(const hidl_vec<ParameterValue>& context,
|
||||||
|
const hidl_vec<ParameterValue>& parameters) override;
|
||||||
|
Return<void> getMicrophones(getMicrophones_cb _hidl_cb) override;
|
||||||
|
Return<Result> setConnectedState(const DeviceAddress& address, bool connected) override;
|
||||||
|
#endif
|
||||||
|
#if MAJOR_VERSION >= 6
|
||||||
|
Return<Result> close() override;
|
||||||
|
Return<Result> addDeviceEffect(AudioPortHandle device, uint64_t effectId) override;
|
||||||
|
Return<Result> removeDeviceEffect(AudioPortHandle device, uint64_t effectId) override;
|
||||||
|
Return<void> updateAudioPatch(int32_t previousPatch, const hidl_vec<AudioPortConfig>& sources,
|
||||||
|
const hidl_vec<AudioPortConfig>& sinks,
|
||||||
|
createAudioPatch_cb _hidl_cb) override;
|
||||||
|
#endif
|
||||||
|
#if MAJOR_VERSION == 7 && MINOR_VERSION == 1
|
||||||
|
Return<Result> setConnectedState_7_1(const AudioPort& devicePort, bool connected) override;
|
||||||
|
#endif
|
||||||
|
Return<void> debug(const hidl_handle& fd, const hidl_vec<hidl_string>& options) override;
|
||||||
|
|
||||||
|
// Utility methods for extending interfaces.
|
||||||
|
Result analyzeStatus(const char* funcName, int status,
|
||||||
|
const std::vector<int>& ignoreErrors = {});
|
||||||
|
void closeInputStream(audio_stream_in_t* stream);
|
||||||
|
void closeOutputStream(audio_stream_out_t* stream);
|
||||||
|
audio_hw_device_t* device() const { return mDevice; }
|
||||||
|
|
||||||
|
uint32_t version() const { return mDevice->common.version; }
|
||||||
|
|
||||||
|
int halSetParameters(const char* keysAndValues) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool mIsClosed;
|
||||||
|
audio_hw_device_t* mDevice;
|
||||||
|
int mOpenedStreamsCount = 0;
|
||||||
|
|
||||||
|
virtual ~Device();
|
||||||
|
|
||||||
|
Result doClose();
|
||||||
|
std::tuple<Result, AudioPatchHandle> createOrUpdateAudioPatch(
|
||||||
|
AudioPatchHandle patch, const hidl_vec<AudioPortConfig>& sources,
|
||||||
|
const hidl_vec<AudioPortConfig>& sinks);
|
||||||
|
template <typename HalPort>
|
||||||
|
Return<void> getAudioPortImpl(const AudioPort& port, getAudioPort_cb _hidl_cb,
|
||||||
|
int (*halGetter)(audio_hw_device_t*, HalPort*),
|
||||||
|
const char* halGetterName);
|
||||||
|
|
||||||
|
// Methods from ParametersUtil.
|
||||||
|
char* halGetParameters(const char* keys) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace implementation
|
||||||
|
} // namespace CPP_VERSION
|
||||||
|
} // namespace audio
|
||||||
|
} // namespace hardware
|
||||||
|
} // namespace android
|
||||||
|
|
||||||
|
#endif // ANDROID_HARDWARE_AUDIO_DEVICE_H
|
70
audio/impl/include/core/default/DevicesFactory.h
Normal file
70
audio/impl/include/core/default/DevicesFactory.h
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ANDROID_HARDWARE_AUDIO_DEVICESFACTORY_H
|
||||||
|
#define ANDROID_HARDWARE_AUDIO_DEVICESFACTORY_H
|
||||||
|
|
||||||
|
#include PATH(android/hardware/audio/FILE_VERSION/IDevicesFactory.h)
|
||||||
|
|
||||||
|
#include <hardware/audio.h>
|
||||||
|
|
||||||
|
#include <hidl/Status.h>
|
||||||
|
|
||||||
|
#include <hidl/MQDescriptor.h>
|
||||||
|
namespace android {
|
||||||
|
namespace hardware {
|
||||||
|
namespace audio {
|
||||||
|
namespace CPP_VERSION {
|
||||||
|
namespace implementation {
|
||||||
|
|
||||||
|
using ::android::sp;
|
||||||
|
using ::android::hardware::hidl_string;
|
||||||
|
using ::android::hardware::hidl_vec;
|
||||||
|
using ::android::hardware::Return;
|
||||||
|
using ::android::hardware::Void;
|
||||||
|
using namespace ::android::hardware::audio::CPP_VERSION;
|
||||||
|
|
||||||
|
struct DevicesFactory : public IDevicesFactory {
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<void> openDevice(IDevicesFactory::Device device, openDevice_cb _hidl_cb) override;
|
||||||
|
#elif MAJOR_VERSION >= 4
|
||||||
|
Return<void> openDevice(const hidl_string& device, openDevice_cb _hidl_cb) override;
|
||||||
|
Return<void> openPrimaryDevice(openPrimaryDevice_cb _hidl_cb) override;
|
||||||
|
#endif
|
||||||
|
#if MAJOR_VERSION == 7 && MINOR_VERSION == 1
|
||||||
|
Return<void> openDevice_7_1(const hidl_string& device, openDevice_7_1_cb _hidl_cb) override;
|
||||||
|
Return<void> openPrimaryDevice_7_1(openPrimaryDevice_7_1_cb _hidl_cb) override;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
private:
|
||||||
|
template <class DeviceShim, class Callback>
|
||||||
|
Return<void> openDevice(const char* moduleName, Callback _hidl_cb);
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<void> openDevice(const char* moduleName, openDevice_cb _hidl_cb);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static int loadAudioInterface(const char* if_name, audio_hw_device_t** dev);
|
||||||
|
};
|
||||||
|
|
||||||
|
extern "C" IDevicesFactory* HIDL_FETCH_IDevicesFactory(const char* name);
|
||||||
|
|
||||||
|
} // namespace implementation
|
||||||
|
} // namespace CPP_VERSION
|
||||||
|
} // namespace audio
|
||||||
|
} // namespace hardware
|
||||||
|
} // namespace android
|
||||||
|
|
||||||
|
#endif // ANDROID_HARDWARE_AUDIO_DEVICESFACTORY_H
|
73
audio/impl/include/core/default/ParametersUtil.h
Normal file
73
audio/impl/include/core/default/ParametersUtil.h
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ANDROID_HARDWARE_AUDIO_PARAMETERS_UTIL_H_
|
||||||
|
#define ANDROID_HARDWARE_AUDIO_PARAMETERS_UTIL_H_
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
#include PATH(android/hardware/audio/common/COMMON_TYPES_FILE_VERSION/types.h)
|
||||||
|
#include PATH(android/hardware/audio/CORE_TYPES_FILE_VERSION/types.h)
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
#include <hidl/HidlSupport.h>
|
||||||
|
#include <media/AudioParameter.h>
|
||||||
|
|
||||||
|
namespace android {
|
||||||
|
namespace hardware {
|
||||||
|
namespace audio {
|
||||||
|
namespace CORE_TYPES_CPP_VERSION {
|
||||||
|
namespace implementation {
|
||||||
|
|
||||||
|
using ::android::hardware::hidl_string;
|
||||||
|
using ::android::hardware::hidl_vec;
|
||||||
|
using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION;
|
||||||
|
using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION;
|
||||||
|
|
||||||
|
class ParametersUtil {
|
||||||
|
public:
|
||||||
|
Result setParam(const char* name, const char* value);
|
||||||
|
Result getParam(const char* name, bool* value);
|
||||||
|
Result getParam(const char* name, int* value);
|
||||||
|
Result getParam(const char* name, String8* value, AudioParameter context = {});
|
||||||
|
void getParametersImpl(
|
||||||
|
const hidl_vec<ParameterValue>& context, const hidl_vec<hidl_string>& keys,
|
||||||
|
std::function<void(Result retval, const hidl_vec<ParameterValue>& parameters)> cb);
|
||||||
|
std::unique_ptr<AudioParameter> getParams(const AudioParameter& keys);
|
||||||
|
Result setParam(const char* name, bool value);
|
||||||
|
Result setParam(const char* name, int value);
|
||||||
|
Result setParam(const char* name, float value);
|
||||||
|
Result setParametersImpl(const hidl_vec<ParameterValue>& context,
|
||||||
|
const hidl_vec<ParameterValue>& parameters);
|
||||||
|
Result setParams(const AudioParameter& param);
|
||||||
|
Result setParam(const char* name, const DeviceAddress& address);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual ~ParametersUtil() {}
|
||||||
|
|
||||||
|
virtual char* halGetParameters(const char* keys) = 0;
|
||||||
|
virtual int halSetParameters(const char* keysAndValues) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace implementation
|
||||||
|
} // namespace CORE_TYPES_CPP_VERSION
|
||||||
|
} // namespace audio
|
||||||
|
} // namespace hardware
|
||||||
|
} // namespace android
|
||||||
|
|
||||||
|
#endif // ANDROID_HARDWARE_AUDIO_PARAMETERS_UTIL_H_
|
154
audio/impl/include/core/default/PrimaryDevice.h
Normal file
154
audio/impl/include/core/default/PrimaryDevice.h
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ANDROID_HARDWARE_AUDIO_PRIMARYDEVICE_H
|
||||||
|
#define ANDROID_HARDWARE_AUDIO_PRIMARYDEVICE_H
|
||||||
|
|
||||||
|
#include PATH(android/hardware/audio/FILE_VERSION/IPrimaryDevice.h)
|
||||||
|
|
||||||
|
#include "Device.h"
|
||||||
|
|
||||||
|
#include <hidl/Status.h>
|
||||||
|
|
||||||
|
#include <hidl/MQDescriptor.h>
|
||||||
|
|
||||||
|
namespace android {
|
||||||
|
namespace hardware {
|
||||||
|
namespace audio {
|
||||||
|
namespace CPP_VERSION {
|
||||||
|
namespace implementation {
|
||||||
|
|
||||||
|
using ::android::sp;
|
||||||
|
using ::android::hardware::hidl_string;
|
||||||
|
using ::android::hardware::hidl_vec;
|
||||||
|
using ::android::hardware::Return;
|
||||||
|
using ::android::hardware::Void;
|
||||||
|
using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION;
|
||||||
|
using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION;
|
||||||
|
using namespace ::android::hardware::audio::CPP_VERSION;
|
||||||
|
|
||||||
|
struct PrimaryDevice : public IPrimaryDevice {
|
||||||
|
explicit PrimaryDevice(audio_hw_device_t* device);
|
||||||
|
|
||||||
|
// Methods from ::android::hardware::audio::CPP_VERSION::IDevice follow.
|
||||||
|
Return<Result> initCheck() override;
|
||||||
|
Return<Result> setMasterVolume(float volume) override;
|
||||||
|
Return<void> getMasterVolume(getMasterVolume_cb _hidl_cb) override;
|
||||||
|
Return<Result> setMicMute(bool mute) override;
|
||||||
|
Return<void> getMicMute(getMicMute_cb _hidl_cb) override;
|
||||||
|
Return<Result> setMasterMute(bool mute) override;
|
||||||
|
Return<void> getMasterMute(getMasterMute_cb _hidl_cb) override;
|
||||||
|
Return<void> getInputBufferSize(const AudioConfig& config,
|
||||||
|
getInputBufferSize_cb _hidl_cb) override;
|
||||||
|
|
||||||
|
Return<void> openOutputStream(int32_t ioHandle, const DeviceAddress& device,
|
||||||
|
const AudioConfig& config,
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
AudioOutputFlags flags,
|
||||||
|
#else
|
||||||
|
const AudioOutputFlags& flags,
|
||||||
|
#endif
|
||||||
|
#if MAJOR_VERSION >= 4
|
||||||
|
const SourceMetadata& sourceMetadata,
|
||||||
|
#endif
|
||||||
|
openOutputStream_cb _hidl_cb) override;
|
||||||
|
Return<void> openInputStream(int32_t ioHandle, const DeviceAddress& device,
|
||||||
|
const AudioConfig& config,
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
AudioInputFlags flags,
|
||||||
|
#else
|
||||||
|
const AudioInputFlags& flags,
|
||||||
|
#endif
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
AudioSource source,
|
||||||
|
#elif MAJOR_VERSION >= 4
|
||||||
|
const SinkMetadata& sinkMetadata,
|
||||||
|
#endif
|
||||||
|
openInputStream_cb _hidl_cb) override;
|
||||||
|
|
||||||
|
Return<bool> supportsAudioPatches() override;
|
||||||
|
Return<void> createAudioPatch(const hidl_vec<AudioPortConfig>& sources,
|
||||||
|
const hidl_vec<AudioPortConfig>& sinks,
|
||||||
|
createAudioPatch_cb _hidl_cb) override;
|
||||||
|
Return<Result> releaseAudioPatch(int32_t patch) override;
|
||||||
|
Return<void> getAudioPort(const AudioPort& port, getAudioPort_cb _hidl_cb) override;
|
||||||
|
Return<Result> setAudioPortConfig(const AudioPortConfig& config) override;
|
||||||
|
|
||||||
|
Return<Result> setScreenState(bool turnedOn) override;
|
||||||
|
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<AudioHwSync> getHwAvSync() override;
|
||||||
|
Return<void> getParameters(const hidl_vec<hidl_string>& keys,
|
||||||
|
getParameters_cb _hidl_cb) override;
|
||||||
|
Return<Result> setParameters(const hidl_vec<ParameterValue>& parameters) override;
|
||||||
|
Return<void> debugDump(const hidl_handle& fd) override;
|
||||||
|
#elif MAJOR_VERSION >= 4
|
||||||
|
Return<void> getHwAvSync(getHwAvSync_cb _hidl_cb) override;
|
||||||
|
Return<void> getParameters(const hidl_vec<ParameterValue>& context,
|
||||||
|
const hidl_vec<hidl_string>& keys,
|
||||||
|
getParameters_cb _hidl_cb) override;
|
||||||
|
Return<Result> setParameters(const hidl_vec<ParameterValue>& context,
|
||||||
|
const hidl_vec<ParameterValue>& parameters) override;
|
||||||
|
Return<void> getMicrophones(getMicrophones_cb _hidl_cb) override;
|
||||||
|
Return<Result> setConnectedState(const DeviceAddress& address, bool connected) override;
|
||||||
|
#endif
|
||||||
|
#if MAJOR_VERSION >= 6
|
||||||
|
Return<Result> close() override;
|
||||||
|
Return<Result> addDeviceEffect(AudioPortHandle device, uint64_t effectId) override;
|
||||||
|
Return<Result> removeDeviceEffect(AudioPortHandle device, uint64_t effectId) override;
|
||||||
|
Return<void> updateAudioPatch(int32_t previousPatch, const hidl_vec<AudioPortConfig>& sources,
|
||||||
|
const hidl_vec<AudioPortConfig>& sinks,
|
||||||
|
updateAudioPatch_cb _hidl_cb) override;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Return<void> debug(const hidl_handle& fd, const hidl_vec<hidl_string>& options) override;
|
||||||
|
|
||||||
|
// Methods from ::android::hardware::audio::CPP_VERSION::IPrimaryDevice follow.
|
||||||
|
Return<Result> setVoiceVolume(float volume) override;
|
||||||
|
Return<Result> setMode(AudioMode mode) override;
|
||||||
|
Return<void> getBtScoNrecEnabled(getBtScoNrecEnabled_cb _hidl_cb) override;
|
||||||
|
Return<Result> setBtScoNrecEnabled(bool enabled) override;
|
||||||
|
Return<void> getBtScoWidebandEnabled(getBtScoWidebandEnabled_cb _hidl_cb) override;
|
||||||
|
Return<Result> setBtScoWidebandEnabled(bool enabled) override;
|
||||||
|
Return<void> getTtyMode(getTtyMode_cb _hidl_cb) override;
|
||||||
|
Return<Result> setTtyMode(IPrimaryDevice::TtyMode mode) override;
|
||||||
|
Return<void> getHacEnabled(getHacEnabled_cb _hidl_cb) override;
|
||||||
|
Return<Result> setHacEnabled(bool enabled) override;
|
||||||
|
|
||||||
|
#if MAJOR_VERSION >= 4
|
||||||
|
Return<Result> setBtScoHeadsetDebugName(const hidl_string& name) override;
|
||||||
|
Return<void> getBtHfpEnabled(getBtHfpEnabled_cb _hidl_cb) override;
|
||||||
|
Return<Result> setBtHfpEnabled(bool enabled) override;
|
||||||
|
Return<Result> setBtHfpSampleRate(uint32_t sampleRateHz) override;
|
||||||
|
Return<Result> setBtHfpVolume(float volume) override;
|
||||||
|
Return<Result> updateRotation(IPrimaryDevice::Rotation rotation) override;
|
||||||
|
#endif
|
||||||
|
#if MAJOR_VERSION == 7 && MINOR_VERSION == 1
|
||||||
|
Return<sp<::android::hardware::audio::V7_1::IDevice>> getDevice() override { return mDevice; }
|
||||||
|
#endif
|
||||||
|
private:
|
||||||
|
sp<Device> mDevice;
|
||||||
|
|
||||||
|
virtual ~PrimaryDevice();
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace implementation
|
||||||
|
} // namespace CPP_VERSION
|
||||||
|
} // namespace audio
|
||||||
|
} // namespace hardware
|
||||||
|
} // namespace android
|
||||||
|
|
||||||
|
#endif // ANDROID_HARDWARE_AUDIO_PRIMARYDEVICE_H
|
236
audio/impl/include/core/default/Stream.h
Normal file
236
audio/impl/include/core/default/Stream.h
Normal file
@@ -0,0 +1,236 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ANDROID_HARDWARE_AUDIO_STREAM_H
|
||||||
|
#define ANDROID_HARDWARE_AUDIO_STREAM_H
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
#include PATH(android/hardware/audio/COMMON_TYPES_FILE_VERSION/IStream.h)
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
#include "ParametersUtil.h"
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include <hardware/audio.h>
|
||||||
|
#include <hidl/Status.h>
|
||||||
|
|
||||||
|
#include <hidl/MQDescriptor.h>
|
||||||
|
|
||||||
|
#include <VersionUtils.h>
|
||||||
|
|
||||||
|
namespace android {
|
||||||
|
namespace hardware {
|
||||||
|
namespace audio {
|
||||||
|
namespace CPP_VERSION {
|
||||||
|
namespace implementation {
|
||||||
|
|
||||||
|
using ::android::sp;
|
||||||
|
using ::android::hardware::hidl_string;
|
||||||
|
using ::android::hardware::hidl_vec;
|
||||||
|
using ::android::hardware::Return;
|
||||||
|
using ::android::hardware::Void;
|
||||||
|
using ::android::hardware::audio::CORE_TYPES_CPP_VERSION::implementation::ParametersUtil;
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::implementation::
|
||||||
|
AudioChannelBitfield;
|
||||||
|
#endif
|
||||||
|
using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION;
|
||||||
|
using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION;
|
||||||
|
using namespace ::android::hardware::audio::CPP_VERSION;
|
||||||
|
|
||||||
|
struct Stream : public IStream, public ParametersUtil {
|
||||||
|
Stream(bool isInput, audio_stream_t* stream);
|
||||||
|
|
||||||
|
/** 1GiB is the maximum buffer size the HAL client is allowed to request.
|
||||||
|
* This value has been chosen to be under SIZE_MAX and still big enough
|
||||||
|
* for all audio use case.
|
||||||
|
* Keep private for 2.0, put in .hal in 2.1
|
||||||
|
*/
|
||||||
|
static constexpr uint32_t MAX_BUFFER_SIZE = 2 << 30 /* == 1GiB */;
|
||||||
|
|
||||||
|
// Methods from ::android::hardware::audio::CPP_VERSION::IStream follow.
|
||||||
|
Return<uint64_t> getFrameSize() override;
|
||||||
|
Return<uint64_t> getFrameCount() override;
|
||||||
|
Return<uint64_t> getBufferSize() override;
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
Return<uint32_t> getSampleRate() override;
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<void> getSupportedSampleRates(getSupportedSampleRates_cb _hidl_cb) override;
|
||||||
|
Return<void> getSupportedChannelMasks(getSupportedChannelMasks_cb _hidl_cb) override;
|
||||||
|
#endif
|
||||||
|
Return<void> getSupportedSampleRates(AudioFormat format, getSupportedSampleRates_cb _hidl_cb);
|
||||||
|
Return<void> getSupportedChannelMasks(AudioFormat format, getSupportedChannelMasks_cb _hidl_cb);
|
||||||
|
Return<Result> setSampleRate(uint32_t sampleRateHz) override;
|
||||||
|
Return<AudioChannelBitfield> getChannelMask() override;
|
||||||
|
Return<Result> setChannelMask(AudioChannelBitfield mask) override;
|
||||||
|
Return<AudioFormat> getFormat() override;
|
||||||
|
Return<void> getSupportedFormats(getSupportedFormats_cb _hidl_cb) override;
|
||||||
|
Return<Result> setFormat(AudioFormat format) override;
|
||||||
|
#else
|
||||||
|
Return<void> getSupportedProfiles(getSupportedProfiles_cb _hidl_cb) override;
|
||||||
|
Return<Result> setAudioProperties(const AudioConfigBaseOptional& config) override;
|
||||||
|
#endif // MAJOR_VERSION <= 6
|
||||||
|
Return<void> getAudioProperties(getAudioProperties_cb _hidl_cb) override;
|
||||||
|
Return<Result> addEffect(uint64_t effectId) override;
|
||||||
|
Return<Result> removeEffect(uint64_t effectId) override;
|
||||||
|
Return<Result> standby() override;
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<AudioDevice> getDevice() override;
|
||||||
|
Return<Result> setDevice(const DeviceAddress& address) override;
|
||||||
|
Return<void> getParameters(const hidl_vec<hidl_string>& keys,
|
||||||
|
getParameters_cb _hidl_cb) override;
|
||||||
|
Return<Result> setParameters(const hidl_vec<ParameterValue>& parameters) override;
|
||||||
|
Return<Result> setConnectedState(const DeviceAddress& address, bool connected) override;
|
||||||
|
#elif MAJOR_VERSION >= 4
|
||||||
|
Return<void> getDevices(getDevices_cb _hidl_cb) override;
|
||||||
|
Return<Result> setDevices(const hidl_vec<DeviceAddress>& devices) override;
|
||||||
|
Return<void> getParameters(const hidl_vec<ParameterValue>& context,
|
||||||
|
const hidl_vec<hidl_string>& keys,
|
||||||
|
getParameters_cb _hidl_cb) override;
|
||||||
|
Return<Result> setParameters(const hidl_vec<ParameterValue>& context,
|
||||||
|
const hidl_vec<ParameterValue>& parameters) override;
|
||||||
|
#endif
|
||||||
|
Return<Result> setHwAvSync(uint32_t hwAvSync) override;
|
||||||
|
Return<Result> start() override;
|
||||||
|
Return<Result> stop() override;
|
||||||
|
Return<void> createMmapBuffer(int32_t minSizeFrames, createMmapBuffer_cb _hidl_cb) override;
|
||||||
|
Return<void> getMmapPosition(getMmapPosition_cb _hidl_cb) override;
|
||||||
|
Return<Result> close() override;
|
||||||
|
|
||||||
|
Return<void> debug(const hidl_handle& fd, const hidl_vec<hidl_string>& options) override;
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<void> debugDump(const hidl_handle& fd) override;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Utility methods for extending interfaces.
|
||||||
|
static Result analyzeStatus(const char* funcName, int status);
|
||||||
|
static Result analyzeStatus(const char* funcName, int status,
|
||||||
|
const std::vector<int>& ignoreErrors);
|
||||||
|
|
||||||
|
private:
|
||||||
|
const bool mIsInput;
|
||||||
|
audio_stream_t* mStream;
|
||||||
|
|
||||||
|
virtual ~Stream();
|
||||||
|
|
||||||
|
// Methods from ParametersUtil.
|
||||||
|
char* halGetParameters(const char* keys) override;
|
||||||
|
int halSetParameters(const char* keysAndValues) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
struct StreamMmap : public RefBase {
|
||||||
|
explicit StreamMmap(T* stream) : mStream(stream) {}
|
||||||
|
|
||||||
|
Return<Result> start();
|
||||||
|
Return<Result> stop();
|
||||||
|
Return<void> createMmapBuffer(int32_t minSizeFrames, size_t frameSize,
|
||||||
|
IStream::createMmapBuffer_cb _hidl_cb);
|
||||||
|
Return<void> getMmapPosition(IStream::getMmapPosition_cb _hidl_cb);
|
||||||
|
|
||||||
|
private:
|
||||||
|
StreamMmap() {}
|
||||||
|
|
||||||
|
T* mStream;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
Return<Result> StreamMmap<T>::start() {
|
||||||
|
if (mStream->start == NULL) return Result::NOT_SUPPORTED;
|
||||||
|
int result = mStream->start(mStream);
|
||||||
|
return Stream::analyzeStatus("start", result);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
Return<Result> StreamMmap<T>::stop() {
|
||||||
|
if (mStream->stop == NULL) return Result::NOT_SUPPORTED;
|
||||||
|
int result = mStream->stop(mStream);
|
||||||
|
return Stream::analyzeStatus("stop", result);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
Return<void> StreamMmap<T>::createMmapBuffer(int32_t minSizeFrames, size_t frameSize,
|
||||||
|
IStream::createMmapBuffer_cb _hidl_cb) {
|
||||||
|
Result retval(Result::NOT_SUPPORTED);
|
||||||
|
MmapBufferInfo info;
|
||||||
|
native_handle_t* hidlHandle = nullptr;
|
||||||
|
|
||||||
|
if (mStream->create_mmap_buffer != NULL) {
|
||||||
|
if (minSizeFrames <= 0) {
|
||||||
|
retval = Result::INVALID_ARGUMENTS;
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
struct audio_mmap_buffer_info halInfo;
|
||||||
|
retval = Stream::analyzeStatus(
|
||||||
|
"create_mmap_buffer", mStream->create_mmap_buffer(mStream, minSizeFrames, &halInfo));
|
||||||
|
if (retval == Result::OK) {
|
||||||
|
hidlHandle = native_handle_create(1, 0);
|
||||||
|
hidlHandle->data[0] = halInfo.shared_memory_fd;
|
||||||
|
|
||||||
|
// Negative buffer size frame is a legacy hack to indicate that the buffer
|
||||||
|
// is shareable to applications before the relevant flag was introduced
|
||||||
|
bool applicationShareable =
|
||||||
|
halInfo.flags & AUDIO_MMAP_APPLICATION_SHAREABLE || halInfo.buffer_size_frames < 0;
|
||||||
|
halInfo.buffer_size_frames = abs(halInfo.buffer_size_frames);
|
||||||
|
info.sharedMemory = // hidl_memory size must always be positive
|
||||||
|
hidl_memory("audio_buffer", hidlHandle, frameSize * halInfo.buffer_size_frames);
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
if (applicationShareable) {
|
||||||
|
halInfo.buffer_size_frames *= -1;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
info.flags =
|
||||||
|
halInfo.flags | (applicationShareable ? MmapBufferFlag::APPLICATION_SHAREABLE
|
||||||
|
: MmapBufferFlag::NONE);
|
||||||
|
#endif
|
||||||
|
info.bufferSizeFrames = halInfo.buffer_size_frames;
|
||||||
|
info.burstSizeFrames = halInfo.burst_size_frames;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exit:
|
||||||
|
_hidl_cb(retval, info);
|
||||||
|
if (hidlHandle != nullptr) {
|
||||||
|
native_handle_delete(hidlHandle);
|
||||||
|
}
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
Return<void> StreamMmap<T>::getMmapPosition(IStream::getMmapPosition_cb _hidl_cb) {
|
||||||
|
Result retval(Result::NOT_SUPPORTED);
|
||||||
|
MmapPosition position;
|
||||||
|
|
||||||
|
if (mStream->get_mmap_position != NULL) {
|
||||||
|
struct audio_mmap_position halPosition;
|
||||||
|
retval = Stream::analyzeStatus("get_mmap_position",
|
||||||
|
mStream->get_mmap_position(mStream, &halPosition));
|
||||||
|
if (retval == Result::OK) {
|
||||||
|
position.timeNanoseconds = halPosition.time_nanoseconds;
|
||||||
|
position.positionFrames = halPosition.position_frames;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_hidl_cb(retval, position);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace implementation
|
||||||
|
} // namespace CPP_VERSION
|
||||||
|
} // namespace audio
|
||||||
|
} // namespace hardware
|
||||||
|
} // namespace android
|
||||||
|
|
||||||
|
#endif // ANDROID_HARDWARE_AUDIO_STREAM_H
|
162
audio/impl/include/core/default/StreamIn.h
Normal file
162
audio/impl/include/core/default/StreamIn.h
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ANDROID_HARDWARE_AUDIO_STREAMIN_H
|
||||||
|
#define ANDROID_HARDWARE_AUDIO_STREAMIN_H
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
#include PATH(android/hardware/audio/CORE_TYPES_FILE_VERSION/IStreamIn.h)
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
#include "Device.h"
|
||||||
|
#include "Stream.h"
|
||||||
|
|
||||||
|
#include <atomic>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
#include <fmq/EventFlag.h>
|
||||||
|
#include <fmq/MessageQueue.h>
|
||||||
|
#include <hidl/MQDescriptor.h>
|
||||||
|
#include <hidl/Status.h>
|
||||||
|
#include <utils/Thread.h>
|
||||||
|
|
||||||
|
namespace android {
|
||||||
|
namespace hardware {
|
||||||
|
namespace audio {
|
||||||
|
namespace CPP_VERSION {
|
||||||
|
namespace implementation {
|
||||||
|
|
||||||
|
using ::android::sp;
|
||||||
|
using ::android::hardware::hidl_string;
|
||||||
|
using ::android::hardware::hidl_vec;
|
||||||
|
using ::android::hardware::Return;
|
||||||
|
using ::android::hardware::Void;
|
||||||
|
using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION;
|
||||||
|
using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION;
|
||||||
|
using namespace ::android::hardware::audio::CPP_VERSION;
|
||||||
|
|
||||||
|
struct StreamIn : public IStreamIn {
|
||||||
|
typedef MessageQueue<ReadParameters, kSynchronizedReadWrite> CommandMQ;
|
||||||
|
typedef MessageQueue<uint8_t, kSynchronizedReadWrite> DataMQ;
|
||||||
|
typedef MessageQueue<ReadStatus, kSynchronizedReadWrite> StatusMQ;
|
||||||
|
|
||||||
|
StreamIn(const sp<Device>& device, audio_stream_in_t* stream);
|
||||||
|
|
||||||
|
// Methods from ::android::hardware::audio::CPP_VERSION::IStream follow.
|
||||||
|
Return<uint64_t> getFrameSize() override;
|
||||||
|
Return<uint64_t> getFrameCount() override;
|
||||||
|
Return<uint64_t> getBufferSize() override;
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
Return<uint32_t> getSampleRate() override;
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<void> getSupportedSampleRates(getSupportedSampleRates_cb _hidl_cb) override;
|
||||||
|
Return<void> getSupportedChannelMasks(getSupportedChannelMasks_cb _hidl_cb) override;
|
||||||
|
#endif
|
||||||
|
Return<void> getSupportedSampleRates(AudioFormat format, getSupportedSampleRates_cb _hidl_cb);
|
||||||
|
Return<void> getSupportedChannelMasks(AudioFormat format, getSupportedChannelMasks_cb _hidl_cb);
|
||||||
|
Return<Result> setSampleRate(uint32_t sampleRateHz) override;
|
||||||
|
Return<AudioChannelBitfield> getChannelMask() override;
|
||||||
|
Return<Result> setChannelMask(AudioChannelBitfield mask) override;
|
||||||
|
Return<AudioFormat> getFormat() override;
|
||||||
|
Return<void> getSupportedFormats(getSupportedFormats_cb _hidl_cb) override;
|
||||||
|
Return<Result> setFormat(AudioFormat format) override;
|
||||||
|
#else
|
||||||
|
Return<void> getSupportedProfiles(getSupportedProfiles_cb _hidl_cb) override;
|
||||||
|
Return<Result> setAudioProperties(const AudioConfigBaseOptional& config) override;
|
||||||
|
#endif // MAJOR_VERSION <= 6
|
||||||
|
Return<void> getAudioProperties(getAudioProperties_cb _hidl_cb) override;
|
||||||
|
Return<Result> addEffect(uint64_t effectId) override;
|
||||||
|
Return<Result> removeEffect(uint64_t effectId) override;
|
||||||
|
Return<Result> standby() override;
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<AudioDevice> getDevice() override;
|
||||||
|
Return<Result> setDevice(const DeviceAddress& address) override;
|
||||||
|
Return<void> getParameters(const hidl_vec<hidl_string>& keys,
|
||||||
|
getParameters_cb _hidl_cb) override;
|
||||||
|
Return<Result> setParameters(const hidl_vec<ParameterValue>& parameters) override;
|
||||||
|
Return<Result> setConnectedState(const DeviceAddress& address, bool connected) override;
|
||||||
|
#elif MAJOR_VERSION >= 4
|
||||||
|
Return<void> getDevices(getDevices_cb _hidl_cb) override;
|
||||||
|
Return<Result> setDevices(const hidl_vec<DeviceAddress>& devices) override;
|
||||||
|
Return<void> getParameters(const hidl_vec<ParameterValue>& context,
|
||||||
|
const hidl_vec<hidl_string>& keys,
|
||||||
|
getParameters_cb _hidl_cb) override;
|
||||||
|
Return<Result> setParameters(const hidl_vec<ParameterValue>& context,
|
||||||
|
const hidl_vec<ParameterValue>& parameters) override;
|
||||||
|
#endif
|
||||||
|
Return<Result> setHwAvSync(uint32_t hwAvSync) override;
|
||||||
|
Return<Result> close() override;
|
||||||
|
|
||||||
|
Return<void> debug(const hidl_handle& fd, const hidl_vec<hidl_string>& options) override;
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<void> debugDump(const hidl_handle& fd) override;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Methods from ::android::hardware::audio::CPP_VERSION::IStreamIn follow.
|
||||||
|
Return<void> getAudioSource(getAudioSource_cb _hidl_cb) override;
|
||||||
|
Return<Result> setGain(float gain) override;
|
||||||
|
Return<void> prepareForReading(uint32_t frameSize, uint32_t framesCount,
|
||||||
|
prepareForReading_cb _hidl_cb) override;
|
||||||
|
Return<uint32_t> getInputFramesLost() override;
|
||||||
|
Return<void> getCapturePosition(getCapturePosition_cb _hidl_cb) override;
|
||||||
|
Return<Result> start() override;
|
||||||
|
Return<Result> stop() override;
|
||||||
|
Return<void> createMmapBuffer(int32_t minSizeFrames, createMmapBuffer_cb _hidl_cb) override;
|
||||||
|
Return<void> getMmapPosition(getMmapPosition_cb _hidl_cb) override;
|
||||||
|
#if MAJOR_VERSION >= 4
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
Return<void> updateSinkMetadata(const SinkMetadata& sinkMetadata) override;
|
||||||
|
#else
|
||||||
|
Return<Result> updateSinkMetadata(const SinkMetadata& sinkMetadata) override;
|
||||||
|
#endif
|
||||||
|
Return<void> getActiveMicrophones(getActiveMicrophones_cb _hidl_cb) override;
|
||||||
|
#endif // MAJOR_VERSION >= 4
|
||||||
|
#if MAJOR_VERSION >= 5
|
||||||
|
Return<Result> setMicrophoneDirection(MicrophoneDirection direction) override;
|
||||||
|
Return<Result> setMicrophoneFieldDimension(float zoom) override;
|
||||||
|
#endif
|
||||||
|
static Result getCapturePositionImpl(audio_stream_in_t* stream, uint64_t* frames,
|
||||||
|
uint64_t* time);
|
||||||
|
|
||||||
|
private:
|
||||||
|
#if MAJOR_VERSION >= 4
|
||||||
|
Result doUpdateSinkMetadata(const SinkMetadata& sinkMetadata);
|
||||||
|
#if MAJOR_VERSION >= 7
|
||||||
|
Result doUpdateSinkMetadataV7(const SinkMetadata& sinkMetadata);
|
||||||
|
#endif
|
||||||
|
#endif // MAJOR_VERSION >= 4
|
||||||
|
|
||||||
|
const sp<Device> mDevice;
|
||||||
|
audio_stream_in_t* mStream;
|
||||||
|
const sp<Stream> mStreamCommon;
|
||||||
|
const sp<StreamMmap<audio_stream_in_t>> mStreamMmap;
|
||||||
|
std::unique_ptr<CommandMQ> mCommandMQ;
|
||||||
|
std::unique_ptr<DataMQ> mDataMQ;
|
||||||
|
std::unique_ptr<StatusMQ> mStatusMQ;
|
||||||
|
EventFlag* mEfGroup;
|
||||||
|
std::atomic<bool> mStopReadThread;
|
||||||
|
sp<Thread> mReadThread;
|
||||||
|
|
||||||
|
virtual ~StreamIn();
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace implementation
|
||||||
|
} // namespace CPP_VERSION
|
||||||
|
} // namespace audio
|
||||||
|
} // namespace hardware
|
||||||
|
} // namespace android
|
||||||
|
|
||||||
|
#endif // ANDROID_HARDWARE_AUDIO_STREAMIN_H
|
201
audio/impl/include/core/default/StreamOut.h
Normal file
201
audio/impl/include/core/default/StreamOut.h
Normal file
@@ -0,0 +1,201 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ANDROID_HARDWARE_AUDIO_STREAMOUT_H
|
||||||
|
#define ANDROID_HARDWARE_AUDIO_STREAMOUT_H
|
||||||
|
|
||||||
|
#include PATH(android/hardware/audio/FILE_VERSION/IStreamOut.h)
|
||||||
|
|
||||||
|
#include "Device.h"
|
||||||
|
#include "Stream.h"
|
||||||
|
|
||||||
|
#include <atomic>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
#include <fmq/EventFlag.h>
|
||||||
|
#include <fmq/MessageQueue.h>
|
||||||
|
#include <hidl/MQDescriptor.h>
|
||||||
|
#include <hidl/Status.h>
|
||||||
|
#include <mediautils/Synchronization.h>
|
||||||
|
#include <utils/Thread.h>
|
||||||
|
|
||||||
|
namespace android {
|
||||||
|
namespace hardware {
|
||||||
|
namespace audio {
|
||||||
|
namespace CPP_VERSION {
|
||||||
|
namespace implementation {
|
||||||
|
|
||||||
|
using ::android::sp;
|
||||||
|
using ::android::hardware::hidl_string;
|
||||||
|
using ::android::hardware::hidl_vec;
|
||||||
|
using ::android::hardware::Return;
|
||||||
|
using ::android::hardware::Void;
|
||||||
|
using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION;
|
||||||
|
using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION;
|
||||||
|
using namespace ::android::hardware::audio::CPP_VERSION;
|
||||||
|
|
||||||
|
struct StreamOut : public IStreamOut {
|
||||||
|
typedef MessageQueue<WriteCommand, kSynchronizedReadWrite> CommandMQ;
|
||||||
|
typedef MessageQueue<uint8_t, kSynchronizedReadWrite> DataMQ;
|
||||||
|
typedef MessageQueue<WriteStatus, kSynchronizedReadWrite> StatusMQ;
|
||||||
|
|
||||||
|
StreamOut(const sp<Device>& device, audio_stream_out_t* stream);
|
||||||
|
|
||||||
|
// Methods from ::android::hardware::audio::CPP_VERSION::IStream follow.
|
||||||
|
Return<uint64_t> getFrameSize() override;
|
||||||
|
Return<uint64_t> getFrameCount() override;
|
||||||
|
Return<uint64_t> getBufferSize() override;
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
Return<uint32_t> getSampleRate() override;
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<void> getSupportedSampleRates(getSupportedSampleRates_cb _hidl_cb) override;
|
||||||
|
Return<void> getSupportedChannelMasks(getSupportedChannelMasks_cb _hidl_cb) override;
|
||||||
|
#endif
|
||||||
|
Return<void> getSupportedSampleRates(AudioFormat format, getSupportedSampleRates_cb _hidl_cb);
|
||||||
|
Return<void> getSupportedChannelMasks(AudioFormat format, getSupportedChannelMasks_cb _hidl_cb);
|
||||||
|
Return<Result> setSampleRate(uint32_t sampleRateHz) override;
|
||||||
|
Return<AudioChannelBitfield> getChannelMask() override;
|
||||||
|
Return<Result> setChannelMask(AudioChannelBitfield mask) override;
|
||||||
|
Return<AudioFormat> getFormat() override;
|
||||||
|
Return<void> getSupportedFormats(getSupportedFormats_cb _hidl_cb) override;
|
||||||
|
Return<Result> setFormat(AudioFormat format) override;
|
||||||
|
#else
|
||||||
|
Return<void> getSupportedProfiles(getSupportedProfiles_cb _hidl_cb) override;
|
||||||
|
Return<Result> setAudioProperties(const AudioConfigBaseOptional& config) override;
|
||||||
|
#endif // MAJOR_VERSION <= 6
|
||||||
|
Return<void> getAudioProperties(getAudioProperties_cb _hidl_cb) override;
|
||||||
|
Return<Result> addEffect(uint64_t effectId) override;
|
||||||
|
Return<Result> removeEffect(uint64_t effectId) override;
|
||||||
|
Return<Result> standby() override;
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<AudioDevice> getDevice() override;
|
||||||
|
Return<Result> setDevice(const DeviceAddress& address) override;
|
||||||
|
Return<void> getParameters(const hidl_vec<hidl_string>& keys,
|
||||||
|
getParameters_cb _hidl_cb) override;
|
||||||
|
Return<Result> setParameters(const hidl_vec<ParameterValue>& parameters) override;
|
||||||
|
Return<Result> setConnectedState(const DeviceAddress& address, bool connected) override;
|
||||||
|
#elif MAJOR_VERSION >= 4
|
||||||
|
Return<void> getDevices(getDevices_cb _hidl_cb) override;
|
||||||
|
Return<Result> setDevices(const hidl_vec<DeviceAddress>& devices) override;
|
||||||
|
Return<void> getParameters(const hidl_vec<ParameterValue>& context,
|
||||||
|
const hidl_vec<hidl_string>& keys,
|
||||||
|
getParameters_cb _hidl_cb) override;
|
||||||
|
Return<Result> setParameters(const hidl_vec<ParameterValue>& context,
|
||||||
|
const hidl_vec<ParameterValue>& parameters) override;
|
||||||
|
#endif
|
||||||
|
Return<Result> setHwAvSync(uint32_t hwAvSync) override;
|
||||||
|
Return<Result> close() override;
|
||||||
|
|
||||||
|
Return<void> debug(const hidl_handle& fd, const hidl_vec<hidl_string>& options) override;
|
||||||
|
#if MAJOR_VERSION == 2
|
||||||
|
Return<void> debugDump(const hidl_handle& fd) override;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Methods from ::android::hardware::audio::CPP_VERSION::IStreamOut follow.
|
||||||
|
Return<uint32_t> getLatency() override;
|
||||||
|
Return<Result> setVolume(float left, float right) override;
|
||||||
|
Return<void> prepareForWriting(uint32_t frameSize, uint32_t framesCount,
|
||||||
|
prepareForWriting_cb _hidl_cb) override;
|
||||||
|
Return<void> getRenderPosition(getRenderPosition_cb _hidl_cb) override;
|
||||||
|
Return<void> getNextWriteTimestamp(getNextWriteTimestamp_cb _hidl_cb) override;
|
||||||
|
Return<Result> setCallback(const sp<IStreamOutCallback>& callback) override;
|
||||||
|
Return<Result> clearCallback() override;
|
||||||
|
Return<void> supportsPauseAndResume(supportsPauseAndResume_cb _hidl_cb) override;
|
||||||
|
Return<Result> pause() override;
|
||||||
|
Return<Result> resume() override;
|
||||||
|
Return<bool> supportsDrain() override;
|
||||||
|
Return<Result> drain(AudioDrain type) override;
|
||||||
|
Return<Result> flush() override;
|
||||||
|
Return<void> getPresentationPosition(getPresentationPosition_cb _hidl_cb) override;
|
||||||
|
Return<Result> start() override;
|
||||||
|
Return<Result> stop() override;
|
||||||
|
Return<void> createMmapBuffer(int32_t minSizeFrames, createMmapBuffer_cb _hidl_cb) override;
|
||||||
|
Return<void> getMmapPosition(getMmapPosition_cb _hidl_cb) override;
|
||||||
|
#if MAJOR_VERSION >= 4
|
||||||
|
Return<Result> selectPresentation(int32_t presentationId, int32_t programId) override;
|
||||||
|
#if MAJOR_VERSION <= 6
|
||||||
|
Return<void> updateSourceMetadata(const SourceMetadata& sourceMetadata) override;
|
||||||
|
#else
|
||||||
|
Return<Result> updateSourceMetadata(const SourceMetadata& sourceMetadata) override;
|
||||||
|
#endif
|
||||||
|
#endif // MAJOR_VERSION >= 4
|
||||||
|
#if MAJOR_VERSION >= 6
|
||||||
|
Return<void> getDualMonoMode(getDualMonoMode_cb _hidl_cb) override;
|
||||||
|
Return<Result> setDualMonoMode(DualMonoMode mode) override;
|
||||||
|
Return<void> getAudioDescriptionMixLevel(getAudioDescriptionMixLevel_cb _hidl_cb) override;
|
||||||
|
Return<Result> setAudioDescriptionMixLevel(float leveldB) override;
|
||||||
|
Return<void> getPlaybackRateParameters(getPlaybackRateParameters_cb _hidl_cb) override;
|
||||||
|
Return<Result> setPlaybackRateParameters(const PlaybackRate& playbackRate) override;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static Result getPresentationPositionImpl(audio_stream_out_t* stream, uint64_t* frames,
|
||||||
|
TimeSpec* timeStamp);
|
||||||
|
|
||||||
|
#if MAJOR_VERSION >= 6
|
||||||
|
Return<Result> setEventCallback(const sp<IStreamOutEventCallback>& callback) override;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
private:
|
||||||
|
#if MAJOR_VERSION >= 4
|
||||||
|
Result doUpdateSourceMetadata(const SourceMetadata& sourceMetadata);
|
||||||
|
#if MAJOR_VERSION >= 7
|
||||||
|
Result doUpdateSourceMetadataV7(const SourceMetadata& sourceMetadata);
|
||||||
|
#if MAJOR_VERSION == 7 && MINOR_VERSION == 1
|
||||||
|
Return<Result> setLatencyMode(LatencyMode mode) override;
|
||||||
|
Return<void> getRecommendedLatencyModes(getRecommendedLatencyModes_cb _hidl_cb) override;
|
||||||
|
Return<Result> setLatencyModeCallback(
|
||||||
|
const sp<IStreamOutLatencyModeCallback>& callback) override;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif // MAJOR_VERSION >= 4
|
||||||
|
|
||||||
|
const sp<Device> mDevice;
|
||||||
|
audio_stream_out_t* mStream;
|
||||||
|
const sp<Stream> mStreamCommon;
|
||||||
|
const sp<StreamMmap<audio_stream_out_t>> mStreamMmap;
|
||||||
|
mediautils::atomic_sp<IStreamOutCallback> mCallback; // for non-blocking write and drain
|
||||||
|
#if MAJOR_VERSION >= 6
|
||||||
|
mediautils::atomic_sp<IStreamOutEventCallback> mEventCallback;
|
||||||
|
#if MAJOR_VERSION == 7 && MINOR_VERSION == 1
|
||||||
|
mediautils::atomic_sp<IStreamOutLatencyModeCallback> mLatencyModeCallback;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
std::unique_ptr<CommandMQ> mCommandMQ;
|
||||||
|
std::unique_ptr<DataMQ> mDataMQ;
|
||||||
|
std::unique_ptr<StatusMQ> mStatusMQ;
|
||||||
|
EventFlag* mEfGroup;
|
||||||
|
std::atomic<bool> mStopWriteThread;
|
||||||
|
sp<Thread> mWriteThread;
|
||||||
|
|
||||||
|
virtual ~StreamOut();
|
||||||
|
|
||||||
|
static int asyncCallback(stream_callback_event_t event, void* param, void* cookie);
|
||||||
|
|
||||||
|
#if MAJOR_VERSION >= 6
|
||||||
|
static int asyncEventCallback(stream_event_callback_type_t event, void* param, void* cookie);
|
||||||
|
#if MAJOR_VERSION == 7 && MINOR_VERSION == 1
|
||||||
|
static void latencyModeCallback(audio_latency_mode_t* modes, size_t num_modes, void* cookie);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace implementation
|
||||||
|
} // namespace CPP_VERSION
|
||||||
|
} // namespace audio
|
||||||
|
} // namespace hardware
|
||||||
|
} // namespace android
|
||||||
|
|
||||||
|
#endif // ANDROID_HARDWARE_AUDIO_STREAMOUT_H
|
82
audio/impl/include/core/default/Util.h
Normal file
82
audio/impl/include/core/default/Util.h
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ANDROID_HARDWARE_AUDIO_UTIL_H
|
||||||
|
#define ANDROID_HARDWARE_AUDIO_UTIL_H
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
#include PATH(android/hardware/audio/CORE_TYPES_FILE_VERSION/types.h)
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include <system/audio.h>
|
||||||
|
|
||||||
|
namespace android {
|
||||||
|
namespace hardware {
|
||||||
|
namespace audio {
|
||||||
|
namespace CORE_TYPES_CPP_VERSION {
|
||||||
|
namespace implementation {
|
||||||
|
|
||||||
|
using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION;
|
||||||
|
using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION;
|
||||||
|
|
||||||
|
namespace util {
|
||||||
|
|
||||||
|
/** @return true if gain is between 0 and 1 included. */
|
||||||
|
constexpr bool isGainNormalized(float gain) {
|
||||||
|
return gain >= 0.0 && gain <= 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
inline bool element_in(T e, const std::vector<T>& v) {
|
||||||
|
return std::find(v.begin(), v.end(), e) != v.end();
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline Result analyzeStatus(status_t status) {
|
||||||
|
switch (status) {
|
||||||
|
case 0:
|
||||||
|
return Result::OK;
|
||||||
|
case -EINVAL:
|
||||||
|
return Result::INVALID_ARGUMENTS;
|
||||||
|
case -ENODATA:
|
||||||
|
return Result::INVALID_STATE;
|
||||||
|
case -ENODEV:
|
||||||
|
return Result::NOT_INITIALIZED;
|
||||||
|
case -ENOSYS:
|
||||||
|
return Result::NOT_SUPPORTED;
|
||||||
|
default:
|
||||||
|
return Result::INVALID_STATE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline Result analyzeStatus(const char* className, const char* funcName, status_t status,
|
||||||
|
const std::vector<int>& ignoreErrors = {}) {
|
||||||
|
if (status != 0 && !element_in(-status, ignoreErrors)) {
|
||||||
|
ALOGW("Error from HAL %s in function %s: %s", className, funcName, strerror(-status));
|
||||||
|
}
|
||||||
|
return analyzeStatus(status);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace util
|
||||||
|
} // namespace implementation
|
||||||
|
} // namespace CORE_TYPES_CPP_VERSION
|
||||||
|
} // namespace audio
|
||||||
|
} // namespace hardware
|
||||||
|
} // namespace android
|
||||||
|
|
||||||
|
#endif // ANDROID_HARDWARE_AUDIO_UTIL_H
|
@@ -1,150 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!-- Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
|
|
||||||
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions are
|
|
||||||
* met:
|
|
||||||
* * Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* * Redistributions in binary form must reproduce the above
|
|
||||||
* copyright notice, this list of conditions and the following
|
|
||||||
* disclaimer in the documentation and/or other materials provided
|
|
||||||
* with the distribution.
|
|
||||||
* * Neither the name of The Linux Foundation nor the names of its
|
|
||||||
* contributors may be used to endorse or promote products derived
|
|
||||||
* from this software without specific prior written permission.
|
|
||||||
|
|
||||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
|
||||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
|
||||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
||||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
||||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
|
||||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
|
||||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
|
||||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
* Changes from Qualcomm Innovation Center are provided under the following license:
|
|
||||||
*
|
|
||||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted (subject to the limitations in the
|
|
||||||
* disclaimer below) provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* * Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* * Redistributions in binary form must reproduce the above
|
|
||||||
* copyright notice, this list of conditions and the following
|
|
||||||
* disclaimer in the documentation and/or other materials provided
|
|
||||||
* with the distribution.
|
|
||||||
*
|
|
||||||
* * Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
|
|
||||||
* contributors may be used to endorse or promote products derived
|
|
||||||
* from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
|
|
||||||
* GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
|
|
||||||
* HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
||||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
|
||||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
|
||||||
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
|
||||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -->
|
|
||||||
|
|
||||||
<audio_effects_conf version="2.0" xmlns="http://schemas.android.com/audio/audio_effects_conf/v2_0">
|
|
||||||
<libraries>
|
|
||||||
<library name="bundle" path="libbundlewrapper.so"/>
|
|
||||||
<library name="reverb" path="libreverbwrapper.so"/>
|
|
||||||
<library name="visualizer_sw" path="libvisualizer.so"/>
|
|
||||||
<library name="visualizer_hw" path="libqcomvisualizer.so"/>
|
|
||||||
<library name="downmix" path="libdownmix.so"/>
|
|
||||||
<library name="loudness_enhancer" path="libldnhncr.so"/>
|
|
||||||
<library name="dynamics_processing" path="libdynproc.so"/>
|
|
||||||
<library name="proxy" path="libeffectproxy.so"/>
|
|
||||||
<library name="offload_bundle" path="libqcompostprocbundle.so"/>
|
|
||||||
<library name="audio_pre_processing" path="libqcomvoiceprocessing.so"/>
|
|
||||||
<library name="volume_listener" path="libvolumelistener.so"/>
|
|
||||||
<library name="audiosphere" path="libasphere.so"/>
|
|
||||||
<library name="quasar" path="libquasar.so"/>
|
|
||||||
</libraries>
|
|
||||||
<effects>
|
|
||||||
<effectProxy name="bassboost" library="proxy" uuid="14804144-a5ee-4d24-aa88-0002a5d5c51b">
|
|
||||||
<libsw library="bundle" uuid="8631f300-72e2-11df-b57e-0002a5d5c51b"/>
|
|
||||||
<libhw library="offload_bundle" uuid="2c4a8c24-1581-487f-94f6-0002a5d5c51b"/>
|
|
||||||
</effectProxy>
|
|
||||||
<effectProxy name="virtualizer" library="proxy" uuid="d3467faa-acc7-4d34-acaf-0002a5d5c51b">
|
|
||||||
<libsw library="bundle" uuid="1d4033c0-8557-11df-9f2d-0002a5d5c51b"/>
|
|
||||||
<libhw library="offload_bundle" uuid="509a4498-561a-4bea-b3b1-0002a5d5c51b"/>
|
|
||||||
</effectProxy>
|
|
||||||
<effectProxy name="equalizer" library="proxy" uuid="c8e70ecd-48ca-456e-8a4f-0002a5d5c51b">
|
|
||||||
<libsw library="bundle" uuid="ce772f20-847d-11df-bb17-0002a5d5c51b"/>
|
|
||||||
<libhw library="offload_bundle" uuid="a0dac280-401c-11e3-9379-0002a5d5c51b"/>
|
|
||||||
</effectProxy>
|
|
||||||
<effect name="volume" library="bundle" uuid="119341a0-8469-11df-81f9-0002a5d5c51b"/>
|
|
||||||
<effectProxy name="reverb_env_aux" library="proxy" uuid="48404ac9-d202-4ccc-bf84-0002a5d5c51b">
|
|
||||||
<libsw library="reverb" uuid="4a387fc0-8ab3-11df-8bad-0002a5d5c51b"/>
|
|
||||||
<libhw library="offload_bundle" uuid="79a18026-18fd-4185-8233-0002a5d5c51b"/>
|
|
||||||
</effectProxy>
|
|
||||||
<effectProxy name="reverb_env_ins" library="proxy" uuid="b707403a-a1c1-4291-9573-0002a5d5c51b">
|
|
||||||
<libsw library="reverb" uuid="c7a511a0-a3bb-11df-860e-0002a5d5c51b"/>
|
|
||||||
<libhw library="offload_bundle" uuid="eb64ea04-973b-43d2-8f5e-0002a5d5c51b"/>
|
|
||||||
</effectProxy>
|
|
||||||
<effectProxy name="reverb_pre_aux" library="proxy" uuid="1b78f587-6d1c-422e-8b84-0002a5d5c51b">
|
|
||||||
<libsw library="reverb" uuid="f29a1400-a3bb-11df-8ddc-0002a5d5c51b"/>
|
|
||||||
<libhw library="offload_bundle" uuid="6987be09-b142-4b41-9056-0002a5d5c51b"/>
|
|
||||||
</effectProxy>
|
|
||||||
<effectProxy name="reverb_pre_ins" library="proxy" uuid="f3e178d2-ebcb-408e-8357-0002a5d5c51b">
|
|
||||||
<libsw library="reverb" uuid="172cdf00-a3bc-11df-a72f-0002a5d5c51b"/>
|
|
||||||
<libhw library="offload_bundle" uuid="aa2bebf6-47cf-4613-9bca-0002a5d5c51b"/>
|
|
||||||
</effectProxy>
|
|
||||||
<effectProxy name="visualizer" library="proxy" uuid="1d0a1a53-7d5d-48f2-8e71-27fbd10d842c">
|
|
||||||
<libsw library="visualizer_sw" uuid="d069d9e0-8329-11df-9168-0002a5d5c51b"/>
|
|
||||||
<libhw library="visualizer_hw" uuid="7a8044a0-1a71-11e3-a184-0002a5d5c51b"/>
|
|
||||||
</effectProxy>
|
|
||||||
<effect name="downmix" library="downmix" uuid="93f04452-e4fe-41cc-91f9-e475b6d1d69f"/>
|
|
||||||
<effect name="hw_acc" library="offload_bundle" uuid="7d1580bd-297f-4683-9239-e475b6d1d69f"/>
|
|
||||||
<effect name="loudness_enhancer" library="loudness_enhancer" uuid="fa415329-2034-4bea-b5dc-5b381c8d1e2c"/>
|
|
||||||
<effect name="dynamics_processing" library="dynamics_processing" uuid="e0e6539b-1781-7261-676f-6d7573696340"/>
|
|
||||||
<effect name="aec" library="audio_pre_processing" uuid="0f8d0d2a-59e5-45fe-b6e4-248c8a799109"/>
|
|
||||||
<effect name="ns" library="audio_pre_processing" uuid="1d97bb0b-9e2f-4403-9ae3-58c2554306f8"/>
|
|
||||||
<effect name="music_helper" library="volume_listener" uuid="08b8b058-0590-11e5-ac71-0025b32654a0"/>
|
|
||||||
<effect name="ring_helper" library="volume_listener" uuid="0956df94-0590-11e5-bdbe-0025b32654a0"/>
|
|
||||||
<effect name="alarm_helper" library="volume_listener" uuid="09f303e2-0590-11e5-8fdb-0025b32654a0"/>
|
|
||||||
<effect name="voice_helper" library="volume_listener" uuid="0ace5c08-0590-11e5-ae9e-0025b32654a0"/>
|
|
||||||
<effect name="notification_helper" library="volume_listener" uuid="0b776dde-0590-11e5-81ba-0025b32654a0"/>
|
|
||||||
<effect name="audiosphere" library="audiosphere" uuid="184e62ab-2d19-4364-9d1b-c0a40733866c"/>
|
|
||||||
<effect name="quasar" library="quasar" uuid="71d0e2ee-e44d-483d-a809-09e75ee55ecd"/>
|
|
||||||
</effects>
|
|
||||||
<postprocess>
|
|
||||||
<stream type="music">
|
|
||||||
<apply effect="music_helper"/>
|
|
||||||
</stream>
|
|
||||||
<stream type="ring">
|
|
||||||
<apply effect="ring_helper"/>
|
|
||||||
</stream>
|
|
||||||
<stream type="alarm">
|
|
||||||
<apply effect="alarm_helper"/>
|
|
||||||
</stream>
|
|
||||||
<stream type="voice_call">
|
|
||||||
<apply effect="voice_helper"/>
|
|
||||||
</stream>
|
|
||||||
<stream type="notification">
|
|
||||||
<apply effect="notification_helper"/>
|
|
||||||
</stream>
|
|
||||||
</postprocess>
|
|
||||||
<preprocess>
|
|
||||||
<stream type="voice_communication">
|
|
||||||
<apply effect="aec"/>
|
|
||||||
<apply effect="ns"/>
|
|
||||||
</stream>
|
|
||||||
</preprocess>
|
|
||||||
</audio_effects_conf>
|
|
@@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<audio_effects_conf version="2.0" xmlns="http://schemas.android.com/audio/audio_effects_conf/v2_0">
|
|
||||||
|
|
||||||
<libraries>
|
|
||||||
<library name="haptic_generator" path="libhapticgenerator.so"/>
|
|
||||||
</libraries>
|
|
||||||
|
|
||||||
<effects>
|
|
||||||
<effect name="haptic_generator" library="haptic_generator" uuid="97c4acd1-8b82-4f2f-832e-c2fe5d7a9931"/>
|
|
||||||
</effects>
|
|
||||||
|
|
||||||
</audio_effects_conf>
|
|
@@ -1,78 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<audio_effects_conf version="2.0" xmlns="http://schemas.android.com/audio/audio_effects_conf/v2_0">
|
|
||||||
|
|
||||||
<libraries>
|
|
||||||
<!-- This is a proxy library that will be an abstraction for the HW and SW effects-->
|
|
||||||
<library name="proxy" path="libeffectproxy.so"/>
|
|
||||||
<!-- This is the HW implementation library for the effect-->
|
|
||||||
<library name="offload" path="libaudioeffectoffload.so"/>
|
|
||||||
<library name="bundle" path="libbundlewrapper.so"/>
|
|
||||||
<library name="reverb" path="libreverbwrapper.so"/>
|
|
||||||
<library name="visualizer_sw" path="libvisualizer.so"/>
|
|
||||||
<library name="downmix" path="libdownmix.so"/>
|
|
||||||
<library name="mysound" path="libmysound.so"/>
|
|
||||||
<library name="myspace" path="libmyspace.so"/>
|
|
||||||
<library name="soundalive_sec" path="libaudiosaplus_sec.so"/>
|
|
||||||
<library name="loudness_enhancer" path="libldnhncr.so"/>
|
|
||||||
<library name="dynamics_processing" path="libdynproc.so"/>
|
|
||||||
<library name="soundbooster_plus" path="libsamsungSoundbooster_plus.so"/>
|
|
||||||
<library name="pre_processing" path="libqcomvoiceprocessing.so"/>
|
|
||||||
<library name="playbackrecorder" path="libplaybackrecorder.so"/>
|
|
||||||
<library name="dap" path="libswdap.so"/>
|
|
||||||
</libraries>
|
|
||||||
|
|
||||||
<effects>
|
|
||||||
<effect name="soundbooster_plus" library="soundbooster_plus" uuid="50de45f0-5d4c-11e5-a837-0800200c9a66"/>
|
|
||||||
<effectProxy name="soundalive" library="proxy" uuid="05227ea0-50bb-11e3-ac69-0002a5d5c51b">
|
|
||||||
<libsw library="soundalive_sec" uuid="cf65eb39-ce2f-48a8-a903-ceb818c06745"/>
|
|
||||||
<libhw library="offload" uuid="0b2dbc60-50bb-11e3-988b-0002a5d5c51b"/>
|
|
||||||
</effectProxy>
|
|
||||||
<effect name="bassboost" library="bundle" uuid="8631f300-72e2-11df-b57e-0002a5d5c51b"/>
|
|
||||||
<effect name="virtualizer" library="bundle" uuid="1d4033c0-8557-11df-9f2d-0002a5d5c51b"/>
|
|
||||||
<effect name="equalizer" library="bundle" uuid="ce772f20-847d-11df-bb17-0002a5d5c51b"/>
|
|
||||||
<effect name="volume" library="bundle" uuid="119341a0-8469-11df-81f9-0002a5d5c51b"/>
|
|
||||||
<effect name="reverb_env_aux" library="reverb" uuid="4a387fc0-8ab3-11df-8bad-0002a5d5c51b"/>
|
|
||||||
<effect name="reverb_env_ins" library="reverb" uuid="c7a511a0-a3bb-11df-860e-0002a5d5c51b"/>
|
|
||||||
<effect name="reverb_pre_aux" library="reverb" uuid="f29a1400-a3bb-11df-8ddc-0002a5d5c51b"/>
|
|
||||||
<effect name="reverb_pre_ins" library="reverb" uuid="172cdf00-a3bc-11df-a72f-0002a5d5c51b"/>
|
|
||||||
<effect name="visualizer" library="visualizer_sw" uuid="d069d9e0-8329-11df-9168-0002a5d5c51b"/>
|
|
||||||
<effect name="downmix" library="downmix" uuid="93f04452-e4fe-41cc-91f9-e475b6d1d69f"/>
|
|
||||||
<effect name="loudness_enhancer" library="loudness_enhancer" uuid="fa415329-2034-4bea-b5dc-5b381c8d1e2c"/>
|
|
||||||
<effect name="dynamics_processing" library="dynamics_processing" uuid="e0e6539b-1781-7261-676f-6d7573696340"/>
|
|
||||||
<effectProxy name="dha" library="proxy" uuid="37155c20-50bb-11e3-9fac-0002a5d5c51b">
|
|
||||||
<libsw library="mysound" uuid="263a88e0-50b1-11e2-bcfd-0800200c9a66"/>
|
|
||||||
<libhw library="offload" uuid="3ef69260-50bb-11e3-931e-0002a5d5c51b"/>
|
|
||||||
</effectProxy>
|
|
||||||
<effectProxy name="sa3d" library="proxy" uuid="1c91fca0-664a-11e4-b8c2-0002a5d5c51b">
|
|
||||||
<libsw library="myspace" uuid="3462a6e0-655a-11e4-8b67-0002a5d5c51b"/>
|
|
||||||
<libhw library="offload" uuid="c7a84e61-eebe-4fcc-bc53-efcb841b4625"/>
|
|
||||||
</effectProxy>
|
|
||||||
<effect name="aec" library="pre_processing" uuid="0f8d0d2a-59e5-45fe-b6e4-248c8a799109"/>
|
|
||||||
<effect name="ns" library="pre_processing" uuid="1d97bb0b-9e2f-4403-9ae3-58c2554306f8"/>
|
|
||||||
<effect name="playbackrecorder" library="playbackrecorder" uuid="517a26c0-fd7c-11e5-a837-0800200c9a66"/>
|
|
||||||
<!-- Supporting Dolby offload effect -->
|
|
||||||
<effectProxy name="dap_proxy" library="proxy" uuid="9d4921da-8225-4f29-aefa-39537a04bcaa">
|
|
||||||
<libsw library="dap" uuid="6ab06da4-c516-4611-8166-452799218539"/>
|
|
||||||
<libhw library="offload" uuid="a0c30891-8246-4aef-b8ad-d53e26da0253"/>
|
|
||||||
</effectProxy>
|
|
||||||
<effect name="volumemonitor_hw" library="offload" uuid="052a63b0-f95a-11e9-8f0b-362b9e155667"/>
|
|
||||||
</effects>
|
|
||||||
|
|
||||||
<preprocess>
|
|
||||||
<stream type="voice_communication">
|
|
||||||
<apply effect="aec"/>
|
|
||||||
</stream>
|
|
||||||
</preprocess>
|
|
||||||
|
|
||||||
<postprocess>
|
|
||||||
<stream type="music">
|
|
||||||
<apply effect="sa3d"/>
|
|
||||||
</stream>
|
|
||||||
<stream type="ring">
|
|
||||||
<apply effect="sa3d"/>
|
|
||||||
</stream>
|
|
||||||
<stream type="alarm">
|
|
||||||
<apply effect="sa3d"/>
|
|
||||||
</stream>
|
|
||||||
</postprocess>
|
|
||||||
</audio_effects_conf>
|
|
@@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<audio_effects_conf version="2.0" xmlns="http://schemas.android.com/audio/audio_effects_conf/v2_0">
|
|
||||||
|
|
||||||
<libraries>
|
|
||||||
<library name="spatializer" path="libswspatializer.so"/>
|
|
||||||
</libraries>
|
|
||||||
|
|
||||||
<effects>
|
|
||||||
<effect name="spatializer" library="spatializer" uuid="ccd4cf09-a79d-46c2-9aae-06a1698d6c8f"/>
|
|
||||||
</effects>
|
|
||||||
|
|
||||||
</audio_effects_conf>
|
|
516
configs/audio/audio_policy_configuration.xml
Normal file
516
configs/audio/audio_policy_configuration.xml
Normal file
@@ -0,0 +1,516 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<!-- Copyright (c) 2016-2020, The Linux Foundation. All rights reserved
|
||||||
|
Not a Contribution.
|
||||||
|
-->
|
||||||
|
<!-- Copyright (C) 2015 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.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Changes from Qualcomm Innovation Center are provided under the following license:
|
||||||
|
|
||||||
|
Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
|
SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
|
-->
|
||||||
|
|
||||||
|
<audioPolicyConfiguration version="7.0" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||||
|
<!-- version section contains a “version” tag in the form “major.minor” e.g version=”1.0” -->
|
||||||
|
|
||||||
|
<!-- Global configuration Decalaration -->
|
||||||
|
<globalConfiguration speaker_drc_enabled="true" call_screen_mode_supported="true"/>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Modules section:
|
||||||
|
There is one section per audio HW module present on the platform.
|
||||||
|
Each module section will contains two mandatory tags for audio HAL “halVersion” and “name”.
|
||||||
|
The module names are the same as in current .conf file:
|
||||||
|
“primary”, “A2DP”, “remote_submix”, “USB”
|
||||||
|
Each module will contain the following sections:
|
||||||
|
“devicePorts”: a list of device descriptors for all input and output devices accessible via this
|
||||||
|
module.
|
||||||
|
This contains both permanently attached devices and removable devices.
|
||||||
|
“mixPorts”: listing all output and input streams exposed by the audio HAL
|
||||||
|
“routes”: list of possible connections between input and output devices or between stream and
|
||||||
|
devices.
|
||||||
|
"route": is defined by an attribute:
|
||||||
|
-"type": <mux|mix> means all sources are mutual exclusive (mux) or can be mixed (mix)
|
||||||
|
-"sink": the sink involved in this route
|
||||||
|
-"sources": all the sources than can be connected to the sink via vis route
|
||||||
|
“attachedDevices”: permanently attached devices.
|
||||||
|
The attachedDevices section is a list of devices names. The names correspond to device names
|
||||||
|
defined in <devicePorts> section.
|
||||||
|
“defaultOutputDevice”: device to be used by default when no policy rule applies
|
||||||
|
-->
|
||||||
|
<modules>
|
||||||
|
<!-- Primary Audio HAL -->
|
||||||
|
<module name="primary" halVersion="2.0">
|
||||||
|
<attachedDevices>
|
||||||
|
<item>Earpiece</item>
|
||||||
|
<item>Speaker</item>
|
||||||
|
<item>Telephony Tx</item>
|
||||||
|
<item>Built-In Mic</item>
|
||||||
|
<item>Built-In Back Mic</item>
|
||||||
|
<item>FM Tuner</item>
|
||||||
|
<item>Telephony Rx</item>
|
||||||
|
<item>Echo Reference</item>
|
||||||
|
</attachedDevices>
|
||||||
|
<defaultOutputDevice>Speaker</defaultOutputDevice>
|
||||||
|
<mixPorts>
|
||||||
|
<mixPort name="primary output" role="source" flags="AUDIO_OUTPUT_FLAG_FAST AUDIO_OUTPUT_FLAG_PRIMARY">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="raw" role="source"
|
||||||
|
flags="AUDIO_OUTPUT_FLAG_FAST AUDIO_OUTPUT_FLAG_RAW">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="haptics output" role="source">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="deep_buffer" role="source"
|
||||||
|
flags="AUDIO_OUTPUT_FLAG_DEEP_BUFFER">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_8_24_BIT"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_24_BIT_PACKED"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="mmap_no_irq_out" role="source" flags="AUDIO_OUTPUT_FLAG_DIRECT AUDIO_OUTPUT_FLAG_MMAP_NOIRQ">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_8_24_BIT"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_24_BIT_PACKED"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="hifi_playback" role="source" />
|
||||||
|
<mixPort name="spatial output" role="source" flags="AUDIO_OUTPUT_FLAG_SPATIALIZER">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="direct_pcm" role="source" recommendedMuteDurationMs="160"
|
||||||
|
flags="AUDIO_OUTPUT_FLAG_DIRECT">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_8_24_BIT"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000 352800 384000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_24_BIT_PACKED"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000 352800 384000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000 352800 384000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="compressed_offload" role="source"
|
||||||
|
flags="AUDIO_OUTPUT_FLAG_DIRECT AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD AUDIO_OUTPUT_FLAG_NON_BLOCKING AUDIO_OUTPUT_FLAG_GAPLESS_OFFLOAD">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_MP3"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_FLAC"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_ALAC"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_APE"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_AAC_LC"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_AAC_HE_V1"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_AAC_HE_V2"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_DTS"
|
||||||
|
samplingRates="32000 44100 48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_DTS_HD"
|
||||||
|
samplingRates="32000 44100 48000 64000 88200 96000 128000 176400 192000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_WMA"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_WMA_PRO"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_2POINT1 AUDIO_CHANNEL_OUT_QUAD AUDIO_CHANNEL_OUT_PENTA AUDIO_CHANNEL_OUT_5POINT1 AUDIO_CHANNEL_OUT_6POINT1 AUDIO_CHANNEL_OUT_7POINT1"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_VORBIS"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_AAC_ADTS_LC"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_AAC_ADTS_HE_V1"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_AAC_ADTS_HE_V2"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_OPUS"
|
||||||
|
samplingRates="8000 12000 16000 24000 48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="voice_tx" role="source">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000 16000 48000" channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="voip_rx" role="source"
|
||||||
|
flags="AUDIO_OUTPUT_FLAG_VOIP_RX">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000 16000 32000 48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="incall_music_uplink" role="source"
|
||||||
|
flags="AUDIO_OUTPUT_FLAG_INCALL_MUSIC">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000 16000 48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</mixPort>
|
||||||
|
|
||||||
|
<mixPort name="primary input" role="sink" maxOpenCount="2" maxActiveCount="2">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="compress-input" role="sink"
|
||||||
|
flags="AUDIO_INPUT_FLAG_DIRECT" >
|
||||||
|
<profile name="compress-capture-AAC-LC" format="AUDIO_FORMAT_AAC_LC"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK"/>
|
||||||
|
<profile name="compress-capture-AAC-HE-V1" format="AUDIO_FORMAT_AAC_ADTS_HE_V1"
|
||||||
|
samplingRates="24000 32000 44100 48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK"/>
|
||||||
|
<profile name="compress-capture-AAC-HE-V2" format="AUDIO_FORMAT_AAC_ADTS_HE_V2"
|
||||||
|
samplingRates="24000 32000 44100 48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_STEREO"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="fast input" role="sink"
|
||||||
|
flags="AUDIO_INPUT_FLAG_FAST">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="quad mic" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_INDEX_MASK_4"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="voip_tx" role="sink"
|
||||||
|
flags="AUDIO_INPUT_FLAG_VOIP_TX">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000 16000 32000 48000" channelMasks="AUDIO_CHANNEL_IN_MONO"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="usb_surround_sound" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 88200 96000 176400 192000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK AUDIO_CHANNEL_INDEX_MASK_3 AUDIO_CHANNEL_INDEX_MASK_4 AUDIO_CHANNEL_IN_5POINT1 AUDIO_CHANNEL_INDEX_MASK_6 AUDIO_CHANNEL_INDEX_MASK_8"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 88200 96000 176400 192000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_5POINT1 AUDIO_CHANNEL_INDEX_MASK_6 AUDIO_CHANNEL_INDEX_MASK_8"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 88200 96000 176400 192000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_5POINT1 AUDIO_CHANNEL_INDEX_MASK_6 AUDIO_CHANNEL_INDEX_MASK_8"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="record_24" role="sink" maxOpenCount="2" maxActiveCount="2">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_24_BIT_PACKED"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 96000 192000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK AUDIO_CHANNEL_INDEX_MASK_3 AUDIO_CHANNEL_INDEX_MASK_4"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_8_24_BIT"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 96000 192000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK AUDIO_CHANNEL_INDEX_MASK_3 AUDIO_CHANNEL_INDEX_MASK_4"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 96000 192000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK AUDIO_CHANNEL_INDEX_MASK_3 AUDIO_CHANNEL_INDEX_MASK_4"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="voice_rx" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000 16000 48000" channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="mmap_no_irq_in" role="sink" flags="AUDIO_INPUT_FLAG_MMAP_NOIRQ">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK AUDIO_CHANNEL_INDEX_MASK_3"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_24_BIT_PACKED"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK AUDIO_CHANNEL_INDEX_MASK_3"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_8_24_BIT"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK AUDIO_CHANNEL_INDEX_MASK_3"/>
|
||||||
|
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="hifi_input" role="sink" />
|
||||||
|
</mixPorts>
|
||||||
|
|
||||||
|
<devicePorts>
|
||||||
|
<!-- Output devices declaration, i.e. Sink DEVICE PORT -->
|
||||||
|
<devicePort tagName="Earpiece" type="AUDIO_DEVICE_OUT_EARPIECE" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="Speaker" role="sink" type="AUDIO_DEVICE_OUT_SPEAKER" address="">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="Wired Headset" type="AUDIO_DEVICE_OUT_WIRED_HEADSET" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="Wired Headphones" type="AUDIO_DEVICE_OUT_WIRED_HEADPHONE" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="Line" type="AUDIO_DEVICE_OUT_LINE" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="BT SCO" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000 16000" channelMasks="AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="BT SCO Headset" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000 16000" channelMasks="AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="BT SCO Car Kit" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000 16000" channelMasks="AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="Telephony Tx" type="AUDIO_DEVICE_OUT_TELEPHONY_TX" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000 16000" channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="HDMI" type="AUDIO_DEVICE_OUT_AUX_DIGITAL" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000 11025 16000 22050 32000 44100 48000 64000 88200 96000 128000 176400 192000"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="Proxy" type="AUDIO_DEVICE_OUT_PROXY" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000 11025 16000 22050 32000 44100 48000 64000 88200 96000 128000 176400 192000"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="FM" type="AUDIO_DEVICE_OUT_FM" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="BT BLE Out" type="AUDIO_DEVICE_OUT_BLE_HEADSET" role="sink"
|
||||||
|
encodedFormats="AUDIO_FORMAT_LC3 VX_AUDIO_FORMAT_APTX_ADAPTIVE_QLEA">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000 16000 32000 48000" channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="BT BLE Speaker" type="AUDIO_DEVICE_OUT_BLE_SPEAKER" role="sink"
|
||||||
|
encodedFormats="AUDIO_FORMAT_LC3 VX_AUDIO_FORMAT_APTX_ADAPTIVE_QLEA">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000 16000 32000 48000" channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="BT BLE Broadcast" type="AUDIO_DEVICE_OUT_BLE_BROADCAST" role="sink"
|
||||||
|
encodedFormats="AUDIO_FORMAT_LC3">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000 16000 32000 48000" channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="USB Device Out" type="AUDIO_DEVICE_OUT_USB_DEVICE" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="44100 48000 64000 88200 96000 128000 176400 192000"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="USB Headset Out" type="AUDIO_DEVICE_OUT_USB_HEADSET" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="44100 48000 64000 88200 96000 128000 176400 192000"/>
|
||||||
|
</devicePort>
|
||||||
|
|
||||||
|
<!-- Input devices declaration, i.e. Source DEVICE PORT -->
|
||||||
|
<devicePort tagName="Built-In Mic" type="AUDIO_DEVICE_IN_BUILTIN_MIC" role="source">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK"/>
|
||||||
|
<!-- To support compress offload capture such that client can query -->
|
||||||
|
<profile name="compress-capture-AAC-LC" format="AUDIO_FORMAT_AAC_LC"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK"/>
|
||||||
|
<profile name="compress-capture-AAC-HE-V1" format="AUDIO_FORMAT_AAC_ADTS_HE_V1"
|
||||||
|
samplingRates="24000 32000 44100 48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK"/>
|
||||||
|
<profile name="compress-capture-AAC-HE-V2" format="AUDIO_FORMAT_AAC_ADTS_HE_V2"
|
||||||
|
samplingRates="24000 32000 44100 48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_STEREO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="Built-In Back Mic" type="AUDIO_DEVICE_IN_BACK_MIC" role="source">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="FM Tuner" type="AUDIO_DEVICE_IN_FM_TUNER" role="source">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="Wired Headset Mic" type="AUDIO_DEVICE_IN_WIRED_HEADSET" role="source">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="BT SCO Headset Mic" type="AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET" role="source">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000 16000" channelMasks="AUDIO_CHANNEL_IN_MONO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="Telephony Rx" type="AUDIO_DEVICE_IN_TELEPHONY_RX" role="source">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000 16000 48000" channelMasks="AUDIO_CHANNEL_IN_MONO"/>
|
||||||
|
<gains>
|
||||||
|
<gain name="gain_1" mode="AUDIO_GAIN_MODE_JOINT"
|
||||||
|
minValueMB="-8400"
|
||||||
|
maxValueMB="4000"
|
||||||
|
defaultValueMB="0"
|
||||||
|
stepValueMB="100"/>
|
||||||
|
</gains>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="USB Device In" type="AUDIO_DEVICE_IN_USB_DEVICE" role="source">
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="USB Headset In" type="AUDIO_DEVICE_IN_USB_HEADSET" role="source">
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="Echo Reference" type="AUDIO_DEVICE_IN_ECHO_REFERENCE" role="source">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_IN_MONO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="BLE In" type="AUDIO_DEVICE_IN_BLE_HEADSET" role="source"
|
||||||
|
encodedFormats="AUDIO_FORMAT_LC3">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000 16000 24000 44100 48000" channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO"/>
|
||||||
|
</devicePort>
|
||||||
|
</devicePorts>
|
||||||
|
<!-- route declaration, i.e. list all available sources for a given sink -->
|
||||||
|
<routes>
|
||||||
|
<route type="mix" sink="Earpiece"
|
||||||
|
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,haptics output,Telephony Rx"/>
|
||||||
|
<route type="mix" sink="Speaker"
|
||||||
|
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,haptics output,Telephony Rx"/>
|
||||||
|
<route type="mix" sink="Wired Headset"
|
||||||
|
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,haptics output,Telephony Rx"/>
|
||||||
|
<route type="mix" sink="Wired Headphones"
|
||||||
|
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,haptics output,Telephony Rx"/>
|
||||||
|
<route type="mix" sink="Line"
|
||||||
|
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,haptics output,Telephony Rx"/>
|
||||||
|
<route type="mix" sink="HDMI"
|
||||||
|
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,haptics output,Telephony Rx"/>
|
||||||
|
<route type="mix" sink="Proxy"
|
||||||
|
sources="primary output,deep_buffer,direct_pcm,compressed_offload,haptics output"/>
|
||||||
|
<route type="mix" sink="FM"
|
||||||
|
sources="primary output"/>
|
||||||
|
<route type="mix" sink="BT SCO"
|
||||||
|
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,haptics output,spatial output,Telephony Rx"/>
|
||||||
|
<route type="mix" sink="BT SCO Headset"
|
||||||
|
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,haptics output,spatial output,Telephony Rx"/>
|
||||||
|
<route type="mix" sink="BT BLE Out"
|
||||||
|
sources="primary output,raw,mmap_no_irq_out,deep_buffer,direct_pcm,compressed_offload,voip_rx,haptics output,spatial output,Telephony Rx"/>
|
||||||
|
<route type="mix" sink="BT SCO Car Kit"
|
||||||
|
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,haptics output,spatial output,Telephony Rx"/>
|
||||||
|
<route type="mix" sink="USB Device Out"
|
||||||
|
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,hifi_playback,haptics output,Telephony Rx"/>
|
||||||
|
<route type="mix" sink="USB Headset Out"
|
||||||
|
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,hifi_playback,haptics output,Telephony Rx"/>
|
||||||
|
<route type="mix" sink="Telephony Tx"
|
||||||
|
sources="voice_tx,incall_music_uplink"/>
|
||||||
|
<route type="mix" sink="voice_rx"
|
||||||
|
sources="Telephony Rx"/>
|
||||||
|
<route type="mix" sink="primary input"
|
||||||
|
sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic,BT SCO Headset Mic,FM Tuner,Telephony Rx,Echo Reference,BLE In"/>
|
||||||
|
<route type="mix" sink="compress-input"
|
||||||
|
sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,Wired Headset Mic,USB Device In,USB Headset In,BLE In"/>
|
||||||
|
<route type="mix" sink="usb_surround_sound"
|
||||||
|
sources="USB Device In,USB Headset In"/>
|
||||||
|
<route type="mix" sink="fast input"
|
||||||
|
sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In,Wired Headset Mic"/>
|
||||||
|
<route type="mix" sink="quad mic"
|
||||||
|
sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In,Wired Headset Mic"/>
|
||||||
|
<route type="mix" sink="voip_tx"
|
||||||
|
sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In,Wired Headset Mic,BLE In"/>
|
||||||
|
<route type="mix" sink="record_24"
|
||||||
|
sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic,BLE In"/>
|
||||||
|
<route type="mix" sink="mmap_no_irq_in"
|
||||||
|
sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In,Wired Headset Mic"/>
|
||||||
|
<route type="mix" sink="BT BLE Speaker"
|
||||||
|
sources="primary output,raw,mmap_no_irq_out,deep_buffer,direct_pcm,compressed_offload,voip_rx,haptics output"/>
|
||||||
|
<route type="mix" sink="BT BLE Broadcast"
|
||||||
|
sources="primary output,deep_buffer,direct_pcm,compressed_offload"/>
|
||||||
|
<route type="mix" sink="hifi_input" sources="USB Device In,USB Headset In" />
|
||||||
|
</routes>
|
||||||
|
|
||||||
|
</module>
|
||||||
|
|
||||||
|
<!-- A2DP Audio HAL -->
|
||||||
|
<!-- <module name="a2dp" halVersion="2.0">
|
||||||
|
<mixPorts>
|
||||||
|
<mixPort name="a2dp input" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="44100 48000" channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO"/>
|
||||||
|
</mixPort>
|
||||||
|
</mixPorts>
|
||||||
|
|
||||||
|
<devicePorts>
|
||||||
|
<devicePort tagName="BT A2DP In" type="AUDIO_DEVICE_IN_BLUETOOTH_A2DP" role="source">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="44100 48000" channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO"/>
|
||||||
|
</devicePort>
|
||||||
|
</devicePorts>
|
||||||
|
|
||||||
|
<routes>
|
||||||
|
<route type="mix" sink="a2dp input"
|
||||||
|
sources="BT A2DP In"/>
|
||||||
|
</routes>
|
||||||
|
</module> -->
|
||||||
|
|
||||||
|
<!-- Usb Audio HAL -->
|
||||||
|
<module name="usb" halVersion="2.0">
|
||||||
|
<mixPorts>
|
||||||
|
<mixPort name="usb_accessory output" role="source">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="44100" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</mixPort>
|
||||||
|
</mixPorts>
|
||||||
|
<devicePorts>
|
||||||
|
<devicePort tagName="USB Host Out" type="AUDIO_DEVICE_OUT_USB_ACCESSORY" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="44100" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</devicePort>
|
||||||
|
</devicePorts>
|
||||||
|
<routes>
|
||||||
|
<route type="mix" sink="USB Host Out"
|
||||||
|
sources="usb_accessory output"/>
|
||||||
|
</routes>
|
||||||
|
</module>
|
||||||
|
|
||||||
|
<!-- Bluetooth Audio HAL -->
|
||||||
|
<xi:include href="/vendor/etc/bluetooth_audio_policy_configuration.xml"/>
|
||||||
|
|
||||||
|
<!-- Remote Submix Audio HAL -->
|
||||||
|
<xi:include href="/vendor/etc/r_submix_audio_policy_configuration.xml"/>
|
||||||
|
|
||||||
|
</modules>
|
||||||
|
<!-- End of Modules section -->
|
||||||
|
|
||||||
|
<!-- Volume section -->
|
||||||
|
|
||||||
|
<xi:include href="/vendor/etc/audio_policy_volumes.xml"/>
|
||||||
|
<xi:include href="/vendor/etc/default_volume_tables.xml"/>
|
||||||
|
|
||||||
|
<!-- End of Volume section -->
|
||||||
|
|
||||||
|
</audioPolicyConfiguration>
|
382
configs/audio/audio_policy_configuration_base.xml
Normal file
382
configs/audio/audio_policy_configuration_base.xml
Normal file
@@ -0,0 +1,382 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<!-- Copyright (c) 2016-2021, The Linux Foundation. All rights reserved
|
||||||
|
Not a Contribution.
|
||||||
|
-->
|
||||||
|
<!-- Copyright (C) 2015 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.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<audioPolicyConfiguration version="1.0" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||||
|
<!-- version section contains a “version” tag in the form “major.minor” e.g version=”1.0” -->
|
||||||
|
|
||||||
|
<!-- Global configuration Decalaration -->
|
||||||
|
<globalConfiguration speaker_drc_enabled="true"/>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Modules section:
|
||||||
|
There is one section per audio HW module present on the platform.
|
||||||
|
Each module section will contains two mandatory tags for audio HAL “halVersion” and “name”.
|
||||||
|
The module names are the same as in current .conf file:
|
||||||
|
“primary”, “A2DP”, “remote_submix”, “USB”
|
||||||
|
Each module will contain the following sections:
|
||||||
|
“devicePorts”: a list of device descriptors for all input and output devices accessible via this
|
||||||
|
module.
|
||||||
|
This contains both permanently attached devices and removable devices.
|
||||||
|
“mixPorts”: listing all output and input streams exposed by the audio HAL
|
||||||
|
“routes”: list of possible connections between input and output devices or between stream and
|
||||||
|
devices.
|
||||||
|
"route": is defined by an attribute:
|
||||||
|
-"type": <mux|mix> means all sources are mutual exclusive (mux) or can be mixed (mix)
|
||||||
|
-"sink": the sink involved in this route
|
||||||
|
-"sources": all the sources than can be connected to the sink via vis route
|
||||||
|
“attachedDevices”: permanently attached devices.
|
||||||
|
The attachedDevices section is a list of devices names. The names correspond to device names
|
||||||
|
defined in <devicePorts> section.
|
||||||
|
“defaultOutputDevice”: device to be used by default when no policy rule applies
|
||||||
|
-->
|
||||||
|
<modules>
|
||||||
|
<!-- Primary Audio HAL -->
|
||||||
|
<module name="primary" halVersion="2.0">
|
||||||
|
<attachedDevices>
|
||||||
|
<item>Speaker</item>
|
||||||
|
<item>Telephony Tx</item>
|
||||||
|
<item>Built-In Mic</item>
|
||||||
|
<item>Built-In Back Mic</item>
|
||||||
|
<item>FM Tuner</item>
|
||||||
|
<item>Telephony Rx</item>
|
||||||
|
</attachedDevices>
|
||||||
|
<defaultOutputDevice>Speaker</defaultOutputDevice>
|
||||||
|
<mixPorts>
|
||||||
|
<mixPort name="primary output" role="source" flags="AUDIO_OUTPUT_FLAG_FAST|AUDIO_OUTPUT_FLAG_PRIMARY">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="deep_buffer" role="source"
|
||||||
|
flags="AUDIO_OUTPUT_FLAG_DEEP_BUFFER">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="mmap_no_irq_out" role="source" flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_MMAP_NOIRQ">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="hifi_playback" role="source" />
|
||||||
|
<mixPort name="compress_passthrough" role="source"
|
||||||
|
flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING"/>
|
||||||
|
<mixPort name="direct_pcm" role="source"
|
||||||
|
flags="AUDIO_OUTPUT_FLAG_DIRECT">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000,128000,176400,192000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_8_24_BIT"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000,128000,176400,192000,352800,384000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_24_BIT_PACKED"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000,128000,176400,192000,352800,384000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000,128000,176400,192000,352800,384000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="compressed_offload" role="source"
|
||||||
|
flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_MP3"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_FLAC"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000,128000,176400,192000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_ALAC"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000,128000,176400,192000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_APE"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000,128000,176400,192000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_AAC_LC"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_AAC_HE_V1"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_AAC_HE_V2"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_DTS"
|
||||||
|
samplingRates="32000,44100,48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_DTS_HD"
|
||||||
|
samplingRates="32000,44100,48000,64000,88200,96000,128000,176400,192000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_WMA"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_WMA_PRO"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_AAC_ADTS_LC"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_AAC_ADTS_HE_V1"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_AAC_ADTS_HE_V2"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="dsd_compress_passthrough" role="source"
|
||||||
|
flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_DSD"
|
||||||
|
samplingRates="2822400,5644800"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="voice_tx" role="source">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000,16000,48000" channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="voip_rx" role="source"
|
||||||
|
flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_VOIP_RX">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000,16000,32000,48000" channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="incall_music_uplink" role="source"
|
||||||
|
flags="AUDIO_OUTPUT_FLAG_INCALL_MUSIC">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000,16000,48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="primary input" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="usb_surround_sound" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,88200,96000,176400,192000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_INDEX_MASK_3,AUDIO_CHANNEL_INDEX_MASK_4,AUDIO_CHANNEL_IN_5POINT1,AUDIO_CHANNEL_INDEX_MASK_6,AUDIO_CHANNEL_IN_7POINT1,AUDIO_CHANNEL_INDEX_MASK_8"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,88200,96000,176400,192000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_5POINT1,AUDIO_CHANNEL_INDEX_MASK_6,AUDIO_CHANNEL_IN_7POINT1,AUDIO_CHANNEL_INDEX_MASK_8"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,88200,96000,176400,192000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_5POINT1,AUDIO_CHANNEL_INDEX_MASK_6,AUDIO_CHANNEL_IN_7POINT1,AUDIO_CHANNEL_INDEX_MASK_8"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="voip_tx" role="sink"
|
||||||
|
flags="AUDIO_INPUT_FLAG_VOIP_TX">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000,16000,32000,48000" channelMasks="AUDIO_CHANNEL_IN_MONO"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="surround_sound" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_INDEX_MASK_3,AUDIO_CHANNEL_INDEX_MASK_4,AUDIO_CHANNEL_IN_5POINT1,AUDIO_CHANNEL_INDEX_MASK_6"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="record_24" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_24_BIT_PACKED"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,96000,192000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_INDEX_MASK_3,AUDIO_CHANNEL_INDEX_MASK_4"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_8_24_BIT"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,96000,192000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_INDEX_MASK_3,AUDIO_CHANNEL_INDEX_MASK_4"/>
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,96000,192000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_INDEX_MASK_3,AUDIO_CHANNEL_INDEX_MASK_4"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="voice_rx" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000,16000,48000" channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="mmap_no_irq_in" role="sink" flags="AUDIO_INPUT_FLAG_MMAP_NOIRQ">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_INDEX_MASK_3"/>
|
||||||
|
</mixPort>
|
||||||
|
<mixPort name="hifi_input" role="sink" />
|
||||||
|
</mixPorts>
|
||||||
|
|
||||||
|
<devicePorts>
|
||||||
|
<!-- Output devices declaration, i.e. Sink DEVICE PORT -->
|
||||||
|
<devicePort tagName="Speaker" role="sink" type="AUDIO_DEVICE_OUT_SPEAKER" address="">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="Wired Headset" type="AUDIO_DEVICE_OUT_WIRED_HEADSET" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="Wired Headphones" type="AUDIO_DEVICE_OUT_WIRED_HEADPHONE" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="Line" type="AUDIO_DEVICE_OUT_LINE" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="BT SCO" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000,16000" channelMasks="AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="BT SCO Headset" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000,16000" channelMasks="AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="BT SCO Car Kit" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000,16000" channelMasks="AUDIO_CHANNEL_OUT_MONO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="Telephony Tx" type="AUDIO_DEVICE_OUT_TELEPHONY_TX" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000,16000" channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="HDMI" type="AUDIO_DEVICE_OUT_AUX_DIGITAL" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000,11025,16000,22050,32000,44100,48000,64000,88200,96000,128000,176400,192000"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="Proxy" type="AUDIO_DEVICE_OUT_PROXY" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000,11025,16000,22050,32000,44100,48000,64000,88200,96000,128000,176400,192000"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="FM" type="AUDIO_DEVICE_OUT_FM" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="USB Device Out" type="AUDIO_DEVICE_OUT_USB_DEVICE" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="44100,48000,64000,88200,96000,128000,176400,192000"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="USB Headset Out" type="AUDIO_DEVICE_OUT_USB_HEADSET" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="44100,48000,64000,88200,96000,128000,176400,192000"/>
|
||||||
|
</devicePort>
|
||||||
|
|
||||||
|
<!-- Input devices declaration, i.e. Source DEVICE PORT -->
|
||||||
|
<devicePort tagName="Built-In Mic" type="AUDIO_DEVICE_IN_BUILTIN_MIC" role="source">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="Built-In Back Mic" type="AUDIO_DEVICE_IN_BACK_MIC" role="source">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="FM Tuner" type="AUDIO_DEVICE_IN_FM_TUNER" role="source">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="Wired Headset Mic" type="AUDIO_DEVICE_IN_WIRED_HEADSET" role="source">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
|
||||||
|
channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="BT SCO Headset Mic" type="AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET" role="source">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000,16000" channelMasks="AUDIO_CHANNEL_IN_MONO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="Telephony Rx" type="AUDIO_DEVICE_IN_TELEPHONY_RX" role="source">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="8000,16000,48000" channelMasks="AUDIO_CHANNEL_IN_MONO"/>
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="USB Device In" type="AUDIO_DEVICE_IN_USB_DEVICE" role="source">
|
||||||
|
</devicePort>
|
||||||
|
<devicePort tagName="USB Headset In" type="AUDIO_DEVICE_IN_USB_HEADSET" role="source">
|
||||||
|
</devicePort>
|
||||||
|
|
||||||
|
</devicePorts>
|
||||||
|
<!-- route declaration, i.e. list all available sources for a given sink -->
|
||||||
|
<routes>
|
||||||
|
<route type="mix" sink="Speaker"
|
||||||
|
sources="primary output,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out"/>
|
||||||
|
<route type="mix" sink="Wired Headset"
|
||||||
|
sources="primary output,deep_buffer,direct_pcm,compressed_offload,dsd_compress_passthrough,voip_rx,mmap_no_irq_out"/>
|
||||||
|
<route type="mix" sink="Wired Headphones"
|
||||||
|
sources="primary output,deep_buffer,direct_pcm,compressed_offload,dsd_compress_passthrough,voip_rx,mmap_no_irq_out"/>
|
||||||
|
<route type="mix" sink="Line"
|
||||||
|
sources="primary output,deep_buffer,direct_pcm,compressed_offload,dsd_compress_passthrough,voip_rx,mmap_no_irq_out"/>
|
||||||
|
<route type="mix" sink="HDMI"
|
||||||
|
sources="primary output,deep_buffer,direct_pcm,compressed_offload,compress_passthrough"/>
|
||||||
|
<route type="mix" sink="Proxy"
|
||||||
|
sources="primary output,deep_buffer,direct_pcm,compressed_offload"/>
|
||||||
|
<route type="mix" sink="Telephony Tx"
|
||||||
|
sources="voice_tx,incall_music_uplink"/>
|
||||||
|
<route type="mix" sink="FM"
|
||||||
|
sources="primary output"/>
|
||||||
|
<route type="mix" sink="BT SCO"
|
||||||
|
sources="primary output,deep_buffer,direct_pcm,compressed_offload,voip_rx"/>
|
||||||
|
<route type="mix" sink="BT SCO Headset"
|
||||||
|
sources="primary output,deep_buffer,direct_pcm,compressed_offload,voip_rx"/>
|
||||||
|
<route type="mix" sink="BT SCO Car Kit"
|
||||||
|
sources="primary output,deep_buffer,direct_pcm,compressed_offload,voip_rx"/>
|
||||||
|
<route type="mix" sink="USB Device Out"
|
||||||
|
sources="primary output,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,hifi_playback"/>
|
||||||
|
<route type="mix" sink="USB Headset Out"
|
||||||
|
sources="primary output,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,hifi_playback"/>
|
||||||
|
<route type="mix" sink="Telephony Tx"
|
||||||
|
sources="voice_tx"/>
|
||||||
|
<route type="mix" sink="voice_rx"
|
||||||
|
sources="Telephony Rx"/>
|
||||||
|
<route type="mix" sink="primary input"
|
||||||
|
sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic,BT SCO Headset Mic,FM Tuner"/>
|
||||||
|
<route type="mix" sink="usb_surround_sound"
|
||||||
|
sources="USB Device In,USB Headset In"/>
|
||||||
|
<route type="mix" sink="voip_tx"
|
||||||
|
sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In,Wired Headset Mic"/>
|
||||||
|
<route type="mix" sink="surround_sound"
|
||||||
|
sources="Built-In Mic,Built-In Back Mic"/>
|
||||||
|
<route type="mix" sink="record_24"
|
||||||
|
sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic"/>
|
||||||
|
<route type="mix" sink="mmap_no_irq_in"
|
||||||
|
sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic,USB Device In,USB Headset In"/>
|
||||||
|
<route type="mix" sink="hifi_input" sources="USB Device In,USB Headset In" />
|
||||||
|
</routes>
|
||||||
|
|
||||||
|
</module>
|
||||||
|
|
||||||
|
<!-- Usb Audio HAL -->
|
||||||
|
<module name="usb" halVersion="2.0">
|
||||||
|
<mixPorts>
|
||||||
|
<mixPort name="usb_accessory output" role="source">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="44100" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</mixPort>
|
||||||
|
</mixPorts>
|
||||||
|
<devicePorts>
|
||||||
|
<devicePort tagName="USB Host Out" type="AUDIO_DEVICE_OUT_USB_ACCESSORY" role="sink">
|
||||||
|
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||||
|
samplingRates="44100" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||||
|
</devicePort>
|
||||||
|
</devicePorts>
|
||||||
|
<routes>
|
||||||
|
<route type="mix" sink="USB Host Out"
|
||||||
|
sources="usb_accessory output"/>
|
||||||
|
</routes>
|
||||||
|
</module>
|
||||||
|
|
||||||
|
<!-- Remote Submix Audio HAL -->
|
||||||
|
<xi:include href="/vendor/etc/r_submix_audio_policy_configuration.xml"/>
|
||||||
|
|
||||||
|
<!-- Bluetooth Audio HAL -->
|
||||||
|
<xi:include href="/vendor/etc/bluetooth_audio_policy_configuration.xml"/>
|
||||||
|
|
||||||
|
</modules>
|
||||||
|
<!-- End of Modules section -->
|
||||||
|
|
||||||
|
<!-- Volume section -->
|
||||||
|
|
||||||
|
<xi:include href="/vendor/etc/audio_policy_volumes.xml"/>
|
||||||
|
<xi:include href="/vendor/etc/default_volume_tables.xml"/>
|
||||||
|
|
||||||
|
<!-- End of Volume section -->
|
||||||
|
|
||||||
|
</audioPolicyConfiguration>
|
@@ -1,70 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<!-- Copyright 2016 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.
|
|
||||||
|
|
||||||
This file was modified by Dolby Laboratories. The portions of the
|
|
||||||
code that are surrounded by "DOLBY..." are copyrighted and
|
|
||||||
licensed separately, as follows:
|
|
||||||
|
|
||||||
Copyright (C) 2018-2022 Dolby Laboratories
|
|
||||||
|
|
||||||
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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<Included>
|
|
||||||
<Decoders>
|
|
||||||
<!-- DOLBY_UDC -->
|
|
||||||
<MediaCodec name="c2.dolby.eac3.decoder" >
|
|
||||||
<Type name="audio/ac3">
|
|
||||||
<Alias name="OMX.dolby.ac3.decoder" />
|
|
||||||
<Limit name="channel-count" max="6" />
|
|
||||||
<Limit name="sample-rate" ranges="32000,44100,48000" />
|
|
||||||
<Limit name="bitrate" range="32000-640000" />
|
|
||||||
</Type>
|
|
||||||
<Type name="audio/eac3">
|
|
||||||
<Alias name="OMX.dolby.eac3.decoder" />
|
|
||||||
<Limit name="channel-count" max="8" />
|
|
||||||
<Limit name="sample-rate" ranges="32000,44100,48000" />
|
|
||||||
<Limit name="bitrate" range="32000-6144000" />
|
|
||||||
</Type>
|
|
||||||
<Type name="audio/eac3-joc">
|
|
||||||
<Alias name="OMX.dolby.eac3-joc.decoder" />
|
|
||||||
<Limit name="channel-count" max="16" />
|
|
||||||
<Limit name="sample-rate" ranges="48000" />
|
|
||||||
<Limit name="bitrate" range="32000-6144000" />
|
|
||||||
</Type>
|
|
||||||
<Attribute name="software-codec" />
|
|
||||||
</MediaCodec>
|
|
||||||
<!-- DOLBY_UDC END -->
|
|
||||||
<!-- DOLBY_AC4 -->
|
|
||||||
<MediaCodec name="c2.dolby.ac4.decoder" type="audio/ac4">
|
|
||||||
<Alias name="OMX.dolby.ac4.decoder" />
|
|
||||||
<Limit name="channel-count" max="16" />
|
|
||||||
<Limit name="sample-rate" ranges="48000" />
|
|
||||||
<Limit name="bitrate" range="16000-2688000" />
|
|
||||||
<Attribute name="software-codec" />
|
|
||||||
</MediaCodec>
|
|
||||||
<!-- DOLBY_AC4 END -->
|
|
||||||
</Decoders>
|
|
||||||
</Included>
|
|
@@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!-- Audio Volume Curve Configuration file -->
|
|
||||||
<audioPolicyConfiguration version="1.0" xmlns:xi="http://www.w3.org/2001/XInclude">
|
|
||||||
<!-- Volume section -->
|
|
||||||
<xi:include href="audio_policy_volumes.xml"/>
|
|
||||||
<xi:include href="default_volume_tables.xml"/>
|
|
||||||
<!-- End of Volume section -->
|
|
||||||
|
|
||||||
</audioPolicyConfiguration>
|
|
@@ -1,240 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
||||||
<audioPolicyConfiguration version="1.0" xmlns:xi="http://www.w3.org/2001/XInclude">
|
|
||||||
<situations>
|
|
||||||
<situation type="stv_ringback" stream="AUDIO_STREAM_VOICE_CALL">
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_EARPIECE">
|
|
||||||
0, 97, 137, 193, 289, 433, 648, 969, 1450
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_SPEAKER">
|
|
||||||
40, 73, 103, 145, 205, 289, 408, 576, 814
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_BLUETOOTH_SCO">
|
|
||||||
1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET">
|
|
||||||
1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT">
|
|
||||||
1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_USB_HEADSET">
|
|
||||||
132, 187, 264, 373, 527, 745, 1053, 1487, 2100
|
|
||||||
</volume>
|
|
||||||
</situation>
|
|
||||||
<situation type="stv_call_connection" stream="AUDIO_STREAM_VOICE_CALL">
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_EARPIECE">
|
|
||||||
0, 137, 193, 273, 386, 545, 770, 1087, 1536
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_SPEAKER">
|
|
||||||
97, 137, 193, 273, 386, 545, 770, 1087, 1536
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_BLUETOOTH_SCO">
|
|
||||||
1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET">
|
|
||||||
1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT">
|
|
||||||
1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_USB_HEADSET">
|
|
||||||
132, 187, 264, 373, 527, 745, 1053, 1487, 2100
|
|
||||||
</volume>
|
|
||||||
</situation>
|
|
||||||
<situation type="stv_call_waiting" stream="AUDIO_STREAM_VOICE_CALL">
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_EARPIECE">
|
|
||||||
0, 137, 193, 273, 386, 545, 770, 1087, 1536
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_SPEAKER">
|
|
||||||
97, 137, 193, 273, 386, 545, 770, 1087, 1536
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_BLUETOOTH_SCO">
|
|
||||||
1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET">
|
|
||||||
1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT">
|
|
||||||
1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_USB_HEADSET">
|
|
||||||
132, 187, 264, 373, 527, 745, 1053, 1487, 2100
|
|
||||||
</volume>
|
|
||||||
</situation>
|
|
||||||
<situation type="stv_voip_via_smart_view" stream="AUDIO_STREAM_VOICE_CALL">
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_SPEAKER">
|
|
||||||
0, 365, 515, 728, 1029, 1453, 2053, 2900, 4096
|
|
||||||
</volume>
|
|
||||||
</situation>
|
|
||||||
<situation type="stv_boot_sound" stream="AUDIO_STREAM_SYSTEM">
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_EARPIECE">
|
|
||||||
0, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_SPEAKER">
|
|
||||||
0, 179, 201, 225, 252, 283, 317, 356, 399, 502, 632, 796, 1002, 1262, 1589, 2000
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_USB_HEADSET">
|
|
||||||
126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126
|
|
||||||
</volume>
|
|
||||||
</situation>
|
|
||||||
<situation type="stv_burst_shot" stream="AUDIO_STREAM_SYSTEM">
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_EARPIECE">
|
|
||||||
0, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_SPEAKER">
|
|
||||||
0, 14, 16, 18, 20, 23, 26, 29, 33, 41, 51, 64, 80, 101, 127, 160
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_USB_HEADSET">
|
|
||||||
0, 41, 52, 65, 82, 103, 129, 183, 258, 365, 516, 729, 1029, 1454, 2053, 2900
|
|
||||||
</volume>
|
|
||||||
</situation>
|
|
||||||
<situation type="stv_camcording_start" stream="AUDIO_STREAM_SYSTEM">
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_EARPIECE">
|
|
||||||
0, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_SPEAKER">
|
|
||||||
0, 44, 49, 55, 62, 70, 79, 89, 100, 126, 158, 199, 250, 315, 397, 500
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_USB_HEADSET">
|
|
||||||
0, 4, 5, 6, 7, 9, 11, 16, 22, 31, 44, 62, 88, 125, 175, 250
|
|
||||||
</volume>
|
|
||||||
</situation>
|
|
||||||
<situation type="stv_charger_connection" stream="AUDIO_STREAM_SYSTEM">
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_EARPIECE">
|
|
||||||
0, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_SPEAKER">
|
|
||||||
0, 26, 29, 33, 37, 42, 47, 53, 60, 75, 95, 119, 150, 189, 238, 300
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_USB_HEADSET">
|
|
||||||
0, 3, 4, 5, 6, 7, 9, 12, 16, 21, 29, 39, 53, 71, 95, 130
|
|
||||||
</volume>
|
|
||||||
</situation>
|
|
||||||
<situation type="stv_hmt" stream="AUDIO_STREAM_SYSTEM">
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_EARPIECE">
|
|
||||||
126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_SPEAKER">
|
|
||||||
126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_USB_HEADSET">
|
|
||||||
126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126
|
|
||||||
</volume>
|
|
||||||
</situation>
|
|
||||||
<situation type="stv_key_tone" stream="AUDIO_STREAM_SYSTEM">
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_EARPIECE">
|
|
||||||
0, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_SPEAKER">
|
|
||||||
0, 49, 55, 62, 70, 78, 87, 98, 110, 138, 174, 219, 276, 347, 437, 550
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_USB_HEADSET">
|
|
||||||
0, 28, 35, 44, 56, 71, 89, 126, 178, 251, 355, 502, 709, 1002, 1416, 2000
|
|
||||||
</volume>
|
|
||||||
</situation>
|
|
||||||
<situation type="stv_keyboard" stream="AUDIO_STREAM_SYSTEM">
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_EARPIECE">
|
|
||||||
0, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_SPEAKER">
|
|
||||||
0, 12, 13, 15, 17, 19, 21, 24, 27, 34, 43, 54, 68, 85, 107, 135
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_USB_HEADSET">
|
|
||||||
0, 41, 52, 65, 82, 103, 129, 183, 258, 365, 516, 729, 1029, 1454, 2053, 2900
|
|
||||||
</volume>
|
|
||||||
</situation>
|
|
||||||
<situation type="stv_lock_screen" stream="AUDIO_STREAM_SYSTEM">
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_EARPIECE">
|
|
||||||
0, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_SPEAKER">
|
|
||||||
0, 16, 18, 20, 23, 26, 29, 32, 36, 45, 57, 72, 91, 114, 143, 180
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_USB_HEADSET">
|
|
||||||
0, 41, 52, 65, 82, 103, 129, 183, 258, 365, 516, 729, 1029, 1454, 2053, 2900
|
|
||||||
</volume>
|
|
||||||
</situation>
|
|
||||||
<situation type="stv_low_battery" stream="AUDIO_STREAM_SYSTEM">
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_EARPIECE">
|
|
||||||
0, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_SPEAKER">
|
|
||||||
0, 34, 38, 43, 48, 54, 61, 68, 76, 96, 121, 152, 191, 240, 302, 380
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_USB_HEADSET">
|
|
||||||
0, 10, 13, 16, 20, 25, 31, 44, 62, 88, 125, 175, 250, 350, 500, 700
|
|
||||||
</volume>
|
|
||||||
</situation>
|
|
||||||
<situation type="stv_midi" stream="AUDIO_STREAM_SYSTEM">
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_EARPIECE">
|
|
||||||
126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_SPEAKER">
|
|
||||||
126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_USB_HEADSET">
|
|
||||||
126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126
|
|
||||||
</volume>
|
|
||||||
</situation>
|
|
||||||
<situation type="stv_shutter" stream="AUDIO_STREAM_SYSTEM">
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_EARPIECE">
|
|
||||||
0, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_SPEAKER">
|
|
||||||
0, 10, 11, 12, 14, 16, 18, 20, 23, 29, 36, 45, 57, 72, 91, 115
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_USB_HEADSET">
|
|
||||||
0, 10, 13, 16, 20, 25, 31, 44, 62, 88, 125, 175, 250, 350, 500, 700
|
|
||||||
</volume>
|
|
||||||
</situation>
|
|
||||||
<situation type="stv_touch_tone" stream="AUDIO_STREAM_SYSTEM">
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_EARPIECE">
|
|
||||||
0, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_SPEAKER">
|
|
||||||
0, 10, 12, 14, 16, 18, 20, 22, 25, 31, 38, 48, 60, 75, 95, 120
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_USB_HEADSET">
|
|
||||||
0, 18, 23, 29, 37, 46, 58, 82, 116, 164, 231, 326, 461, 651, 920, 1300
|
|
||||||
</volume>
|
|
||||||
</situation>
|
|
||||||
<situation type="stv_unlock_screen" stream="AUDIO_STREAM_SYSTEM">
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_EARPIECE">
|
|
||||||
0, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_SPEAKER">
|
|
||||||
0, 8, 9, 10, 11, 12, 14, 16, 18, 23, 29, 36, 45, 57, 72, 91
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_USB_HEADSET">
|
|
||||||
0, 41, 52, 65, 82, 103, 129, 183, 258, 365, 516, 729, 1029, 1454, 2053, 2900
|
|
||||||
</volume>
|
|
||||||
</situation>
|
|
||||||
<situation type="stv_smart_view_music" stream="AUDIO_STREAM_MUSIC">
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_SPEAKER">
|
|
||||||
0, 7, 13, 23, 41, 73, 129, 230, 365, 515, 728, 1029, 1453, 2053, 2900, 4096
|
|
||||||
</volume>
|
|
||||||
</situation>
|
|
||||||
<situation type="stv_virtual_vib_sound" stream="AUDIO_STREAM_ENFORCED_AUDIBLE">
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_SPEAKER">
|
|
||||||
0, 89, 100, 112, 126, 141, 158, 177, 199, 251, 316, 398, 501, 631, 794, 1000
|
|
||||||
</volume>
|
|
||||||
</situation>
|
|
||||||
<situation type="stv_dtmf" stream="AUDIO_STREAM_DTMF">
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_EARPIECE">
|
|
||||||
3, 3, 8, 15, 23, 32, 45, 63, 89, 126, 178, 251, 355, 501, 708, 1000
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_SPEAKER">
|
|
||||||
20, 28, 35, 43, 50, 63, 75, 90, 105, 123, 140, 160, 185, 195, 210, 220
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_BLUETOOTH_SCO">
|
|
||||||
126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET">
|
|
||||||
126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126
|
|
||||||
</volume>
|
|
||||||
<volume device="AUDIO_DEVICE_OUT_USB_HEADSET">
|
|
||||||
4, 5, 7, 9, 12, 16, 22, 30, 40, 53, 71, 95, 127, 169, 225, 300
|
|
||||||
</volume>
|
|
||||||
</situation>
|
|
||||||
</situations>
|
|
||||||
</audioPolicyConfiguration>
|
|
File diff suppressed because it is too large
Load Diff
55
device.mk
55
device.mk
@@ -5,7 +5,8 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
# Add common symlinks definitions for Qualcomm Samsung
|
# Add common symlinks definitions for Qualcomm Samsung
|
||||||
$(call inherit-product, hardware/samsung/symlinks/qcom-common.mk)
|
$(call soong_config_set,rfs,mpss_firmware_symlink_target,firmware_modem)
|
||||||
|
$(call inherit-product, hardware/qcom-caf/common/common.mk)
|
||||||
|
|
||||||
# Enable project quotas and casefolding for emulated storage without sdcardfs
|
# Enable project quotas and casefolding for emulated storage without sdcardfs
|
||||||
$(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk)
|
$(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk)
|
||||||
@@ -13,15 +14,12 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk)
|
|||||||
# Enforce generic ramdisk allow list
|
# Enforce generic ramdisk allow list
|
||||||
$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_ramdisk.mk)
|
$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_ramdisk.mk)
|
||||||
|
|
||||||
|
# Non A/B device
|
||||||
|
$(call inherit-product, $(SRC_TARGET_DIR)/product/non_ab_device.mk)
|
||||||
|
|
||||||
# Dalvik
|
# Dalvik
|
||||||
$(call inherit-product, frameworks/native/build/phone-xhdpi-6144-dalvik-heap.mk)
|
$(call inherit-product, frameworks/native/build/phone-xhdpi-6144-dalvik-heap.mk)
|
||||||
|
|
||||||
# Enable updating of APEXes
|
|
||||||
$(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk)
|
|
||||||
|
|
||||||
# Add common definitions for Qualcomm
|
|
||||||
$(call inherit-product, hardware/qcom-caf/common/common.mk)
|
|
||||||
|
|
||||||
# AAPT
|
# AAPT
|
||||||
PRODUCT_AAPT_CONFIG := normal
|
PRODUCT_AAPT_CONFIG := normal
|
||||||
PRODUCT_AAPT_PREF_CONFIG := xxxhdpi
|
PRODUCT_AAPT_PREF_CONFIG := xxxhdpi
|
||||||
@@ -30,17 +28,20 @@ PRODUCT_AAPT_PREF_CONFIG := xxxhdpi
|
|||||||
BOARD_SHIPPING_API_LEVEL := 34
|
BOARD_SHIPPING_API_LEVEL := 34
|
||||||
PRODUCT_SHIPPING_API_LEVEL := $(BOARD_SHIPPING_API_LEVEL)
|
PRODUCT_SHIPPING_API_LEVEL := $(BOARD_SHIPPING_API_LEVEL)
|
||||||
|
|
||||||
|
# No A/B
|
||||||
|
AB_OTA_UPDATER := false
|
||||||
|
|
||||||
# Audio
|
# Audio
|
||||||
PRODUCT_PACKAGES += \
|
PRODUCT_PACKAGES += \
|
||||||
android.hardware.audio@7.1-impl \
|
android.hardware.audio@7.1-impl.samsung-sm8650 \
|
||||||
android.hardware.audio.effect@7.0-impl \
|
android.hardware.audio.effect@7.0-impl \
|
||||||
android.hardware.audio.service \
|
android.hardware.audio.service \
|
||||||
android.hardware.bluetooth.audio-impl \
|
android.hardware.bluetooth.audio-impl \
|
||||||
android.hardware.soundtrigger@2.3-impl \
|
android.hardware.soundtrigger@2.3-impl \
|
||||||
audioadsprpcd \
|
|
||||||
audio.bluetooth.default \
|
audio.bluetooth.default \
|
||||||
audio.r_submix.default \
|
audio.r_submix.default \
|
||||||
audio.usb.default \
|
audio.usb.default \
|
||||||
|
libagmmixer \
|
||||||
libagm_compress_plugin \
|
libagm_compress_plugin \
|
||||||
libagm_mixer_plugin \
|
libagm_mixer_plugin \
|
||||||
libagm_pcm_plugin \
|
libagm_pcm_plugin \
|
||||||
@@ -60,22 +61,12 @@ AUDIO_HAL_DIR := hardware/qcom-caf/sm8650/audio/primary-hal
|
|||||||
AUDIO_PAL_DIR := hardware/qcom-caf/sm8650/audio/pal
|
AUDIO_PAL_DIR := hardware/qcom-caf/sm8650/audio/pal
|
||||||
|
|
||||||
PRODUCT_COPY_FILES += \
|
PRODUCT_COPY_FILES += \
|
||||||
$(AUDIO_HAL_DIR)/configs/pineapple/audio_effects.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio/sku_pineapple/audio_effects.xml \
|
|
||||||
$(AUDIO_HAL_DIR)/configs/pineapple/audio_effects.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio/sku_pineapple/audio_effects.conf \
|
$(AUDIO_HAL_DIR)/configs/pineapple/audio_effects.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio/sku_pineapple/audio_effects.conf \
|
||||||
$(AUDIO_HAL_DIR)/configs/common/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \
|
$(AUDIO_HAL_DIR)/configs/pineapple/audio_effects.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio/sku_pineapple/audio_effects.xml \
|
||||||
$(AUDIO_HAL_DIR)/configs/common/bluetooth_qti_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_qti_audio_policy_configuration.xml \
|
|
||||||
$(AUDIO_HAL_DIR)/configs/common/bluetooth_qti_hearing_aid_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_qti_hearing_aid_audio_policy_configuration.xml \
|
|
||||||
$(AUDIO_HAL_DIR)/configs/pineapple/microphone_characteristics.xml:$(TARGET_COPY_OUT_VENDOR)/etc/microphone_characteristics.xml \
|
$(AUDIO_HAL_DIR)/configs/pineapple/microphone_characteristics.xml:$(TARGET_COPY_OUT_VENDOR)/etc/microphone_characteristics.xml \
|
||||||
$(AUDIO_PAL_DIR)/configs/pineapple/card-defs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/card-defs.xml \
|
$(LOCAL_PATH)/configs/audio/audio_policy_configuration_base.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \
|
||||||
$(AUDIO_HAL_DIR)/configs/pineapple/mem_logger_config.xml:$(TARGET_COPY_OUT_VENDOR)/etc/mem_logger_config.xml \
|
$(LOCAL_PATH)/configs/audio/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio/sku_pineapple_qssi/audio_policy_configuration.xml \
|
||||||
$(LOCAL_PATH)/configs/audio/audio_effects_haptic.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects_haptic.xml \
|
$(LOCAL_PATH)/configs/audio/audio_policy_volumes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_volumes.xml
|
||||||
$(LOCAL_PATH)/configs/audio/audio_effects_sec.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects_sec.xml \
|
|
||||||
$(LOCAL_PATH)/configs/audio/audio_effects_spatializer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects_spatializer.xml \
|
|
||||||
$(LOCAL_PATH)/configs/audio/audio_effects.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects.xml \
|
|
||||||
$(LOCAL_PATH)/configs/audio/audio_policy_volumes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_volumes.xml \
|
|
||||||
$(LOCAL_PATH)/configs/audio/dax3_media_codecs_dolby_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/dax3_media_codecs_dolby_audio.xml \
|
|
||||||
$(LOCAL_PATH)/configs/audio/situation_audio_policy_volumes_sec.xml:$(TARGET_COPY_OUT_VENDOR)/etc/situation_audio_policy_volumes_sec.xml \
|
|
||||||
$(LOCAL_PATH)/configs/audio/usecaseKvManager.xml:$(TARGET_COPY_OUT_VENDOR)/etc/usecaseKvManager.xml
|
|
||||||
|
|
||||||
PRODUCT_COPY_FILES += \
|
PRODUCT_COPY_FILES += \
|
||||||
frameworks/av/services/audiopolicy/config/bluetooth_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_audio_policy_configuration.xml \
|
frameworks/av/services/audiopolicy/config/bluetooth_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_audio_policy_configuration.xml \
|
||||||
@@ -109,6 +100,10 @@ PRODUCT_COPY_FILES += \
|
|||||||
frameworks/native/data/etc/android.hardware.camera.raw.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.raw.xml \
|
frameworks/native/data/etc/android.hardware.camera.raw.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.raw.xml \
|
||||||
$(LOCAL_PATH)/configs/permissions/platform-samsung.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/platform-samsung.xml
|
$(LOCAL_PATH)/configs/permissions/platform-samsung.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/platform-samsung.xml
|
||||||
|
|
||||||
|
# Charger
|
||||||
|
PRODUCT_PACKAGES += \
|
||||||
|
charger_res_images_vendor
|
||||||
|
|
||||||
# DebugFS
|
# DebugFS
|
||||||
PRODUCT_SET_DEBUGFS_RESTRICTIONS := true
|
PRODUCT_SET_DEBUGFS_RESTRICTIONS := true
|
||||||
|
|
||||||
@@ -246,14 +241,12 @@ PRODUCT_COPY_FILES += \
|
|||||||
PRODUCT_PACKAGES += \
|
PRODUCT_PACKAGES += \
|
||||||
librilutils \
|
librilutils \
|
||||||
libnetutils.vendor \
|
libnetutils.vendor \
|
||||||
libsecril-client \
|
|
||||||
secril_config_svc \
|
secril_config_svc \
|
||||||
sehradiomanager
|
sehradiomanager
|
||||||
|
#libsecril-client \
|
||||||
|
|
||||||
# Rootdir
|
# Rootdir
|
||||||
PRODUCT_PACKAGES += \
|
PRODUCT_PACKAGES += \
|
||||||
dcc_extension.sh \
|
|
||||||
hdm_status.sh \
|
|
||||||
init.class_main.sh \
|
init.class_main.sh \
|
||||||
init.crda.sh \
|
init.crda.sh \
|
||||||
init.kernel.post_boot-cliffs.sh \
|
init.kernel.post_boot-cliffs.sh \
|
||||||
@@ -391,15 +384,15 @@ PRODUCT_PACKAGES += \
|
|||||||
# Wi-Fi
|
# Wi-Fi
|
||||||
PRODUCT_PACKAGES += \
|
PRODUCT_PACKAGES += \
|
||||||
android.hardware.wifi-service \
|
android.hardware.wifi-service \
|
||||||
|
firmware_WCNSS_qcom_cfg.ini_symlink \
|
||||||
|
firmware_wlan_mac.bin_symlink \
|
||||||
|
firmware_wlanmdsp.otaupdate_symlink \
|
||||||
hostapd \
|
hostapd \
|
||||||
libwpa_client \
|
|
||||||
libwifi-hal-ctrl \
|
libwifi-hal-ctrl \
|
||||||
libwifi-hal-qcom \
|
libwifi-hal-qcom \
|
||||||
|
libwpa_client \
|
||||||
wpa_supplicant \
|
wpa_supplicant \
|
||||||
wpa_supplicant.conf \
|
wpa_supplicant.conf
|
||||||
firmware_wlanmdsp.otaupdate_symlink \
|
|
||||||
firmware_wlan_mac.bin_symlink \
|
|
||||||
firmware_WCNSS_qcom_cfg.ini_symlink
|
|
||||||
|
|
||||||
PRODUCT_COPY_FILES += \
|
PRODUCT_COPY_FILES += \
|
||||||
frameworks/native/data/etc/android.hardware.wifi.aware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.aware.xml \
|
frameworks/native/data/etc/android.hardware.wifi.aware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.aware.xml \
|
||||||
|
@@ -21,17 +21,14 @@ from extract_utils.main import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
namespace_imports = [
|
namespace_imports = [
|
||||||
# FIXME
|
|
||||||
'device/samsung/e3q',
|
'device/samsung/e3q',
|
||||||
'hardware/samsung',
|
|
||||||
'kernel/samsung/sm8650',
|
|
||||||
'kernel/samsung/sm8650-modules',
|
|
||||||
'hardware/qcom-caf/sm8650',
|
'hardware/qcom-caf/sm8650',
|
||||||
'vendor/qcom/opensource/commonsys/display',
|
|
||||||
'vendor/qcom/opensource/commonsys-intf/display',
|
|
||||||
'hardware/qcom-caf/sm8650/data-ipa-cfg-mgr',
|
|
||||||
'vendor/qcom/opensource/dataservices',
|
|
||||||
'hardware/qcom-caf/wlan',
|
'hardware/qcom-caf/wlan',
|
||||||
|
'hardware/samsung',
|
||||||
|
'vendor/qcom/opensource/commonsys-intf/display',
|
||||||
|
'vendor/qcom/opensource/commonsys/display',
|
||||||
|
'vendor/qcom/opensource/dataservices',
|
||||||
|
'vendor/qcom/opensource/display',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@@ -42,6 +39,7 @@ def lib_fixup_vendor_suffix(lib: str, partition: str, *args, **kwargs):
|
|||||||
lib_fixups: lib_fixups_user_type = {
|
lib_fixups: lib_fixups_user_type = {
|
||||||
**lib_fixups,
|
**lib_fixups,
|
||||||
(
|
(
|
||||||
|
'vendor.qti.diaghal@1.0',
|
||||||
'libsecril-client'
|
'libsecril-client'
|
||||||
): lib_fixup_vendor_suffix,
|
): lib_fixup_vendor_suffix,
|
||||||
(
|
(
|
||||||
@@ -55,20 +53,26 @@ lib_fixups: lib_fixups_user_type = {
|
|||||||
blob_fixups: blob_fixups_user_type = {
|
blob_fixups: blob_fixups_user_type = {
|
||||||
'vendor/lib64/libskeymint_cli.so': blob_fixup()
|
'vendor/lib64/libskeymint_cli.so': blob_fixup()
|
||||||
.replace_needed('libcrypto.so', 'libcrypto-v33.so'),
|
.replace_needed('libcrypto.so', 'libcrypto-v33.so'),
|
||||||
'vendor/etc/seccomp_policy/atfwd@2.0.policy': blob_fixup()
|
#'vendor/etc/seccomp_policy/atfwd@2.0.policy': blob_fixup()
|
||||||
.add_line_if_missing('gettid: 1'),
|
# .add_line_if_missing('gettid: 1'),
|
||||||
'vendor/lib64/libsec-ril.so': blob_fixup()
|
'vendor/lib64/libsec-ril.so': blob_fixup()
|
||||||
.binary_regex_replace(b'ril.dds.call.ongoing', b'vendor.calls.slot_id')
|
.binary_regex_replace(b'ril.dds.call.ongoing', b'vendor.calls.slot_id')
|
||||||
# mov x3, x21 -> mov x3, #0
|
# mov x3, x21 -> mov x3, #0
|
||||||
.sig_replace('bf c2 00 f8 76 0e 40 f9 80 0e 40 f9 e1 03 16 aa 82 0c 80 52 e3 03 15 aa 24 00 80 52 08 00 40 f9', 'bf c2 00 f8 76 0e 40 f9 80 0e 40 f9 e1 03 16 aa 82 0c 80 52 03 00 80 d2 24 00 80 52 08 00 40 f9'),
|
.sig_replace('bf c2 00 f8 76 0e 40 f9 80 0e 40 f9 e1 03 16 aa 82 0c 80 52 e3 03 15 aa 24 00 80 52 08 00 40 f9', 'bf c2 00 f8 76 0e 40 f9 80 0e 40 f9 e1 03 16 aa 82 0c 80 52 03 00 80 d2 24 00 80 52 08 00 40 f9'),
|
||||||
'vendor/lib64/libqcodec2_core.so': blob_fixup()
|
'vendor/lib64/libqcodec2_core.so': blob_fixup()
|
||||||
.add_needed('libcodec2_shim.so'),
|
.add_needed('libcodec2_shim.so'),
|
||||||
'vendor/lib64/unihal_android.so': blob_fixup()
|
('vendor/lib64/unihal_android.so', 'vendor/lib64/libc2filterplugin.so'): blob_fixup()
|
||||||
.add_needed('libui_shim.so'),
|
.add_needed('libui_shim.so'),
|
||||||
'vendor/etc/vintf/manifest/sec_c2_manifest_default0_1_2.xml': blob_fixup()
|
'vendor/etc/vintf/manifest/sec_c2_manifest_default0_1_2.xml': blob_fixup()
|
||||||
.regex_replace('default0', 'software'),
|
.regex_replace('default0', 'software'),
|
||||||
('vendor/etc/media_codecs.xml', 'vendor/etc/media_codecs_pineapple.xml', 'vendor/etc/media_codecs_pineapple_vendor.xml'): blob_fixup()
|
('vendor/etc/media_codecs.xml', 'vendor/etc/media_codecs_pineapple.xml', 'vendor/etc/media_codecs_pineapple_vendor.xml'): blob_fixup()
|
||||||
.regex_replace('.*media_codecs_(google_audio|google_c2|google_telephony|google_video|vendor_audio).*\n', ''),
|
.regex_replace('.*media_codecs_(google_audio|google_c2|google_telephony|google_video|vendor_audio).*\n', ''),
|
||||||
|
('vendor/lib64/libspukeymint.so', 'vendor/bin/hw/android.hardware.security.keymint-service-spu-qti'): blob_fixup()
|
||||||
|
.replace_needed('android.hardware.security.sharedsecret-V2-ndk.so', 'android.hardware.security.sharedsecret-V1-ndk.so'),
|
||||||
|
('vendor/lib64/libsensorndkbridge.so', 'vendor/bin/hw/android.hardware.sensors-service.multihal'): blob_fixup()
|
||||||
|
.replace_needed('android.hardware.sensors-V2-ndk.so', 'android.hardware.sensors-V3-ndk.so'),
|
||||||
|
'vendor/etc/init/android.hardware.security.keymint-service-qti.rc': blob_fixup()
|
||||||
|
.regex_replace('android.hardware.security.keymint-service', 'android.hardware.security.keymint-service-qti'),
|
||||||
} # fmt: skip
|
} # fmt: skip
|
||||||
|
|
||||||
module = ExtractUtilsModule(
|
module = ExtractUtilsModule(
|
||||||
|
@@ -23,5 +23,5 @@ PRODUCT_MANUFACTURER := samsung
|
|||||||
PRODUCT_GMS_CLIENTID_BASE := android-samsung-ss
|
PRODUCT_GMS_CLIENTID_BASE := android-samsung-ss
|
||||||
|
|
||||||
PRODUCT_BUILD_PROP_OVERRIDES += \
|
PRODUCT_BUILD_PROP_OVERRIDES += \
|
||||||
BuildDesc="e3qxxx-user 14 UP1A.231005.007 S928BXXU4AXK4 release-keys" \
|
BuildDesc="e3qxxx-user 15 AP3A.240905.015.A2 S928BXXU4BYD9 release-keys" \
|
||||||
BuildFingerprint="samsung/e3qxxx/e3q:14/UP1A.231005.007/S928BXXU4AXK4:user/release-keys"
|
BuildFingerprint="samsung/e3qxxx/e3q:14/UP1A.231005.007/S928BXXU4BYD9:user/release-keys"
|
||||||
|
3
odm.prop
3
odm.prop
@@ -1,3 +1,2 @@
|
|||||||
# Miscellaneous
|
# QC Value Addons
|
||||||
ro.vendor.qti.va_odm.support=1
|
ro.vendor.qti.va_odm.support=1
|
||||||
|
|
||||||
|
36
product.prop
36
product.prop
@@ -1,17 +1,15 @@
|
|||||||
# Audio
|
# Audio
|
||||||
aaudio.hw_burst_min_usec=2000
|
|
||||||
aaudio.mmap_exclusive_policy=2
|
|
||||||
aaudio.mmap_policy=2
|
|
||||||
af.fast_track_multiplier=1
|
af.fast_track_multiplier=1
|
||||||
audio.deep_buffer.media=true
|
audio.deep_buffer.media=true
|
||||||
audio.offload.min.duration.secs=30
|
audio.offload.min.duration.secs=30
|
||||||
audio.offload.video=true
|
audio.offload.video=true
|
||||||
audio.sys.mute.latency.factor=2
|
ro.af.client_heap_size_kbyte=7168
|
||||||
audio.sys.noisy.broadcast.delay=500
|
|
||||||
audio.sys.offload.pstimeout.secs=3
|
|
||||||
audio.sys.routing.latency=0
|
|
||||||
|
|
||||||
# Bluetooth
|
# Bluetooth
|
||||||
|
bluetooth.hardware.power.idle_cur_ma=4
|
||||||
|
bluetooth.hardware.power.operating_voltage_mv=4000
|
||||||
|
bluetooth.hardware.power.rx_cur_ma=18
|
||||||
|
bluetooth.hardware.power.tx_cur_ma=33
|
||||||
bluetooth.device.class_of_device=90,2,12
|
bluetooth.device.class_of_device=90,2,12
|
||||||
bluetooth.profile.a2dp.source.enabled=true
|
bluetooth.profile.a2dp.source.enabled=true
|
||||||
bluetooth.profile.asha.central.enabled=true
|
bluetooth.profile.asha.central.enabled=true
|
||||||
@@ -38,27 +36,3 @@ bluetooth.profile.vcp.controller.enabled=true
|
|||||||
persist.bluetooth.bqr.event_mask=0
|
persist.bluetooth.bqr.event_mask=0
|
||||||
persist.bluetooth.bqr.min_interval_ms=0
|
persist.bluetooth.bqr.min_interval_ms=0
|
||||||
persist.bluetooth.samsung.a2dp_offload.cap=sbc-aptx-ssc-hifi
|
persist.bluetooth.samsung.a2dp_offload.cap=sbc-aptx-ssc-hifi
|
||||||
|
|
||||||
# Media
|
|
||||||
media.stagefright.audio.deep=false
|
|
||||||
|
|
||||||
# Miscellaneous
|
|
||||||
remote_provisioning.enable_rkpd=true
|
|
||||||
remote_provisioning.hostname=remoteprovisioning.googleapis.com
|
|
||||||
restore.feature.use_samsung_smart_switch_flow=1
|
|
||||||
ro.af.client_heap_size_kbyte=7168
|
|
||||||
ro.boot.uwbcountrycode=ff
|
|
||||||
ro.com.google.cdb.spa1=bsxasm1
|
|
||||||
ro.com.google.clientidbase=android-samsung-ss
|
|
||||||
ro.com.google.clientidbase.tx=android-samsung-rvod2
|
|
||||||
ro.com.google.gmsversion=14_202406
|
|
||||||
ro.frp.pst=/dev/block/persistent
|
|
||||||
ro.opa.eligible_device=true
|
|
||||||
ro.setupwizard.mode=OPTIONAL
|
|
||||||
ro.setupwizard.rotation_locked=false
|
|
||||||
ro.setupwizard.wifi_on_exit=false
|
|
||||||
setupwizard.feature.enable_quick_start_flow=true
|
|
||||||
setupwizard.feature.enable_stencil_partner_customization=1
|
|
||||||
setupwizard.feature.support_oem_large_screen_landscape_temporary_by_sys_prop=true
|
|
||||||
setupwizard.phenotype_sync_timeout_ms=90000
|
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# Unpinned blobs from e3qxxx-user 14 UP1A.231005.007 S928BXXU4AXK4 release-keys
|
# Unpinned blobs from e3qxxx-user 15 AP3A.240905.015.A2 S928BXXU4BYD9 release-keys
|
||||||
|
|
||||||
# Current blobs with deps disabled:
|
# Current blobs with deps disabled:
|
||||||
# com.qti.node.dewarp, com.qti.chi.override, libcamximageformatutils, depend on multiple versions of the same aidl_interface: android.hardware.graphics.allocator-V1-ndk, android.hardware.graphics.allocator-V2-ndk-source
|
# com.qti.node.dewarp, com.qti.chi.override, libcamximageformatutils, depend on multiple versions of the same aidl_interface: android.hardware.graphics.allocator-V1-ndk, android.hardware.graphics.allocator-V2-ndk-source
|
||||||
@@ -64,12 +64,14 @@ vendor/lib64/libar-pal.so;DISABLE_CHECKELF
|
|||||||
vendor/lib64/libarmemlog.so
|
vendor/lib64/libarmemlog.so
|
||||||
vendor/lib64/libats.so
|
vendor/lib64/libats.so
|
||||||
vendor/lib64/libaudio_log_utils.so
|
vendor/lib64/libaudio_log_utils.so
|
||||||
|
vendor/lib64/libaudiofeaturestats.so
|
||||||
vendor/lib64/libcapiv2svacnnvendor.so
|
vendor/lib64/libcapiv2svacnnvendor.so
|
||||||
vendor/lib64/libcapiv2svarnnvendor.so
|
vendor/lib64/libcapiv2svarnnvendor.so
|
||||||
vendor/lib64/libcapiv2udk7vendor.so
|
vendor/lib64/libcapiv2udk7vendor.so
|
||||||
vendor/lib64/libcapiv2uvvendor.so
|
vendor/lib64/libcapiv2uvvendor.so
|
||||||
vendor/lib64/libcustomva_intf.so
|
vendor/lib64/libcustomva_intf.so
|
||||||
vendor/lib64/libdsd2pcm.so
|
vendor/lib64/libdsd2pcm.so
|
||||||
|
vendor/lib64/libhotword_intf.so
|
||||||
vendor/lib64/liblistensoundmodel2vendor.so
|
vendor/lib64/liblistensoundmodel2vendor.so
|
||||||
vendor/lib64/liblx-ar_util.so
|
vendor/lib64/liblx-ar_util.so
|
||||||
vendor/lib64/liblx-osal.so
|
vendor/lib64/liblx-osal.so
|
||||||
@@ -83,7 +85,6 @@ vendor/lib64/libsecnativefeature.so
|
|||||||
vendor/lib64/libspatializerparamstorage.so
|
vendor/lib64/libspatializerparamstorage.so
|
||||||
vendor/lib64/libspeakercalibration.so
|
vendor/lib64/libspeakercalibration.so
|
||||||
vendor/lib64/libtensorflowlite_c.so
|
vendor/lib64/libtensorflowlite_c.so
|
||||||
vendor/lib64/libvui_dmgr_client.so
|
|
||||||
vendor/lib64/libvui_intf.so
|
vendor/lib64/libvui_intf.so
|
||||||
vendor/lib64/vendor.qti.hardware.AGMIPC@1.0-impl.so
|
vendor/lib64/vendor.qti.hardware.AGMIPC@1.0-impl.so
|
||||||
vendor/lib64/vendor.qti.hardware.ListenSoundModel@1.0-impl.so
|
vendor/lib64/vendor.qti.hardware.ListenSoundModel@1.0-impl.so
|
||||||
@@ -103,6 +104,15 @@ vendor/etc/audio/sku_pineapple/resourcemanager_pineapple_cdp.xml
|
|||||||
vendor/etc/audio/sku_pineapple/resourcemanager_pineapple_mtp.xml
|
vendor/etc/audio/sku_pineapple/resourcemanager_pineapple_mtp.xml
|
||||||
vendor/etc/audio/sku_pineapple/resourcemanager_pineapple_qrd.xml
|
vendor/etc/audio/sku_pineapple/resourcemanager_pineapple_qrd.xml
|
||||||
vendor/etc/audio/sku_pineapple/resourcemanager_pineapple_qrd_sku2.xml
|
vendor/etc/audio/sku_pineapple/resourcemanager_pineapple_qrd_sku2.xml
|
||||||
|
vendor/etc/audio_effects.xml
|
||||||
|
vendor/etc/audio_effects_haptic.xml
|
||||||
|
vendor/etc/audio_effects_sec.xml
|
||||||
|
vendor/etc/audio_effects_spatializer.xml
|
||||||
|
vendor/etc/card-defs.xml
|
||||||
|
vendor/etc/mem_logger_config.xml
|
||||||
|
vendor/etc/sec_audio_volume_curve.xml
|
||||||
|
vendor/etc/situation_audio_policy_volumes_sec.xml
|
||||||
|
vendor/etc/usecaseKvManager.xml
|
||||||
|
|
||||||
# Audio FX modules
|
# Audio FX modules
|
||||||
vendor/lib64/lib_SamsungRec_08020.so
|
vendor/lib64/lib_SamsungRec_08020.so
|
||||||
@@ -138,7 +148,7 @@ vendor/lib64/vendor.samsung.hardware.bluetooth.audio-V2-ndk.so
|
|||||||
vendor/lib64/vendor.samsung.hardware.bluetooth@2.0.so
|
vendor/lib64/vendor.samsung.hardware.bluetooth@2.0.so
|
||||||
|
|
||||||
# Bluetooth (A2DP)
|
# Bluetooth (A2DP)
|
||||||
vendor/etc/vintf/manifest/bluetooth_audio.xml
|
#vendor/etc/vintf/manifest/bluetooth_audio.xml
|
||||||
vendor/lib64/btaudio_offload_if.so
|
vendor/lib64/btaudio_offload_if.so
|
||||||
vendor/lib64/hw/android.hardware.bluetooth.audio-impl-qti.so
|
vendor/lib64/hw/android.hardware.bluetooth.audio-impl-qti.so
|
||||||
vendor/lib64/hw/vendor.qti.hardware.bluetooth_audio@2.0-impl.so
|
vendor/lib64/hw/vendor.qti.hardware.bluetooth_audio@2.0-impl.so
|
||||||
@@ -165,7 +175,6 @@ vendor/etc/aip/config/pcc_config.json
|
|||||||
vendor/etc/aip/model/1129_dummy_1441_cached.dlc
|
vendor/etc/aip/model/1129_dummy_1441_cached.dlc
|
||||||
vendor/etc/aip/model/CIGSOL_SWISP_200M_v1.6.2_Exp18_e12850_592x4176_A16W8_cached.dlc
|
vendor/etc/aip/model/CIGSOL_SWISP_200M_v1.6.2_Exp18_e12850_592x4176_A16W8_cached.dlc
|
||||||
vendor/etc/aip/model/CIGSOL_fp32_ver220923_HTP_FP16_cached.dlc
|
vendor/etc/aip/model/CIGSOL_fp32_ver220923_HTP_FP16_cached.dlc
|
||||||
vendor/etc/aip/model/FP16_dummy_HTP_FP16_cached.dlc
|
|
||||||
vendor/etc/aip/model/ModelSet2_AIMFISP-timestamp
|
vendor/etc/aip/model/ModelSet2_AIMFISP-timestamp
|
||||||
vendor/etc/aip/model/ModelSet2_eraw_AIMFISP-timestamp
|
vendor/etc/aip/model/ModelSet2_eraw_AIMFISP-timestamp
|
||||||
vendor/etc/aip/model/ModelSet_AIMFISP-timestamp
|
vendor/etc/aip/model/ModelSet_AIMFISP-timestamp
|
||||||
@@ -191,7 +200,7 @@ vendor/etc/external_camera_config.xml
|
|||||||
vendor/etc/init/android.hardware.camera.provider-V1-external-service.rc
|
vendor/etc/init/android.hardware.camera.provider-V1-external-service.rc
|
||||||
vendor/etc/init/camera.unihal.rc
|
vendor/etc/init/camera.unihal.rc
|
||||||
vendor/etc/init/vendor.samsung.hardware.camera.provider-service_64.rc
|
vendor/etc/init/vendor.samsung.hardware.camera.provider-service_64.rc
|
||||||
vendor/etc/portrait_data/SRIB_ClatNetLite_INT8_V003_sm8650_vendor.tvm.so
|
vendor/etc/portrait_data/SRIB_ClatNetLite_INT8_V004_sm8650_vendor.tvm.so
|
||||||
vendor/etc/portrait_data/dual_portrait_product.json
|
vendor/etc/portrait_data/dual_portrait_product.json
|
||||||
vendor/etc/portrait_data/single_bokeh_feature_vendor.json
|
vendor/etc/portrait_data/single_bokeh_feature_vendor.json
|
||||||
vendor/etc/sat/arcsat_fusion.config
|
vendor/etc/sat/arcsat_fusion.config
|
||||||
@@ -449,7 +458,6 @@ vendor/lib64/libSceneDetector_v1.camera.samsung.so
|
|||||||
vendor/lib64/libSecExif.uniplugin@1.0.so
|
vendor/lib64/libSecExif.uniplugin@1.0.so
|
||||||
vendor/lib64/libSecJpegEncoder.uniplugin@1.0.so
|
vendor/lib64/libSecJpegEncoder.uniplugin@1.0.so
|
||||||
vendor/lib64/libSecPhotoHdrEncoder.uniplugin@1.0.so
|
vendor/lib64/libSecPhotoHdrEncoder.uniplugin@1.0.so
|
||||||
vendor/lib64/libSingleTakeBlurDetection.uniplugin@1.0.so
|
|
||||||
vendor/lib64/libSmartScan.camera.samsung.so
|
vendor/lib64/libSmartScan.camera.samsung.so
|
||||||
vendor/lib64/libSnpeCpu.so;FIX_SONAME
|
vendor/lib64/libSnpeCpu.so;FIX_SONAME
|
||||||
vendor/lib64/libSnpeGpu.so;FIX_SONAME
|
vendor/lib64/libSnpeGpu.so;FIX_SONAME
|
||||||
@@ -469,7 +477,6 @@ vendor/lib64/libUniScaler.uniplugin@1.0.so
|
|||||||
vendor/lib64/libWideDistortionCorrection.camera.samsung.so
|
vendor/lib64/libWideDistortionCorrection.camera.samsung.so
|
||||||
vendor/lib64/lib_profiler.so
|
vendor/lib64/lib_profiler.so
|
||||||
vendor/lib64/libai_denoiser_interface.so
|
vendor/lib64/libai_denoiser_interface.so
|
||||||
vendor/lib64/libai_tetra_text_zoom.arcsoft.so
|
|
||||||
vendor/lib64/libaidenoiser.so
|
vendor/lib64/libaidenoiser.so
|
||||||
vendor/lib64/libaidenoiserv2.so
|
vendor/lib64/libaidenoiserv2.so
|
||||||
vendor/lib64/libaifrc.quram.so
|
vendor/lib64/libaifrc.quram.so
|
||||||
@@ -712,8 +719,13 @@ vendor/etc/charger_fw_fstab.qti
|
|||||||
vendor/etc/cne/mwqem.conf
|
vendor/etc/cne/mwqem.conf
|
||||||
vendor/etc/cne/profileMwqem.xml
|
vendor/etc/cne/profileMwqem.xml
|
||||||
vendor/etc/default-permissions/com.qualcomm.qti.cne.xml
|
vendor/etc/default-permissions/com.qualcomm.qti.cne.xml
|
||||||
|
vendor/etc/default-permissions/vendor.qti.data.txpwradmin.xml
|
||||||
|
vendor/etc/init/cnd.rc
|
||||||
vendor/lib64/libshsc.so
|
vendor/lib64/libshsc.so
|
||||||
|
vendor/lib64/libxml.so
|
||||||
|
vendor/lib64/vendor.qti.data.factoryservice-V1-ndk.so
|
||||||
vendor/lib64/vendor.qti.data.mwqem@1.0.so
|
vendor/lib64/vendor.qti.data.mwqem@1.0.so
|
||||||
|
vendor/lib64/vendor.qti.data.mwqemaidlservice-V1-ndk.so
|
||||||
vendor/lib64/vendor.qti.data.slm@1.0.so
|
vendor/lib64/vendor.qti.data.slm@1.0.so
|
||||||
vendor/lib64/vendor.qti.hardware.cacert@1.0.so
|
vendor/lib64/vendor.qti.hardware.cacert@1.0.so
|
||||||
vendor/lib64/vendor.qti.hardware.data.cne.internal.constants@1.0.so
|
vendor/lib64/vendor.qti.hardware.data.cne.internal.constants@1.0.so
|
||||||
@@ -721,17 +733,26 @@ vendor/lib64/vendor.qti.hardware.data.cne.internal.server@1.0.so
|
|||||||
vendor/lib64/vendor.qti.hardware.data.cne.internal.server@1.1.so
|
vendor/lib64/vendor.qti.hardware.data.cne.internal.server@1.1.so
|
||||||
vendor/lib64/vendor.qti.hardware.data.cne.internal.server@1.2.so
|
vendor/lib64/vendor.qti.hardware.data.cne.internal.server@1.2.so
|
||||||
vendor/lib64/vendor.qti.hardware.data.cne.internal.server@1.3.so
|
vendor/lib64/vendor.qti.hardware.data.cne.internal.server@1.3.so
|
||||||
|
vendor/lib64/vendor.qti.hardware.data.cneaidlservice.internal.api-V1-ndk.so
|
||||||
|
vendor/lib64/vendor.qti.hardware.data.cneaidlservice.internal.constants-V1-ndk.so
|
||||||
|
vendor/lib64/vendor.qti.hardware.data.cneaidlservice.internal.server-V1-ndk.so
|
||||||
vendor/lib64/vendor.qti.hardware.data.dynamicdds@1.0.so
|
vendor/lib64/vendor.qti.hardware.data.dynamicdds@1.0.so
|
||||||
vendor/lib64/vendor.qti.hardware.data.dynamicdds@1.1.so
|
vendor/lib64/vendor.qti.hardware.data.dynamicdds@1.1.so
|
||||||
|
vendor/lib64/vendor.qti.hardware.data.dynamicddsaidlservice-V1-ndk.so
|
||||||
vendor/lib64/vendor.qti.hardware.data.flow@1.0.so
|
vendor/lib64/vendor.qti.hardware.data.flow@1.0.so
|
||||||
vendor/lib64/vendor.qti.hardware.data.flow@1.1.so
|
vendor/lib64/vendor.qti.hardware.data.flow@1.1.so
|
||||||
|
vendor/lib64/vendor.qti.hardware.data.flowaidlservice-V1-ndk.so
|
||||||
vendor/lib64/vendor.qti.hardware.data.latency@1.0.so
|
vendor/lib64/vendor.qti.hardware.data.latency@1.0.so
|
||||||
vendor/lib64/vendor.qti.hardware.data.lce@1.0.so
|
vendor/lib64/vendor.qti.hardware.data.lce@1.0.so
|
||||||
|
vendor/lib64/vendor.qti.hardware.data.lceaidlservice-V1-ndk.so
|
||||||
|
vendor/lib64/vendor.qti.hardware.data.qmiaidlservice-V1-ndk.so
|
||||||
vendor/lib64/vendor.qti.hardware.mwqemadapter@1.0.so
|
vendor/lib64/vendor.qti.hardware.mwqemadapter@1.0.so
|
||||||
|
vendor/lib64/vendor.qti.hardware.mwqemadapteraidlservice-V1-ndk.so
|
||||||
vendor/lib64/vendor.qti.hardware.slmadapter@1.0.so
|
vendor/lib64/vendor.qti.hardware.slmadapter@1.0.so
|
||||||
vendor/lib64/vendor.qti.latency@2.0.so
|
vendor/lib64/vendor.qti.latency@2.0.so
|
||||||
vendor/lib64/vendor.qti.latency@2.1.so
|
vendor/lib64/vendor.qti.latency@2.1.so
|
||||||
vendor/lib64/vendor.qti.latency@2.2.so
|
vendor/lib64/vendor.qti.latency@2.2.so
|
||||||
|
vendor/lib64/vendor.qti.latencyaidlservice-V1-ndk.so
|
||||||
|
|
||||||
# Configstore
|
# Configstore
|
||||||
vendor/bin/hw/vendor.qti.hardware.capabilityconfigstore@1.0-service
|
vendor/bin/hw/vendor.qti.hardware.capabilityconfigstore@1.0-service
|
||||||
@@ -801,7 +822,6 @@ vendor/lib64/libnicm_utils.so
|
|||||||
vendor/lib64/libqcmaputils.so
|
vendor/lib64/libqcmaputils.so
|
||||||
vendor/lib64/libqdi.so
|
vendor/lib64/libqdi.so
|
||||||
vendor/lib64/libqdp.so
|
vendor/lib64/libqdp.so
|
||||||
vendor/lib64/libxml.so
|
|
||||||
vendor/lib64/vendor.qti.hardware.radio.atfwd-V1-ndk.so
|
vendor/lib64/vendor.qti.hardware.radio.atfwd-V1-ndk.so
|
||||||
|
|
||||||
# Diag
|
# Diag
|
||||||
@@ -810,7 +830,7 @@ vendor/etc/init/vendor.qti.diag.rc
|
|||||||
vendor/etc/vintf/manifest/vendor.qti.diag.hal.service.xml
|
vendor/etc/vintf/manifest/vendor.qti.diag.hal.service.xml
|
||||||
vendor/lib64/libdiag.so
|
vendor/lib64/libdiag.so
|
||||||
vendor/lib64/libqsocket.so
|
vendor/lib64/libqsocket.so
|
||||||
vendor/lib64/vendor.qti.diaghal@1.0.so
|
vendor/lib64/vendor.qti.diaghal@1.0.so;MODULE_SUFFIX=_vendor
|
||||||
|
|
||||||
# Display
|
# Display
|
||||||
vendor/bin/hw/vendor.qti.hardware.display.color-service
|
vendor/bin/hw/vendor.qti.hardware.display.color-service
|
||||||
@@ -894,6 +914,7 @@ vendor/etc/display/qdcm_calib_data_vtdr6130_amoled_qsync_video_mode_dsi_visionox
|
|||||||
vendor/etc/display/qdcm_calib_data_vtdr6130_amoled_video_mode_dsi_visionox_panel_with_DSC.json
|
vendor/etc/display/qdcm_calib_data_vtdr6130_amoled_video_mode_dsi_visionox_panel_with_DSC.json
|
||||||
|
|
||||||
# Dolby
|
# Dolby
|
||||||
|
vendor/etc/dax3_media_codecs_dolby_audio.xml
|
||||||
vendor/etc/dolby/dax-default.xml
|
vendor/etc/dolby/dax-default.xml
|
||||||
vendor/etc/media_codecs_dolby_audio.xml
|
vendor/etc/media_codecs_dolby_audio.xml
|
||||||
|
|
||||||
@@ -914,7 +935,6 @@ vendor/lib64/vendor.qti.hardware.dpmservice@1.1.so
|
|||||||
|
|
||||||
# DRK
|
# DRK
|
||||||
vendor/bin/hw/vendor.samsung.hardware.security.drk-service
|
vendor/bin/hw/vendor.samsung.hardware.security.drk-service
|
||||||
vendor/bin/hw/vendor.samsung.hardware.security.drk@2.0-service
|
|
||||||
vendor/etc/init/vendor.samsung.hardware.security.drk-service.rc
|
vendor/etc/init/vendor.samsung.hardware.security.drk-service.rc
|
||||||
vendor/etc/vintf/manifest/drk_manifest.xml
|
vendor/etc/vintf/manifest/drk_manifest.xml
|
||||||
vendor/lib64/libdk_vnd_service_core.so
|
vendor/lib64/libdk_vnd_service_core.so
|
||||||
@@ -1155,7 +1175,6 @@ vendor/lib64/liblowi_common.so
|
|||||||
vendor/lib64/liblowi_wifihal.so
|
vendor/lib64/liblowi_wifihal.so
|
||||||
vendor/lib64/libmapdata_api.so
|
vendor/lib64/libmapdata_api.so
|
||||||
vendor/lib64/libpal_net_if.so
|
vendor/lib64/libpal_net_if.so
|
||||||
vendor/lib64/libsemnativecarrierfeature.so
|
|
||||||
vendor/lib64/libsynergy_loc_api.so
|
vendor/lib64/libsynergy_loc_api.so
|
||||||
vendor/lib64/libsys_info_cache.so
|
vendor/lib64/libsys_info_cache.so
|
||||||
vendor/lib64/libwifiobserver.so
|
vendor/lib64/libwifiobserver.so
|
||||||
@@ -1208,10 +1227,10 @@ vendor/lib64/vendor.samsung.hardware.health-V1-ndk.so
|
|||||||
vendor/lib64/vendor.samsung.hardware.hyper-V2-ndk.so
|
vendor/lib64/vendor.samsung.hardware.hyper-V2-ndk.so
|
||||||
|
|
||||||
# Media
|
# Media
|
||||||
|
#vendor/bin/init.qti.media.sh
|
||||||
system_ext/lib64/libmmosal.so
|
system_ext/lib64/libmmosal.so
|
||||||
system_ext/lib64/libmmparser_lite.so
|
system_ext/lib64/libmmparser_lite.so
|
||||||
vendor/bin/hw/vendor.qti.media.c2@1.0-service
|
vendor/bin/hw/vendor.qti.media.c2@1.0-service
|
||||||
vendor/bin/init.qti.media.sh
|
|
||||||
vendor/etc/init/init.qti.media.rc
|
vendor/etc/init/init.qti.media.rc
|
||||||
vendor/etc/init/vendor.qti.media.c2@1.0-service.rc
|
vendor/etc/init/vendor.qti.media.c2@1.0-service.rc
|
||||||
vendor/etc/media_codecs.xml
|
vendor/etc/media_codecs.xml
|
||||||
@@ -1282,6 +1301,7 @@ vendor/lib64/libstagefright_foundation_vendor.so
|
|||||||
vendor/lib64/libstreamprocessor.so
|
vendor/lib64/libstreamprocessor.so
|
||||||
vendor/lib64/libvideotxr.so
|
vendor/lib64/libvideotxr.so
|
||||||
vendor/lib64/qti.video.utils.videobufferlayout.so
|
vendor/lib64/qti.video.utils.videobufferlayout.so
|
||||||
|
vendor/lib64/vendor.samsung.hardware.media.mpp-V5-ndk.so
|
||||||
vendor/lib64/vintf-codecsolution-V2-ndk.so
|
vendor/lib64/vintf-codecsolution-V2-ndk.so
|
||||||
|
|
||||||
# Memory
|
# Memory
|
||||||
@@ -1366,7 +1386,7 @@ vendor/lib64/libqspm-mem-utils-vendor.so
|
|||||||
vendor/lib64/vendor.qti.qspmhal-V1-ndk.so
|
vendor/lib64/vendor.qti.qspmhal-V1-ndk.so
|
||||||
|
|
||||||
# QMI
|
# QMI
|
||||||
vendor/bin/init.qti.write.sh
|
#vendor/bin/init.qti.write.sh
|
||||||
vendor/bin/qcom-system-daemon
|
vendor/bin/qcom-system-daemon
|
||||||
vendor/bin/qrtr-cfg
|
vendor/bin/qrtr-cfg
|
||||||
vendor/bin/qrtr-lookup
|
vendor/bin/qrtr-lookup
|
||||||
@@ -1400,6 +1420,7 @@ vendor/etc/init/vendor.qti.smp2p.rc
|
|||||||
vendor/etc/init/vendor.qti.tftp.rc
|
vendor/etc/init/vendor.qti.tftp.rc
|
||||||
|
|
||||||
# RIL
|
# RIL
|
||||||
|
#vendor/lib64/vendor.samsung.hardware.radio.network-V1-ndk.so
|
||||||
vendor/bin/hw/rild
|
vendor/bin/hw/rild
|
||||||
vendor/bin/irsc_util
|
vendor/bin/irsc_util
|
||||||
vendor/bin/ks
|
vendor/bin/ks
|
||||||
@@ -1420,16 +1441,15 @@ vendor/etc/pdpcnt-conf.xml
|
|||||||
vendor/etc/plmn_delta.bin
|
vendor/etc/plmn_delta.bin
|
||||||
vendor/etc/plmn_delta_attaio.bin
|
vendor/etc/plmn_delta_attaio.bin
|
||||||
vendor/etc/plmn_delta_hktw.bin
|
vendor/etc/plmn_delta_hktw.bin
|
||||||
|
vendor/etc/plmn_delta_ltn.bin
|
||||||
vendor/etc/plmn_delta_usagsm.bin
|
vendor/etc/plmn_delta_usagsm.bin
|
||||||
vendor/etc/plmn_se13.bin
|
vendor/etc/plmn_se13_prebuilt.bin
|
||||||
vendor/etc/qms_log_config
|
vendor/etc/qms_log_config
|
||||||
vendor/etc/sec_config_oem
|
vendor/etc/sec_config_oem
|
||||||
vendor/etc/seccomp_policy/qms.policy
|
vendor/etc/seccomp_policy/qms.policy
|
||||||
vendor/etc/vintf/manifest/qms-saidl.xml
|
vendor/etc/vintf/manifest/qms-saidl.xml
|
||||||
vendor/etc/vintf/manifest/vendor.samsung.hardware.radio_manifest_2_34.xml
|
vendor/etc/vintf/manifest/vendor.samsung.hardware.radio_manifest_2_34.xml
|
||||||
vendor/etc/vintf/manifest/vendor.samsung.hardware.sehradio_manifest_2_34.xml
|
vendor/etc/vintf/manifest/vendor.samsung.hardware.sehradio_manifest_2_34.xml
|
||||||
vendor/lib64/libSemDataProps.so
|
|
||||||
vendor/lib64/libSemTelephonyProps.so
|
|
||||||
vendor/lib64/libengmode_client.so
|
vendor/lib64/libengmode_client.so
|
||||||
vendor/lib64/libqdpr.so
|
vendor/lib64/libqdpr.so
|
||||||
vendor/lib64/libril_sem.so
|
vendor/lib64/libril_sem.so
|
||||||
@@ -1471,37 +1491,40 @@ vendor/etc/seccomp_policy/wfdvndservice.policy
|
|||||||
vendor/etc/seccomp_policy/wifidisplayhalservice.policy
|
vendor/etc/seccomp_policy/wifidisplayhalservice.policy
|
||||||
|
|
||||||
# Secure element
|
# Secure element
|
||||||
|
#vendor/etc/vintf/manifest/vendor.samsung.hardware.security.sem-manifest.xml
|
||||||
vendor/bin/hw/android.hardware.secure_element-service.nxp
|
vendor/bin/hw/android.hardware.secure_element-service.nxp
|
||||||
vendor/bin/hw/vendor.samsung.hardware.security.sem@1.0-service
|
vendor/bin/hw/vendor.samsung.hardware.security.sem-service
|
||||||
vendor/etc/init/secure_element-service-nxp.rc
|
vendor/etc/init/secure_element-service-nxp.rc
|
||||||
vendor/etc/init/vendor.samsung.hardware.security.sem@1.0-service.rc
|
vendor/etc/init/vendor.samsung.hardware.security.sem-service.rc
|
||||||
vendor/etc/libese-nxp.conf
|
vendor/etc/libese-nxp.conf
|
||||||
vendor/etc/vintf/manifest/vendor.samsung.hardware.security.sem@1.0-manifest.xml
|
vendor/lib64/libVendorSemDataProps.so
|
||||||
|
vendor/lib64/libVendorSemTelephonyProps.so
|
||||||
vendor/lib64/libese-grdg.so
|
vendor/lib64/libese-grdg.so
|
||||||
vendor/lib64/libsec_esek.so
|
vendor/lib64/libsec_esek.so
|
||||||
vendor/lib64/libsec_semHalTlc.so
|
vendor/lib64/libsec_semHalTlc.so
|
||||||
|
vendor/lib64/libsemnativecarrierfeature.so
|
||||||
vendor/lib64/vendor.qti.esepowermanager@1.0.so
|
vendor/lib64/vendor.qti.esepowermanager@1.0.so
|
||||||
vendor/lib64/vendor.samsung.hardware.security.sem@1.0.so
|
vendor/lib64/vendor.samsung.hardware.security.sem-V1-ndk.so
|
||||||
|
|
||||||
# Security
|
# Security
|
||||||
vendor/bin/hw/android.hardware.security.keymint-service
|
#vendor/etc/vintf/manifest/vendor.samsung.hardware.security.skpm-manifest.xml
|
||||||
|
#vendor/lib64/android.hardware.keymaster-V4-ndk.so;MODULE_SUFFIX=_vendor
|
||||||
|
#vendor/lib64/android.hardware.keymaster@3.0.so;MODULE_SUFFIX=_vendor
|
||||||
|
#vendor/lib64/android.hardware.keymaster@4.0.so;MODULE_SUFFIX=_vendor
|
||||||
|
#vendor/lib64/android.hardware.keymaster@4.1.so;MODULE_SUFFIX=_vendor
|
||||||
|
#vendor/lib64/android.hardware.security.keymint-V1-ndk.so;MODULE_SUFFIX=_vendor
|
||||||
|
#vendor/lib64/android.hardware.security.keymint-V3-ndk.so;MODULE_SUFFIX=_vendor
|
||||||
|
#vendor/lib64/libkeymaster4_1support.so;MODULE_SUFFIX=_vendor
|
||||||
|
#vendor/lib64/libkeymaster4support.so;MODULE_SUFFIX=_vendor
|
||||||
|
#vendor/lib64/libkeymaster_messages.so;MODULE_SUFFIX=_vendor
|
||||||
|
#vendor/lib64/libkeymaster_portable.so;MODULE_SUFFIX=_vendor
|
||||||
|
#vendor/lib64/libpuresoftkeymasterdevice.so;MODULE_SUFFIX=_vendor
|
||||||
|
vendor/bin/hw/android.hardware.security.keymint-service:vendor/bin/hw/android.hardware.security.keymint-service-qti
|
||||||
vendor/bin/hw/android.hardware.security.keymint-service-spu-qti
|
vendor/bin/hw/android.hardware.security.keymint-service-spu-qti
|
||||||
vendor/bin/hw/vendor.samsung.hardware.security.skpm@1.0-service
|
vendor/bin/hw/vendor.samsung.hardware.security.skpm-service
|
||||||
vendor/etc/init/android.hardware.security.keymint-service-spu-qti.rc
|
vendor/etc/init/android.hardware.security.keymint-service-spu-qti.rc
|
||||||
vendor/etc/init/android.hardware.security.keymint-service.rc
|
vendor/etc/init/android.hardware.security.keymint-service.rc:vendor/etc/init/android.hardware.security.keymint-service-qti.rc
|
||||||
vendor/etc/init/vendor.samsung.hardware.security.skpm@1.0-service.rc
|
vendor/etc/init/vendor.samsung.hardware.security.skpm-service.rc
|
||||||
vendor/etc/vintf/manifest/vendor.samsung.hardware.security.skpm@1.0-manifest.xml
|
|
||||||
vendor/lib64/android.hardware.keymaster-V4-ndk.so;MODULE_SUFFIX=_vendor
|
|
||||||
vendor/lib64/android.hardware.keymaster@3.0.so;MODULE_SUFFIX=_vendor
|
|
||||||
vendor/lib64/android.hardware.keymaster@4.0.so;MODULE_SUFFIX=_vendor
|
|
||||||
vendor/lib64/android.hardware.keymaster@4.1.so;MODULE_SUFFIX=_vendor
|
|
||||||
vendor/lib64/android.hardware.security.keymint-V1-ndk.so;MODULE_SUFFIX=_vendor
|
|
||||||
vendor/lib64/android.hardware.security.keymint-V3-ndk.so;MODULE_SUFFIX=_vendor
|
|
||||||
vendor/lib64/libkeymaster4_1support.so;MODULE_SUFFIX=_vendor
|
|
||||||
vendor/lib64/libkeymaster4support.so;MODULE_SUFFIX=_vendor
|
|
||||||
vendor/lib64/libkeymaster_messages.so;MODULE_SUFFIX=_vendor
|
|
||||||
vendor/lib64/libkeymaster_portable.so;MODULE_SUFFIX=_vendor
|
|
||||||
vendor/lib64/libpuresoftkeymasterdevice.so;MODULE_SUFFIX=_vendor
|
|
||||||
vendor/lib64/libsec_skpmHalTlc.so
|
vendor/lib64/libsec_skpmHalTlc.so
|
||||||
vendor/lib64/libskeymint10device.so
|
vendor/lib64/libskeymint10device.so
|
||||||
vendor/lib64/libskeymint_cli.so
|
vendor/lib64/libskeymint_cli.so
|
||||||
@@ -1510,7 +1533,7 @@ vendor/lib64/libspukeymint.so
|
|||||||
vendor/lib64/libspukeymintdeviceutils.so
|
vendor/lib64/libspukeymintdeviceutils.so
|
||||||
vendor/lib64/libspukeymintutils.so
|
vendor/lib64/libspukeymintutils.so
|
||||||
vendor/lib64/vendor.samsung.hardware.keymint-V3-ndk.so
|
vendor/lib64/vendor.samsung.hardware.keymint-V3-ndk.so
|
||||||
vendor/lib64/vendor.samsung.hardware.security.skpm@1.0.so
|
vendor/lib64/vendor.samsung.hardware.security.skpm-V1-ndk.so
|
||||||
|
|
||||||
# SMC Invoke
|
# SMC Invoke
|
||||||
vendor/lib64/libminkdescriptor.so
|
vendor/lib64/libminkdescriptor.so
|
||||||
@@ -1518,9 +1541,9 @@ vendor/lib64/libminksocket_vendor.so
|
|||||||
vendor/lib64/libqcbor.so
|
vendor/lib64/libqcbor.so
|
||||||
|
|
||||||
# Sensors
|
# Sensors
|
||||||
|
#vendor/bin/init.qcom.sensors.sh
|
||||||
vendor/bin/factory.ssc
|
vendor/bin/factory.ssc
|
||||||
vendor/bin/hw/android.hardware.sensors-service.multihal
|
vendor/bin/hw/android.hardware.sensors-service.multihal
|
||||||
vendor/bin/init.qcom.sensors.sh
|
|
||||||
vendor/bin/sensors.qti
|
vendor/bin/sensors.qti
|
||||||
vendor/bin/sscrpcd
|
vendor/bin/sscrpcd
|
||||||
vendor/etc/init/android.hardware.sensors-service-multihal.rc
|
vendor/etc/init/android.hardware.sensors-service-multihal.rc
|
||||||
@@ -1609,7 +1632,6 @@ vendor/etc/vintf/manifest/vendor.samsung.hardware.thermal-default.xml
|
|||||||
vendor/lib64/libthermalclient.so
|
vendor/lib64/libthermalclient.so
|
||||||
vendor/lib64/service-listener-ext-aidl-V1-ndk.so
|
vendor/lib64/service-listener-ext-aidl-V1-ndk.so
|
||||||
vendor/lib64/vendor.samsung.hardware.thermal-V1-ndk.so
|
vendor/lib64/vendor.samsung.hardware.thermal-V1-ndk.so
|
||||||
vendor/lib64/vendor.samsung.hardware.thermal@1.0.so
|
|
||||||
|
|
||||||
# Time services
|
# Time services
|
||||||
vendor/app/TimeService/TimeService.apk
|
vendor/app/TimeService/TimeService.apk
|
||||||
@@ -1651,7 +1673,6 @@ vendor/etc/libuwb-nxp.conf
|
|||||||
# Vibration
|
# Vibration
|
||||||
vendor/bin/hw/vendor.samsung.hardware.vibrator-service
|
vendor/bin/hw/vendor.samsung.hardware.vibrator-service
|
||||||
vendor/etc/Hapticsconfig.xml
|
vendor/etc/Hapticsconfig.xml
|
||||||
vendor/etc/audio_effects_haptic.xml
|
|
||||||
vendor/etc/init/vendor.samsung.hardware.vibrator-default.rc
|
vendor/etc/init/vendor.samsung.hardware.vibrator-default.rc
|
||||||
vendor/etc/vintf/manifest/vendor.samsung.hardware.vibrator-default.xml
|
vendor/etc/vintf/manifest/vendor.samsung.hardware.vibrator-default.xml
|
||||||
vendor/lib64/vendor.samsung.hardware.vibrator-V5-ndk.so
|
vendor/lib64/vendor.samsung.hardware.vibrator-V5-ndk.so
|
||||||
|
@@ -5,18 +5,6 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
// Init scripts
|
// Init scripts
|
||||||
sh_binary {
|
|
||||||
name: "dcc_extension.sh",
|
|
||||||
src: "bin/dcc_extension.sh",
|
|
||||||
vendor: true,
|
|
||||||
}
|
|
||||||
|
|
||||||
sh_binary {
|
|
||||||
name: "hdm_status.sh",
|
|
||||||
src: "bin/hdm_status.sh",
|
|
||||||
vendor: true,
|
|
||||||
}
|
|
||||||
|
|
||||||
sh_binary {
|
sh_binary {
|
||||||
name: "init.class_main.sh",
|
name: "init.class_main.sh",
|
||||||
src: "bin/init.class_main.sh",
|
src: "bin/init.class_main.sh",
|
||||||
|
179
system.prop
179
system.prop
@@ -1,179 +0,0 @@
|
|||||||
# Camera
|
|
||||||
persist.vendor.camera.privapp.list=org.codeaurora.snapcam
|
|
||||||
vendor.camera.aux.packagelist=org.codeaurora.snapcam
|
|
||||||
|
|
||||||
# CNE
|
|
||||||
persist.vendor.cne.feature=1
|
|
||||||
|
|
||||||
# Display
|
|
||||||
debug.sf.enable_hwc_vds=0
|
|
||||||
debug.sf.latch_unsignaled=1
|
|
||||||
ro.hwui.drop_shadow_cache_size=6
|
|
||||||
ro.hwui.gradient_cache_size=1
|
|
||||||
ro.hwui.layer_cache_size=48
|
|
||||||
ro.hwui.path_cache_size=32
|
|
||||||
ro.hwui.r_buffer_cache_size=8
|
|
||||||
ro.hwui.text_large_cache_height=1024
|
|
||||||
ro.hwui.text_large_cache_width=2048
|
|
||||||
ro.hwui.text_small_cache_height=1024
|
|
||||||
ro.hwui.text_small_cache_width=1024
|
|
||||||
ro.hwui.texture_cache_flushrate=0.4
|
|
||||||
ro.hwui.texture_cache_size=72
|
|
||||||
ro.opengles.version=196610
|
|
||||||
|
|
||||||
# DRM
|
|
||||||
ro.netflix.bsp_rev=Q8650-37577-1
|
|
||||||
|
|
||||||
# Health
|
|
||||||
ro.charger.enable_suspend=1
|
|
||||||
|
|
||||||
# NFC
|
|
||||||
ro.nfc.port=I2C
|
|
||||||
|
|
||||||
# Radio
|
|
||||||
persist.rild.nitz_long_ons_0=
|
|
||||||
persist.rild.nitz_long_ons_1=
|
|
||||||
persist.rild.nitz_long_ons_2=
|
|
||||||
persist.rild.nitz_long_ons_3=
|
|
||||||
persist.rild.nitz_plmn=
|
|
||||||
persist.rild.nitz_short_ons_0=
|
|
||||||
persist.rild.nitz_short_ons_1=
|
|
||||||
persist.rild.nitz_short_ons_2=
|
|
||||||
persist.rild.nitz_short_ons_3=
|
|
||||||
persist.vendor.radio.atfwd.start=true
|
|
||||||
ril.subscription.types=NV,RUIM
|
|
||||||
rild.libpath=/vendor/lib64/libril-qc-hal-qmi.so
|
|
||||||
|
|
||||||
# Sensors
|
|
||||||
persist.vendor.sensors.enable.mag_filter=true
|
|
||||||
|
|
||||||
# Wi-Fi
|
|
||||||
ro.wifi.channels=
|
|
||||||
|
|
||||||
# Wi-Fi Display
|
|
||||||
persist.debug.wfd.enable=1
|
|
||||||
persist.sys.wfd.virtual=0
|
|
||||||
|
|
||||||
# Miscellaneous
|
|
||||||
arm64.memtag.process.system_server=off
|
|
||||||
com.samsung.speg.prelauncher.disable=true
|
|
||||||
config.disable_rtt=true
|
|
||||||
dalvik.vm.appimageformat=lz4
|
|
||||||
dalvik.vm.dex2oat-Xms=64m
|
|
||||||
dalvik.vm.dex2oat-Xmx=512m
|
|
||||||
dalvik.vm.dex2oat-max-image-block-size=524288
|
|
||||||
dalvik.vm.dex2oat-minidebuginfo=true
|
|
||||||
dalvik.vm.dex2oat-resolve-startup-strings=true
|
|
||||||
dalvik.vm.dex2oat64.enabled=true
|
|
||||||
dalvik.vm.dexopt.secondary=true
|
|
||||||
dalvik.vm.dexopt.thermal-cutoff=2
|
|
||||||
dalvik.vm.finalizer-timeout-ms=60000
|
|
||||||
dalvik.vm.heapsize=36m
|
|
||||||
dalvik.vm.image-dex2oat-Xms=64m
|
|
||||||
dalvik.vm.image-dex2oat-Xmx=64m
|
|
||||||
dalvik.vm.lockprof.threshold=500
|
|
||||||
dalvik.vm.madvise.artfile.size=4294967295
|
|
||||||
dalvik.vm.madvise.odexfile.size=104857600
|
|
||||||
dalvik.vm.madvise.vdexfile.size=104857600
|
|
||||||
dalvik.vm.minidebuginfo=true
|
|
||||||
dalvik.vm.systemuicompilerfilter=speed
|
|
||||||
dalvik.vm.usap_pool_enabled=false
|
|
||||||
dalvik.vm.usap_pool_refill_delay_ms=3000
|
|
||||||
dalvik.vm.usap_pool_size_max=3
|
|
||||||
dalvik.vm.usap_pool_size_min=1
|
|
||||||
dalvik.vm.usap_refill_threshold=1
|
|
||||||
dalvik.vm.useartservice=true
|
|
||||||
dalvik.vm.usejit=true
|
|
||||||
debug.atrace.tags.enableflags=0
|
|
||||||
debug.codec2.stop_hal_before_surface=0
|
|
||||||
debug.hwui.skia_atrace_enabled=false
|
|
||||||
dev.pm.dyn_samplingrate=1
|
|
||||||
log.tag.ClatdController=D
|
|
||||||
log.tag.ConnectivityManager=D
|
|
||||||
log.tag.ConnectivityService=D
|
|
||||||
log.tag.IptablesRestoreController=D
|
|
||||||
log.tag.NetworkLogger=D
|
|
||||||
mmp.enable.3g2=true
|
|
||||||
net.bt.name=Android
|
|
||||||
persist.backup.ntpServer="0.pool.ntp.org"
|
|
||||||
persist.data.df.agg.dl_pkt=10
|
|
||||||
persist.data.df.agg.dl_size=4096
|
|
||||||
persist.data.df.dev_name=rmnet_usb0
|
|
||||||
persist.data.df.dl_mode=5
|
|
||||||
persist.data.df.iwlan_mux=9
|
|
||||||
persist.data.df.mux_count=8
|
|
||||||
persist.data.df.ul_mode=5
|
|
||||||
persist.data.wda.enable=true
|
|
||||||
persist.debug.coresight.config=stm-events
|
|
||||||
persist.device_config.runtime_native_boot.iorap_perfetto_enable=true
|
|
||||||
persist.fuse_sdcard=true
|
|
||||||
persist.log.level=0xFFFFFFFF
|
|
||||||
persist.log.semlevel=0xFFFFFF00
|
|
||||||
persist.mm.enable.prefetch=true
|
|
||||||
persist.rmnet.data.enable=true
|
|
||||||
persist.sys.force_sw_gles=1
|
|
||||||
persist.timed.enable=true
|
|
||||||
persist.traced.enable=1
|
|
||||||
persist.vendor.data.mode=concurrent
|
|
||||||
persist.vendor.time_services.init=0
|
|
||||||
pm.dexopt.ab-ota=speed-profile
|
|
||||||
pm.dexopt.bg-dexopt=speed-profile
|
|
||||||
pm.dexopt.boot-after-mainline-update=verify
|
|
||||||
pm.dexopt.boot-after-ota=verify
|
|
||||||
pm.dexopt.cmdline=verify
|
|
||||||
pm.dexopt.first-boot=verify
|
|
||||||
pm.dexopt.inactive=verify
|
|
||||||
pm.dexopt.install=speed-profile
|
|
||||||
pm.dexopt.install-bulk=speed-profile
|
|
||||||
pm.dexopt.install-bulk-downgraded=verify
|
|
||||||
pm.dexopt.install-bulk-secondary=verify
|
|
||||||
pm.dexopt.install-bulk-secondary-downgraded=extract
|
|
||||||
pm.dexopt.install-fast=skip
|
|
||||||
pm.dexopt.post-boot=extract
|
|
||||||
pm.dexopt.shared=speed
|
|
||||||
qcom.hw.aac.encoder=true
|
|
||||||
qemu.hw.mainkeys=0
|
|
||||||
ro.actionable_compatible_property.enabled=true
|
|
||||||
ro.build.2ndbrand=false
|
|
||||||
ro.build.changelist=29543898
|
|
||||||
ro.build.display_build_number=true
|
|
||||||
ro.build.official.developer=false
|
|
||||||
ro.build.official.release=true
|
|
||||||
ro.build.version.sem=3402
|
|
||||||
ro.build.version.sep=150500
|
|
||||||
ro.camerax.extensions.enabled=true
|
|
||||||
ro.config.dmverity=G
|
|
||||||
ro.config.iccc_version=3.0
|
|
||||||
ro.config.knox=v30
|
|
||||||
ro.config.rm_preload_enabled=1
|
|
||||||
ro.dalvik.vm.native.bridge=0
|
|
||||||
ro.kernel.qemu=0
|
|
||||||
ro.kernel.qemu.gles=0
|
|
||||||
ro.launcher.blur.appLaunch=0
|
|
||||||
ro.media.recorder-max-base-layer-fps=60
|
|
||||||
ro.oem_unlock_supported=1
|
|
||||||
ro.postinstall.fstab.prefix=/system
|
|
||||||
ro.product.property_source_order=odm,vendor,product,system_ext,system
|
|
||||||
ro.product_ship=true
|
|
||||||
ro.security.bio.release=1
|
|
||||||
ro.security.bio.ver=1.1
|
|
||||||
ro.security.bt.release=1
|
|
||||||
ro.security.bt.ver=1.0
|
|
||||||
ro.security.fips.ux=Enabled
|
|
||||||
ro.security.fips_bssl.ver=1.7
|
|
||||||
ro.security.mdf.release=1
|
|
||||||
ro.security.mdf.ux=Enabled
|
|
||||||
ro.security.mdf.ver=3.3
|
|
||||||
ro.security.wlan.release=2
|
|
||||||
ro.security.wlan.ver=1.0
|
|
||||||
ro.smps.gain.spk=0.3
|
|
||||||
ro.system.build.version.sehi=3405
|
|
||||||
ro.system.qb.id=86324119
|
|
||||||
ro.vendor.qti.va_aosp.support=1
|
|
||||||
security.mdf=None
|
|
||||||
security.mdf.result=None
|
|
||||||
security.perf_harden=1
|
|
||||||
sys.hqm.support=true
|
|
||||||
sys.qca1530=detect
|
|
||||||
vendor.mm.enable.qcom_parser=16777215
|
|
||||||
|
|
@@ -12,9 +12,6 @@ ro.vendor.fingerprint.request_touch_event=true
|
|||||||
aaudio.hw_burst_min_usec=2000
|
aaudio.hw_burst_min_usec=2000
|
||||||
aaudio.mmap_exclusive_policy=2
|
aaudio.mmap_exclusive_policy=2
|
||||||
aaudio.mmap_policy=2
|
aaudio.mmap_policy=2
|
||||||
af.fast_track_multiplier=1
|
|
||||||
audio.deep_buffer.media=true
|
|
||||||
audio.offload.video=true
|
|
||||||
audio.sys.noisy.broadcast.delay=600
|
audio.sys.noisy.broadcast.delay=600
|
||||||
audio.sys.offload.pstimeout.secs=3
|
audio.sys.offload.pstimeout.secs=3
|
||||||
persist.audio.fluence.speaker=true
|
persist.audio.fluence.speaker=true
|
||||||
|
Reference in New Issue
Block a user