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

Commit eac8ea64 authored by Andy Hung's avatar Andy Hung Committed by Automerger Merge Worker
Browse files

AudioFlinger: Workaround for dumpsys stall am: e72ff02b am: 835bee5e

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/15584430

Change-Id: Ief91da8a721a5b3f611393aa322a276a090101cc
parents 182b58a8 835bee5e
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -465,6 +465,18 @@ status_t DeviceHalHidl::dump(int fd, const Vector<String16>& args) {
    argsFromHal(args, &hidlArgs);
    Return<void> ret = mDevice->debug(hidlHandle, hidlArgs);
    native_handle_delete(hidlHandle);

    // TODO(b/111997867, b/177271958)  Workaround - remove when fixed.
    // A Binder transmitted fd may not close immediately due to a race condition b/111997867
    // when the remote binder thread removes the last refcount to the fd blocks in the
    // kernel for binder activity. We send a Binder ping() command to unblock the thread
    // and complete the fd close / release.
    //
    // See DeviceHalHidl::dump(), EffectHalHidl::dump(), StreamHalHidl::dump(),
    //     EffectsFactoryHalHidl::dumpEffects().

    (void)mDevice->ping(); // synchronous Binder call

    return processReturn("dump", ret);
}

+12 −0
Original line number Diff line number Diff line
@@ -239,6 +239,18 @@ status_t EffectHalHidl::dump(int fd) {
    hidlHandle->data[0] = fd;
    Return<void> ret = mEffect->debug(hidlHandle, {} /* options */);
    native_handle_delete(hidlHandle);

    // TODO(b/111997867, b/177271958)  Workaround - remove when fixed.
    // A Binder transmitted fd may not close immediately due to a race condition b/111997867
    // when the remote binder thread removes the last refcount to the fd blocks in the
    // kernel for binder activity. We send a Binder ping() command to unblock the thread
    // and complete the fd close / release.
    //
    // See DeviceHalHidl::dump(), EffectHalHidl::dump(), StreamHalHidl::dump(),
    //     EffectsFactoryHalHidl::dumpEffects().

    (void)mEffect->ping(); // synchronous Binder call

    return ret.isOk() ? OK : FAILED_TRANSACTION;
}

+12 −0
Original line number Diff line number Diff line
@@ -180,6 +180,18 @@ status_t EffectsFactoryHalHidl::dumpEffects(int fd) {
    hidlHandle->data[0] = fd;
    Return<void> ret = mEffectsFactory->debug(hidlHandle, {} /* options */);
    native_handle_delete(hidlHandle);

    // TODO(b/111997867, b/177271958)  Workaround - remove when fixed.
    // A Binder transmitted fd may not close immediately due to a race condition b/111997867
    // when the remote binder thread removes the last refcount to the fd blocks in the
    // kernel for binder activity. We send a Binder ping() command to unblock the thread
    // and complete the fd close / release.
    //
    // See DeviceHalHidl::dump(), EffectHalHidl::dump(), StreamHalHidl::dump(),
    //     EffectsFactoryHalHidl::dumpEffects().

    (void)mEffectsFactory->ping(); // synchronous Binder call

    return processReturn(__FUNCTION__, ret);
}

+12 −0
Original line number Diff line number Diff line
@@ -160,6 +160,18 @@ status_t StreamHalHidl::dump(int fd, const Vector<String16>& args) {
    argsFromHal(args, &hidlArgs);
    Return<void> ret = mStream->debug(hidlHandle, hidlArgs);
    native_handle_delete(hidlHandle);

    // TODO(b/111997867, b/177271958)  Workaround - remove when fixed.
    // A Binder transmitted fd may not close immediately due to a race condition b/111997867
    // when the remote binder thread removes the last refcount to the fd blocks in the
    // kernel for binder activity. We send a Binder ping() command to unblock the thread
    // and complete the fd close / release.
    //
    // See DeviceHalHidl::dump(), EffectHalHidl::dump(), StreamHalHidl::dump(),
    //     EffectsFactoryHalHidl::dumpEffects().

    (void)mStream->ping(); // synchronous Binder call

    mStreamPowerLog.dump(fd);
    return processReturn("dump", ret);
}