From 28d3bb09751aeebb6d7411c426b21c56246f9ff0 Mon Sep 17 00:00:00 2001 From: Baker Linden Date: Mon, 3 Mar 2014 11:53:57 -0800 Subject: [MAINT-3555][MAINT-3703] - Removed logging for MAINT-3555 - Added NULL guard to fix MAINT-3703 (hopefully) --- indra/llaudio/lllistener_fmodex.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/llaudio') diff --git a/indra/llaudio/lllistener_fmodex.cpp b/indra/llaudio/lllistener_fmodex.cpp index 2509a7aebc..31ab47a635 100644 --- a/indra/llaudio/lllistener_fmodex.cpp +++ b/indra/llaudio/lllistener_fmodex.cpp @@ -94,6 +94,11 @@ void LLListener_FMODEX::orient(LLVector3 up, LLVector3 at) //----------------------------------------------------------------------- void LLListener_FMODEX::commitDeferredChanges() { + if(!mSystem) + { + return; + } + mSystem->update(); } -- cgit v1.3 From 4f565ed077058cd3ce90ffd347c4a8346d734dbd Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Fri, 14 Mar 2014 19:48:35 -0400 Subject: Update fmodex to 4.44.31. Move DSP descriptor to heap storage. --- autobuild.xml | 12 ++++++------ indra/cmake/FMODEX.cmake | 2 +- indra/llaudio/llaudioengine_fmodex.cpp | 23 +++++++++++++---------- indra/llaudio/llaudioengine_fmodex.h | 3 ++- 4 files changed, 22 insertions(+), 18 deletions(-) (limited to 'indra/llaudio') diff --git a/autobuild.xml b/autobuild.xml index 6226c2137b..d0aa79acab 100755 --- a/autobuild.xml +++ b/autobuild.xml @@ -498,9 +498,9 @@ archive hash - 10352aab979c333a52dbad21b6e6fba9 + 179f3fa55920f0702b5721d52426fe02 url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/274403/arch/Darwin/installer/fmodex-4.44-darwin-20130419.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/288119/arch/Darwin/installer/fmodex-4.44.31-darwin-20140314.tar.bz2 name darwin @@ -510,9 +510,9 @@ archive hash - 79e45527aa9fb90b813599dff5ce01a7 + 65073109c821db1517860480e570994e url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/274378/arch/Linux/installer/fmodex-4.44-linux-20130419.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/288120/arch/Linux/installer/fmodex-4.44.31-linux-20140314.tar.bz2 name linux @@ -522,9 +522,9 @@ archive hash - 91752db72202807cffb33c1ec3fd90fc + 6c859cd17fb8c9cdd96b188c2a2c2838 url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/276321/arch/CYGWIN/installer/fmodex-4.44-windows-20130521.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/288120/arch/CYGWIN/installer/fmodex-4.44.31-windows-20140314.tar.bz2 name windows diff --git a/indra/cmake/FMODEX.cmake b/indra/cmake/FMODEX.cmake index 65bc1cabeb..163260137b 100644 --- a/indra/cmake/FMODEX.cmake +++ b/indra/cmake/FMODEX.cmake @@ -39,7 +39,7 @@ if (FMODEX) optimized fmodex) endif (WINDOWS) set(FMODEX_LIBRARIES ${FMODEX_LIBRARY}) - set(FMODEX_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/fmodex) + set(FMODEX_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/) endif (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR) endif (STANDALONE) endif (FMODEX) diff --git a/indra/llaudio/llaudioengine_fmodex.cpp b/indra/llaudio/llaudioengine_fmodex.cpp index e9b74b8f41..71f5d47367 100644 --- a/indra/llaudio/llaudioengine_fmodex.cpp +++ b/indra/llaudio/llaudioengine_fmodex.cpp @@ -5,7 +5,7 @@ * * $LicenseInfo:firstyear=2002&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. + * Copyright (C) 2014, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -320,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; @@ -347,15 +347,14 @@ bool LLAudioEngine_FMODEX::initWind() if (!mWindDSP) { - FMOD_DSP_DESCRIPTION dspdesc; - memset(&dspdesc, 0, sizeof(FMOD_DSP_DESCRIPTION)); //Set everything to zero - strncpy(dspdesc.name,"Wind Unit", sizeof(dspdesc.name)); //Set name to "Wind Unit" - dspdesc.channels=2; - dspdesc.read = &windCallback; //Assign callback. - if(Check_FMOD_Error(mSystem->createDSP(&dspdesc, &mWindDSP), "FMOD::createDSP")) + memset(&mWindDSPDesc, 0, sizeof(mWindDSPDesc)); //Set everything to zero + strncpy(mWindDSPDesc.name, "Wind Unit", sizeof(mWindDSPDesc.name)); + mWindDSPDesc.channels = 2; + mWindDSPDesc.read = &windCallback; // Assign callback - may be called from arbitrary threads + if (Check_FMOD_Error(mSystem->createDSP(&mWindDSPDesc, &mWindDSP), "FMOD::createDSP")) return false; - if(mWindGen) + if (mWindGen) delete mWindGen; float frequency = 44100; @@ -364,6 +363,7 @@ bool LLAudioEngine_FMODEX::initWind() mWindDSP->setUserData((void*)mWindGen); } + // *TODO: Should this guard against multiple plays? if (mWindDSP) { mSystem->playDSP(FMOD_CHANNEL_FREE, mWindDSP, false, 0); @@ -741,6 +741,9 @@ void LLAudioChannelFMODEX::set3DMode(bool use3d) } } +// *NOTE: This is almost certainly being called on the mixer thread, +// not the main thread. May have implications for callees or audio +// engine shutdown. FMOD_RESULT F_CALLBACK windCallback(FMOD_DSP_STATE *dsp_state, float *originalbuffer, float *newbuffer, unsigned int length, int inchannels, int outchannels) { diff --git a/indra/llaudio/llaudioengine_fmodex.h b/indra/llaudio/llaudioengine_fmodex.h index 415a9ed0ef..ca9a6c0df0 100644 --- a/indra/llaudio/llaudioengine_fmodex.h +++ b/indra/llaudio/llaudioengine_fmodex.h @@ -5,7 +5,7 @@ * * $LicenseInfo:firstyear=2002&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. + * Copyright (C) 2014, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -74,6 +74,7 @@ protected: LLWindGen *mWindGen; + FMOD_DSP_DESCRIPTION mWindDSPDesc; FMOD::DSP *mWindDSP; FMOD::System *mSystem; bool mEnableProfiler; -- cgit v1.3 From c62d2cca2962f9847f844df137c21aa44edc2d75 Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Fri, 14 Mar 2014 20:58:35 -0400 Subject: Additions & fixes for lib copy, use only forwarded ptrs in LLAE interfaces. Copy3rdPartyLibs needed to copy the now-corrected fmodexL libraries and it had a bad library reference on Linux for release. In llaudio land, the audio engine interfaces, even the fmodex specializations, seem to want to be external-structure free so use a forward declaration and pointer to FMOD_DSP_DESCRIPTION and deal with it in the ctor/dtor. --- indra/cmake/Copy3rdPartyLibs.cmake | 4 +++- indra/llaudio/llaudioengine_fmodex.cpp | 12 +++++++----- indra/llaudio/llaudioengine_fmodex.h | 3 ++- 3 files changed, 12 insertions(+), 7 deletions(-) (limited to 'indra/llaudio') diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 44c2d3ac27..f98e88b697 100755 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -64,6 +64,7 @@ if(WINDOWS) endif(USE_TCMALLOC) if (FMODEX) + set(debug_files ${debug_files} fmodexL.dll) set(release_files ${release_files} fmodex.dll) endif (FMODEX) @@ -294,7 +295,8 @@ elseif(LINUX) endif (USE_TCMALLOC) if (FMODEX) - set(release_file ${release_files} "libfmodex.so") + set(debug_files ${debug_files} "libfmodexL.so") + set(release_files ${release_files} "libfmodex.so") endif (FMODEX) else(WINDOWS) diff --git a/indra/llaudio/llaudioengine_fmodex.cpp b/indra/llaudio/llaudioengine_fmodex.cpp index 71f5d47367..36e8044a25 100644 --- a/indra/llaudio/llaudioengine_fmodex.cpp +++ b/indra/llaudio/llaudioengine_fmodex.cpp @@ -55,11 +55,13 @@ LLAudioEngine_FMODEX::LLAudioEngine_FMODEX(bool enable_profiler) mWindDSP = NULL; mSystem = NULL; mEnableProfiler = enable_profiler; + mWindDSPDesc = new FMOD_DSP_DESCRIPTION(); } LLAudioEngine_FMODEX::~LLAudioEngine_FMODEX() { + delete mWindDSPDesc; } @@ -347,11 +349,11 @@ bool LLAudioEngine_FMODEX::initWind() if (!mWindDSP) { - memset(&mWindDSPDesc, 0, sizeof(mWindDSPDesc)); //Set everything to zero - strncpy(mWindDSPDesc.name, "Wind Unit", sizeof(mWindDSPDesc.name)); - mWindDSPDesc.channels = 2; - mWindDSPDesc.read = &windCallback; // Assign callback - may be called from arbitrary threads - if (Check_FMOD_Error(mSystem->createDSP(&mWindDSPDesc, &mWindDSP), "FMOD::createDSP")) + memset(mWindDSPDesc, 0, sizeof(*mWindDSPDesc)); //Set everything to zero + strncpy(mWindDSPDesc->name, "Wind Unit", sizeof(mWindDSPDesc->name)); + mWindDSPDesc->channels = 2; + mWindDSPDesc->read = &windCallback; // Assign callback - may be called from arbitrary threads + if (Check_FMOD_Error(mSystem->createDSP(mWindDSPDesc, &mWindDSP), "FMOD::createDSP")) return false; if (mWindGen) diff --git a/indra/llaudio/llaudioengine_fmodex.h b/indra/llaudio/llaudioengine_fmodex.h index ca9a6c0df0..ca389d489f 100644 --- a/indra/llaudio/llaudioengine_fmodex.h +++ b/indra/llaudio/llaudioengine_fmodex.h @@ -41,6 +41,7 @@ namespace FMOD class Sound; class DSP; } +typedef struct FMOD_DSP_DESCRIPTION FMOD_DSP_DESCRIPTION; //Interfaces class LLAudioEngine_FMODEX : public LLAudioEngine @@ -74,7 +75,7 @@ protected: LLWindGen *mWindGen; - FMOD_DSP_DESCRIPTION mWindDSPDesc; + FMOD_DSP_DESCRIPTION *mWindDSPDesc; FMOD::DSP *mWindDSP; FMOD::System *mSystem; bool mEnableProfiler; -- cgit v1.3