Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0179b6a9 authored by Andy Hung's avatar Andy Hung Committed by Gerrit Code Review
Browse files

Merge changes I700b04d3,If56e449a

* changes:
  audio HAL: set minimum Binder access priority
  audio HAL: Enable RT priority inheritance
parents 11dcbb94 2d990244
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@ service vendor.audio-hal /vendor/bin/hw/android.hardware.audio.service
    # 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
+3 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
#include <algorithm>

#include <android/log.h>
#include <hidl/HidlTransportSupport.h>
#include <mediautils/MemoryLeakTrackUtil.h>
#include <memunreachable/memunreachable.h>

@@ -183,6 +184,7 @@ std::tuple<Result, sp<IStreamOut>> Device::openOutputStreamCore(int32_t ioHandle
    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);
@@ -220,6 +222,7 @@ std::tuple<Result, sp<IStreamIn>> Device::openInputStreamCore(
    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);
+3 −0
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@
#include <string.h>

#include <android/log.h>
#include <hidl/HidlTransportSupport.h>
#include <system/thread_defs.h>

namespace android {
namespace hardware {
@@ -103,6 +105,7 @@ Return<void> DevicesFactory::openDevice(const char* moduleName, Callback _hidl_c
    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;
+3 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@

#include <UuidUtils.h>
#include <android/log.h>
#include <hidl/HidlTransportSupport.h>
#include <media/EffectsFactoryApi.h>
#include <system/audio_effects/effect_aec.h>
#include <system/audio_effects/effect_agc.h>
@@ -44,6 +45,7 @@
#include <system/audio_effects/effect_presetreverb.h>
#include <system/audio_effects/effect_virtualizer.h>
#include <system/audio_effects/effect_visualizer.h>
#include <system/thread_defs.h>
#include <util/EffectUtils.h>

namespace android {
@@ -189,6 +191,7 @@ Return<void> EffectsFactory::createEffectImpl(const Uuid& uuid, int32_t session,
        status = (*handle)->get_descriptor(handle, &halDescriptor);
        if (status == OK) {
            effect = dispatchEffectInstanceCreation(halDescriptor, handle);
            android::hardware::setMinSchedulerPolicy(effect, SCHED_NORMAL, ANDROID_PRIORITY_AUDIO);
            effectId = EffectMap::getInstance().add(handle);
        } else {
            ALOGE("Error querying effect descriptor for %s: %s",