mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-03 03:14:17 +00:00
Merge "Audio AIDL HAL priority update" am: 05d7ab4b45
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2328924 Change-Id: I7ea06a56a001ecaedd6e8d019160a80aa4ff2354 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -15,10 +15,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define LOG_TAG "AHAL_EffectFactory"
|
#define LOG_TAG "AHAL_EffectFactory"
|
||||||
#include <android-base/logging.h>
|
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
|
||||||
|
#include <android-base/logging.h>
|
||||||
|
#include <android/binder_ibinder_platform.h>
|
||||||
|
#include <system/thread_defs.h>
|
||||||
|
|
||||||
#include "effect-impl/EffectTypes.h"
|
#include "effect-impl/EffectTypes.h"
|
||||||
#include "effect-impl/EffectUUID.h"
|
#include "effect-impl/EffectUUID.h"
|
||||||
#include "effectFactory-impl/EffectFactory.h"
|
#include "effectFactory-impl/EffectFactory.h"
|
||||||
@@ -109,6 +112,8 @@ ndk::ScopedAStatus Factory::createEffect(const AudioUuid& in_impl_uuid,
|
|||||||
return ndk::ScopedAStatus::fromExceptionCode(EX_TRANSACTION_FAILED);
|
return ndk::ScopedAStatus::fromExceptionCode(EX_TRANSACTION_FAILED);
|
||||||
}
|
}
|
||||||
*_aidl_return = effectSp;
|
*_aidl_return = effectSp;
|
||||||
|
AIBinder_setMinSchedulerPolicy(effectSp->asBinder().get(), SCHED_NORMAL,
|
||||||
|
ANDROID_PRIORITY_AUDIO);
|
||||||
mEffectUuidMap[std::weak_ptr<IEffect>(effectSp)] = in_impl_uuid;
|
mEffectUuidMap[std::weak_ptr<IEffect>(effectSp)] = in_impl_uuid;
|
||||||
LOG(DEBUG) << __func__ << ": instance " << effectSp.get() << " created successfully";
|
LOG(DEBUG) << __func__ << ": instance " << effectSp.get() << " created successfully";
|
||||||
return ndk::ScopedAStatus::ok();
|
return ndk::ScopedAStatus::ok();
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#define LOG_TAG "AHAL_Module"
|
#define LOG_TAG "AHAL_Module"
|
||||||
#include <android-base/logging.h>
|
#include <android-base/logging.h>
|
||||||
|
#include <android/binder_ibinder_platform.h>
|
||||||
|
|
||||||
#include <Utils.h>
|
#include <Utils.h>
|
||||||
#include <aidl/android/media/audio/common/AudioInputFlags.h>
|
#include <aidl/android/media/audio/common/AudioInputFlags.h>
|
||||||
@@ -307,6 +308,8 @@ ndk::ScopedAStatus Module::setModuleDebug(
|
|||||||
ndk::ScopedAStatus Module::getTelephony(std::shared_ptr<ITelephony>* _aidl_return) {
|
ndk::ScopedAStatus Module::getTelephony(std::shared_ptr<ITelephony>* _aidl_return) {
|
||||||
if (mTelephony == nullptr) {
|
if (mTelephony == nullptr) {
|
||||||
mTelephony = ndk::SharedRefBase::make<Telephony>();
|
mTelephony = ndk::SharedRefBase::make<Telephony>();
|
||||||
|
AIBinder_setMinSchedulerPolicy(mTelephony->asBinder().get(), SCHED_NORMAL,
|
||||||
|
ANDROID_PRIORITY_AUDIO);
|
||||||
}
|
}
|
||||||
*_aidl_return = mTelephony;
|
*_aidl_return = mTelephony;
|
||||||
LOG(DEBUG) << __func__ << ": returning instance of ITelephony: " << _aidl_return->get();
|
LOG(DEBUG) << __func__ << ": returning instance of ITelephony: " << _aidl_return->get();
|
||||||
@@ -525,6 +528,7 @@ ndk::ScopedAStatus Module::openInputStream(const OpenInputStreamArguments& in_ar
|
|||||||
if (auto status = stream->init(); !status.isOk()) {
|
if (auto status = stream->init(); !status.isOk()) {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
AIBinder_setMinSchedulerPolicy(stream->asBinder().get(), SCHED_NORMAL, ANDROID_PRIORITY_AUDIO);
|
||||||
StreamWrapper streamWrapper(stream);
|
StreamWrapper streamWrapper(stream);
|
||||||
auto patchIt = mPatches.find(in_args.portConfigId);
|
auto patchIt = mPatches.find(in_args.portConfigId);
|
||||||
if (patchIt != mPatches.end()) {
|
if (patchIt != mPatches.end()) {
|
||||||
@@ -575,6 +579,7 @@ ndk::ScopedAStatus Module::openOutputStream(const OpenOutputStreamArguments& in_
|
|||||||
if (auto status = stream->init(); !status.isOk()) {
|
if (auto status = stream->init(); !status.isOk()) {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
AIBinder_setMinSchedulerPolicy(stream->asBinder().get(), SCHED_NORMAL, ANDROID_PRIORITY_AUDIO);
|
||||||
StreamWrapper streamWrapper(stream);
|
StreamWrapper streamWrapper(stream);
|
||||||
auto patchIt = mPatches.find(in_args.portConfigId);
|
auto patchIt = mPatches.find(in_args.portConfigId);
|
||||||
if (patchIt != mPatches.end()) {
|
if (patchIt != mPatches.end()) {
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ service vendor.audio-effect-hal-aidl /vendor/bin/hw/android.hardware.audio.effec
|
|||||||
# media gid needed for /dev/fm (radio) and for /data/misc/media (tee)
|
# media gid needed for /dev/fm (radio) and for /data/misc/media (tee)
|
||||||
group audio media
|
group audio media
|
||||||
capabilities BLOCK_SUSPEND
|
capabilities BLOCK_SUSPEND
|
||||||
|
# setting RLIMIT_RTPRIO allows binder RT priority inheritance
|
||||||
|
rlimit rtprio 10 10
|
||||||
ioprio rt 4
|
ioprio rt 4
|
||||||
task_profiles ProcessCapacityHigh HighPerformance
|
task_profiles ProcessCapacityHigh HighPerformance
|
||||||
onrestart restart audioserver
|
onrestart restart audioserver
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ service vendor.audio-hal-aidl /vendor/bin/hw/android.hardware.audio.service-aidl
|
|||||||
# media gid needed for /dev/fm (radio) and for /data/misc/media (tee)
|
# media gid needed for /dev/fm (radio) and for /data/misc/media (tee)
|
||||||
group audio camera drmrpc inet media mediadrm net_bt net_bt_admin net_bw_acct wakelock context_hub
|
group audio camera drmrpc inet media mediadrm net_bt net_bt_admin net_bw_acct wakelock context_hub
|
||||||
capabilities BLOCK_SUSPEND
|
capabilities BLOCK_SUSPEND
|
||||||
|
# setting RLIMIT_RTPRIO allows binder RT priority inheritance
|
||||||
|
rlimit rtprio 10 10
|
||||||
ioprio rt 4
|
ioprio rt 4
|
||||||
task_profiles ProcessCapacityHigh HighPerformance
|
task_profiles ProcessCapacityHigh HighPerformance
|
||||||
onrestart restart audioserver
|
onrestart restart audioserver
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
#include "core-impl/Module.h"
|
#include "core-impl/Module.h"
|
||||||
|
|
||||||
#include <android-base/logging.h>
|
#include <android-base/logging.h>
|
||||||
|
#include <android/binder_ibinder_platform.h>
|
||||||
#include <android/binder_manager.h>
|
#include <android/binder_manager.h>
|
||||||
#include <android/binder_process.h>
|
#include <android/binder_process.h>
|
||||||
|
|
||||||
@@ -44,6 +45,8 @@ int main() {
|
|||||||
|
|
||||||
// Make the default module
|
// Make the default module
|
||||||
auto moduleDefault = ndk::SharedRefBase::make<Module>();
|
auto moduleDefault = ndk::SharedRefBase::make<Module>();
|
||||||
|
AIBinder_setMinSchedulerPolicy(moduleDefault->asBinder().get(), SCHED_NORMAL,
|
||||||
|
ANDROID_PRIORITY_AUDIO);
|
||||||
const std::string moduleDefaultName = std::string() + Module::descriptor + "/default";
|
const std::string moduleDefaultName = std::string() + Module::descriptor + "/default";
|
||||||
status = AServiceManager_addService(moduleDefault->asBinder().get(), moduleDefaultName.c_str());
|
status = AServiceManager_addService(moduleDefault->asBinder().get(), moduleDefaultName.c_str());
|
||||||
CHECK_EQ(STATUS_OK, status);
|
CHECK_EQ(STATUS_OK, status);
|
||||||
|
|||||||
Reference in New Issue
Block a user