diff options
author | Vadim Savchuk <vsavchuk@productengine.com> | 2010-09-21 19:11:40 +0300 |
---|---|---|
committer | Vadim Savchuk <vsavchuk@productengine.com> | 2010-09-21 19:11:40 +0300 |
commit | 5b2d4a169830c10dd5bfc4c72ddd94ef80e658d3 (patch) | |
tree | 781b636c27126019ab9f6a005495f51af9434094 /indra/llaudio/llaudioengine.h | |
parent | 5304ad274636a07b764264cb6797c72705629fc3 (diff) |
STORM-163 FIXED Intermittent FPS drop related to "audio" (main thread hangs often on openal lock)
Submitting a patch made by Aleric Inglewood (See VWR-14914).
This bug happens for a lot of people, although it might be needed to have a fast multi core machine.
I have seen it on 1.22.10 once, never used 1.23 sorry, and saw it often on snowglobe. I am sure
it also affects 1.23 but I'd have to test that.
The symptons are that on a viewer with normally a good, high FPS, sometimes it happens
that the FPS dramatically drops (as low as 0.3, but it can also be anything higher, as high
as 10, say).
This particular jira is about a problem where the main thread is slowed down by a mutex lock
in libopenal (most calls starting with 'al' in indra/llaudio/audioengine_openal.cpp and
one in indra/llaudio/listener_openal.cpp). You can see that this is the case by opening the
Frame Console (control-shift-2) and checking that the "audio" (and possibly misc) timings
are very large compared to the Render time.
Diffstat (limited to 'indra/llaudio/llaudioengine.h')
-rw-r--r-- | indra/llaudio/llaudioengine.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/indra/llaudio/llaudioengine.h b/indra/llaudio/llaudioengine.h index 6a5000d7ed..30d2490635 100644 --- a/indra/llaudio/llaudioengine.h +++ b/indra/llaudio/llaudioengine.h @@ -118,8 +118,8 @@ public: // Use these for temporarily muting the audio system. // Does not change buffers, initialization, etc. but // stops playing new sounds. - virtual void setMuted(bool muted); - virtual bool getMuted() const { return mMuted; } + void setMuted(bool muted); + bool getMuted() const { return mMuted; } #ifdef USE_PLUGIN_MEDIA LLPluginClassMedia* initializeMedia(const std::string& media_type); #endif @@ -239,6 +239,7 @@ protected: LLAudioBuffer *mBuffers[MAX_BUFFERS]; F32 mMasterGain; + F32 mInternalGain; // Actual gain set; either mMasterGain or 0 when mMuted is true. F32 mSecondaryGain[AUDIO_TYPE_COUNT]; F32 mNextWindUpdate; @@ -303,7 +304,8 @@ public: virtual void setGain(const F32 gain) { mGain = llclamp(gain, 0.f, 1.f); } const LLUUID &getID() const { return mID; } - bool isDone(); + bool isDone() const; + bool isMuted() const { return mSourceMuted; } LLAudioData *getCurrentData(); LLAudioData *getQueuedData(); @@ -325,6 +327,7 @@ protected: LLUUID mOwnerID; // owner of the object playing the sound F32 mPriority; F32 mGain; + bool mSourceMuted; bool mAmbient; bool mLoop; bool mSyncMaster; |