Loading services/audioflinger/MelReporter.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -111,7 +111,7 @@ void MelReporter::updateMetadataForCsd(audio_io_handle_t streamHandle, return; } audio_utils::lock_guard _laf(mAfMelReporterCallback->mutex()); audio_utils::lock_guard _laf(mAfMelReporterCallback->mutex()); // AudioFlinger_Mutex audio_utils::lock_guard _l(mutex()); auto activeMelPatchId = activePatchStreamHandle_l(streamHandle); if (!activeMelPatchId) { Loading Loading @@ -171,7 +171,7 @@ void MelReporter::onCreateAudioPatch(audio_patch_handle_t handle, } if (!newPatch.deviceHandles.empty()) { audio_utils::lock_guard _afl(mAfMelReporterCallback->mutex()); audio_utils::lock_guard _afl(mAfMelReporterCallback->mutex()); // AudioFlinger_Mutex audio_utils::lock_guard _l(mutex()); ALOGV("%s add patch handle %d to active devices", __func__, handle); startMelComputationForActivePatch_l(newPatch); Loading Loading @@ -226,7 +226,7 @@ void MelReporter::onReleaseAudioPatch(audio_patch_handle_t handle) { mActiveMelPatches.erase(patchIt); } audio_utils::lock_guard _afl(mAfMelReporterCallback->mutex()); audio_utils::lock_guard _afl(mAfMelReporterCallback->mutex()); // AudioFlinger_Mutex audio_utils::lock_guard _l(mutex()); stopMelComputationForPatch_l(melPatch); } Loading services/audioflinger/MelReporter.h +11 −6 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ public: * implementation, false otherwise. */ bool activateHalSoundDoseComputation(const std::string& module, const sp<DeviceHalInterface>& device); const sp<DeviceHalInterface>& device) EXCLUDES_MelReporter_Mutex; /** * Activates the MEL reporting from internal framework values. These are used Loading @@ -72,7 +72,7 @@ public: * Note: the internal CSD computation does not guarantee a certification with * IEC62368-1 3rd edition or EN50332-3 */ void activateInternalSoundDoseComputation(); void activateInternalSoundDoseComputation() EXCLUDES_MelReporter_Mutex; sp<media::ISoundDose> getSoundDoseInterface(const sp<media::ISoundDoseCallback>& callback); Loading @@ -80,8 +80,9 @@ public: // PatchCommandListener methods void onCreateAudioPatch(audio_patch_handle_t handle, const IAfPatchPanel::Patch& patch) final; void onReleaseAudioPatch(audio_patch_handle_t handle) final; const IAfPatchPanel::Patch& patch) final EXCLUDES_AudioFlinger_Mutex; void onReleaseAudioPatch(audio_patch_handle_t handle) final EXCLUDES_AudioFlinger_Mutex; /** * The new metadata can determine whether we should compute MEL for the given thread. Loading @@ -89,7 +90,9 @@ public: * Otherwise, this method will disable CSD. **/ void updateMetadataForCsd(audio_io_handle_t streamHandle, const std::vector<playback_track_metadata_v7_t>& metadataVec); const std::vector<playback_track_metadata_v7_t>& metadataVec) EXCLUDES_AudioFlinger_Mutex; private: struct ActiveMelPatch { audio_io_handle_t streamHandle{AUDIO_IO_HANDLE_NONE}; Loading @@ -101,7 +104,9 @@ private: bool shouldComputeMelForDeviceType(audio_devices_t device); void stopInternalMelComputation(); audio_utils::mutex& mutex() const { return mMutex; } audio_utils::mutex& mutex() const RETURN_CAPABILITY(audio_utils::MelReporter_Mutex) { return mMutex; } /** Should be called with the following order of locks: mAudioFlinger.mutex() -> mutex(). */ void stopMelComputationForPatch_l(const ActiveMelPatch& patch) REQUIRES(mutex()); Loading Loading
services/audioflinger/MelReporter.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -111,7 +111,7 @@ void MelReporter::updateMetadataForCsd(audio_io_handle_t streamHandle, return; } audio_utils::lock_guard _laf(mAfMelReporterCallback->mutex()); audio_utils::lock_guard _laf(mAfMelReporterCallback->mutex()); // AudioFlinger_Mutex audio_utils::lock_guard _l(mutex()); auto activeMelPatchId = activePatchStreamHandle_l(streamHandle); if (!activeMelPatchId) { Loading Loading @@ -171,7 +171,7 @@ void MelReporter::onCreateAudioPatch(audio_patch_handle_t handle, } if (!newPatch.deviceHandles.empty()) { audio_utils::lock_guard _afl(mAfMelReporterCallback->mutex()); audio_utils::lock_guard _afl(mAfMelReporterCallback->mutex()); // AudioFlinger_Mutex audio_utils::lock_guard _l(mutex()); ALOGV("%s add patch handle %d to active devices", __func__, handle); startMelComputationForActivePatch_l(newPatch); Loading Loading @@ -226,7 +226,7 @@ void MelReporter::onReleaseAudioPatch(audio_patch_handle_t handle) { mActiveMelPatches.erase(patchIt); } audio_utils::lock_guard _afl(mAfMelReporterCallback->mutex()); audio_utils::lock_guard _afl(mAfMelReporterCallback->mutex()); // AudioFlinger_Mutex audio_utils::lock_guard _l(mutex()); stopMelComputationForPatch_l(melPatch); } Loading
services/audioflinger/MelReporter.h +11 −6 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ public: * implementation, false otherwise. */ bool activateHalSoundDoseComputation(const std::string& module, const sp<DeviceHalInterface>& device); const sp<DeviceHalInterface>& device) EXCLUDES_MelReporter_Mutex; /** * Activates the MEL reporting from internal framework values. These are used Loading @@ -72,7 +72,7 @@ public: * Note: the internal CSD computation does not guarantee a certification with * IEC62368-1 3rd edition or EN50332-3 */ void activateInternalSoundDoseComputation(); void activateInternalSoundDoseComputation() EXCLUDES_MelReporter_Mutex; sp<media::ISoundDose> getSoundDoseInterface(const sp<media::ISoundDoseCallback>& callback); Loading @@ -80,8 +80,9 @@ public: // PatchCommandListener methods void onCreateAudioPatch(audio_patch_handle_t handle, const IAfPatchPanel::Patch& patch) final; void onReleaseAudioPatch(audio_patch_handle_t handle) final; const IAfPatchPanel::Patch& patch) final EXCLUDES_AudioFlinger_Mutex; void onReleaseAudioPatch(audio_patch_handle_t handle) final EXCLUDES_AudioFlinger_Mutex; /** * The new metadata can determine whether we should compute MEL for the given thread. Loading @@ -89,7 +90,9 @@ public: * Otherwise, this method will disable CSD. **/ void updateMetadataForCsd(audio_io_handle_t streamHandle, const std::vector<playback_track_metadata_v7_t>& metadataVec); const std::vector<playback_track_metadata_v7_t>& metadataVec) EXCLUDES_AudioFlinger_Mutex; private: struct ActiveMelPatch { audio_io_handle_t streamHandle{AUDIO_IO_HANDLE_NONE}; Loading @@ -101,7 +104,9 @@ private: bool shouldComputeMelForDeviceType(audio_devices_t device); void stopInternalMelComputation(); audio_utils::mutex& mutex() const { return mMutex; } audio_utils::mutex& mutex() const RETURN_CAPABILITY(audio_utils::MelReporter_Mutex) { return mMutex; } /** Should be called with the following order of locks: mAudioFlinger.mutex() -> mutex(). */ void stopMelComputationForPatch_l(const ActiveMelPatch& patch) REQUIRES(mutex()); Loading