Loading services/audioflinger/Effects.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -1378,6 +1378,11 @@ status_t EffectModule::setVolume(uint32_t* left, uint32_t* right, bool controlle status_t EffectModule::setVolumeInternal( uint32_t *left, uint32_t *right, bool controller) { if (mVolume.has_value() && *left == mVolume.value()[0] && *right == mVolume.value()[1]) { LOG_ALWAYS_FATAL_IF( !mReturnedVolume.has_value(), "The cached returned volume must not be null when the cached volume has value"); *left = mReturnedVolume.value()[0]; *right = mReturnedVolume.value()[1]; return NO_ERROR; } LOG_ALWAYS_FATAL_IF(mEffectInterface == nullptr, "%s", mEffectInterfaceDebug.c_str()); Loading @@ -1393,6 +1398,7 @@ status_t EffectModule::setVolumeInternal( mVolume = {*left, *right}; // Cache the value that has been set *left = volume[0]; *right = volume[1]; mReturnedVolume = {*left, *right}; } return status; } Loading services/audioflinger/Effects.h +4 −0 Original line number Diff line number Diff line Loading @@ -307,7 +307,11 @@ private: // this tid is allowed to call setVolume() without acquiring the mutex. pid_t mSetVolumeReentrantTid = INVALID_PID; // Cache the volume that has been set successfully. std::optional<std::vector<uint32_t>> mVolume; // Cache the volume that returned from the effect when setting volume successfully. The value // here is used to indicate the volume to apply before this effect. std::optional<std::vector<uint32_t>> mReturnedVolume; // TODO: b/315995877, remove this debugging string after root cause std::string mEffectInterfaceDebug; }; Loading Loading
services/audioflinger/Effects.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -1378,6 +1378,11 @@ status_t EffectModule::setVolume(uint32_t* left, uint32_t* right, bool controlle status_t EffectModule::setVolumeInternal( uint32_t *left, uint32_t *right, bool controller) { if (mVolume.has_value() && *left == mVolume.value()[0] && *right == mVolume.value()[1]) { LOG_ALWAYS_FATAL_IF( !mReturnedVolume.has_value(), "The cached returned volume must not be null when the cached volume has value"); *left = mReturnedVolume.value()[0]; *right = mReturnedVolume.value()[1]; return NO_ERROR; } LOG_ALWAYS_FATAL_IF(mEffectInterface == nullptr, "%s", mEffectInterfaceDebug.c_str()); Loading @@ -1393,6 +1398,7 @@ status_t EffectModule::setVolumeInternal( mVolume = {*left, *right}; // Cache the value that has been set *left = volume[0]; *right = volume[1]; mReturnedVolume = {*left, *right}; } return status; } Loading
services/audioflinger/Effects.h +4 −0 Original line number Diff line number Diff line Loading @@ -307,7 +307,11 @@ private: // this tid is allowed to call setVolume() without acquiring the mutex. pid_t mSetVolumeReentrantTid = INVALID_PID; // Cache the volume that has been set successfully. std::optional<std::vector<uint32_t>> mVolume; // Cache the volume that returned from the effect when setting volume successfully. The value // here is used to indicate the volume to apply before this effect. std::optional<std::vector<uint32_t>> mReturnedVolume; // TODO: b/315995877, remove this debugging string after root cause std::string mEffectInterfaceDebug; }; Loading