Loading audio/aidl/default/EffectFactory.cpp +6 −1 Original line number Diff line number Diff line Loading @@ -15,10 +15,13 @@ */ #define LOG_TAG "AHAL_EffectFactory" #include <android-base/logging.h> #include <dlfcn.h> #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/EffectUUID.h" #include "effectFactory-impl/EffectFactory.h" Loading Loading @@ -109,6 +112,8 @@ ndk::ScopedAStatus Factory::createEffect(const AudioUuid& in_impl_uuid, return ndk::ScopedAStatus::fromExceptionCode(EX_TRANSACTION_FAILED); } *_aidl_return = effectSp; AIBinder_setMinSchedulerPolicy(effectSp->asBinder().get(), SCHED_NORMAL, ANDROID_PRIORITY_AUDIO); mEffectUuidMap[std::weak_ptr<IEffect>(effectSp)] = in_impl_uuid; LOG(DEBUG) << __func__ << ": instance " << effectSp.get() << " created successfully"; return ndk::ScopedAStatus::ok(); Loading audio/aidl/default/Module.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #define LOG_TAG "AHAL_Module" #include <android-base/logging.h> #include <android/binder_ibinder_platform.h> #include <Utils.h> #include <aidl/android/media/audio/common/AudioInputFlags.h> Loading Loading @@ -307,6 +308,8 @@ ndk::ScopedAStatus Module::setModuleDebug( ndk::ScopedAStatus Module::getTelephony(std::shared_ptr<ITelephony>* _aidl_return) { if (mTelephony == nullptr) { mTelephony = ndk::SharedRefBase::make<Telephony>(); AIBinder_setMinSchedulerPolicy(mTelephony->asBinder().get(), SCHED_NORMAL, ANDROID_PRIORITY_AUDIO); } *_aidl_return = mTelephony; LOG(DEBUG) << __func__ << ": returning instance of ITelephony: " << _aidl_return->get(); Loading Loading @@ -525,6 +528,7 @@ ndk::ScopedAStatus Module::openInputStream(const OpenInputStreamArguments& in_ar if (auto status = stream->init(); !status.isOk()) { return status; } AIBinder_setMinSchedulerPolicy(stream->asBinder().get(), SCHED_NORMAL, ANDROID_PRIORITY_AUDIO); StreamWrapper streamWrapper(stream); auto patchIt = mPatches.find(in_args.portConfigId); if (patchIt != mPatches.end()) { Loading Loading @@ -575,6 +579,7 @@ ndk::ScopedAStatus Module::openOutputStream(const OpenOutputStreamArguments& in_ if (auto status = stream->init(); !status.isOk()) { return status; } AIBinder_setMinSchedulerPolicy(stream->asBinder().get(), SCHED_NORMAL, ANDROID_PRIORITY_AUDIO); StreamWrapper streamWrapper(stream); auto patchIt = mPatches.find(in_args.portConfigId); if (patchIt != mPatches.end()) { Loading audio/aidl/default/android.hardware.audio.effect.service-aidl.example.rc +2 −0 Original line number Diff line number Diff line Loading @@ -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) group audio media capabilities BLOCK_SUSPEND # setting RLIMIT_RTPRIO allows binder RT priority inheritance rlimit rtprio 10 10 ioprio rt 4 task_profiles ProcessCapacityHigh HighPerformance onrestart restart audioserver audio/aidl/default/android.hardware.audio.service-aidl.example.rc +2 −0 Original line number Diff line number Diff line Loading @@ -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) group audio camera drmrpc inet media mediadrm net_bt net_bt_admin net_bw_acct wakelock context_hub capabilities BLOCK_SUSPEND # setting RLIMIT_RTPRIO allows binder RT priority inheritance rlimit rtprio 10 10 ioprio rt 4 task_profiles ProcessCapacityHigh HighPerformance onrestart restart audioserver audio/aidl/default/main.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include "core-impl/Module.h" #include <android-base/logging.h> #include <android/binder_ibinder_platform.h> #include <android/binder_manager.h> #include <android/binder_process.h> Loading @@ -44,6 +45,8 @@ int main() { // Make the default 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"; status = AServiceManager_addService(moduleDefault->asBinder().get(), moduleDefaultName.c_str()); CHECK_EQ(STATUS_OK, status); Loading Loading
audio/aidl/default/EffectFactory.cpp +6 −1 Original line number Diff line number Diff line Loading @@ -15,10 +15,13 @@ */ #define LOG_TAG "AHAL_EffectFactory" #include <android-base/logging.h> #include <dlfcn.h> #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/EffectUUID.h" #include "effectFactory-impl/EffectFactory.h" Loading Loading @@ -109,6 +112,8 @@ ndk::ScopedAStatus Factory::createEffect(const AudioUuid& in_impl_uuid, return ndk::ScopedAStatus::fromExceptionCode(EX_TRANSACTION_FAILED); } *_aidl_return = effectSp; AIBinder_setMinSchedulerPolicy(effectSp->asBinder().get(), SCHED_NORMAL, ANDROID_PRIORITY_AUDIO); mEffectUuidMap[std::weak_ptr<IEffect>(effectSp)] = in_impl_uuid; LOG(DEBUG) << __func__ << ": instance " << effectSp.get() << " created successfully"; return ndk::ScopedAStatus::ok(); Loading
audio/aidl/default/Module.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #define LOG_TAG "AHAL_Module" #include <android-base/logging.h> #include <android/binder_ibinder_platform.h> #include <Utils.h> #include <aidl/android/media/audio/common/AudioInputFlags.h> Loading Loading @@ -307,6 +308,8 @@ ndk::ScopedAStatus Module::setModuleDebug( ndk::ScopedAStatus Module::getTelephony(std::shared_ptr<ITelephony>* _aidl_return) { if (mTelephony == nullptr) { mTelephony = ndk::SharedRefBase::make<Telephony>(); AIBinder_setMinSchedulerPolicy(mTelephony->asBinder().get(), SCHED_NORMAL, ANDROID_PRIORITY_AUDIO); } *_aidl_return = mTelephony; LOG(DEBUG) << __func__ << ": returning instance of ITelephony: " << _aidl_return->get(); Loading Loading @@ -525,6 +528,7 @@ ndk::ScopedAStatus Module::openInputStream(const OpenInputStreamArguments& in_ar if (auto status = stream->init(); !status.isOk()) { return status; } AIBinder_setMinSchedulerPolicy(stream->asBinder().get(), SCHED_NORMAL, ANDROID_PRIORITY_AUDIO); StreamWrapper streamWrapper(stream); auto patchIt = mPatches.find(in_args.portConfigId); if (patchIt != mPatches.end()) { Loading Loading @@ -575,6 +579,7 @@ ndk::ScopedAStatus Module::openOutputStream(const OpenOutputStreamArguments& in_ if (auto status = stream->init(); !status.isOk()) { return status; } AIBinder_setMinSchedulerPolicy(stream->asBinder().get(), SCHED_NORMAL, ANDROID_PRIORITY_AUDIO); StreamWrapper streamWrapper(stream); auto patchIt = mPatches.find(in_args.portConfigId); if (patchIt != mPatches.end()) { Loading
audio/aidl/default/android.hardware.audio.effect.service-aidl.example.rc +2 −0 Original line number Diff line number Diff line Loading @@ -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) group audio media capabilities BLOCK_SUSPEND # setting RLIMIT_RTPRIO allows binder RT priority inheritance rlimit rtprio 10 10 ioprio rt 4 task_profiles ProcessCapacityHigh HighPerformance onrestart restart audioserver
audio/aidl/default/android.hardware.audio.service-aidl.example.rc +2 −0 Original line number Diff line number Diff line Loading @@ -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) group audio camera drmrpc inet media mediadrm net_bt net_bt_admin net_bw_acct wakelock context_hub capabilities BLOCK_SUSPEND # setting RLIMIT_RTPRIO allows binder RT priority inheritance rlimit rtprio 10 10 ioprio rt 4 task_profiles ProcessCapacityHigh HighPerformance onrestart restart audioserver
audio/aidl/default/main.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include "core-impl/Module.h" #include <android-base/logging.h> #include <android/binder_ibinder_platform.h> #include <android/binder_manager.h> #include <android/binder_process.h> Loading @@ -44,6 +45,8 @@ int main() { // Make the default 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"; status = AServiceManager_addService(moduleDefault->asBinder().get(), moduleDefaultName.c_str()); CHECK_EQ(STATUS_OK, status); Loading