From 993ac3b95ca79312b3309a2d539b19fe6f89c318 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 26 Nov 2021 22:56:20 +0200 Subject: SL-16339 Rename setAmbient to not cause confusion setAmbient has nothing to do with ambient sounds --- indra/llaudio/llaudioengine.cpp | 7 ++++--- indra/llaudio/llaudioengine.h | 6 +++--- indra/llaudio/llaudioengine_fmodstudio.cpp | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) (limited to 'indra/llaudio') diff --git a/indra/llaudio/llaudioengine.cpp b/indra/llaudio/llaudioengine.cpp index 1d447f32ae..8089d8cb8f 100644 --- a/indra/llaudio/llaudioengine.cpp +++ b/indra/llaudio/llaudioengine.cpp @@ -831,7 +831,8 @@ void LLAudioEngine::triggerSound(const LLUUID &audio_uuid, const LLUUID& owner_i addAudioSource(asp); if (pos_global.isExactlyZero()) { - asp->setAmbient(true); + // For sound preview and UI + asp->setForcedPriority(true); } else { @@ -1278,7 +1279,7 @@ LLAudioSource::LLAudioSource(const LLUUID& id, const LLUUID& owner_id, const F32 mPriority(0.f), mGain(gain), mSourceMuted(false), - mAmbient(false), + mForcedPriority(false), mLoop(false), mSyncMaster(false), mSyncSlave(false), @@ -1344,7 +1345,7 @@ void LLAudioSource::update() void LLAudioSource::updatePriority() { - if (isAmbient()) + if (isForcedPriority()) { mPriority = 1.f; } diff --git a/indra/llaudio/llaudioengine.h b/indra/llaudio/llaudioengine.h index 97674f15f7..bba4492daa 100644 --- a/indra/llaudio/llaudioengine.h +++ b/indra/llaudio/llaudioengine.h @@ -277,8 +277,8 @@ public: void addAudioData(LLAudioData *adp, bool set_current = TRUE); - void setAmbient(const bool ambient) { mAmbient = ambient; } - bool isAmbient() const { return mAmbient; } + void setForcedPriority(const bool ambient) { mForcedPriority = ambient; } + bool isForcedPriority() const { return mForcedPriority; } void setLoop(const bool loop) { mLoop = loop; } bool isLoop() const { return mLoop; } @@ -331,7 +331,7 @@ protected: F32 mPriority; F32 mGain; bool mSourceMuted; - bool mAmbient; + bool mForcedPriority; // ignore mute, set high priority, researved for sound preview and UI bool mLoop; bool mSyncMaster; bool mSyncSlave; diff --git a/indra/llaudio/llaudioengine_fmodstudio.cpp b/indra/llaudio/llaudioengine_fmodstudio.cpp index 70b3a08473..5450577134 100644 --- a/indra/llaudio/llaudioengine_fmodstudio.cpp +++ b/indra/llaudio/llaudioengine_fmodstudio.cpp @@ -519,9 +519,9 @@ void LLAudioChannelFMODSTUDIO::update3DPosition() return; } - if (mCurrentSourcep->isAmbient()) + if (mCurrentSourcep->isForcedPriority()) { - // Ambient sound, don't need to do any positional updates. + // Prioritized UI and preview sounds don't need to do any positional updates. set3DMode(false); } else -- cgit v1.3 From 59ceaf556960cec87edbcf93a00a77f54c0e9a1a Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 27 Nov 2021 18:28:23 +0200 Subject: SL-16339 Rename setAmbient in openal --- indra/llaudio/llaudioengine_openal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llaudio') diff --git a/indra/llaudio/llaudioengine_openal.cpp b/indra/llaudio/llaudioengine_openal.cpp index 3bdd0302ee..305aa1ecb5 100644 --- a/indra/llaudio/llaudioengine_openal.cpp +++ b/indra/llaudio/llaudioengine_openal.cpp @@ -297,7 +297,7 @@ void LLAudioChannelOpenAL::update3DPosition() { return; } - if (mCurrentSourcep->isAmbient()) + if (mCurrentSourcep->isForcedPriority()) { alSource3f(mALSource, AL_POSITION, 0.0, 0.0, 0.0); alSource3f(mALSource, AL_VELOCITY, 0.0, 0.0, 0.0); -- cgit v1.3 From 2f78338aeb3d0297813bc9c9c7a9d75a2055000d Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 11 Jun 2020 15:25:35 +0300 Subject: Debug Fmod with logging --- indra/cmake/Copy3rdPartyLibs.cmake | 6 +++--- indra/cmake/FMODSTUDIO.cmake | 6 +++--- indra/llaudio/llaudioengine_fmodstudio.cpp | 8 ++++++++ indra/llaudio/llstreamingaudio_fmodstudio.cpp | 1 + indra/newview/CMakeLists.txt | 4 ++-- 5 files changed, 17 insertions(+), 8 deletions(-) (limited to 'indra/llaudio') diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index b20d23cead..a8ad51fb11 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -87,7 +87,7 @@ if(WINDOWS) if (FMODSTUDIO) set(debug_files ${debug_files} fmodL.dll) - set(release_files ${release_files} fmod.dll) + set(release_files ${release_files} fmodL.dll) endif (FMODSTUDIO) if (OPENAL) @@ -179,7 +179,7 @@ elseif(DARWIN) if (FMODSTUDIO) set(debug_files ${debug_files} libfmodL.dylib) - set(release_files ${release_files} libfmod.dylib) + set(release_files ${release_files} libfmodL.dylib) endif (FMODSTUDIO) elseif(LINUX) @@ -229,7 +229,7 @@ elseif(LINUX) if (FMODSTUDIO) set(debug_files ${debug_files} "libfmodL.so") - set(release_files ${release_files} "libfmod.so") + set(release_files ${release_files} "libfmodL.so") endif (FMODSTUDIO) else(WINDOWS) diff --git a/indra/cmake/FMODSTUDIO.cmake b/indra/cmake/FMODSTUDIO.cmake index 8840354ac6..a58bdf7ef3 100644 --- a/indra/cmake/FMODSTUDIO.cmake +++ b/indra/cmake/FMODSTUDIO.cmake @@ -20,16 +20,16 @@ if (FMODSTUDIO) if (WINDOWS) set(FMODSTUDIO_LIBRARY debug fmodL_vc - optimized fmod_vc) + optimized fmodL_vc) elseif (DARWIN) #despite files being called libfmod.dylib, we are searching for fmod set(FMODSTUDIO_LIBRARY debug fmodL - optimized fmod) + optimized fmodL) elseif (LINUX) set(FMODSTUDIO_LIBRARY debug fmodL - optimized fmod) + optimized fmodL) endif (WINDOWS) set(FMODSTUDIO_LIBRARIES ${FMODSTUDIO_LIBRARY}) set(FMODSTUDIO_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/fmodstudio) diff --git a/indra/llaudio/llaudioengine_fmodstudio.cpp b/indra/llaudio/llaudioengine_fmodstudio.cpp index 5450577134..e9d0fbd6d8 100644 --- a/indra/llaudio/llaudioengine_fmodstudio.cpp +++ b/indra/llaudio/llaudioengine_fmodstudio.cpp @@ -97,6 +97,14 @@ bool LLAudioEngine_FMODSTUDIO::init(const S32 num_channels, void* userdata, cons << " expected:" << FMOD_VERSION << LL_ENDL; } + Check_FMOD_Error(result, "FMOD::System::getVersion"); + std::string logfile = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "fmod.log"); + result = FMOD::Debug_Initialize(FMOD_DEBUG_LEVEL_LOG, FMOD_DEBUG_MODE_FILE, 0, logfile.c_str()); + if (Check_FMOD_Error(result, "FMOD::System_Create")) + { + LL_WARNS() << "Failed to init logging" << LL_ENDL; + } + // In this case, all sounds, PLUS wind and stream will be software. result = mSystem->setSoftwareChannels(num_channels + 2); Check_FMOD_Error(result, "FMOD::System::setSoftwareChannels"); diff --git a/indra/llaudio/llstreamingaudio_fmodstudio.cpp b/indra/llaudio/llstreamingaudio_fmodstudio.cpp index 08d19209aa..d6fedb2952 100644 --- a/indra/llaudio/llstreamingaudio_fmodstudio.cpp +++ b/indra/llaudio/llstreamingaudio_fmodstudio.cpp @@ -157,6 +157,7 @@ void LLStreamingAudio_FMODSTUDIO::update() } else if (open_state == FMOD_OPENSTATE_ERROR) { + LL_INFOS() << "getOpenState returned FMOD_OPENSTATE_ERROR" << LL_ENDL; stop(); return; } diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 5a06106de3..4e687d15c8 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1870,8 +1870,8 @@ if (WINDOWS) if (FMODSTUDIO) list(APPEND COPY_INPUT_DEPENDENCIES - ${SHARED_LIB_STAGING_DIR}/Release/fmod.dll - ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/fmod.dll + ${SHARED_LIB_STAGING_DIR}/Release/fmodL.dll + ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/fmodL.dll ${SHARED_LIB_STAGING_DIR}/Debug/fmodL.dll ) endif (FMODSTUDIO) -- cgit v1.3 From be820f2eb90519ac0fa8d13be9dc5a798e8bfc7f Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 14 Mar 2022 18:21:16 +0200 Subject: Revert "Debug Fmod with logging" This reverts commits b21c17eee973dc06c1392dd45dbc19c1ce394852 and 2f78338aeb3d0297813bc9c9c7a9d75a2055000d. 'Debug Fmod' was not an intended commit, was meant for local testing. But might be a good idea to make this a part of DebWithRelInfo or provide a cmake switch. --- indra/cmake/Copy3rdPartyLibs.cmake | 6 +++--- indra/cmake/FMODSTUDIO.cmake | 6 +++--- indra/llaudio/llaudioengine_fmodstudio.cpp | 8 -------- indra/newview/CMakeLists.txt | 4 ++-- indra/newview/viewer_manifest.py | 10 +++++----- 5 files changed, 13 insertions(+), 21 deletions(-) (limited to 'indra/llaudio') diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index a8ad51fb11..b20d23cead 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -87,7 +87,7 @@ if(WINDOWS) if (FMODSTUDIO) set(debug_files ${debug_files} fmodL.dll) - set(release_files ${release_files} fmodL.dll) + set(release_files ${release_files} fmod.dll) endif (FMODSTUDIO) if (OPENAL) @@ -179,7 +179,7 @@ elseif(DARWIN) if (FMODSTUDIO) set(debug_files ${debug_files} libfmodL.dylib) - set(release_files ${release_files} libfmodL.dylib) + set(release_files ${release_files} libfmod.dylib) endif (FMODSTUDIO) elseif(LINUX) @@ -229,7 +229,7 @@ elseif(LINUX) if (FMODSTUDIO) set(debug_files ${debug_files} "libfmodL.so") - set(release_files ${release_files} "libfmodL.so") + set(release_files ${release_files} "libfmod.so") endif (FMODSTUDIO) else(WINDOWS) diff --git a/indra/cmake/FMODSTUDIO.cmake b/indra/cmake/FMODSTUDIO.cmake index a58bdf7ef3..8840354ac6 100644 --- a/indra/cmake/FMODSTUDIO.cmake +++ b/indra/cmake/FMODSTUDIO.cmake @@ -20,16 +20,16 @@ if (FMODSTUDIO) if (WINDOWS) set(FMODSTUDIO_LIBRARY debug fmodL_vc - optimized fmodL_vc) + optimized fmod_vc) elseif (DARWIN) #despite files being called libfmod.dylib, we are searching for fmod set(FMODSTUDIO_LIBRARY debug fmodL - optimized fmodL) + optimized fmod) elseif (LINUX) set(FMODSTUDIO_LIBRARY debug fmodL - optimized fmodL) + optimized fmod) endif (WINDOWS) set(FMODSTUDIO_LIBRARIES ${FMODSTUDIO_LIBRARY}) set(FMODSTUDIO_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/fmodstudio) diff --git a/indra/llaudio/llaudioengine_fmodstudio.cpp b/indra/llaudio/llaudioengine_fmodstudio.cpp index 72d7577ab2..e5752d3dad 100644 --- a/indra/llaudio/llaudioengine_fmodstudio.cpp +++ b/indra/llaudio/llaudioengine_fmodstudio.cpp @@ -97,14 +97,6 @@ bool LLAudioEngine_FMODSTUDIO::init(const S32 num_channels, void* userdata, cons << " expected:" << FMOD_VERSION << LL_ENDL; } - Check_FMOD_Error(result, "FMOD::System::getVersion"); - std::string logfile = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "fmod.log"); - result = FMOD::Debug_Initialize(FMOD_DEBUG_LEVEL_LOG, FMOD_DEBUG_MODE_FILE, 0, logfile.c_str()); - if (Check_FMOD_Error(result, "FMOD::System_Create")) - { - LL_WARNS() << "Failed to init logging" << LL_ENDL; - } - // In this case, all sounds, PLUS wind and stream will be software. result = mSystem->setSoftwareChannels(num_channels + 2); Check_FMOD_Error(result, "FMOD::System::setSoftwareChannels"); diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index c19be1d2ec..43aea78775 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1874,8 +1874,8 @@ if (WINDOWS) if (FMODSTUDIO) list(APPEND COPY_INPUT_DEPENDENCIES - ${SHARED_LIB_STAGING_DIR}/Release/fmodL.dll - ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/fmodL.dll + ${SHARED_LIB_STAGING_DIR}/Release/fmod.dll + ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/fmod.dll ${SHARED_LIB_STAGING_DIR}/Debug/fmodL.dll ) endif (FMODSTUDIO) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 527d3941b0..7855a62c87 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -517,7 +517,7 @@ class WindowsManifest(ViewerManifest): if(self.args['configuration'].lower() == 'debug'): self.path("fmodL.dll") else: - self.path("fmodL.dll") + self.path("fmod.dll") if self.args['openal'] == 'ON': # Get openal dll @@ -1051,7 +1051,7 @@ class DarwinManifest(ViewerManifest): dylibs += path_optional(os.path.join(debpkgdir, libfile), libfile) else: for libfile in ( - "libfmodL.dylib", + "libfmod.dylib", ): dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) @@ -1545,9 +1545,9 @@ class Linux_i686_Manifest(LinuxManifest): if self.args['fmodstudio'] == 'ON': try: - self.path("libfmodL.so.11.7") - self.path("libfmodL.so.11") - self.path("libfmodL.so") + self.path("libfmod.so.11.7") + self.path("libfmod.so.11") + self.path("libfmod.so") pass except: print("Skipping libfmod.so - not found") -- cgit v1.3 From 478c1e47bef0d316bd9ecaff6563fb9ad1a21c3e Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 4 Apr 2022 22:43:55 +0300 Subject: SL-16902 Fmod better logging --- indra/llaudio/llstreamingaudio_fmodstudio.cpp | 31 ++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'indra/llaudio') diff --git a/indra/llaudio/llstreamingaudio_fmodstudio.cpp b/indra/llaudio/llstreamingaudio_fmodstudio.cpp index 1ad29a3f59..7d176e7582 100644 --- a/indra/llaudio/llstreamingaudio_fmodstudio.cpp +++ b/indra/llaudio/llstreamingaudio_fmodstudio.cpp @@ -70,7 +70,11 @@ mRetryCount(0) // Must be larger than the usual Second Life frame stutter time. const U32 buffer_seconds = 10; //sec const U32 estimated_bitrate = 128; //kbit/sec - mSystem->setStreamBufferSize(estimated_bitrate * buffer_seconds * 128/*bytes/kbit*/, FMOD_TIMEUNIT_RAWBYTES); + FMOD_RESULT result = mSystem->setStreamBufferSize(estimated_bitrate * buffer_seconds * 128/*bytes/kbit*/, FMOD_TIMEUNIT_RAWBYTES); + if (result != FMOD_OK) + { + LL_WARNS("FMOD") << "setStreamBufferSize error: " << FMOD_ErrorString(result) << LL_ENDL; + } // Here's where we set the size of the network buffer and some buffering // parameters. In this case we want a network buffer of 16k, we want it @@ -404,7 +408,11 @@ FMOD::Channel *LLAudioStreamManagerFMODSTUDIO::startStream() if (mStreamChannel) return mStreamChannel; //Already have a channel for this stream. - mSystem->playSound(mInternetStream, NULL, true, &mStreamChannel); + FMOD_RESULT result = mSystem->playSound(mInternetStream, NULL, true, &mStreamChannel); + if (result != FMOD_OK) + { + LL_WARNS("FMOD") << FMOD_ErrorString(result) << LL_ENDL; + } return mStreamChannel; } @@ -445,16 +453,29 @@ bool LLAudioStreamManagerFMODSTUDIO::stopStream() FMOD_OPENSTATE LLAudioStreamManagerFMODSTUDIO::getOpenState(unsigned int* percentbuffered, bool* starving, bool* diskbusy) { FMOD_OPENSTATE state; - mInternetStream->getOpenState(&state, percentbuffered, starving, diskbusy); + FMOD_RESULT result = mInternetStream->getOpenState(&state, percentbuffered, starving, diskbusy); + if (result != FMOD_OK) + { + LL_WARNS("FMOD") << FMOD_ErrorString(result) << LL_ENDL; + } return state; } void LLStreamingAudio_FMODSTUDIO::setBufferSizes(U32 streambuffertime, U32 decodebuffertime) { - mSystem->setStreamBufferSize(streambuffertime / 1000 * 128 * 128, FMOD_TIMEUNIT_RAWBYTES); + FMOD_RESULT result = mSystem->setStreamBufferSize(streambuffertime / 1000 * 128 * 128, FMOD_TIMEUNIT_RAWBYTES); + if (result != FMOD_OK) + { + LL_WARNS("FMOD") << "setStreamBufferSize error: " << FMOD_ErrorString(result) << LL_ENDL; + return; + } FMOD_ADVANCEDSETTINGS settings; memset(&settings, 0, sizeof(settings)); settings.cbSize = sizeof(settings); settings.defaultDecodeBufferSize = decodebuffertime;//ms - mSystem->setAdvancedSettings(&settings); + result = mSystem->setAdvancedSettings(&settings); + if (result != FMOD_OK) + { + LL_WARNS("FMOD") << "setAdvancedSettings error: " << FMOD_ErrorString(result) << LL_ENDL; + } } -- cgit v1.3