diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index f2730c0494..385dfbeecd 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -217,6 +217,10 @@ elseif(DARWIN) set(release_files ${release_files} libfmod.dylib) endif () + if (TARGET ll::openal) + list(APPEND release_files libalut.dylib libopenal.dylib) + endif () + elseif(LINUX) # linux is weird, multiple side by side configurations aren't supported # and we don't seem to have any debug shared libs built yet anyways... diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake index 8a12b15ca4..2ab5fb67cf 100644 --- a/indra/cmake/OPENAL.cmake +++ b/indra/cmake/OPENAL.cmake @@ -39,6 +39,9 @@ if (USE_OPENAL) alut ) else() - message(FATAL_ERROR "OpenAL is not available for this platform") + target_link_libraries( ll::openal INTERFACE + openal + alut + ) endif() endif () diff --git a/indra/llaudio/llaudioengine_openal.cpp b/indra/llaudio/llaudioengine_openal.cpp index 1b8a870798..cac3e51608 100644 --- a/indra/llaudio/llaudioengine_openal.cpp +++ b/indra/llaudio/llaudioengine_openal.cpp @@ -528,7 +528,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude) } alBufferData(buffer, - AL_FORMAT_STEREO16, + AL_FORMAT_STEREO_FLOAT32, mWindGen->windGenerate(mWindBuf, mWindBufSamples), mWindBufBytes, diff --git a/indra/llaudio/llaudioengine_openal.h b/indra/llaudio/llaudioengine_openal.h index 562c96c794..c2dfad6a56 100644 --- a/indra/llaudio/llaudioengine_openal.h +++ b/indra/llaudio/llaudioengine_openal.h @@ -57,9 +57,9 @@ class LLAudioEngine_OpenAL : public LLAudioEngine /*virtual*/ void updateWind(LLVector3 direction, F32 camera_altitude); private: - typedef S16 WIND_SAMPLE_T; + typedef F32 WIND_SAMPLE_T; LLWindGen *mWindGen; - S16 *mWindBuf; + F32 *mWindBuf; U32 mWindBufFreq; U32 mWindBufSamples; U32 mWindBufBytes; diff --git a/indra/llaudio/lllistener_openal.h b/indra/llaudio/lllistener_openal.h index cb163b11a5..5ed99b0471 100644 --- a/indra/llaudio/lllistener_openal.h +++ b/indra/llaudio/lllistener_openal.h @@ -32,6 +32,7 @@ #include "AL/al.h" #include "AL/alut.h" +#include "AL/alext.h" class LLListener_OpenAL : public LLListener { diff --git a/indra/llcommon/StackWalker.cpp b/indra/llcommon/StackWalker.cpp index 7808c36757..4ecff4ee69 100644 --- a/indra/llcommon/StackWalker.cpp +++ b/indra/llcommon/StackWalker.cpp @@ -415,7 +415,7 @@ public: GetUserNameA(szUserName, &dwSize); this->m_parent->OnSymInit(buf, symOptions, szUserName); - return false; + return true; } StackWalker *m_parent; diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index 2fab112aa2..87198e7af1 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -667,18 +667,13 @@ void audio_update_wind(bool force_update) // don't use the setter setMaxWindGain() because we don't // want to screw up the fade-in on startup by setting actual source gain // outside the fade-in. - // Use faster LLCachedControls for frequently visited locations - //F32 master_volume = gSavedSettings.getBOOL("MuteAudio") ? 0.f : gSavedSettings.getF32("AudioLevelMaster"); - //F32 ambient_volume = gSavedSettings.getBOOL("MuteAmbient") ? 0.f : gSavedSettings.getF32("AudioLevelAmbient"); - - static LLCachedControl muteAudio(gSavedSettings, "MuteAudio"); - static LLCachedControl muteAmbient(gSavedSettings, "MuteAmbient"); - static LLCachedControl audioLevelMaster(gSavedSettings, "AudioLevelMaster"); - static LLCachedControl audioLevelAmbient(gSavedSettings, "AudioLevelAmbient"); + static LLCachedControl mute_audio(gSavedSettings, "MuteAudio"); + static LLCachedControl mute_ambient(gSavedSettings, "MuteAmbient"); + static LLCachedControl level_master(gSavedSettings, "AudioLevelMaster"); + static LLCachedControl level_ambient(gSavedSettings, "AudioLevelAmbient"); - F32 master_volume = muteAudio ? 0.f : (F32)audioLevelMaster; - F32 ambient_volume = muteAmbient ? 0.f : (F32)audioLevelAmbient; - // + F32 master_volume = mute_audio() ? 0.f : level_master(); + F32 ambient_volume = mute_ambient() ? 0.f : level_ambient(); F32 max_wind_volume = master_volume * ambient_volume; const F32 WIND_SOUND_TRANSITION_TIME = 2.f; diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 94636371fc..b4aab5b99c 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1245,6 +1245,14 @@ class Darwin_x86_64_Manifest(ViewerManifest): # ): # dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) + # # OpenAL dylibs + # if self.args['openal'] == 'ON': + # for libfile in ( + # "libopenal.dylib", + # "libalut.dylib", + # ): + # dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) + # # our apps # executable_path = {} # embedded_apps = [ (os.path.join("llplugin", "slplugin"), "SLPlugin.app") ] @@ -1549,9 +1557,20 @@ class Darwin_x86_64_Manifest(ViewerManifest): for libfile in ( "libfmod.dylib", ): - print("debug: adding {} to dylibs for fmodstudio".format(path_optional(os.path.join(relpkgdir, libfile), libfile))) dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) + + # OpenAL dylibs + useopenal = self.args['openal'].lower() + print(f"debug: openal={useopenal}") + if useopenal == 'on': + for libfile in ( + "libopenal.dylib", + "libalut.dylib", + ): + print("debug: adding {} to dylibs for openal".format(path_optional(os.path.join(relpkgdir, libfile), libfile))) + dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) + print(f"debug: dylibs = {dylibs}") # our apps