diff options
author | Merov Linden <merov@lindenlab.com> | 2013-06-19 14:06:06 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2013-06-19 14:06:06 -0700 |
commit | 7da4c651911743707c0cc7cd4bebdcefb52eb379 (patch) | |
tree | 6f99d83a2b2bf3de810dd5a1191a47f7cc53ac9d /indra/llaudio | |
parent | f1e594feceb8ab284e023e164d5410cd53a656cb (diff) | |
parent | 2655c7a17ae38a073dcf8f05b0127b68edc34c95 (diff) |
Pull merge from lindenlab/viewer-release
Diffstat (limited to 'indra/llaudio')
-rw-r--r-- | indra/llaudio/llaudioengine_fmodex.cpp | 30 | ||||
-rwxr-xr-x | indra/llaudio/llwindgen.h | 8 |
2 files changed, 24 insertions, 14 deletions
diff --git a/indra/llaudio/llaudioengine_fmodex.cpp b/indra/llaudio/llaudioengine_fmodex.cpp index 45fc3186f4..e9b74b8f41 100644 --- a/indra/llaudio/llaudioengine_fmodex.cpp +++ b/indra/llaudio/llaudioengine_fmodex.cpp @@ -67,7 +67,7 @@ inline bool Check_FMOD_Error(FMOD_RESULT result, const char *string) { if(result == FMOD_OK) return false; - llwarns << string << " Error: " << FMOD_ErrorString(result) << llendl; + lldebugs << string << " Error: " << FMOD_ErrorString(result) << llendl; return true; } @@ -258,19 +258,29 @@ bool LLAudioEngine_FMODEX::init(const S32 num_channels, void* userdata) int r_numbuffers, r_samplerate, r_channels, r_bits; unsigned int r_bufferlength; - char r_name[256]; mSystem->getDSPBufferSize(&r_bufferlength, &r_numbuffers); + LL_INFOS("AppInit") << "LLAudioEngine_FMODEX::init(): r_bufferlength=" << r_bufferlength << " bytes" << LL_ENDL; + LL_INFOS("AppInit") << "LLAudioEngine_FMODEX::init(): r_numbuffers=" << r_numbuffers << LL_ENDL; + mSystem->getSoftwareFormat(&r_samplerate, NULL, &r_channels, NULL, NULL, &r_bits); - mSystem->getDriverInfo(0, r_name, 255, 0); - r_name[255] = '\0'; - int latency = (int)(1000.0f * r_bufferlength * r_numbuffers / r_samplerate); + LL_INFOS("AppInit") << "LLAudioEngine_FMODEX::init(): r_samplerate=" << r_samplerate << "Hz" << LL_ENDL; + LL_INFOS("AppInit") << "LLAudioEngine_FMODEX::init(): r_channels=" << r_channels << LL_ENDL; + LL_INFOS("AppInit") << "LLAudioEngine_FMODEX::init(): r_bits =" << r_bits << LL_ENDL; + + char r_name[512]; + mSystem->getDriverInfo(0, r_name, 511, 0); + r_name[511] = '\0'; + LL_INFOS("AppInit") << "LLAudioEngine_FMODEX::init(): r_name=\"" << r_name << "\"" << LL_ENDL; - LL_INFOS("AppInit") << "FMOD device: "<< r_name << "\n" - << "FMOD Ex parameters: " << r_samplerate << " Hz * " << r_channels << " * " <<r_bits <<" bit\n" - << "\tbuffer " << r_bufferlength << " * " << r_numbuffers << " (" << latency <<"ms)" << LL_ENDL; + int latency = 100; // optimistic default - i suspect if sample rate is 0, everything breaks. + if ( r_samplerate != 0 ) + latency = (int)(1000.0f * r_bufferlength * r_numbuffers / r_samplerate); + LL_INFOS("AppInit") << "LLAudioEngine_FMODEX::init(): latency=" << latency << "ms" << LL_ENDL; mInited = true; + LL_INFOS("AppInit") << "LLAudioEngine_FMODEX::init(): initialization complete." << LL_ENDL; + return true; } @@ -310,8 +320,8 @@ void LLAudioEngine_FMODEX::shutdown() llinfos << "LLAudioEngine_FMODEX::shutdown() closing FMOD Ex" << llendl; if ( mSystem ) // speculative fix for MAINT-2657 { - mSystem->close(); - mSystem->release(); + mSystem->close(); + mSystem->release(); } llinfos << "LLAudioEngine_FMODEX::shutdown() done closing FMOD Ex" << llendl; diff --git a/indra/llaudio/llwindgen.h b/indra/llaudio/llwindgen.h index 719b0ecbf2..ec58f76f5f 100755 --- a/indra/llaudio/llwindgen.h +++ b/indra/llaudio/llwindgen.h @@ -57,7 +57,7 @@ public: const U32 getInputSamplingRate() { return mInputSamplingRate; } const F32 getNextSample(); const F32 getClampedSample(bool clamp, F32 sample); - + // newbuffer = the buffer passed from the previous DSP unit. // numsamples = length in samples-per-channel at this mix time. // NOTE: generates L/R interleaved stereo @@ -133,11 +133,11 @@ public: MIXBUFFERFORMAT_T sample_left = (MIXBUFFERFORMAT_T)getClampedSample(clip, mLastSample - (F32)sample_right); *cursamplep = sample_left; - ++cursamplep; + ++cursamplep; *cursamplep = sample_right; - ++cursamplep; + ++cursamplep; + } } - } return newbuffer; } |