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

Unverified Commit a25ba038 authored by Michael Bestas's avatar Michael Bestas
Browse files

Merge tag 'android-14.0.0_r53' into staging/lineage-21.0_merge-android-14.0.0_r53

Android 14.0.0 release 53

# -----BEGIN PGP SIGNATURE-----
#
# iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCZoRX5AAKCRDorT+BmrEO
# eNR7AJ9OYw98BR56xmj+/g+I2FaFXV7Y8wCeNzZgGC9fLTrIqN6wlj5Y2du0EKk=
# =S3zm
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue Jul  2 22:41:24 2024 EEST
# gpg:                using DSA key 4340D13570EF945E83810964E8AD3F819AB10E78
# gpg: Good signature from "The Android Open Source Project <initial-contribution@android.com>" [marginal]
# gpg: initial-contribution@android.com: Verified 2553 signatures in the past
#      2 years.  Encrypted 4 messages in the past 2 years.
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 4340 D135 70EF 945E 8381  0964 E8AD 3F81 9AB1 0E78

# By Shunkai Yao
# Via Android Build Coastguard Worker
* tag 'android-14.0.0_r53':
  Use customized event flag for data FMQ not_empty to avoid conflict

Change-Id: If03a78f631b1e020651f6c79d19e196bf8ddbd80
parents 0d0d2758 abc118d1
Loading
Loading
Loading
Loading
+17 −4
Original line number Diff line number Diff line
@@ -57,7 +57,9 @@ using ::aidl::android::hardware::audio::effect::CommandId;
using ::aidl::android::hardware::audio::effect::Descriptor;
using ::aidl::android::hardware::audio::effect::IEffect;
using ::aidl::android::hardware::audio::effect::IFactory;
using ::aidl::android::hardware::audio::effect::kEventFlagDataMqNotEmpty;
using ::aidl::android::hardware::audio::effect::kEventFlagDataMqUpdate;
using ::aidl::android::hardware::audio::effect::kEventFlagNotEmpty;
using ::aidl::android::hardware::audio::effect::kReopenSupportedVersion;
using ::aidl::android::hardware::audio::effect::State;

@@ -199,6 +201,7 @@ status_t EffectHalAidl::process() {
                              efState & kEventFlagDataMqUpdate) {
        ALOGI("%s %s V%d receive dataMQUpdate eventFlag from HAL", __func__, effectName.c_str(),
              halVersion);

        mConversion->reopen();
    }
    auto statusQ = mConversion->getStatusMQ();
@@ -224,12 +227,22 @@ status_t EffectHalAidl::process() {
              floatsToWrite, mInBuffer->audioBuffer(), inputQ->availableToWrite());
        return INVALID_OPERATION;
    }
    efGroup->wake(aidl::android::hardware::audio::effect::kEventFlagNotEmpty);

    // for V2 audio effect HAL, expect different EventFlag to avoid bit conflict with FMQ_NOT_EMPTY
    efGroup->wake(halVersion >= kReopenSupportedVersion ? kEventFlagDataMqNotEmpty
                                                        : kEventFlagNotEmpty);

    IEffect::Status retStatus{};
    if (!statusQ->readBlocking(&retStatus, 1) || retStatus.status != OK ||
        (size_t)retStatus.fmqConsumed != floatsToWrite || retStatus.fmqProduced == 0) {
        ALOGE("%s read status failed: %s", __func__, retStatus.toString().c_str());
    if (!statusQ->readBlocking(&retStatus, 1)) {
        ALOGE("%s %s V%d read status from status FMQ failed", __func__, effectName.c_str(),
              halVersion);
        return INVALID_OPERATION;
    }
    if (retStatus.status != OK || (size_t)retStatus.fmqConsumed != floatsToWrite ||
        retStatus.fmqProduced == 0) {
        ALOGE("%s read status failed: %s, consumed %d (of %zu) produced %d", __func__,
              retStatus.toString().c_str(), retStatus.fmqConsumed, floatsToWrite,
              retStatus.fmqProduced);
        return INVALID_OPERATION;
    }

+4 −1
Original line number Diff line number Diff line
@@ -176,7 +176,10 @@ void DownmixImpl::process() {
     * in the life cycle of workerThread (threadLoop).
     */
    uint32_t efState = 0;
    if (!mEventFlag || ::android::OK != mEventFlag->wait(kEventFlagNotEmpty, &efState)) {
    if (!mEventFlag ||
        ::android::OK != mEventFlag->wait(mDataMqNotEmptyEf, &efState, 0 /* no timeout */,
                                          true /* retry */) ||
        !(efState & mDataMqNotEmptyEf)) {
        LOG(ERROR) << getEffectName() << __func__ << ": StatusEventFlag invalid";
    }

+6 −4
Original line number Diff line number Diff line
@@ -215,11 +215,12 @@ ndk::ScopedAStatus DynamicsProcessingImpl::open(const Parameter::Common& common,
    RETURN_OK_IF(mState != State::INIT);
    mImplContext = createContext(common);
    RETURN_IF(!mContext || !mImplContext, EX_NULL_POINTER, "createContextFailed");
    int version = 0;
    RETURN_IF(!getInterfaceVersion(&version).isOk(), EX_UNSUPPORTED_OPERATION,
    RETURN_IF(!getInterfaceVersion(&mVersion).isOk(), EX_UNSUPPORTED_OPERATION,
              "FailedToGetInterfaceVersion");
    mImplContext->setVersion(version);
    mEventFlag = mImplContext->getStatusEventFlag();
    mDataMqNotEmptyEf =
            mVersion >= kReopenSupportedVersion ? kEventFlagDataMqNotEmpty : kEventFlagNotEmpty;

    if (specific.has_value()) {
        RETURN_IF_ASTATUS_NOT_OK(setParameterSpecific(specific.value()), "setSpecParamErr");
@@ -233,8 +234,9 @@ ndk::ScopedAStatus DynamicsProcessingImpl::open(const Parameter::Common& common,

    mState = State::IDLE;
    mContext->dupeFmq(ret);
    RETURN_IF(createThread(getEffectName()) != RetCode::SUCCESS, EX_UNSUPPORTED_OPERATION,
              "FailedToCreateWorker");
    RETURN_IF(createThread(getEffectNameWithVersion()) != RetCode::SUCCESS,
              EX_UNSUPPORTED_OPERATION, "FailedToCreateWorker");
    LOG(INFO) << getEffectNameWithVersion() << __func__;
    return ndk::ScopedAStatus::ok();
}