From ba3e89b5c731ed6dc36d4650928be8081b3289f5 Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Fri, 18 Jan 2013 16:43:19 -0800
Subject: first push - patch from CmdCupCake plus force FMODEX on

---
 autobuild.xml                             |  24 +
 indra/cmake/CMakeLists.txt                |   2 +
 indra/cmake/Copy3rdPartyLibs.cmake        |  15 +-
 indra/cmake/FMOD.cmake                    |   2 +-
 indra/cmake/FMODEX.cmake                  |  45 ++
 indra/cmake/FindFMODEX.cmake              |  66 +++
 indra/llaudio/CMakeLists.txt              |  26 +-
 indra/llaudio/llaudioengine.h             |   1 -
 indra/llaudio/llaudioengine_fmodex.cpp    | 746 ++++++++++++++++++++++++++++++
 indra/llaudio/llaudioengine_fmodex.h      | 129 ++++++
 indra/llaudio/lllistener_fmodex.cpp       | 135 ++++++
 indra/llaudio/lllistener_fmodex.h         |  65 +++
 indra/llaudio/llstreamingaudio.h          |   2 +
 indra/llaudio/llstreamingaudio_fmodex.cpp | 382 +++++++++++++++
 indra/llaudio/llstreamingaudio_fmodex.h   |  75 +++
 indra/llaudio/llwindgen.h                 |  34 +-
 indra/newview/CMakeLists.txt              |  57 ++-
 indra/newview/app_settings/settings.xml   |  44 ++
 indra/newview/linux_tools/wrapper.sh      |  12 +-
 indra/newview/llstartup.cpp               |  15 +
 indra/newview/llvieweraudio.cpp           |  70 ++-
 indra/newview/llviewercontrol.cpp         |   1 +
 indra/newview/viewer_manifest.py          |  18 +
 23 files changed, 1887 insertions(+), 79 deletions(-)
 create mode 100644 indra/cmake/FMODEX.cmake
 create mode 100644 indra/cmake/FindFMODEX.cmake
 create mode 100644 indra/llaudio/llaudioengine_fmodex.cpp
 create mode 100644 indra/llaudio/llaudioengine_fmodex.h
 create mode 100644 indra/llaudio/lllistener_fmodex.cpp
 create mode 100644 indra/llaudio/lllistener_fmodex.h
 create mode 100644 indra/llaudio/llstreamingaudio_fmodex.cpp
 create mode 100644 indra/llaudio/llstreamingaudio_fmodex.h

diff --git a/autobuild.xml b/autobuild.xml
index 11c2da52dc..376a1d1d6d 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -531,6 +531,30 @@
           </map>
         </map>
       </map>
+      <key>fmodex</key>
+      <map>
+        <key>license</key>
+        <string>fmodex</string>
+        <key>license_file</key>
+        <string>LICENSES/fmodex.txt</string>
+        <key>name</key>
+        <string>fmodex</string>
+        <key>platforms</key>
+        <map>
+          <key>darwin</key>
+          <map>
+            <key>archive</key>
+            <map>
+              <key>hash</key>
+              <string>3590b83d65b7dc4dd7f6040c179b49f3</string>
+              <key>url</key>
+              <string>http://private-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-fmodex-private/arch/Darwin/fmodex-4.44.04-darwin-20130118.tar.bz2</string>
+            </map>
+            <key>name</key>
+            <string>darwin</string>
+          </map>
+        </map>
+      </map>
       <key>fontconfig</key>
       <map>
         <key>license</key>
diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt
index 569034a6fb..e9c0554641 100644
--- a/indra/cmake/CMakeLists.txt
+++ b/indra/cmake/CMakeLists.txt
@@ -26,6 +26,7 @@ set(cmake_SOURCE_FILES
     FindCARes.cmake
     FindELFIO.cmake
     FindFMOD.cmake
+    FindFMODEX.cmake
     FindGooglePerfTools.cmake
     FindMono.cmake
     FindMySQL.cmake
@@ -33,6 +34,7 @@ set(cmake_SOURCE_FILES
     FindXmlRpcEpi.cmake
     FindZLIB.cmake
     FMOD.cmake
+    FMODEX.cmake
     FreeType.cmake
     GLOD.cmake
     GStreamer010Plugin.cmake
diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake
index c32e357da3..c28361398f 100644
--- a/indra/cmake/Copy3rdPartyLibs.cmake
+++ b/indra/cmake/Copy3rdPartyLibs.cmake
@@ -62,6 +62,11 @@ if(WINDOWS)
       set(release_files ${release_files} libtcmalloc_minimal.dll)
     endif(USE_TCMALLOC)
 
+    if (FMODEX)
+      set(debug_files ${debug_files} fmodexL.dll)
+      set(release_files ${release_files} fmodex.dll)
+    endif (FMODEX)
+
     if (FMOD)
       set(debug_files ${debug_files} fmod.dll)
       set(release_files ${release_files} fmod.dll)
@@ -222,9 +227,15 @@ elseif(DARWIN)
         libcollada14dom.dylib
        )
 
-    # fmod is statically linked on darwin
-    set(fmod_files "")
+    if (FMODEX)
+      #set(debug_files ${debug_files} libfmodexL.dylib)
+      set(release_files ${release_files} libfmodex.dylib)
+    endif (FMODEX)
 
+    if (FMOD)
+        # fmod is statically linked on darwin
+       set(fmod_files "")
+    endif (FMOD)
 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/FMOD.cmake b/indra/cmake/FMOD.cmake
index 3586c1160a..ef0ae58bdf 100644
--- a/indra/cmake/FMOD.cmake
+++ b/indra/cmake/FMOD.cmake
@@ -6,7 +6,7 @@
 # Open source devs should use the -DFMOD:BOOL=ON then if they want to build with FMOD, whether
 # they are using STANDALONE or not.
 if (INSTALL_PROPRIETARY)
-  set(FMOD ON CACHE BOOL "Use FMOD sound library.")
+  set(FMOD OFF CACHE BOOL "Use FMOD sound library.")
 endif (INSTALL_PROPRIETARY)
 
 if (FMOD)
diff --git a/indra/cmake/FMODEX.cmake b/indra/cmake/FMODEX.cmake
new file mode 100644
index 0000000000..448392437a
--- /dev/null
+++ b/indra/cmake/FMODEX.cmake
@@ -0,0 +1,45 @@
+# -*- cmake -*-
+
+# FMOD can be set when launching the make using the argument -DFMOD:BOOL=ON
+# When building using proprietary binaries though (i.e. having access to LL private servers),
+# we always build with FMODEX.
+# Open source devs should use the -DFMODEX:BOOL=ON then if they want to build with FMOD, whether
+# they are using STANDALONE or not.
+if (INSTALL_PROPRIETARY)
+  set(FMODEX ON CACHE BOOL "Using FMOD Ex sound library.")
+endif (INSTALL_PROPRIETARY)
+
+if (FMODEX)
+  if (STANDALONE)
+    # In that case, we use the version of the library installed on the system
+    set(FMODEX_FIND_REQUIRED ON)
+    include(FindFMODEX)
+  else (STANDALONE)
+    if (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR)
+      # If the path have been specified in the arguments, use that
+      set(FMODEX_LIBRARIES ${FMODEX_LIBRARY})
+      MESSAGE(STATUS "Using FMODEX path: ${FMODEX_LIBRARIES}, ${FMODEX_INCLUDE_DIR}")
+    else (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR)
+      # If not, we're going to try to get the package listed in autobuild.xml
+      # Note: if you're not using INSTALL_PROPRIETARY, the package URL should be local (file:/// URL) 
+      # as accessing the private LL location will fail if you don't have the credential
+      include(Prebuilt)
+      use_prebuilt_binary(fmodex)    
+      if (WINDOWS)
+        set(FMODEX_LIBRARY 
+            debug fmodexL_vc
+            optimized fmodex_vc)
+      elseif (DARWIN)
+        set(FMODEX_LIBRARY 
+            debug fmodexL
+            optimized fmodex)
+      elseif (LINUX)
+        set(FMODEX_LIBRARY 
+            debug fmodexL
+            optimized fmodex)
+      endif (WINDOWS)
+      set(FMODEX_LIBRARIES ${FMODEX_LIBRARY})
+      set(FMODEX_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/fmodex)
+    endif (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR)
+  endif (STANDALONE)
+endif (FMODEX)
\ No newline at end of file
diff --git a/indra/cmake/FindFMODEX.cmake b/indra/cmake/FindFMODEX.cmake
new file mode 100644
index 0000000000..9b9b85d73e
--- /dev/null
+++ b/indra/cmake/FindFMODEX.cmake
@@ -0,0 +1,66 @@
+# -*- cmake -*-
+
+# - Find FMODEX
+# Find the FMODEX includes and library
+# This module defines
+#  FMODEX_INCLUDE_DIR, where to find fmod.h and fmod_errors.h
+#  FMODEX_LIBRARIES, the libraries needed to use FMODEX.
+#  FMODEX, If false, do not try to use FMODEX.
+# also defined, but not for general use are
+#  FMODEX_LIBRARY, where to find the FMODEX library.
+
+FIND_PATH(FMODEX_INCLUDE_DIR fmod.h PATH_SUFFIXES fmod)
+
+SET(FMODEX_NAMES ${FMODEX_NAMES} fmodex fmodvc fmodexL_vc)
+FIND_LIBRARY(FMODEX_LIBRARY
+  NAMES ${FMODEX_NAMES}
+  PATH_SUFFIXES fmodex
+  )
+
+IF (FMODEX_SDK_DIR OR WINDOWS)
+    if(WINDOWS)
+        set(FMODEX_SDK_DIR "$ENV{PROGRAMFILES}/FMOD SoundSystem/FMOD Programmers API Windows" CACHE PATH "Path to FMODEX")
+        STRING(REGEX REPLACE "\\\\" "/" FMODEX_SDK_DIR ${FMODEX_SDK_DIR}) 
+    endif(WINDOWS)
+    find_library(FMODEX_LIBRARY
+             fmodex_vc fmodexL_vc 
+             PATHS
+             ${FMODEX_SDK_DIR}/api/lib
+             ${FMODEX_SDK_DIR}/api
+             ${FMODEX_SDK_DIR}
+             )
+    find_path(FMODEX_INCLUDE_DIR fmod.h
+        ${FMODEX_SDK_DIR}/api/inc
+        ${FMODEX_SDK_DIR}/api
+        ${FMODEX_SDK_DIR}
+      )
+    find_path(FMODEX_INCLUDE_DIR fmod.h
+        ${FMODEX_SDK_DIR}/api/inc
+        ${FMODEX_SDK_DIR}/api
+        ${FMODEX_SDK_DIR}
+      )
+    IF (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR)
+      SET(FMODEX_LIBRARIES ${FMODEX_LIBRARY})
+      SET(FMODEX_FOUND "YES")
+    endif (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR)
+ENDIF (FMODEX_SDK_DIR OR WINDOWS)
+
+IF (FMODEX_FOUND)
+  IF (NOT FMODEX_FIND_QUIETLY)
+    MESSAGE(STATUS "Found FMODEX: ${FMODEX_LIBRARIES}")
+  ENDIF (NOT FMODEX_FIND_QUIETLY)
+ELSE (FMODEX_FOUND)
+  IF (FMODEX_FIND_REQUIRED)
+    MESSAGE(FATAL_ERROR "Could not find FMODEX library")
+  ENDIF (FMODEX_FIND_REQUIRED)
+ENDIF (FMODEX_FOUND)
+
+# Deprecated declarations.
+SET (NATIVE_FMODEX_INCLUDE_PATH ${FMODEX_INCLUDE_DIR} )
+GET_FILENAME_COMPONENT (NATIVE_FMODEX_LIB_PATH ${FMODEX_LIBRARY} PATH)
+
+MARK_AS_ADVANCED(
+  FMODEX_LIBRARY
+  FMODEX_INCLUDE_DIR
+  )
+  
\ No newline at end of file
diff --git a/indra/llaudio/CMakeLists.txt b/indra/llaudio/CMakeLists.txt
index 632e5d46e3..e404cfc10e 100644
--- a/indra/llaudio/CMakeLists.txt
+++ b/indra/llaudio/CMakeLists.txt
@@ -5,7 +5,13 @@ project(llaudio)
 include(00-Common)
 include(Audio)
 include(LLAudio)
-include(FMOD)
+if (FMODEX)
+  include(FMODEX)
+  set(FMOD OFF)
+endif (FMODEX)
+if (NOT FMODEX)
+  include(FMOD)
+endif (NOT FMODEX)
 include(OPENAL)
 include(LLCommon)
 include(LLMath)
@@ -24,7 +30,6 @@ include_directories(
     ${VORBIS_INCLUDE_DIRS}
     ${OPENAL_LIB_INCLUDE_DIRS}
     ${FREEAULT_LIB_INCLUDE_DIRS}
-    ${FMOD_INCLUDE_DIR}
     )
 
 set(llaudio_SOURCE_FILES
@@ -44,6 +49,23 @@ set(llaudio_HEADER_FILES
     llwindgen.h
     )
 
+if (FMODEX)
+    include_directories(
+        ${FMODEX_INCLUDE_DIR}
+        )
+    list(APPEND llaudio_SOURCE_FILES
+         llaudioengine_fmodex.cpp
+         lllistener_fmodex.cpp
+         llstreamingaudio_fmodex.cpp
+         )
+
+    list(APPEND llaudio_HEADER_FILES
+         llaudioengine_fmodex.h
+         lllistener_fmodex.h
+         llstreamingaudio_fmodex.h
+         )
+endif (FMODEX)
+
 if (FMOD)
     include_directories(
         ${FMOD_INCLUDE_DIR}
diff --git a/indra/llaudio/llaudioengine.h b/indra/llaudio/llaudioengine.h
index df1e4dc305..dbaba0fb91 100644
--- a/indra/llaudio/llaudioengine.h
+++ b/indra/llaudio/llaudioengine.h
@@ -42,7 +42,6 @@
 #include "lllistener.h"
 
 const F32 LL_WIND_UPDATE_INTERVAL = 0.1f;
-const F32 LL_ROLLOFF_MULTIPLIER_UNDER_WATER = 5.f;			//  How much sounds are weaker under water
 const F32 LL_WIND_UNDERWATER_CENTER_FREQ = 20.f;
 
 const F32 ATTACHED_OBJECT_TIMEOUT = 5.0f;
diff --git a/indra/llaudio/llaudioengine_fmodex.cpp b/indra/llaudio/llaudioengine_fmodex.cpp
new file mode 100644
index 0000000000..c3c30d87fe
--- /dev/null
+++ b/indra/llaudio/llaudioengine_fmodex.cpp
@@ -0,0 +1,746 @@
+/** 
+ * @file audioengine_fmodex.cpp
+ * @brief Implementation of LLAudioEngine class abstracting the audio 
+ * support as a FMODEX implementation
+ *
+ * $LicenseInfo:firstyear=2002&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, 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
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#include "linden_common.h"
+
+#include "llstreamingaudio.h"
+#include "llstreamingaudio_fmodex.h"
+
+#include "llaudioengine_fmodex.h"
+#include "lllistener_fmodex.h"
+
+#include "llerror.h"
+#include "llmath.h"
+#include "llrand.h"
+
+#include "fmod.hpp"
+#include "fmod_errors.h"
+#include "lldir.h"
+#include "llapr.h"
+
+#include "sound_ids.h"
+
+FMOD_RESULT F_CALLBACK windCallback(FMOD_DSP_STATE *dsp_state, float *inbuffer, float *outbuffer, unsigned int length, int inchannels, int outchannels);
+
+FMOD::ChannelGroup *LLAudioEngine_FMODEX::mChannelGroups[LLAudioEngine::AUDIO_TYPE_COUNT] = {0};
+
+LLAudioEngine_FMODEX::LLAudioEngine_FMODEX(bool enable_profiler)
+{
+	mInited = false;
+	mWindGen = NULL;
+	mWindDSP = NULL;
+	mSystem = NULL;
+	mEnableProfiler = enable_profiler;
+}
+
+
+LLAudioEngine_FMODEX::~LLAudioEngine_FMODEX()
+{
+}
+
+
+inline bool Check_FMOD_Error(FMOD_RESULT result, const char *string)
+{
+	if(result == FMOD_OK)
+		return false;
+	llwarns << string << " Error: " << FMOD_ErrorString(result) << llendl;
+	return true;
+}
+
+void* F_STDCALL decode_alloc(unsigned int size, FMOD_MEMORY_TYPE type, const char *sourcestr)
+{
+	if(type & FMOD_MEMORY_STREAM_DECODE)
+	{
+		llinfos << "Decode buffer size: " << size << llendl;
+	}
+	else if(type & FMOD_MEMORY_STREAM_FILE)
+	{
+		llinfos << "Strean buffer size: " << size << llendl;
+	}
+	return new char[size];
+}
+void* F_STDCALL decode_realloc(void *ptr, unsigned int size, FMOD_MEMORY_TYPE type, const char *sourcestr)
+{
+	memset(ptr,0,size);
+	return ptr;
+}
+void F_STDCALL decode_dealloc(void *ptr, FMOD_MEMORY_TYPE type, const char *sourcestr)
+{
+	delete[] (char*)ptr;
+}
+
+bool LLAudioEngine_FMODEX::init(const S32 num_channels, void* userdata)
+{
+	U32 version;
+	FMOD_RESULT result;
+
+	LL_DEBUGS("AppInit") << "LLAudioEngine_FMODEX::init() initializing FMOD" << LL_ENDL;
+
+	//result = FMOD::Memory_Initialize(NULL, 0, &decode_alloc, &decode_realloc, &decode_dealloc, FMOD_MEMORY_STREAM_DECODE | FMOD_MEMORY_STREAM_FILE);
+	//if(Check_FMOD_Error(result, "FMOD::Memory_Initialize"))
+	//	return false;
+
+	result = FMOD::System_Create(&mSystem);
+	if(Check_FMOD_Error(result, "FMOD::System_Create"))
+		return false;
+
+	//will call LLAudioEngine_FMODEX::allocateListener, which needs a valid mSystem pointer.
+	LLAudioEngine::init(num_channels, userdata);	
+	
+	result = mSystem->getVersion(&version);
+	Check_FMOD_Error(result, "FMOD::System::getVersion");
+
+	if (version < FMOD_VERSION)
+	{
+		LL_WARNS("AppInit") << "Error : You are using the wrong FMOD Ex version (" << version
+			<< ")!  You should be using FMOD Ex" << FMOD_VERSION << LL_ENDL;
+	}
+
+	result = mSystem->setSoftwareFormat(44100, FMOD_SOUND_FORMAT_PCM16, 0, 0, FMOD_DSP_RESAMPLER_LINEAR);
+	Check_FMOD_Error(result,"FMOD::System::setSoftwareFormat");
+
+	// 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");
+
+	U32 fmod_flags = FMOD_INIT_NORMAL;
+	if(mEnableProfiler)
+	{
+		fmod_flags |= FMOD_INIT_ENABLE_PROFILE;
+		mSystem->createChannelGroup("None", &mChannelGroups[AUDIO_TYPE_NONE]);
+		mSystem->createChannelGroup("SFX", &mChannelGroups[AUDIO_TYPE_SFX]);
+		mSystem->createChannelGroup("UI", &mChannelGroups[AUDIO_TYPE_UI]);
+		mSystem->createChannelGroup("Ambient", &mChannelGroups[AUDIO_TYPE_AMBIENT]);
+	}
+
+#if LL_LINUX
+	bool audio_ok = false;
+
+	if (!audio_ok)
+	{
+		if (NULL == getenv("LL_BAD_FMOD_PULSEAUDIO")) /*Flawfinder: ignore*/
+		{
+			LL_DEBUGS("AppInit") << "Trying PulseAudio audio output..." << LL_ENDL;
+			if(mSystem->setOutput(FMOD_OUTPUTTYPE_PULSEAUDIO) == FMOD_OK &&
+				(result = mSystem->init(num_channels + 2, fmod_flags, 0)) == FMOD_OK)
+			{
+				LL_DEBUGS("AppInit") << "PulseAudio output initialized OKAY"	<< LL_ENDL;
+				audio_ok = true;
+			}
+			else 
+			{
+				Check_FMOD_Error(result, "PulseAudio audio output FAILED to initialize");
+			}
+		} 
+		else 
+		{
+			LL_DEBUGS("AppInit") << "PulseAudio audio output SKIPPED" << LL_ENDL;
+		}	
+	}
+	if (!audio_ok)
+	{
+		if (NULL == getenv("LL_BAD_FMOD_ALSA"))		/*Flawfinder: ignore*/
+		{
+			LL_DEBUGS("AppInit") << "Trying ALSA audio output..." << LL_ENDL;
+			if(mSystem->setOutput(FMOD_OUTPUTTYPE_ALSA) == FMOD_OK &&
+			    (result = mSystem->init(num_channels + 2, fmod_flags, 0)) == FMOD_OK)
+			{
+				LL_DEBUGS("AppInit") << "ALSA audio output initialized OKAY" << LL_ENDL;
+				audio_ok = true;
+			} 
+			else 
+			{
+				Check_FMOD_Error(result, "ALSA audio output FAILED to initialize");
+			}
+		} 
+		else 
+		{
+			LL_DEBUGS("AppInit") << "ALSA audio output SKIPPED" << LL_ENDL;
+		}
+	}
+	if (!audio_ok)
+	{
+		if (NULL == getenv("LL_BAD_FMOD_OSS")) 	 /*Flawfinder: ignore*/
+		{
+			LL_DEBUGS("AppInit") << "Trying OSS audio output..." << LL_ENDL;
+			if(mSystem->setOutput(FMOD_OUTPUTTYPE_OSS) == FMOD_OK &&
+			    (result = mSystem->init(num_channels + 2, fmod_flags, 0)) == FMOD_OK)
+			{
+				LL_DEBUGS("AppInit") << "OSS audio output initialized OKAY" << LL_ENDL;
+				audio_ok = true;
+			}
+			else
+			{
+				Check_FMOD_Error(result, "OSS audio output FAILED to initialize");
+			}
+		}
+		else 
+		{
+			LL_DEBUGS("AppInit") << "OSS audio output SKIPPED" << LL_ENDL;
+		}
+	}
+	if (!audio_ok)
+	{
+		LL_WARNS("AppInit") << "Overall audio init failure." << LL_ENDL;
+		return false;
+	}
+
+	// We're interested in logging which output method we
+	// ended up with, for QA purposes.
+	FMOD_OUTPUTTYPE output_type;
+	mSystem->getOutput(&output_type);
+	switch (output_type)
+	{
+		case FMOD_OUTPUTTYPE_NOSOUND: 
+			LL_INFOS("AppInit") << "Audio output: NoSound" << LL_ENDL; break;
+		case FMOD_OUTPUTTYPE_PULSEAUDIO:	
+			LL_INFOS("AppInit") << "Audio output: PulseAudio" << LL_ENDL; break;
+		case FMOD_OUTPUTTYPE_ALSA: 
+			LL_INFOS("AppInit") << "Audio output: ALSA" << LL_ENDL; break;
+		case FMOD_OUTPUTTYPE_OSS:	
+			LL_INFOS("AppInit") << "Audio output: OSS" << LL_ENDL; break;
+		default:
+			LL_INFOS("AppInit") << "Audio output: Unknown!" << LL_ENDL; break;
+	};
+#else // LL_LINUX
+
+	// initialize the FMOD engine
+	result = mSystem->init( num_channels + 2, fmod_flags, 0);
+	if (result == FMOD_ERR_OUTPUT_CREATEBUFFER)
+	{
+		/*
+		Ok, the speaker mode selected isn't supported by this soundcard. Switch it
+		back to stereo...
+		*/
+		result = mSystem->setSpeakerMode(FMOD_SPEAKERMODE_STEREO);
+		Check_FMOD_Error(result,"Error falling back to stereo mode");
+		/*
+		... and re-init.
+		*/
+		result = mSystem->init( num_channels + 2, fmod_flags, 0);
+	}
+	if(Check_FMOD_Error(result, "Error initializing FMOD Ex"))
+		return false;
+#endif
+
+	// set up our favourite FMOD-native streaming audio implementation if none has already been added
+	if (!getStreamingAudioImpl()) // no existing implementation added
+		setStreamingAudioImpl(new LLStreamingAudio_FMODEX(mSystem));
+
+	LL_INFOS("AppInit") << "LLAudioEngine_FMODEX::init() FMOD Ex initialized correctly" << LL_ENDL;
+
+	int r_numbuffers, r_samplerate, r_channels, r_bits;
+	unsigned int r_bufferlength;
+	char r_name[256];
+	mSystem->getDSPBufferSize(&r_bufferlength, &r_numbuffers);
+	mSystem->getSoftwareFormat(&r_samplerate, NULL, &r_channels, NULL, NULL, &r_bits);
+	mSystem->getDriverInfo(0, r_name, 255, 0);
+	r_name[255] = '\0';
+	int latency = 1000.0 * r_bufferlength * r_numbuffers /r_samplerate;
+
+	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;
+
+	mInited = true;
+
+	return true;
+}
+
+
+std::string LLAudioEngine_FMODEX::getDriverName(bool verbose)
+{
+	llassert_always(mSystem);
+	if (verbose)
+	{
+		U32 version;
+		if(!Check_FMOD_Error(mSystem->getVersion(&version), "FMOD::System::getVersion"))
+		{
+			return llformat("FMOD Ex %1x.%02x.%02x", version >> 16, version >> 8 & 0x000000FF, version & 0x000000FF);
+		}
+	}
+	return "FMODEx";
+}
+
+
+void LLAudioEngine_FMODEX::allocateListener(void)
+{	
+	mListenerp = (LLListener *) new LLListener_FMODEX(mSystem);
+	if (!mListenerp)
+	{
+		llwarns << "Listener creation failed" << llendl;
+	}
+}
+
+
+void LLAudioEngine_FMODEX::shutdown()
+{
+	stopInternetStream();
+
+	llinfos << "About to LLAudioEngine::shutdown()" << llendl;
+	LLAudioEngine::shutdown();
+	
+	llinfos << "LLAudioEngine_FMODEX::shutdown() closing FMOD Ex" << llendl;
+	mSystem->close();
+	mSystem->release();
+	llinfos << "LLAudioEngine_FMODEX::shutdown() done closing FMOD Ex" << llendl;
+
+	delete mListenerp;
+	mListenerp = NULL;
+}
+
+
+LLAudioBuffer * LLAudioEngine_FMODEX::createBuffer()
+{
+	return new LLAudioBufferFMODEX(mSystem);
+}
+
+
+LLAudioChannel * LLAudioEngine_FMODEX::createChannel()
+{
+	return new LLAudioChannelFMODEX(mSystem);
+}
+
+bool LLAudioEngine_FMODEX::initWind()
+{
+	mNextWindUpdate = 0.0;
+
+	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"))
+			return false;
+
+		if(mWindGen)
+			delete mWindGen;
+	
+		float frequency = 44100;
+		mWindDSP->getDefaults(&frequency,0,0,0);
+		mWindGen = new LLWindGen<MIXBUFFERFORMAT>((U32)frequency);
+		mWindDSP->setUserData((void*)mWindGen);
+	}
+
+	if (mWindDSP)
+	{
+		mSystem->playDSP(FMOD_CHANNEL_FREE, mWindDSP, false, 0);
+		return true;
+	}
+	return false;
+}
+
+
+void LLAudioEngine_FMODEX::cleanupWind()
+{
+	if (mWindDSP)
+	{
+		mWindDSP->remove();
+		mWindDSP->release();
+		mWindDSP = NULL;
+	}
+
+	delete mWindGen;
+	mWindGen = NULL;
+}
+
+
+//-----------------------------------------------------------------------
+void LLAudioEngine_FMODEX::updateWind(LLVector3 wind_vec, F32 camera_height_above_water)
+{
+	LLVector3 wind_pos;
+	F64 pitch;
+	F64 center_freq;
+
+	if (!mEnableWind)
+	{
+		return;
+	}
+	
+	if (mWindUpdateTimer.checkExpirationAndReset(LL_WIND_UPDATE_INTERVAL))
+	{
+		
+		// wind comes in as Linden coordinate (+X = forward, +Y = left, +Z = up)
+		// need to convert this to the conventional orientation DS3D and OpenAL use
+		// where +X = right, +Y = up, +Z = backwards
+
+		wind_vec.setVec(-wind_vec.mV[1], wind_vec.mV[2], -wind_vec.mV[0]);
+
+		// cerr << "Wind update" << endl;
+
+		pitch = 1.0 + mapWindVecToPitch(wind_vec);
+		center_freq = 80.0 * pow(pitch,2.5*(mapWindVecToGain(wind_vec)+1.0));
+		
+		mWindGen->mTargetFreq = (F32)center_freq;
+		mWindGen->mTargetGain = (F32)mapWindVecToGain(wind_vec) * mMaxWindGain;
+		mWindGen->mTargetPanGainR = (F32)mapWindVecToPan(wind_vec);
+  	}
+}
+
+//-----------------------------------------------------------------------
+void LLAudioEngine_FMODEX::setInternalGain(F32 gain)
+{
+	if (!mInited)
+	{
+		return;
+	}
+
+	gain = llclamp( gain, 0.0f, 1.0f );
+
+	FMOD::ChannelGroup *master_group;
+	mSystem->getMasterChannelGroup(&master_group);
+
+	master_group->setVolume(gain);
+
+	LLStreamingAudioInterface *saimpl = getStreamingAudioImpl();
+	if ( saimpl )
+	{
+		// fmod likes its streaming audio channel gain re-asserted after
+		// master volume change.
+		saimpl->setGain(saimpl->getGain());
+	}
+}
+
+//
+// LLAudioChannelFMODEX implementation
+//
+
+LLAudioChannelFMODEX::LLAudioChannelFMODEX(FMOD::System *system) : LLAudioChannel(), mSystemp(system), mChannelp(NULL), mLastSamplePos(0)
+{
+}
+
+
+LLAudioChannelFMODEX::~LLAudioChannelFMODEX()
+{
+	cleanup();
+}
+
+bool LLAudioChannelFMODEX::updateBuffer()
+{
+	if (LLAudioChannel::updateBuffer())
+	{
+		// Base class update returned true, which means that we need to actually
+		// set up the channel for a different buffer.
+
+		LLAudioBufferFMODEX *bufferp = (LLAudioBufferFMODEX *)mCurrentSourcep->getCurrentBuffer();
+
+		// Grab the FMOD sample associated with the buffer
+		FMOD::Sound *soundp = bufferp->getSound();
+		if (!soundp)
+		{
+			// This is bad, there should ALWAYS be a sound associated with a legit
+			// buffer.
+			llerrs << "No FMOD sound!" << llendl;
+			return false;
+		}
+
+
+		// Actually play the sound.  Start it off paused so we can do all the necessary
+		// setup.
+		if(!mChannelp)
+		{
+			FMOD_RESULT result = getSystem()->playSound(FMOD_CHANNEL_FREE, soundp, true, &mChannelp);
+			Check_FMOD_Error(result, "FMOD::System::playSound");
+		}
+
+		//llinfos << "Setting up channel " << std::hex << mChannelID << std::dec << llendl;
+	}
+
+	// If we have a source for the channel, we need to update its gain.
+	if (mCurrentSourcep)
+	{
+		// SJB: warnings can spam and hurt framerate, disabling
+		FMOD_RESULT result;
+
+		result = mChannelp->setVolume(getSecondaryGain() * mCurrentSourcep->getGain());
+		//Check_FMOD_Error(result, "FMOD::Channel::setVolume");
+
+		result = mChannelp->setMode(mCurrentSourcep->isLoop() ? FMOD_LOOP_NORMAL : FMOD_LOOP_OFF);
+		/*if(Check_FMOD_Error(result, "FMOD::Channel::setMode"))
+		{
+			S32 index;
+			mChannelp->getIndex(&index);
+ 			llwarns << "Channel " << index << "Source ID: " << mCurrentSourcep->getID()
+ 					<< " at " << mCurrentSourcep->getPositionGlobal() << llendl;		
+		}*/
+	}
+
+	return true;
+}
+
+
+void LLAudioChannelFMODEX::update3DPosition()
+{
+	if (!mChannelp)
+	{
+		// We're not actually a live channel (i.e., we're not playing back anything)
+		return;
+	}
+
+	LLAudioBufferFMODEX  *bufferp = (LLAudioBufferFMODEX  *)mCurrentBufferp;
+	if (!bufferp)
+	{
+		// We don't have a buffer associated with us (should really have been picked up
+		// by the above if.
+		return;
+	}
+
+	if (mCurrentSourcep->isAmbient())
+	{
+		// Ambient sound, don't need to do any positional updates.
+		set3DMode(false);
+	}
+	else
+	{
+		// Localized sound.  Update the position and velocity of the sound.
+		set3DMode(true);
+
+		LLVector3 float_pos;
+		float_pos.setVec(mCurrentSourcep->getPositionGlobal());
+		FMOD_RESULT result = mChannelp->set3DAttributes((FMOD_VECTOR*)float_pos.mV, (FMOD_VECTOR*)mCurrentSourcep->getVelocity().mV);
+		Check_FMOD_Error(result, "FMOD::Channel::set3DAttributes");
+	}
+}
+
+
+void LLAudioChannelFMODEX::updateLoop()
+{
+	if (!mChannelp)
+	{
+		// May want to clear up the loop/sample counters.
+		return;
+	}
+
+	//
+	// Hack:  We keep track of whether we looped or not by seeing when the
+	// sample position looks like it's going backwards.  Not reliable; may
+	// yield false negatives.
+	//
+	U32 cur_pos;
+	mChannelp->getPosition(&cur_pos,FMOD_TIMEUNIT_PCMBYTES);
+
+	if (cur_pos < (U32)mLastSamplePos)
+	{
+		mLoopedThisFrame = true;
+	}
+	mLastSamplePos = cur_pos;
+}
+
+
+void LLAudioChannelFMODEX::cleanup()
+{
+	if (!mChannelp)
+	{
+		//llinfos << "Aborting cleanup with no channel handle." << llendl;
+		return;
+	}
+
+	//llinfos << "Cleaning up channel: " << mChannelID << llendl;
+	Check_FMOD_Error(mChannelp->stop(),"FMOD::Channel::stop");
+
+	mCurrentBufferp = NULL;
+	mChannelp = NULL;
+}
+
+
+void LLAudioChannelFMODEX::play()
+{
+	if (!mChannelp)
+	{
+		llwarns << "Playing without a channel handle, aborting" << llendl;
+		return;
+	}
+
+	Check_FMOD_Error(mChannelp->setPaused(false), "FMOD::Channel::pause");
+
+	getSource()->setPlayedOnce(true);
+
+	if(LLAudioEngine_FMODEX::mChannelGroups[getSource()->getType()])
+		mChannelp->setChannelGroup(LLAudioEngine_FMODEX::mChannelGroups[getSource()->getType()]);
+}
+
+
+void LLAudioChannelFMODEX::playSynced(LLAudioChannel *channelp)
+{
+	LLAudioChannelFMODEX *fmod_channelp = (LLAudioChannelFMODEX*)channelp;
+	if (!(fmod_channelp->mChannelp && mChannelp))
+	{
+		// Don't have channels allocated to both the master and the slave
+		return;
+	}
+
+	U32 cur_pos;
+	if(Check_FMOD_Error(mChannelp->getPosition(&cur_pos,FMOD_TIMEUNIT_PCMBYTES), "Unable to retrieve current position"))
+		return;
+
+	cur_pos %= mCurrentBufferp->getLength();
+	
+	// Try to match the position of our sync master
+	Check_FMOD_Error(mChannelp->setPosition(cur_pos,FMOD_TIMEUNIT_PCMBYTES),"Unable to set current position");
+
+	// Start us playing
+	play();
+}
+
+
+bool LLAudioChannelFMODEX::isPlaying()
+{
+	if (!mChannelp)
+	{
+		return false;
+	}
+
+	bool paused, playing;
+	mChannelp->getPaused(&paused);
+	mChannelp->isPlaying(&playing);
+	return !paused && playing;
+}
+
+
+//
+// LLAudioChannelFMODEX implementation
+//
+
+
+LLAudioBufferFMODEX::LLAudioBufferFMODEX(FMOD::System *system) : mSystemp(system), mSoundp(NULL)
+{
+}
+
+
+LLAudioBufferFMODEX::~LLAudioBufferFMODEX()
+{
+	if(mSoundp)
+	{
+		mSoundp->release();
+		mSoundp = NULL;
+	}
+}
+
+
+bool LLAudioBufferFMODEX::loadWAV(const std::string& filename)
+{
+	// Try to open a wav file from disk.  This will eventually go away, as we don't
+	// really want to block doing this.
+	if (filename.empty())
+	{
+		// invalid filename, abort.
+		return false;
+	}
+
+	if (!LLAPRFile::isExist(filename, NULL, LL_APR_RPB))
+	{
+		// File not found, abort.
+		return false;
+	}
+	
+	if (mSoundp)
+	{
+		// If there's already something loaded in this buffer, clean it up.
+		mSoundp->release();
+		mSoundp = NULL;
+	}
+
+	FMOD_MODE base_mode = FMOD_LOOP_NORMAL | FMOD_SOFTWARE;
+	FMOD_CREATESOUNDEXINFO exinfo;
+	memset(&exinfo,0,sizeof(exinfo));
+	exinfo.cbsize = sizeof(exinfo);
+	exinfo.suggestedsoundtype = FMOD_SOUND_TYPE_WAV;	//Hint to speed up loading.
+	// Load up the wav file into an fmod sample
+#if LL_WINDOWS
+	FMOD_RESULT result = getSystem()->createSound((const char*)utf8str_to_utf16str(filename).c_str(), base_mode | FMOD_UNICODE, &exinfo, &mSoundp);
+#else
+	FMOD_RESULT result = getSystem()->createSound(filename.c_str(), base_mode, &exinfo, &mSoundp);
+#endif
+
+	if (result != FMOD_OK)
+	{
+		// We failed to load the file for some reason.
+		llwarns << "Could not load data '" << filename << "': " << FMOD_ErrorString(result) << llendl;
+
+		//
+		// If we EVER want to load wav files provided by end users, we need
+		// to rethink this!
+		//
+		// file is probably corrupt - remove it.
+		LLFile::remove(filename);
+		return false;
+	}
+
+	// Everything went well, return true
+	return true;
+}
+
+
+U32 LLAudioBufferFMODEX::getLength()
+{
+	if (!mSoundp)
+	{
+		return 0;
+	}
+
+	U32 length;
+	mSoundp->getLength(&length, FMOD_TIMEUNIT_PCMBYTES);
+	return length;
+}
+
+
+void LLAudioChannelFMODEX::set3DMode(bool use3d)
+{
+	FMOD_MODE current_mode;
+	if(mChannelp->getMode(&current_mode) != FMOD_OK)
+		return;
+	FMOD_MODE new_mode = current_mode;	
+	new_mode &= ~(use3d ? FMOD_2D : FMOD_3D);
+	new_mode |= use3d ? FMOD_3D : FMOD_2D;
+
+	if(current_mode != new_mode)
+	{
+		mChannelp->setMode(new_mode);
+	}
+}
+
+
+FMOD_RESULT F_CALLBACK windCallback(FMOD_DSP_STATE *dsp_state, float *originalbuffer, float *newbuffer, unsigned int length, int inchannels, int outchannels)
+{
+	// originalbuffer = fmod's original mixbuffer.
+	// newbuffer = the buffer passed from the previous DSP unit.
+	// length = length in samples at this mix time.
+	// userdata = user parameter passed through in FSOUND_DSP_Create.
+	
+	LLWindGen<LLAudioEngine_FMODEX::MIXBUFFERFORMAT> *windgen;
+	FMOD::DSP *thisdsp = (FMOD::DSP *)dsp_state->instance;
+
+	thisdsp->getUserData((void **)&windgen);
+	S32 channels, configwidth, configheight;
+	thisdsp->getInfo(0, 0, &channels, &configwidth, &configheight);
+	
+	windgen->windGenerate((LLAudioEngine_FMODEX::MIXBUFFERFORMAT *)newbuffer, length);
+
+	return FMOD_OK;
+}
diff --git a/indra/llaudio/llaudioengine_fmodex.h b/indra/llaudio/llaudioengine_fmodex.h
new file mode 100644
index 0000000000..cf3d967d4f
--- /dev/null
+++ b/indra/llaudio/llaudioengine_fmodex.h
@@ -0,0 +1,129 @@
+/** 
+ * @file audioengine_fmodex.h
+ * @brief Definition of LLAudioEngine class abstracting the audio 
+ * support as a FMODEX implementation
+ *
+ * $LicenseInfo:firstyear=2002&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, 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
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_AUDIOENGINE_FMODEX_H
+#define LL_AUDIOENGINE_FMODEX_H
+
+#include "llaudioengine.h"
+#include "lllistener_fmod.h"
+#include "llwindgen.h"
+
+//Stubs
+class LLAudioStreamManagerFMODEX;
+namespace FMOD
+{
+	class System;
+	class Channel;
+	class ChannelGroup;
+	class Sound;
+	class DSP;
+}
+
+//Interfaces
+class LLAudioEngine_FMODEX : public LLAudioEngine 
+{
+public:
+	LLAudioEngine_FMODEX(bool enable_profiler);
+	virtual ~LLAudioEngine_FMODEX();
+
+	// initialization/startup/shutdown
+	virtual bool init(const S32 num_channels, void *user_data);
+	virtual std::string getDriverName(bool verbose);
+	virtual void allocateListener();
+
+	virtual void shutdown();
+
+	/*virtual*/ bool initWind();
+	/*virtual*/ void cleanupWind();
+
+	/*virtual*/void updateWind(LLVector3 direction, F32 camera_height_above_water);
+
+	typedef F32 MIXBUFFERFORMAT;
+
+	FMOD::System *getSystem()				const {return mSystem;}
+protected:
+	/*virtual*/ LLAudioBuffer *createBuffer(); // Get a free buffer, or flush an existing one if you have to.
+	/*virtual*/ LLAudioChannel *createChannel(); // Create a new audio channel.
+
+	/*virtual*/ void setInternalGain(F32 gain);
+
+	bool mInited;
+
+	LLWindGen<MIXBUFFERFORMAT> *mWindGen;
+
+	FMOD::DSP *mWindDSP;
+	FMOD::System *mSystem;
+	bool mEnableProfiler;
+
+public:
+	static FMOD::ChannelGroup *mChannelGroups[LLAudioEngine::AUDIO_TYPE_COUNT];
+};
+
+
+class LLAudioChannelFMODEX : public LLAudioChannel
+{
+public:
+	LLAudioChannelFMODEX(FMOD::System *audioengine);
+	virtual ~LLAudioChannelFMODEX();
+
+protected:
+	/*virtual*/ void play();
+	/*virtual*/ void playSynced(LLAudioChannel *channelp);
+	/*virtual*/ void cleanup();
+	/*virtual*/ bool isPlaying();
+
+	/*virtual*/ bool updateBuffer();
+	/*virtual*/ void update3DPosition();
+	/*virtual*/ void updateLoop();
+
+	void set3DMode(bool use3d);
+protected:
+	FMOD::System *getSystem()	const {return mSystemp;}
+	FMOD::System *mSystemp;
+	FMOD::Channel *mChannelp;
+	S32 mLastSamplePos;
+};
+
+
+class LLAudioBufferFMODEX : public LLAudioBuffer
+{
+public:
+	LLAudioBufferFMODEX(FMOD::System *audioengine);
+	virtual ~LLAudioBufferFMODEX();
+
+	/*virtual*/ bool loadWAV(const std::string& filename);
+	/*virtual*/ U32 getLength();
+	friend class LLAudioChannelFMODEX;
+protected:
+	FMOD::System *getSystem()	const {return mSystemp;}
+	FMOD::System *mSystemp;
+	FMOD::Sound *getSound()		const{ return mSoundp; }
+	FMOD::Sound *mSoundp;
+};
+
+
+#endif // LL_AUDIOENGINE_FMODEX_H
diff --git a/indra/llaudio/lllistener_fmodex.cpp b/indra/llaudio/lllistener_fmodex.cpp
new file mode 100644
index 0000000000..4bc745b89a
--- /dev/null
+++ b/indra/llaudio/lllistener_fmodex.cpp
@@ -0,0 +1,135 @@
+/** 
+ * @file listener_fmodex.cpp
+ * @brief Implementation of LISTENER class abstracting the audio
+ * support as a FMODEX implementation (windows only)
+ *
+ * $LicenseInfo:firstyear=2002&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, 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
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#include "linden_common.h"
+#include "llaudioengine.h"
+#include "lllistener_fmodex.h"
+#include "fmod.hpp"
+
+//-----------------------------------------------------------------------
+// constructor
+//-----------------------------------------------------------------------
+LLListener_FMODEX::LLListener_FMODEX(FMOD::System *system)
+{
+	mSystem = system;
+	init();
+}
+
+//-----------------------------------------------------------------------
+LLListener_FMODEX::~LLListener_FMODEX()
+{
+}
+
+//-----------------------------------------------------------------------
+void LLListener_FMODEX::init(void)
+{
+	// do inherited
+	LLListener::init();
+	mDopplerFactor = 1.0f;
+	mRolloffFactor = 1.0f;
+}
+
+//-----------------------------------------------------------------------
+void LLListener_FMODEX::translate(LLVector3 offset)
+{
+	LLListener::translate(offset);
+
+	mSystem->set3DListenerAttributes(0, (FMOD_VECTOR*)mPosition.mV, NULL, (FMOD_VECTOR*)mListenAt.mV, (FMOD_VECTOR*)mListenUp.mV);
+}
+
+//-----------------------------------------------------------------------
+void LLListener_FMODEX::setPosition(LLVector3 pos)
+{
+	LLListener::setPosition(pos);
+
+	mSystem->set3DListenerAttributes(0, (FMOD_VECTOR*)mPosition.mV, NULL, (FMOD_VECTOR*)mListenAt.mV, (FMOD_VECTOR*)mListenUp.mV);
+}
+
+//-----------------------------------------------------------------------
+void LLListener_FMODEX::setVelocity(LLVector3 vel)
+{
+	LLListener::setVelocity(vel);
+
+	mSystem->set3DListenerAttributes(0, NULL, (FMOD_VECTOR*)mVelocity.mV, (FMOD_VECTOR*)mListenAt.mV, (FMOD_VECTOR*)mListenUp.mV);
+}
+
+//-----------------------------------------------------------------------
+void LLListener_FMODEX::orient(LLVector3 up, LLVector3 at)
+{
+	LLListener::orient(up, at);
+
+	// Welcome to the transition between right and left
+	// (coordinate systems, that is)
+	// Leaving the at vector alone results in a L/R reversal
+	// since DX is left-handed and we (LL, OpenGL, OpenAL) are right-handed
+	at = -at;
+
+	mSystem->set3DListenerAttributes(0, NULL, NULL, (FMOD_VECTOR*)at.mV, (FMOD_VECTOR*)up.mV);
+}
+
+//-----------------------------------------------------------------------
+void LLListener_FMODEX::commitDeferredChanges()
+{
+	mSystem->update();
+}
+
+
+void LLListener_FMODEX::setRolloffFactor(F32 factor)
+{
+	//An internal FMODEx optimization skips 3D updates if there have not been changes to the 3D sound environment.
+	//Sadly, a change in rolloff is not accounted for, thus we must touch the listener properties as well.
+	//In short: Changing the position ticks a dirtyflag inside fmodex, which makes it not skip 3D processing next update call.
+	if(mRolloffFactor != factor)
+	{
+		LLVector3 pos = mVelocity - LLVector3(0.f,0.f,.1f);
+		mSystem->set3DListenerAttributes(0, (FMOD_VECTOR*)pos.mV, NULL, NULL, NULL);
+		mSystem->set3DListenerAttributes(0, (FMOD_VECTOR*)mVelocity.mV, NULL, NULL, NULL);
+	}
+	mRolloffFactor = factor;
+	mSystem->set3DSettings(mDopplerFactor, 1.f, mRolloffFactor);
+}
+
+
+F32 LLListener_FMODEX::getRolloffFactor()
+{
+	return mRolloffFactor;
+}
+
+
+void LLListener_FMODEX::setDopplerFactor(F32 factor)
+{
+	mDopplerFactor = factor;
+	mSystem->set3DSettings(mDopplerFactor, 1.f, mRolloffFactor);
+}
+
+
+F32 LLListener_FMODEX::getDopplerFactor()
+{
+	return mDopplerFactor;
+}
+
+
diff --git a/indra/llaudio/lllistener_fmodex.h b/indra/llaudio/lllistener_fmodex.h
new file mode 100644
index 0000000000..073b65d53a
--- /dev/null
+++ b/indra/llaudio/lllistener_fmodex.h
@@ -0,0 +1,65 @@
+/** 
+ * @file listener_fmodex.h
+ * @brief Description of LISTENER class abstracting the audio support
+ * as an FMOD 3D implementation (windows and Linux)
+ *
+ * $LicenseInfo:firstyear=2002&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, 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
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LISTENER_FMODEX_H
+#define LL_LISTENER_FMODEX_H
+
+#include "lllistener.h"
+
+//Stubs
+namespace FMOD
+{
+	class System;
+}
+
+//Interfaces
+class LLListener_FMODEX : public LLListener
+{
+ public:  
+	LLListener_FMODEX(FMOD::System *system);
+	virtual ~LLListener_FMODEX();
+	virtual void init();  
+
+	virtual void translate(LLVector3 offset);
+	virtual void setPosition(LLVector3 pos);
+	virtual void setVelocity(LLVector3 vel);
+	virtual void orient(LLVector3 up, LLVector3 at);
+	virtual void commitDeferredChanges();
+
+	virtual void setDopplerFactor(F32 factor);
+	virtual F32 getDopplerFactor();
+	virtual void setRolloffFactor(F32 factor);
+	virtual F32 getRolloffFactor();
+ protected:
+	 FMOD::System *mSystem;
+	 F32 mDopplerFactor;
+	 F32 mRolloffFactor;
+};
+
+#endif
+
+
diff --git a/indra/llaudio/llstreamingaudio.h b/indra/llaudio/llstreamingaudio.h
index 20104af744..93479f9d59 100644
--- a/indra/llaudio/llstreamingaudio.h
+++ b/indra/llaudio/llstreamingaudio.h
@@ -45,6 +45,8 @@ class LLStreamingAudioInterface
 	virtual void setGain(F32 vol) = 0;
 	virtual F32 getGain() = 0;
 	virtual std::string getURL() = 0;
+	virtual bool supportsAdjustableBufferSizes(){return false;}
+	virtual void setBufferSizes(U32 streambuffertime, U32 decodebuffertime){};
 };
 
 #endif // LL_STREAMINGAUDIO_H
diff --git a/indra/llaudio/llstreamingaudio_fmodex.cpp b/indra/llaudio/llstreamingaudio_fmodex.cpp
new file mode 100644
index 0000000000..463d816331
--- /dev/null
+++ b/indra/llaudio/llstreamingaudio_fmodex.cpp
@@ -0,0 +1,382 @@
+/** 
+ * @file streamingaudio_fmodex.cpp
+ * @brief LLStreamingAudio_FMODEX implementation
+ *
+ * $LicenseInfo:firstyear=2002&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, 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
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#include "linden_common.h"
+
+#include "llmath.h"
+
+#include "fmod.hpp"
+#include "fmod_errors.h"
+
+#include "llstreamingaudio_fmodex.h"
+
+
+class LLAudioStreamManagerFMODEX
+{
+public:
+	LLAudioStreamManagerFMODEX(FMOD::System *system, const std::string& url);
+	FMOD::Channel* startStream();
+	bool stopStream(); // Returns true if the stream was successfully stopped.
+	bool ready();
+
+	const std::string& getURL() 	{ return mInternetStreamURL; }
+
+	FMOD_OPENSTATE getOpenState(unsigned int* percentbuffered=NULL, bool* starving=NULL, bool* diskbusy=NULL);
+protected:
+	FMOD::System* mSystem;
+	FMOD::Channel* mStreamChannel;
+	FMOD::Sound* mInternetStream;
+	bool mReady;
+
+	std::string mInternetStreamURL;
+};
+
+
+
+//---------------------------------------------------------------------------
+// Internet Streaming
+//---------------------------------------------------------------------------
+LLStreamingAudio_FMODEX::LLStreamingAudio_FMODEX(FMOD::System *system) :
+	mSystem(system),
+	mCurrentInternetStreamp(NULL),
+	mFMODInternetStreamChannelp(NULL),
+	mGain(1.0f)
+{
+	// Number of milliseconds of audio to buffer for the audio card.
+	// 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);
+
+	// 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 
+	// to prebuffer 40% of that when we first connect, and we want it 
+	// to rebuffer 80% of that whenever we encounter a buffer underrun.
+
+	// Leave the net buffer properties at the default.
+	//FSOUND_Stream_Net_SetBufferProperties(20000, 40, 80);
+}
+
+
+LLStreamingAudio_FMODEX::~LLStreamingAudio_FMODEX()
+{
+	// nothing interesting/safe to do.
+}
+
+
+void LLStreamingAudio_FMODEX::start(const std::string& url)
+{
+	//if (!mInited)
+	//{
+	//	llwarns << "startInternetStream before audio initialized" << llendl;
+	//	return;
+	//}
+
+	// "stop" stream but don't clear url, etc. in case url == mInternetStreamURL
+	stop();
+
+	if (!url.empty())
+	{
+		llinfos << "Starting internet stream: " << url << llendl;
+		mCurrentInternetStreamp = new LLAudioStreamManagerFMODEX(mSystem,url);
+		mURL = url;
+	}
+	else
+	{
+		llinfos << "Set internet stream to null" << llendl;
+		mURL.clear();
+	}
+}
+
+
+void LLStreamingAudio_FMODEX::update()
+{
+	// Kill dead internet streams, if possible
+	std::list<LLAudioStreamManagerFMODEX *>::iterator iter;
+	for (iter = mDeadStreams.begin(); iter != mDeadStreams.end();)
+	{
+		LLAudioStreamManagerFMODEX *streamp = *iter;
+		if (streamp->stopStream())
+		{
+			llinfos << "Closed dead stream" << llendl;
+			delete streamp;
+			mDeadStreams.erase(iter++);
+		}
+		else
+		{
+			iter++;
+		}
+	}
+
+	// Don't do anything if there are no streams playing
+	if (!mCurrentInternetStreamp)
+	{
+		return;
+	}
+
+	unsigned int progress;
+	bool starving;
+	bool diskbusy;
+	FMOD_OPENSTATE open_state = mCurrentInternetStreamp->getOpenState(&progress, &starving, &diskbusy);
+
+	if (open_state == FMOD_OPENSTATE_READY)
+	{
+		// Stream is live
+
+		// start the stream if it's ready
+		if (!mFMODInternetStreamChannelp &&
+			(mFMODInternetStreamChannelp = mCurrentInternetStreamp->startStream()))
+		{
+			// Reset volume to previously set volume
+			setGain(getGain());
+			mFMODInternetStreamChannelp->setPaused(false);
+			mLastStarved.stop();
+		}
+	}
+	else if(open_state == FMOD_OPENSTATE_ERROR)
+	{
+		stop();
+		return;
+	}
+
+	if(mFMODInternetStreamChannelp)
+	{
+		FMOD::Sound *sound = NULL;
+
+		if(mFMODInternetStreamChannelp->getCurrentSound(&sound) == FMOD_OK && sound)
+		{
+			if(starving)
+			{
+				if(!mLastStarved.getStarted())
+				{
+					llinfos << "Stream starvation detected! Muting stream audio until it clears." << llendl;
+					llinfos << "  (diskbusy="<<diskbusy<<")" << llendl;
+					llinfos << "  (progress="<<progress<<")" << llendl;
+					mFMODInternetStreamChannelp->setMute(true);
+				}
+				mLastStarved.start();
+			}
+			else if(mLastStarved.getStarted() && mLastStarved.getElapsedTimeF32() > 1.f)
+			{
+				mLastStarved.stop();
+				mFMODInternetStreamChannelp->setMute(false);
+			}
+		}
+	}
+}
+
+void LLStreamingAudio_FMODEX::stop()
+{
+	mLastStarved.stop();
+
+	if (mFMODInternetStreamChannelp)
+	{
+		mFMODInternetStreamChannelp->setPaused(true);
+		mFMODInternetStreamChannelp->setPriority(0);
+		mFMODInternetStreamChannelp = NULL;
+	}
+
+	if (mCurrentInternetStreamp)
+	{
+		llinfos << "Stopping internet stream: " << mCurrentInternetStreamp->getURL() << llendl;
+		if (mCurrentInternetStreamp->stopStream())
+		{
+			delete mCurrentInternetStreamp;
+		}
+		else
+		{
+			llwarns << "Pushing stream to dead list: " << mCurrentInternetStreamp->getURL() << llendl;
+			mDeadStreams.push_back(mCurrentInternetStreamp);
+		}
+		mCurrentInternetStreamp = NULL;
+		//mURL.clear();
+	}
+}
+
+void LLStreamingAudio_FMODEX::pause(int pauseopt)
+{
+	if (pauseopt < 0)
+	{
+		pauseopt = mCurrentInternetStreamp ? 1 : 0;
+	}
+
+	if (pauseopt)
+	{
+		if (mCurrentInternetStreamp)
+		{
+			stop();
+		}
+	}
+	else
+	{
+		start(getURL());
+	}
+}
+
+
+// A stream is "playing" if it has been requested to start.  That
+// doesn't necessarily mean audio is coming out of the speakers.
+int LLStreamingAudio_FMODEX::isPlaying()
+{
+	if (mCurrentInternetStreamp)
+	{
+		return 1; // Active and playing
+	}
+	else if (!mURL.empty())
+	{
+		return 2; // "Paused"
+	}
+	else
+	{
+		return 0;
+	}
+}
+
+
+F32 LLStreamingAudio_FMODEX::getGain()
+{
+	return mGain;
+}
+
+
+std::string LLStreamingAudio_FMODEX::getURL()
+{
+	return mURL;
+}
+
+
+void LLStreamingAudio_FMODEX::setGain(F32 vol)
+{
+	mGain = vol;
+
+	if (mFMODInternetStreamChannelp)
+	{
+		vol = llclamp(vol * vol, 0.f, 1.f);	//should vol be squared here?
+
+		mFMODInternetStreamChannelp->setVolume(vol);
+	}
+}
+
+///////////////////////////////////////////////////////
+// manager of possibly-multiple internet audio streams
+
+LLAudioStreamManagerFMODEX::LLAudioStreamManagerFMODEX(FMOD::System *system, const std::string& url) :
+	mSystem(system),
+	mStreamChannel(NULL),
+	mInternetStream(NULL),
+	mReady(false)
+{
+	mInternetStreamURL = url;
+
+	/*FMOD_CREATESOUNDEXINFO exinfo;
+	memset(&exinfo,0,sizeof(exinfo));
+	exinfo.cbsize = sizeof(exinfo);
+	exinfo.suggestedsoundtype = FMOD_SOUND_TYPE_OGGVORBIS;	//Hint to speed up loading.*/
+
+	FMOD_RESULT result = mSystem->createStream(url.c_str(), FMOD_2D | FMOD_NONBLOCKING | FMOD_MPEGSEARCH | FMOD_IGNORETAGS, 0, &mInternetStream);
+
+	if (result!= FMOD_OK)
+	{
+		llwarns << "Couldn't open fmod stream, error "
+			<< FMOD_ErrorString(result)
+			<< llendl;
+		mReady = false;
+		return;
+	}
+
+	mReady = true;
+}
+
+FMOD::Channel *LLAudioStreamManagerFMODEX::startStream()
+{
+	// We need a live and opened stream before we try and play it.
+	if (!mInternetStream || getOpenState() != FMOD_OPENSTATE_READY)
+	{
+		llwarns << "No internet stream to start playing!" << llendl;
+		return NULL;
+	}
+
+	if(mStreamChannel)
+		return mStreamChannel;	//Already have a channel for this stream.
+
+	mSystem->playSound(FMOD_CHANNEL_FREE, mInternetStream, true, &mStreamChannel);
+	return mStreamChannel;
+}
+
+bool LLAudioStreamManagerFMODEX::stopStream()
+{
+	if (mInternetStream)
+	{
+
+
+		bool close = true;
+		switch (getOpenState())
+		{
+		case FMOD_OPENSTATE_CONNECTING:
+			close = false;
+			break;
+		/*case FSOUND_STREAM_NET_NOTCONNECTED:
+		case FSOUND_STREAM_NET_BUFFERING:
+		case FSOUND_STREAM_NET_READY:
+		case FSOUND_STREAM_NET_ERROR:*/
+		default:
+			close = true;
+		}
+
+		if (close)
+		{
+			mInternetStream->release();
+			mStreamChannel = NULL;
+			mInternetStream = NULL;
+			return true;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	else
+	{
+		return true;
+	}
+}
+
+FMOD_OPENSTATE LLAudioStreamManagerFMODEX::getOpenState(unsigned int* percentbuffered, bool* starving, bool* diskbusy)
+{
+	FMOD_OPENSTATE state;
+	mInternetStream->getOpenState(&state, percentbuffered, starving, diskbusy);
+	return state;
+}
+
+void LLStreamingAudio_FMODEX::setBufferSizes(U32 streambuffertime, U32 decodebuffertime)
+{
+	mSystem->setStreamBufferSize(streambuffertime/1000*128*128, FMOD_TIMEUNIT_RAWBYTES);
+	FMOD_ADVANCEDSETTINGS settings;
+	memset(&settings,0,sizeof(settings));
+	settings.cbsize=sizeof(settings);
+	settings.defaultDecodeBufferSize = decodebuffertime;//ms
+	mSystem->setAdvancedSettings(&settings);
+}
diff --git a/indra/llaudio/llstreamingaudio_fmodex.h b/indra/llaudio/llstreamingaudio_fmodex.h
new file mode 100644
index 0000000000..3751dd60ad
--- /dev/null
+++ b/indra/llaudio/llstreamingaudio_fmodex.h
@@ -0,0 +1,75 @@
+/** 
+ * @file streamingaudio_fmodex.h
+ * @brief Definition of LLStreamingAudio_FMODEX implementation
+ *
+ * $LicenseInfo:firstyear=2002&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, 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
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_STREAMINGAUDIO_FMOD_H
+#define LL_STREAMINGAUDIO_FMOD_H
+
+#include "stdtypes.h" // from llcommon
+
+#include "llstreamingaudio.h"
+#include "lltimer.h"
+
+//Stubs
+class LLAudioStreamManagerFMODEX;
+namespace FMOD
+{
+	class System;
+	class Channel;
+}
+
+//Interfaces
+class LLStreamingAudio_FMODEX : public LLStreamingAudioInterface
+{
+ public:
+	LLStreamingAudio_FMODEX(FMOD::System *system);
+	/*virtual*/ ~LLStreamingAudio_FMODEX();
+
+	/*virtual*/ void start(const std::string& url);
+	/*virtual*/ void stop();
+	/*virtual*/ void pause(int pause);
+	/*virtual*/ void update();
+	/*virtual*/ int isPlaying();
+	/*virtual*/ void setGain(F32 vol);
+	/*virtual*/ F32 getGain();
+	/*virtual*/ std::string getURL();
+
+	/*virtual*/ bool supportsAdjustableBufferSizes(){return true;}
+	/*virtual*/ void setBufferSizes(U32 streambuffertime, U32 decodebuffertime);
+private:
+	FMOD::System *mSystem;
+
+	LLAudioStreamManagerFMODEX *mCurrentInternetStreamp;
+	FMOD::Channel *mFMODInternetStreamChannelp;
+	std::list<LLAudioStreamManagerFMODEX *> mDeadStreams;
+
+	std::string mURL;
+	F32 mGain;
+
+	LLTimer mLastStarved;
+};
+
+
+#endif // LL_STREAMINGAUDIO_FMOD_H
diff --git a/indra/llaudio/llwindgen.h b/indra/llaudio/llwindgen.h
index b9cecb60a1..719b0ecbf2 100644
--- a/indra/llaudio/llwindgen.h
+++ b/indra/llaudio/llwindgen.h
@@ -27,6 +27,7 @@
 #define WINDGEN_H
 
 #include "llcommon.h"
+#include "llrand.h"
 
 template <class MIXBUFFERFORMAT_T>
 class LLWindGen
@@ -54,7 +55,9 @@ 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
@@ -89,7 +92,7 @@ public:
 			
 			// Start with white noise
 			// This expression is fragile, rearrange it and it will break!
-			next_sample = (F32)rand() * (1.0f / (F32)(RAND_MAX / (U16_MAX / 8))) + (F32)(S16_MIN / 8);
+			next_sample = getNextSample();
 			
 			// Apply a pinking filter
 			// Magic numbers taken from PKE method at http://www.firstpr.com.au/dsp/pink-noise/
@@ -126,23 +129,13 @@ public:
 			for (U8 i=mSubSamples; i && numsamples; --i, --numsamples) 
 			{
 				mLastSample = mLastSample + delta;
-				S32	sample_right = (S32)(mLastSample * mCurrentPanGainR);
-				S32	sample_left = (S32)mLastSample - sample_right;
+				MIXBUFFERFORMAT_T	sample_right = (MIXBUFFERFORMAT_T)getClampedSample(clip, mLastSample * mCurrentPanGainR);
+				MIXBUFFERFORMAT_T	sample_left = (MIXBUFFERFORMAT_T)getClampedSample(clip, mLastSample - (F32)sample_right);
 				
-				if (!clip)
-				{
-					*cursamplep = (MIXBUFFERFORMAT_T)sample_left;
-					++cursamplep;
-					*cursamplep = (MIXBUFFERFORMAT_T)sample_right;
-					++cursamplep;
-				}
-				else
-				{
-					*cursamplep = (MIXBUFFERFORMAT_T)llclamp(sample_left, (S32)S16_MIN, (S32)S16_MAX);
-					++cursamplep;
-					*cursamplep = (MIXBUFFERFORMAT_T)llclamp(sample_right, (S32)S16_MIN, (S32)S16_MAX);
-					++cursamplep;
-				}
+				*cursamplep = sample_left;
+				++cursamplep;
+				*cursamplep = sample_right;
+				++cursamplep;
 			}
 		}
 		
@@ -173,4 +166,9 @@ private:
 	F32 mLastSample;
 };
 
+template<class T> inline const F32 LLWindGen<T>::getNextSample() { return (F32)rand() * (1.0f / (F32)(RAND_MAX / (U16_MAX / 8))) + (F32)(S16_MIN / 8); }
+template<> inline const F32 LLWindGen<F32>::getNextSample() { return ll_frand()-.5f; }
+template<class T> inline const F32 LLWindGen<T>::getClampedSample(bool clamp, F32 sample) { return clamp ? (F32)llclamp((S32)sample,(S32)S16_MIN,(S32)S16_MAX) : sample; }
+template<> inline const F32 LLWindGen<F32>::getClampedSample(bool clamp, F32 sample) { return sample; }
+
 #endif
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index b569808a06..793b01baa1 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -10,7 +10,8 @@ include(DirectX)
 include(OpenSSL)
 include(DragDrop)
 include(EXPAT)
-include(FMOD)
+include(FMODEX)
+set(FMOD OFF)
 include(OPENAL)
 include(FindOpenGL)
 include(Hunspell)
@@ -52,6 +53,14 @@ if (NOT HAVOK_TPV)
    add_subdirectory(${LLPHYSICSEXTENSIONS_SRC_DIR} llphysicsextensions)
 endif (NOT HAVOK_TPV)
 
+if(FMODEX)
+  include_directories(${FMODEX_INCLUDE_DIR})
+endif(FMODEX)
+
+if(FMOD)
+  include_directories(${FMOD_INCLUDE_DIR})
+endif(FMOD)
+
 include_directories(
     ${DBUSGLIB_INCLUDE_DIRS}
     ${JSONCPP_INCLUDE_DIR}
@@ -61,7 +70,6 @@ include_directories(
     ${LLCOMMON_INCLUDE_DIRS}
     ${LLCOREHTTP_INCLUDE_DIRS}
     ${LLPHYSICS_INCLUDE_DIRS}
-    ${FMOD_INCLUDE_DIR}
     ${LLIMAGE_INCLUDE_DIRS}
     ${LLKDU_INCLUDE_DIRS}
     ${LLINVENTORY_INCLUDE_DIRS}
@@ -1521,10 +1529,15 @@ if (OPENAL)
   set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_OPENAL")
 endif (OPENAL)
 
-if (FMOD)
-  set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_FMOD")
+if (FMOD OR FMODEX)
+  if (FMODEX)
+    set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_FMODEX")
+  endif (FMODEX)
+  if (FMOD)
+    set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_FMOD")
+  endif (FMOD)
 
-  if (DARWIN)
+  if (DARWIN AND FMOD)
     set(fmodwrapper_SOURCE_FILES fmodwrapper.cpp)
     add_library(fmodwrapper SHARED ${fmodwrapper_SOURCE_FILES})
     set(fmodwrapper_needed_LIBRARIES ${FMOD_LIBRARY} ${CARBON_LIBRARY})
@@ -1537,11 +1550,16 @@ if (FMOD)
       )
     set(FMODWRAPPER_LIBRARY fmodwrapper)
     target_link_libraries(fmodwrapper ${fmodwrapper_needed_LIBRARIES})
-  else (DARWIN)
-    # fmodwrapper unnecessary on linux or windows
-    set(FMODWRAPPER_LIBRARY ${FMOD_LIBRARY})
-  endif (DARWIN)
-endif (FMOD)
+  else (DARWIN AND FMOD)
+    # fmodwrapper unnecessary on linux or windows for fmod and darwin for fmodex
+    if (FMODEX)
+       set(FMODWRAPPER_LIBRARY ${FMODEX_LIBRARY})
+    endif (FMODEX)
+    if (FMOD)
+       set(FMODWRAPPER_LIBRARY ${FMOD_LIBRARY})
+    endif (FMOD)
+  endif (DARWIN AND FMOD)
+endif (FMOD OR FMODEX)
 
 set_source_files_properties(llstartup.cpp PROPERTIES COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS}")
 
@@ -1616,9 +1634,6 @@ if (WINDOWS)
       ${SHARED_LIB_STAGING_DIR}/Release/openjpeg.dll
       ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/openjpeg.dll
       ${SHARED_LIB_STAGING_DIR}/Debug/openjpegd.dll
-      ${SHARED_LIB_STAGING_DIR}/Release/fmod.dll
-      ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/fmod.dll
-      ${SHARED_LIB_STAGING_DIR}/Debug/fmod.dll
       ${SHARED_LIB_STAGING_DIR}/Release/msvcr100.dll
       ${SHARED_LIB_STAGING_DIR}/Release/msvcp100.dll
       ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/msvcr100.dll
@@ -1683,6 +1698,22 @@ if (WINDOWS)
       windows-updater
       )
 
+    if (FMODEX)
+      list(APPEND COPY_INPUT_DEPENDENCIES
+           ${SHARED_LIB_STAGING_DIR}/Release/fmodex.dll
+           ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/fmodex.dll
+           ${SHARED_LIB_STAGING_DIR}/Debug/fmodexL.dll
+          )
+    endif (FMODEX)
+
+    if (FMOD)
+      list(APPEND COPY_INPUT_DEPENDENCIES
+           ${SHARED_LIB_STAGING_DIR}/Release/fmod.dll
+           ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/fmod.dll
+           ${SHARED_LIB_STAGING_DIR}/Debug/fmod.dll
+          )
+    endif (FMOD)
+
     add_custom_command(
       OUTPUT  ${CMAKE_CFG_INTDIR}/copy_touched.bat
       COMMAND ${PYTHON_EXECUTABLE}
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 2e91d10cd3..995546ab23 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -269,6 +269,17 @@
       <key>Value</key>
       <real>1.0</real>
     </map>
+    <key>AudioLevelUnderwaterRolloff</key>
+    <map>
+      <key>Comment</key>
+      <string>Controls the distance-based dropoff of audio volume underwater(fraction or multiple of default audio rolloff)</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>F32</string>
+      <key>Value</key>
+      <real>5.0</real>
+    </map>
     <key>AudioLevelSFX</key>
     <map>
       <key>Comment</key>
@@ -14094,5 +14105,38 @@
     <key>Value</key>
     <integer>0</integer>
   </map>
+  <key>FMODExProfilerEnable</key>
+  <map>
+    <key>Comment</key>
+    <string>Enable profiler tool if using FMOD Ex</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>Boolean</string>
+    <key>Value</key>
+    <integer>0</integer>
+    </map>
+  <key>FMODExDecodeBufferSize</key>
+  <map>
+    <key>Comment</key>
+    <string>Sets the streaming decode buffer size (in milliseconds)</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>U32</string>
+    <key>Value</key>
+    <integer>1000</integer>
+    </map>
+  <key>FMODExStreamBufferSize</key>
+  <map>
+    <key>Comment</key>
+    <string>Sets the streaming buffer size (in milliseconds)</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>U32</string>
+    <key>Value</key>
+    <integer>7000</integer>
+  </map>
 </map>
 </llsd>
diff --git a/indra/newview/linux_tools/wrapper.sh b/indra/newview/linux_tools/wrapper.sh
index 20936c6460..71b7e74c63 100755
--- a/indra/newview/linux_tools/wrapper.sh
+++ b/indra/newview/linux_tools/wrapper.sh
@@ -4,17 +4,21 @@
 ## These options are for self-assisted troubleshooting during this beta
 ## testing phase; you should not usually need to touch them.
 
+## - Avoids using any FMOD Ex audio driver.
+#export LL_BAD_FMODEX_DRIVER=x
 ## - Avoids using any OpenAL audio driver.
 #export LL_BAD_OPENAL_DRIVER=x
 ## - Avoids using any FMOD audio driver.
 #export LL_BAD_FMOD_DRIVER=x
 
+## - Avoids using the FMOD Ex PulseAudio audio driver.
+#export LL_BAD_FMOD_PULSEAUDIO=x
+## - Avoids using the FMOD or FMOD Ex ALSA audio driver.
+#export LL_BAD_FMOD_ALSA=x
+## - Avoids using the FMOD or FMOD Ex OSS audio driver.
+#export LL_BAD_FMOD_OSS=x
 ## - Avoids using the FMOD ESD audio driver.
 #export LL_BAD_FMOD_ESD=x
-## - Avoids using the FMOD OSS audio driver.
-#export LL_BAD_FMOD_OSS=x
-## - Avoids using the FMOD ALSA audio driver.
-#export LL_BAD_FMOD_ALSA=x
 
 ## - Avoids the optional OpenGL extensions which have proven most problematic
 ##   on some hardware.  Disabling this option may cause BETTER PERFORMANCE but
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 0e3007724b..6a874d1af5 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -37,6 +37,10 @@
 #include "llviewermedia_streamingaudio.h"
 #include "llaudioengine.h"
 
+#ifdef LL_FMODEX
+# include "llaudioengine_fmodex.h"
+#endif
+
 #ifdef LL_FMOD
 # include "llaudioengine_fmod.h"
 #endif
@@ -623,6 +627,17 @@ bool idle_startup()
 		{
 			gAudiop = NULL;
 
+#ifdef LL_FMODEX		
+			if (!gAudiop
+#if !LL_WINDOWS
+			    && NULL == getenv("LL_BAD_FMODEX_DRIVER")
+#endif // !LL_WINDOWS
+			    )
+			{
+				gAudiop = (LLAudioEngine *) new LLAudioEngine_FMODEX(gSavedSettings.getBOOL("FMODExProfilerEnable"));
+			}
+#endif
+
 #ifdef LL_OPENAL
 			if (!gAudiop
 #if !LL_WINDOWS
diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp
index 8d8c401dac..f349eeac63 100644
--- a/indra/newview/llvieweraudio.cpp
+++ b/indra/newview/llvieweraudio.cpp
@@ -43,6 +43,8 @@
 #include "llparcel.h"
 #include "llviewermessage.h"
 
+#include "llstreamingaudio.h"
+
 /////////////////////////////////////////////////////////
 
 LLViewerAudio::LLViewerAudio() :
@@ -101,6 +103,11 @@ void LLViewerAudio::startInternetStreamWithAutoFade(std::string streamURI)
 		else
 		{
 			mFadeState = FADE_IN;
+
+			LLStreamingAudioInterface *stream = gAudiop->getStreamingAudioImpl();
+			if(stream && stream->supportsAdjustableBufferSizes())
+				stream->setBufferSizes(gSavedSettings.getU32("FMODExStreamBufferSize"),gSavedSettings.getU32("FMODExDecodeBufferSize"));
+
 			gAudiop->startInternetStream(mNextStreamURI);
 			startFading();
 			registerIdleListener();
@@ -156,6 +163,11 @@ bool LLViewerAudio::onIdleUpdate()
 			if (!mNextStreamURI.empty())
 			{
 				mFadeState = FADE_IN;
+
+				LLStreamingAudioInterface *stream = gAudiop->getStreamingAudioImpl();
+				if(stream && stream->supportsAdjustableBufferSizes())
+					stream->setBufferSizes(gSavedSettings.getU32("FMODExStreamBufferSize"),gSavedSettings.getU32("FMODExDecodeBufferSize"));
+
 				gAudiop->startInternetStream(mNextStreamURI);
 				startFading();
 			}
@@ -385,7 +397,12 @@ void audio_update_volume(bool force_update)
 		gAudiop->setMasterGain ( master_volume );
 
 		gAudiop->setDopplerFactor(gSavedSettings.getF32("AudioLevelDoppler"));
-		gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff"));
+
+		if(!LLViewerCamera::getInstance()->cameraUnderWater())
+			gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff"));
+		else
+			gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelUnderwaterRolloff"));
+
 		gAudiop->setMuted(mute_audio || progress_view_visible);
 		
 		if (force_update)
@@ -466,44 +483,22 @@ void audio_update_listener()
 void audio_update_wind(bool force_update)
 {
 #ifdef kAUDIO_ENABLE_WIND
-	//
-	//  Extract height above water to modulate filter by whether above/below water 
-	// 
+
 	LLViewerRegion* region = gAgent.getRegion();
 	if (region)
 	{
-		static F32 last_camera_water_height = -1000.f;
-		LLVector3 camera_pos = gAgentCamera.getCameraPositionAgent();
-		F32 camera_water_height = camera_pos.mV[VZ] - region->getWaterHeight();
-		
-		//
-		//  Don't update rolloff factor unless water surface has been crossed
-		//
-		if (force_update || (last_camera_water_height * camera_water_height) < 0.f)
-		{
-            static LLUICachedControl<F32> rolloff("AudioLevelRolloff", 1.0f);
-			if (camera_water_height < 0.f)
-			{
-				gAudiop->setRolloffFactor(rolloff * LL_ROLLOFF_MULTIPLIER_UNDER_WATER);
-			}
-			else 
-			{
-				gAudiop->setRolloffFactor(rolloff);
-			}
-		}
-        
-        // Scale down the contribution of weather-simulation wind to the
-        // ambient wind noise.  Wind velocity averages 3.5 m/s, with gusts to 7 m/s
-        // whereas steady-state avatar walk velocity is only 3.2 m/s.
-        // Without this the world feels desolate on first login when you are
-        // standing still.
-        static LLUICachedControl<F32> wind_level("AudioLevelWind", 0.5f);
-        LLVector3 scaled_wind_vec = gWindVec * wind_level;
-        
-        // Mix in the avatar's motion, subtract because when you walk north,
-        // the apparent wind moves south.
-        LLVector3 final_wind_vec = scaled_wind_vec - gAgent.getVelocity();
-        
+		// Scale down the contribution of weather-simulation wind to the
+		// ambient wind noise.  Wind velocity averages 3.5 m/s, with gusts to 7 m/s
+		// whereas steady-state avatar walk velocity is only 3.2 m/s.
+		// Without this the world feels desolate on first login when you are
+		// standing still.
+		static LLUICachedControl<F32> wind_level("AudioLevelWind", 0.5f);
+		LLVector3 scaled_wind_vec = gWindVec * wind_level;
+
+		// Mix in the avatar's motion, subtract because when you walk north,
+		// the apparent wind moves south.
+		LLVector3 final_wind_vec = scaled_wind_vec - gAgent.getVelocity();
+
 		// rotate the wind vector to be listener (agent) relative
 		gRelativeWindVec = gAgent.getFrameAgent().rotateToLocal( final_wind_vec );
 
@@ -536,8 +531,7 @@ void audio_update_wind(bool force_update)
 			gAudiop->mMaxWindGain = llmax(gAudiop->mMaxWindGain - volume_delta, 0.f);
 		}
 		
-		last_camera_water_height = camera_water_height;
-		gAudiop->updateWind(gRelativeWindVec, camera_water_height);
+		gAudiop->updateWind(gRelativeWindVec, gAgentCamera.getCameraPositionAgent()[VZ] - gAgent.getRegion()->getWaterHeight());
 	}
 #endif
 }
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index 051f5f4485..a62f73deef 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -655,6 +655,7 @@ void settings_setup_listeners()
 	gSavedSettings.getControl("AudioLevelVoice")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
 	gSavedSettings.getControl("AudioLevelDoppler")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
 	gSavedSettings.getControl("AudioLevelRolloff")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
+	gSavedSettings.getControl("AudioLevelUnderwaterRolloff")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
 	gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
 	gSavedSettings.getControl("MuteMusic")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
 	gSavedSettings.getControl("MuteMedia")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index ea75d4f4f6..cdd227e9fe 100644
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -367,6 +367,14 @@ class WindowsManifest(ViewerManifest):
                 print err.message
                 print "Skipping COLLADA and GLOD libraries (assumming linked statically)"
 
+            # Get fmodex dll, continue if missing
+            try:
+                if self.args['configuration'].lower() == 'debug':
+                    self.path("fmodexL.dll")
+                else:
+                    self.path("fmodex.dll")
+            except:
+                print "Skipping fmodex audio library(assuming other audio engine)"
 
             # Get fmod dll, continue if missing
             if not self.path("fmod.dll"):
@@ -743,6 +751,7 @@ class DarwinManifest(ViewerManifest):
                                 "libcollada14dom.dylib",
                                 "libexpat.1.5.2.dylib",
                                 "libexception_handler.dylib",
+                                "libfmodex.dylib",
                                 "libGLOD.dylib",
                                 ):
                     dylibs += path_optional(os.path.join(libdir, libfile), libfile)
@@ -1125,6 +1134,15 @@ class Linux_i686Manifest(LinuxManifest):
             except:
                     print "Skipping libfmod-3.75.so - not found"
                     pass
+
+            try:
+                    self.path("libfmodex-*.so")
+                    self.path("libfmodex.so")
+                    pass
+            except:
+                    print "Skipping libfmodex.so - not found"
+                    pass
+
             self.end_prefix("lib")
 
             # Vivox runtimes
-- 
cgit v1.2.3


From fa12377b0de935b2a09ee46f5195cfed96dbe557 Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Tue, 22 Jan 2013 15:55:31 -0800
Subject: Update 3p libs to include debug version too

---
 autobuild.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/autobuild.xml b/autobuild.xml
index 376a1d1d6d..b7550e34ca 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -546,9 +546,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>3590b83d65b7dc4dd7f6040c179b49f3</string>
+              <string>c6f551e728295ff798d5804aa4e3671f</string>
               <key>url</key>
-              <string>http://private-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-fmodex-private/arch/Darwin/fmodex-4.44.04-darwin-20130118.tar.bz2</string>
+              <string>http://private-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-fmodex-private/arch/Darwin/fmodex-4.44.04-darwin-20130122.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin</string>
-- 
cgit v1.2.3


From e503acf7b8f6721a4801e2c887b50ce67c0d307d Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Wed, 23 Jan 2013 13:28:54 -0800
Subject: Fix llaudio CMake file to not use FMOD - only FMODEX

---
 indra/llaudio/CMakeLists.txt | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/indra/llaudio/CMakeLists.txt b/indra/llaudio/CMakeLists.txt
index e404cfc10e..b2d7b7c911 100644
--- a/indra/llaudio/CMakeLists.txt
+++ b/indra/llaudio/CMakeLists.txt
@@ -5,13 +5,8 @@ project(llaudio)
 include(00-Common)
 include(Audio)
 include(LLAudio)
-if (FMODEX)
-  include(FMODEX)
-  set(FMOD OFF)
-endif (FMODEX)
-if (NOT FMODEX)
-  include(FMOD)
-endif (NOT FMODEX)
+include(FMODEX)
+set(FMOD OFF)
 include(OPENAL)
 include(LLCommon)
 include(LLMath)
-- 
cgit v1.2.3


From 9b86b8bf3d822bbeefb8518fb335e81a6dc7f3b3 Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Wed, 23 Jan 2013 15:57:38 -0800
Subject: Add in Windows FMOD Ex package

---
 autobuild.xml | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/autobuild.xml b/autobuild.xml
index b7550e34ca..caccdf7abc 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -553,6 +553,18 @@
             <key>name</key>
             <string>darwin</string>
           </map>
+          <key>windows</key>
+          <map>
+            <key>archive</key>
+            <map>
+              <key>hash</key>
+              <string>00f752f73774e0e72d737099860582af</string>
+              <key>url</key>
+              <string>http://private-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-fmodex-private/arch/CYGWIN/fmodex-4.44.04-windows-20130123.tar.bz2</string>
+            </map>
+            <key>name</key>
+            <string>windows</string>
+          </map>
         </map>
       </map>
       <key>fontconfig</key>
-- 
cgit v1.2.3


From b0f2f02333a87598299b490a1e42eb42a8125f74 Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Fri, 1 Feb 2013 08:44:52 -0800
Subject: Removed (most) references to older FMOD library - still a little
 Linux clean up left

---
 autobuild.xml                           |  51 ---
 indra/cmake/CMakeLists.txt              |   2 -
 indra/cmake/Copy3rdPartyLibs.cmake      |  39 --
 indra/cmake/FMOD.cmake                  |  39 --
 indra/cmake/FindFMOD.cmake              |  44 --
 indra/llaudio/CMakeLists.txt            |  25 -
 indra/llaudio/llaudioengine_fmod.cpp    | 781 --------------------------------
 indra/llaudio/llaudioengine_fmod.h      | 124 -----
 indra/llaudio/llaudioengine_fmodex.h    |   1 -
 indra/llaudio/lllistener_fmod.cpp       | 125 -----
 indra/llaudio/lllistener_fmod.h         |  58 ---
 indra/llaudio/lllistener_fmodex.cpp     |   2 +-
 indra/llaudio/llstreamingaudio_fmod.cpp | 356 ---------------
 indra/llaudio/llstreamingaudio_fmod.h   |  62 ---
 indra/llaudio/llstreamingaudio_fmodex.h |   6 +-
 indra/llaudio/llvorbisencode.cpp        |   2 +-
 indra/newview/CMakeLists.txt            |  45 +-
 indra/newview/fmodwrapper.cpp           |   4 +-
 indra/newview/llappviewer.cpp           |  14 +-
 indra/newview/llstartup.cpp             |  19 +-
 indra/newview/viewer_manifest.py        |   4 -
 21 files changed, 21 insertions(+), 1782 deletions(-)
 delete mode 100644 indra/cmake/FMOD.cmake
 delete mode 100644 indra/cmake/FindFMOD.cmake
 delete mode 100644 indra/llaudio/llaudioengine_fmod.cpp
 delete mode 100644 indra/llaudio/llaudioengine_fmod.h
 delete mode 100644 indra/llaudio/lllistener_fmod.cpp
 delete mode 100644 indra/llaudio/lllistener_fmod.h
 delete mode 100644 indra/llaudio/llstreamingaudio_fmod.cpp
 delete mode 100644 indra/llaudio/llstreamingaudio_fmod.h

diff --git a/autobuild.xml b/autobuild.xml
index caccdf7abc..442e4d0765 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -483,54 +483,6 @@
           </map>
         </map>
       </map>
-      <key>fmod</key>
-      <map>
-        <key>license</key>
-        <string>fmod</string>
-        <key>license_file</key>
-        <string>LICENSES/fmod.txt</string>
-        <key>name</key>
-        <string>fmod</string>
-        <key>platforms</key>
-        <map>
-          <key>darwin</key>
-          <map>
-            <key>archive</key>
-            <map>
-              <key>hash</key>
-              <string>61ead113e6479452e6b690c84b4e9d30</string>
-              <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmod-private/rev/221852/arch/Darwin/installer/fmod-3.75-darwin-20110222.tar.bz2</string>
-            </map>
-            <key>name</key>
-            <string>darwin</string>
-          </map>
-          <key>linux</key>
-          <map>
-            <key>archive</key>
-            <map>
-              <key>hash</key>
-              <string>0c61d643db54d2e5999be8254569d8b3</string>
-              <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmod-private/rev/221852/arch/Linux/installer/fmod-3.75-linux-20110223.tar.bz2</string>
-            </map>
-            <key>name</key>
-            <string>linux</string>
-          </map>
-          <key>windows</key>
-          <map>
-            <key>archive</key>
-            <map>
-              <key>hash</key>
-              <string>d9a9a6ad86895353bcd63374a4c1a91d</string>
-              <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmod-private/rev/221852/arch/CYGWIN/installer/fmod-3.75-windows-20110222.tar.bz2</string>
-            </map>
-            <key>name</key>
-            <string>windows</string>
-          </map>
-        </map>
-      </map>
       <key>fmodex</key>
       <map>
         <key>license</key>
@@ -2541,7 +2493,6 @@
                   <string>"Visual Studio 10"</string>
                   <string>-DUNATTENDED:BOOL=ON</string>
                   <string>-DUSE_KDU=FALSE</string>
-                  <string>-DFMOD=FALSE</string>
                 </array>
               </map>
               <key>name</key>
@@ -2630,7 +2581,6 @@
                   <string>-DUNATTENDED:BOOL=ON</string>
                   <string>-DINSTALL_PROPRIETARY=FALSE</string>
                   <string>-DUSE_KDU=FALSE</string>
-                  <string>-DFMOD=FALSE</string>
                 </array>
               </map>
               <key>name</key>
@@ -2718,7 +2668,6 @@
                   <string>-DUNATTENDED:BOOL=ON</string>
                   <string>-DINSTALL_PROPRIETARY=FALSE</string>
                   <string>-DUSE_KDU=FALSE</string>
-                  <string>-DFMOD=FALSE</string>
                 </array>
               </map>
               <key>name</key>
diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt
index e9c0554641..acff0621d1 100644
--- a/indra/cmake/CMakeLists.txt
+++ b/indra/cmake/CMakeLists.txt
@@ -25,7 +25,6 @@ set(cmake_SOURCE_FILES
     FindBerkeleyDB.cmake
     FindCARes.cmake
     FindELFIO.cmake
-    FindFMOD.cmake
     FindFMODEX.cmake
     FindGooglePerfTools.cmake
     FindMono.cmake
@@ -33,7 +32,6 @@ set(cmake_SOURCE_FILES
     FindOpenJPEG.cmake
     FindXmlRpcEpi.cmake
     FindZLIB.cmake
-    FMOD.cmake
     FMODEX.cmake
     FreeType.cmake
     GLOD.cmake
diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake
index c28361398f..f9e2013483 100644
--- a/indra/cmake/Copy3rdPartyLibs.cmake
+++ b/indra/cmake/Copy3rdPartyLibs.cmake
@@ -67,11 +67,6 @@ if(WINDOWS)
       set(release_files ${release_files} fmodex.dll)
     endif (FMODEX)
 
-    if (FMOD)
-      set(debug_files ${debug_files} fmod.dll)
-      set(release_files ${release_files} fmod.dll)
-    endif (FMOD)
-
 #*******************************
 # Copy MS C runtime dlls, required for packaging.
 # *TODO - Adapt this to support VC9
@@ -232,10 +227,6 @@ elseif(DARWIN)
       set(release_files ${release_files} libfmodex.dylib)
     endif (FMODEX)
 
-    if (FMOD)
-        # fmod is statically linked on darwin
-       set(fmod_files "")
-    endif (FMOD)
 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...
@@ -299,10 +290,6 @@ elseif(LINUX)
       set(release_files ${release_files} "libtcmalloc_minimal.so")
     endif (USE_TCMALLOC)
 
-    if (FMOD)
-      set(release_files ${release_files} "libfmod-3.75.so")
-    endif (FMOD)
-
 else(WINDOWS)
     message(STATUS "WARNING: unrecognized platform for staging 3rd party libs, skipping...")
     set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-linux")
@@ -316,8 +303,6 @@ else(WINDOWS)
     set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/release")
     set(release_files "")
 
-    set(fmod_files "")
-
     set(debug_llkdu_src "")
     set(debug_llkdu_dst "")
     set(release_llkdu_src "")
@@ -380,30 +365,6 @@ copy_if_different(
     )
 set(third_party_targets ${third_party_targets} ${out_targets})
 
-if (FMOD_SDK_DIR)
-    copy_if_different(
-        ${FMOD_SDK_DIR} 
-        "${CMAKE_CURRENT_BINARY_DIR}/Debug"
-        out_targets 
-        ${fmod_files}
-        )
-    set(all_targets ${all_targets} ${out_targets})
-    copy_if_different(
-        ${FMOD_SDK_DIR} 
-        "${CMAKE_CURRENT_BINARY_DIR}/Release"
-        out_targets 
-        ${fmod_files}
-        )
-    set(all_targets ${all_targets} ${out_targets})
-    copy_if_different(
-        ${FMOD_SDK_DIR} 
-        "${CMAKE_CURRENT_BINARY_DIR}/RelWithDbgInfo"
-        out_targets 
-        ${fmod_files}
-        )
-    set(all_targets ${all_targets} ${out_targets})
-endif (FMOD_SDK_DIR)
-
 if(NOT STANDALONE)
   add_custom_target(
       stage_third_party_libs ALL
diff --git a/indra/cmake/FMOD.cmake b/indra/cmake/FMOD.cmake
deleted file mode 100644
index ef0ae58bdf..0000000000
--- a/indra/cmake/FMOD.cmake
+++ /dev/null
@@ -1,39 +0,0 @@
-# -*- cmake -*-
-
-# FMOD can be set when launching the make using the argument -DFMOD:BOOL=ON
-# When building using proprietary binaries though (i.e. having access to LL private servers),
-# we always build with FMOD.
-# Open source devs should use the -DFMOD:BOOL=ON then if they want to build with FMOD, whether
-# they are using STANDALONE or not.
-if (INSTALL_PROPRIETARY)
-  set(FMOD OFF CACHE BOOL "Use FMOD sound library.")
-endif (INSTALL_PROPRIETARY)
-
-if (FMOD)
-  if (STANDALONE)
-    # In that case, we use the version of the library installed on the system
-    set(FMOD_FIND_REQUIRED ON)
-    include(FindFMOD)
-  else (STANDALONE)
-    if (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
-      # If the path have been specified in the arguments, use that
-      set(FMOD_LIBRARIES ${FMOD_LIBRARY})
-      MESSAGE(STATUS "Using FMOD path: ${FMOD_LIBRARIES}, ${FMOD_INCLUDE_DIR}")
-    else (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
-      # If not, we're going to try to get the package listed in autobuild.xml
-      # Note: if you're not using INSTALL_PROPRIETARY, the package URL should be local (file:/// URL) 
-      # as accessing the private LL location will fail if you don't have the credential
-      include(Prebuilt)
-      use_prebuilt_binary(fmod)    
-      if (WINDOWS)
-        set(FMOD_LIBRARY fmod)
-      elseif (DARWIN)
-        set(FMOD_LIBRARY fmod)
-      elseif (LINUX)
-        set(FMOD_LIBRARY fmod-3.75)
-      endif (WINDOWS)
-      set(FMOD_LIBRARIES ${FMOD_LIBRARY})
-      set(FMOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
-    endif (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
-  endif (STANDALONE)
-endif (FMOD)
diff --git a/indra/cmake/FindFMOD.cmake b/indra/cmake/FindFMOD.cmake
deleted file mode 100644
index 1ebbc8c96e..0000000000
--- a/indra/cmake/FindFMOD.cmake
+++ /dev/null
@@ -1,44 +0,0 @@
-# -*- cmake -*-
-
-# - Find FMOD
-# Find the FMOD includes and library
-# This module defines
-#  FMOD_INCLUDE_DIR, where to find fmod.h and fmod_errors.h
-#  FMOD_LIBRARIES, the libraries needed to use FMOD.
-#  FMOD, If false, do not try to use FMOD.
-# also defined, but not for general use are
-#  FMOD_LIBRARY, where to find the FMOD library.
-
-FIND_PATH(FMOD_INCLUDE_DIR fmod.h PATH_SUFFIXES fmod)
-
-SET(FMOD_NAMES ${FMOD_NAMES} fmod fmodvc fmodex fmod-3.75)
-FIND_LIBRARY(FMOD_LIBRARY
-  NAMES ${FMOD_NAMES}
-  PATH_SUFFIXES fmod
-  )
-
-IF (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
-  SET(FMOD_LIBRARIES ${FMOD_LIBRARY})
-  SET(FMOD_FOUND "YES")
-ELSE (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
-  SET(FMOD_FOUND "NO")
-ENDIF (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
-
-IF (FMOD_FOUND)
-  IF (NOT FMOD_FIND_QUIETLY)
-    MESSAGE(STATUS "Found FMOD: ${FMOD_LIBRARIES}")
-  ENDIF (NOT FMOD_FIND_QUIETLY)
-ELSE (FMOD_FOUND)
-  IF (FMOD_FIND_REQUIRED)
-    MESSAGE(FATAL_ERROR "Could not find FMOD library")
-  ENDIF (FMOD_FIND_REQUIRED)
-ENDIF (FMOD_FOUND)
-
-# Deprecated declarations.
-SET (NATIVE_FMOD_INCLUDE_PATH ${FMOD_INCLUDE_DIR} )
-GET_FILENAME_COMPONENT (NATIVE_FMOD_LIB_PATH ${FMOD_LIBRARY} PATH)
-
-MARK_AS_ADVANCED(
-  FMOD_LIBRARY
-  FMOD_INCLUDE_DIR
-  )
diff --git a/indra/llaudio/CMakeLists.txt b/indra/llaudio/CMakeLists.txt
index b2d7b7c911..f27bcb27d1 100644
--- a/indra/llaudio/CMakeLists.txt
+++ b/indra/llaudio/CMakeLists.txt
@@ -6,7 +6,6 @@ include(00-Common)
 include(Audio)
 include(LLAudio)
 include(FMODEX)
-set(FMOD OFF)
 include(OPENAL)
 include(LLCommon)
 include(LLMath)
@@ -61,30 +60,6 @@ if (FMODEX)
          )
 endif (FMODEX)
 
-if (FMOD)
-    include_directories(
-        ${FMOD_INCLUDE_DIR}
-        )
-
-    list(APPEND llaudio_SOURCE_FILES
-         llaudioengine_fmod.cpp
-         lllistener_fmod.cpp
-         llstreamingaudio_fmod.cpp
-         )
-
-    list(APPEND llaudio_HEADER_FILES
-         llaudioengine_fmod.h
-         lllistener_fmod.h
-         llstreamingaudio_fmod.h
-         )
-
-    if (LINUX OR DARWIN)
-      set_source_files_properties(llaudioengine_fmod.cpp
-                                  llstreamingaudio_fmod.cpp
-                                  COMPILE_FLAGS -Wno-write-strings)
-    endif (LINUX OR DARWIN)
-endif (FMOD)
-
 if (OPENAL)
   list(APPEND llaudio_SOURCE_FILES
     llaudioengine_openal.cpp
diff --git a/indra/llaudio/llaudioengine_fmod.cpp b/indra/llaudio/llaudioengine_fmod.cpp
deleted file mode 100644
index a40de9fa68..0000000000
--- a/indra/llaudio/llaudioengine_fmod.cpp
+++ /dev/null
@@ -1,781 +0,0 @@
-/** 
- * @file audioengine_fmod.cpp
- * @brief Implementation of LLAudioEngine class abstracting the audio support as a FMOD 3D implementation
- *
- * $LicenseInfo:firstyear=2002&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, 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
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#include "linden_common.h"
-
-#include "llstreamingaudio.h"
-#include "llstreamingaudio_fmod.h"
-
-#include "llaudioengine_fmod.h"
-#include "lllistener_fmod.h"
-
-#include "llerror.h"
-#include "llmath.h"
-#include "llrand.h"
-
-#include "fmod.h"
-#include "fmod_errors.h"
-#include "lldir.h"
-#include "llapr.h"
-
-#include "sound_ids.h"
-
-
-extern "C" {
-	void * F_CALLBACKAPI windCallback(void *originalbuffer, void *newbuffer, int length, void* userdata);
-}
-
-
-LLAudioEngine_FMOD::LLAudioEngine_FMOD()
-{
-	mInited = false;
-	mWindGen = NULL;
-	mWindDSP = NULL;
-}
-
-
-LLAudioEngine_FMOD::~LLAudioEngine_FMOD()
-{
-}
-
-
-bool LLAudioEngine_FMOD::init(const S32 num_channels, void* userdata)
-{
-	LLAudioEngine::init(num_channels, userdata);
-
-	// Reserve one extra channel for the http stream.
-	if (!FSOUND_SetMinHardwareChannels(num_channels + 1))
-	{
-		LL_WARNS("AppInit") << "FMOD::init[0](), error: " << FMOD_ErrorString(FSOUND_GetError()) << LL_ENDL;
-	}
-
-	LL_DEBUGS("AppInit") << "LLAudioEngine_FMOD::init() initializing FMOD" << LL_ENDL;
-
-	F32 version = FSOUND_GetVersion();
-	if (version < FMOD_VERSION)
-	{
-		LL_WARNS("AppInit") << "Error : You are using the wrong FMOD version (" << version
-			<< ")!  You should be using FMOD " << FMOD_VERSION << LL_ENDL;
-		//return false;
-	}
-
-	U32 fmod_flags = 0x0;
-
-#if LL_WINDOWS
-	// Windows needs to know which window is frontmost.
-	// This must be called before FSOUND_Init() per the FMOD docs.
-	// This could be used to let FMOD handle muting when we lose focus,
-	// but we don't actually want to do that because we want to distinguish
-	// between minimized and not-focused states.
-	if (!FSOUND_SetHWND(userdata))
-	{
-		LL_WARNS("AppInit") << "Error setting FMOD window: "
-			<< FMOD_ErrorString(FSOUND_GetError()) << LL_ENDL;
-		return false;
-	}
-	// Play audio when we don't have focus.
-	// (For example, IM client on top of us.)
-	// This means we also try to play audio when minimized,
-	// so we manually handle muting in that case. JC
-	fmod_flags |= FSOUND_INIT_GLOBALFOCUS;
-#endif
-
-#if LL_LINUX
-	// initialize the FMOD engine
-
-	// This is a hack to use only FMOD's basic FPU mixer
-	// when the LL_VALGRIND environmental variable is set,
-	// otherwise valgrind will fall over on FMOD's MMX detection
-	if (getenv("LL_VALGRIND"))		/*Flawfinder: ignore*/
-	{
-		LL_INFOS("AppInit") << "Pacifying valgrind in FMOD init." << LL_ENDL;
-		FSOUND_SetMixer(FSOUND_MIXER_QUALITY_FPU);
-	}
-
-	// If we don't set an output method, Linux FMOD always
-	// decides on OSS and fails otherwise.  So we'll manually
-	// try ESD, then OSS, then ALSA.
-	// Why this order?  See SL-13250, but in short, OSS emulated
-	// on top of ALSA is ironically more reliable than raw ALSA.
-	// Ack, and ESD has more reliable failure modes - but has worse
-	// latency - than all of them, so wins for now.
-	bool audio_ok = false;
-
-	if (!audio_ok)
-	{
-		if (NULL == getenv("LL_BAD_FMOD_ESD")) /*Flawfinder: ignore*/
-		{
-			LL_DEBUGS("AppInit") << "Trying ESD audio output..." << LL_ENDL;
-			if(FSOUND_SetOutput(FSOUND_OUTPUT_ESD) &&
-			   FSOUND_Init(44100, num_channels, fmod_flags))
-			{
-				LL_DEBUGS("AppInit") << "ESD audio output initialized OKAY"
-					<< LL_ENDL;
-				audio_ok = true;
-			} else {
-				LL_WARNS("AppInit") << "ESD audio output FAILED to initialize: "
-					<< FMOD_ErrorString(FSOUND_GetError()) << LL_ENDL;
-			}
-		} else {
-			LL_DEBUGS("AppInit") << "ESD audio output SKIPPED" << LL_ENDL;
-		}
-	}
-	if (!audio_ok)
-	{
-		if (NULL == getenv("LL_BAD_FMOD_OSS")) 	 /*Flawfinder: ignore*/
-		{
-			LL_DEBUGS("AppInit") << "Trying OSS audio output..."	<< LL_ENDL;
-			if(FSOUND_SetOutput(FSOUND_OUTPUT_OSS) &&
-			   FSOUND_Init(44100, num_channels, fmod_flags))
-			{
-				LL_DEBUGS("AppInit") << "OSS audio output initialized OKAY" << LL_ENDL;
-				audio_ok = true;
-			} else {
-				LL_WARNS("AppInit") << "OSS audio output FAILED to initialize: "
-					<< FMOD_ErrorString(FSOUND_GetError()) << LL_ENDL;
-			}
-		} else {
-			LL_DEBUGS("AppInit") << "OSS audio output SKIPPED" << LL_ENDL;
-		}
-	}
-	if (!audio_ok)
-	{
-		if (NULL == getenv("LL_BAD_FMOD_ALSA"))		/*Flawfinder: ignore*/
-		{
-			LL_DEBUGS("AppInit") << "Trying ALSA audio output..." << LL_ENDL;
-			if(FSOUND_SetOutput(FSOUND_OUTPUT_ALSA) &&
-			   FSOUND_Init(44100, num_channels, fmod_flags))
-			{
-				LL_DEBUGS("AppInit") << "ALSA audio output initialized OKAY" << LL_ENDL;
-				audio_ok = true;
-			} else {
-				LL_WARNS("AppInit") << "ALSA audio output FAILED to initialize: "
-					<< FMOD_ErrorString(FSOUND_GetError()) << LL_ENDL;
-			}
-		} else {
-			LL_DEBUGS("AppInit") << "OSS audio output SKIPPED" << LL_ENDL;
-		}
-	}
-	if (!audio_ok)
-	{
-		LL_WARNS("AppInit") << "Overall audio init failure." << LL_ENDL;
-		return false;
-	}
-
-	// On Linux, FMOD causes a SIGPIPE for some netstream error
-	// conditions (an FMOD bug); ignore SIGPIPE so it doesn't crash us.
-	// NOW FIXED in FMOD 3.x since 2006-10-01.
-	//signal(SIGPIPE, SIG_IGN);
-
-	// We're interested in logging which output method we
-	// ended up with, for QA purposes.
-	switch (FSOUND_GetOutput())
-	{
-	case FSOUND_OUTPUT_NOSOUND: LL_DEBUGS("AppInit") << "Audio output: NoSound" << LL_ENDL; break;
-	case FSOUND_OUTPUT_OSS:	LL_DEBUGS("AppInit") << "Audio output: OSS" << LL_ENDL; break;
-	case FSOUND_OUTPUT_ESD:	LL_DEBUGS("AppInit") << "Audio output: ESD" << LL_ENDL; break;
-	case FSOUND_OUTPUT_ALSA: LL_DEBUGS("AppInit") << "Audio output: ALSA" << LL_ENDL; break;
-	default: LL_INFOS("AppInit") << "Audio output: Unknown!" << LL_ENDL; break;
-	};
-
-#else // LL_LINUX
-
-	// initialize the FMOD engine
-	if (!FSOUND_Init(44100, num_channels, fmod_flags))
-	{
-		LL_WARNS("AppInit") << "Error initializing FMOD: "
-			<< FMOD_ErrorString(FSOUND_GetError()) << LL_ENDL;
-		return false;
-	}
-	
-#endif
-
-	// set up our favourite FMOD-native streaming audio implementation if none has already been added
-	if (!getStreamingAudioImpl()) // no existing implementation added
-		setStreamingAudioImpl(new LLStreamingAudio_FMOD());
-
-	LL_DEBUGS("AppInit") << "LLAudioEngine_FMOD::init() FMOD initialized correctly" << LL_ENDL;
-
-	mInited = true;
-
-	return true;
-}
-
-
-std::string LLAudioEngine_FMOD::getDriverName(bool verbose)
-{
-	if (verbose)
-	{
-		F32 version = FSOUND_GetVersion();
-		return llformat("FMOD version %f", version);
-	}
-	else
-	{
-		return "FMOD";
-	}
-}
-
-
-void LLAudioEngine_FMOD::allocateListener(void)
-{	
-	mListenerp = (LLListener *) new LLListener_FMOD();
-	if (!mListenerp)
-	{
-		llwarns << "Listener creation failed" << llendl;
-	}
-}
-
-
-void LLAudioEngine_FMOD::shutdown()
-{
-	if (mWindDSP)
-	{
-		FSOUND_DSP_SetActive(mWindDSP,false);
-		FSOUND_DSP_Free(mWindDSP);
-	}
-
-	stopInternetStream();
-
-	LLAudioEngine::shutdown();
-	
-	llinfos << "LLAudioEngine_FMOD::shutdown() closing FMOD" << llendl;
-	FSOUND_Close();
-	llinfos << "LLAudioEngine_FMOD::shutdown() done closing FMOD" << llendl;
-
-	delete mListenerp;
-	mListenerp = NULL;
-}
-
-
-LLAudioBuffer * LLAudioEngine_FMOD::createBuffer()
-{
-	return new LLAudioBufferFMOD();
-}
-
-
-LLAudioChannel * LLAudioEngine_FMOD::createChannel()
-{
-	return new LLAudioChannelFMOD();
-}
-
-
-bool LLAudioEngine_FMOD::initWind()
-{
-	if (!mWindGen)
-	{
-		bool enable;
-		
-		switch (FSOUND_GetMixer())
-		{
-			case FSOUND_MIXER_MMXP5:
-			case FSOUND_MIXER_MMXP6:
-			case FSOUND_MIXER_QUALITY_MMXP5:
-			case FSOUND_MIXER_QUALITY_MMXP6:
-				enable = (typeid(MIXBUFFERFORMAT) == typeid(S16));
-				break;
-			case FSOUND_MIXER_BLENDMODE:
-				enable = (typeid(MIXBUFFERFORMAT) == typeid(S32));
-				break;
-			case FSOUND_MIXER_QUALITY_FPU:
-				enable = (typeid(MIXBUFFERFORMAT) == typeid(F32));
-				break;
-			default:
-				// FSOUND_GetMixer() does not return a valid mixer type on Darwin
-				LL_INFOS("AppInit") << "Unknown FMOD mixer type, assuming default" << LL_ENDL;
-				enable = true;
-				break;
-		}
-		
-		if (enable)
-		{
-			mWindGen = new LLWindGen<MIXBUFFERFORMAT>(FSOUND_GetOutputRate());
-		}
-		else
-		{
-			LL_WARNS("AppInit") << "Incompatible FMOD mixer type, wind noise disabled" << LL_ENDL;
-		}
-	}
-
-	mNextWindUpdate = 0.0;
-
-	if (mWindGen && !mWindDSP)
-	{
-		mWindDSP = FSOUND_DSP_Create(&windCallback, FSOUND_DSP_DEFAULTPRIORITY_CLEARUNIT + 20, mWindGen);
-	}
-	if (mWindDSP)
-	{
-		FSOUND_DSP_SetActive(mWindDSP, true);
-		return true;
-	}
-	
-	return false;
-}
-
-
-void LLAudioEngine_FMOD::cleanupWind()
-{
-	if (mWindDSP)
-	{
-		FSOUND_DSP_SetActive(mWindDSP, false);
-		FSOUND_DSP_Free(mWindDSP);
-		mWindDSP = NULL;
-	}
-
-	delete mWindGen;
-	mWindGen = NULL;
-}
-
-
-//-----------------------------------------------------------------------
-void LLAudioEngine_FMOD::updateWind(LLVector3 wind_vec, F32 camera_height_above_water)
-{
-	LLVector3 wind_pos;
-	F64 pitch;
-	F64 center_freq;
-
-	if (!mEnableWind)
-	{
-		return;
-	}
-	
-	if (mWindUpdateTimer.checkExpirationAndReset(LL_WIND_UPDATE_INTERVAL))
-	{
-		
-		// wind comes in as Linden coordinate (+X = forward, +Y = left, +Z = up)
-		// need to convert this to the conventional orientation DS3D and OpenAL use
-		// where +X = right, +Y = up, +Z = backwards
-
-		wind_vec.setVec(-wind_vec.mV[1], wind_vec.mV[2], -wind_vec.mV[0]);
-
-		// cerr << "Wind update" << endl;
-
-		pitch = 1.0 + mapWindVecToPitch(wind_vec);
-		center_freq = 80.0 * pow(pitch,2.5*(mapWindVecToGain(wind_vec)+1.0));
-		
-		mWindGen->mTargetFreq = (F32)center_freq;
-		mWindGen->mTargetGain = (F32)mapWindVecToGain(wind_vec) * mMaxWindGain;
-		mWindGen->mTargetPanGainR = (F32)mapWindVecToPan(wind_vec);
-  	}
-}
-
-/*
-//-----------------------------------------------------------------------
-void LLAudioEngine_FMOD::setSourceMinDistance(U16 source_num, F64 distance)
-{
-	if (!mInited)
-	{
-		return;
-	}
-	if (mBuffer[source_num])
-	{
-		mMinDistance[source_num] = (F32) distance;
-		if (!FSOUND_Sample_SetMinMaxDistance(mBuffer[source_num],mMinDistance[source_num], mMaxDistance[source_num]))
-		{
-			llwarns << "FMOD::setSourceMinDistance(" << source_num << "), error: " << FMOD_ErrorString(FSOUND_GetError()) << llendl;
-		}
-	}
-}
-
-//-----------------------------------------------------------------------
-void LLAudioEngine_FMOD::setSourceMaxDistance(U16 source_num, F64 distance)
-{
-	if (!mInited)
-	{
-		return;
-	}
-	if (mBuffer[source_num])
-	{
-		mMaxDistance[source_num] = (F32) distance;
-		if (!FSOUND_Sample_SetMinMaxDistance(mBuffer[source_num],mMinDistance[source_num], mMaxDistance[source_num]))
-		{
-			llwarns << "FMOD::setSourceMaxDistance(" << source_num << "), error: " << FMOD_ErrorString(FSOUND_GetError()) << llendl;
-		}
-	}
-}
-
-//-----------------------------------------------------------------------
-void LLAudioEngine_FMOD::get3DParams(S32 source_num, S32 *volume, S32 *freq, S32 *inside, S32 *outside, LLVector3 *orient, S32 *out_volume, F32 *min_dist, F32 *max_dist)
-{
-	*volume = 0;
-	*freq = 0;
-	*inside = 0;
-	*outside = 0;
-	*orient = LLVector3::zero;
-	*out_volume = 0;
-	*min_dist = 0.f;
-	*max_dist = 0.f;
-}
-
-*/
-
-
-//-----------------------------------------------------------------------
-void LLAudioEngine_FMOD::setInternalGain(F32 gain)
-{
-	if (!mInited)
-	{
-		return;
-	}
-
-	gain = llclamp( gain, 0.0f, 1.0f );
-	FSOUND_SetSFXMasterVolume( llround( 255.0f * gain ) );
-
-	LLStreamingAudioInterface *saimpl = getStreamingAudioImpl();
-	if ( saimpl )
-	{
-		// fmod likes its streaming audio channel gain re-asserted after
-		// master volume change.
-		saimpl->setGain(saimpl->getGain());
-	}
-}
-
-//
-// LLAudioChannelFMOD implementation
-//
-
-LLAudioChannelFMOD::LLAudioChannelFMOD() : LLAudioChannel(), mChannelID(0), mLastSamplePos(0)
-{
-}
-
-
-LLAudioChannelFMOD::~LLAudioChannelFMOD()
-{
-	cleanup();
-}
-
-
-bool LLAudioChannelFMOD::updateBuffer()
-{
-	if (LLAudioChannel::updateBuffer())
-	{
-		// Base class update returned true, which means that we need to actually
-		// set up the channel for a different buffer.
-
-		LLAudioBufferFMOD *bufferp = (LLAudioBufferFMOD *)mCurrentSourcep->getCurrentBuffer();
-
-		// Grab the FMOD sample associated with the buffer
-		FSOUND_SAMPLE *samplep = bufferp->getSample();
-		if (!samplep)
-		{
-			// This is bad, there should ALWAYS be a sample associated with a legit
-			// buffer.
-			llerrs << "No FMOD sample!" << llendl;
-			return false;
-		}
-
-
-		// Actually play the sound.  Start it off paused so we can do all the necessary
-		// setup.
-		mChannelID = FSOUND_PlaySoundEx(FSOUND_FREE, samplep, FSOUND_DSP_GetSFXUnit(), true);
-
-		//llinfos << "Setting up channel " << std::hex << mChannelID << std::dec << llendl;
-	}
-
-	// If we have a source for the channel, we need to update its gain.
-	if (mCurrentSourcep)
-	{
-		// SJB: warnings can spam and hurt framerate, disabling
-		if (!FSOUND_SetVolume(mChannelID, llround(getSecondaryGain() * mCurrentSourcep->getGain() * 255.0f)))
-		{
-// 			llwarns << "LLAudioChannelFMOD::updateBuffer error: " << FMOD_ErrorString(FSOUND_GetError()) << llendl;
-		}
-		
-		if (!FSOUND_SetLoopMode(mChannelID, mCurrentSourcep->isLoop() ? FSOUND_LOOP_NORMAL : FSOUND_LOOP_OFF))
-		{
-// 			llwarns << "Channel " << mChannelID << "Source ID: " << mCurrentSourcep->getID()
-// 					<< " at " << mCurrentSourcep->getPositionGlobal() << llendl;
-// 			llwarns << "LLAudioChannelFMOD::updateBuffer error: " << FMOD_ErrorString(FSOUND_GetError()) << llendl;
-		}
-	}
-
-	return true;
-}
-
-
-void LLAudioChannelFMOD::update3DPosition()
-{
-	if (!mChannelID)
-	{
-		// We're not actually a live channel (i.e., we're not playing back anything)
-		return;
-	}
-
-	LLAudioBufferFMOD *bufferp = (LLAudioBufferFMOD *)mCurrentBufferp;
-	if (!bufferp)
-	{
-		// We don't have a buffer associated with us (should really have been picked up
-		// by the above if.
-		return;
-	}
-
-	if (mCurrentSourcep->isAmbient())
-	{
-		// Ambient sound, don't need to do any positional updates.
-		bufferp->set3DMode(false);
-	}
-	else
-	{
-		// Localized sound.  Update the position and velocity of the sound.
-		bufferp->set3DMode(true);
-
-		LLVector3 float_pos;
-		float_pos.setVec(mCurrentSourcep->getPositionGlobal());
-		if (!FSOUND_3D_SetAttributes(mChannelID, float_pos.mV, mCurrentSourcep->getVelocity().mV))
-		{
-			LL_DEBUGS("FMOD") << "LLAudioChannelFMOD::update3DPosition error: " << FMOD_ErrorString(FSOUND_GetError()) << LL_ENDL;
-		}
-	}
-}
-
-
-void LLAudioChannelFMOD::updateLoop()
-{
-	if (!mChannelID)
-	{
-		// May want to clear up the loop/sample counters.
-		return;
-	}
-
-	//
-	// Hack:  We keep track of whether we looped or not by seeing when the
-	// sample position looks like it's going backwards.  Not reliable; may
-	// yield false negatives.
-	//
-	U32 cur_pos = FSOUND_GetCurrentPosition(mChannelID);
-	if (cur_pos < (U32)mLastSamplePos)
-	{
-		mLoopedThisFrame = true;
-	}
-	mLastSamplePos = cur_pos;
-}
-
-
-void LLAudioChannelFMOD::cleanup()
-{
-	if (!mChannelID)
-	{
-		//llinfos << "Aborting cleanup with no channelID." << llendl;
-		return;
-	}
-
-	//llinfos << "Cleaning up channel: " << mChannelID << llendl;
-	if (!FSOUND_StopSound(mChannelID))
-	{
-		LL_DEBUGS("FMOD") << "LLAudioChannelFMOD::cleanup error: " << FMOD_ErrorString(FSOUND_GetError()) << llendl;
-	}
-
-	mCurrentBufferp = NULL;
-	mChannelID = 0;
-}
-
-
-void LLAudioChannelFMOD::play()
-{
-	if (!mChannelID)
-	{
-		llwarns << "Playing without a channelID, aborting" << llendl;
-		return;
-	}
-
-	if (!FSOUND_SetPaused(mChannelID, false))
-	{
-		llwarns << "LLAudioChannelFMOD::play error: " << FMOD_ErrorString(FSOUND_GetError()) << llendl;
-	}
-	getSource()->setPlayedOnce(true);
-}
-
-
-void LLAudioChannelFMOD::playSynced(LLAudioChannel *channelp)
-{
-	LLAudioChannelFMOD *fmod_channelp = (LLAudioChannelFMOD*)channelp;
-	if (!(fmod_channelp->mChannelID && mChannelID))
-	{
-		// Don't have channels allocated to both the master and the slave
-		return;
-	}
-
-	U32 position = FSOUND_GetCurrentPosition(fmod_channelp->mChannelID) % mCurrentBufferp->getLength();
-	// Try to match the position of our sync master
-	if (!FSOUND_SetCurrentPosition(mChannelID, position))
-	{
-		llwarns << "LLAudioChannelFMOD::playSynced unable to set current position" << llendl;
-	}
-
-	// Start us playing
-	play();
-}
-
-
-bool LLAudioChannelFMOD::isPlaying()
-{
-	if (!mChannelID)
-	{
-		return false;
-	}
-
-	return FSOUND_IsPlaying(mChannelID) && (!FSOUND_GetPaused(mChannelID));
-}
-
-
-
-//
-// LLAudioBufferFMOD implementation
-//
-
-
-LLAudioBufferFMOD::LLAudioBufferFMOD()
-{
-	mSamplep = NULL;
-}
-
-
-LLAudioBufferFMOD::~LLAudioBufferFMOD()
-{
-	if (mSamplep)
-	{
-		// Clean up the associated FMOD sample if it exists.
-		FSOUND_Sample_Free(mSamplep);
-		mSamplep = NULL;
-	}
-}
-
-
-bool LLAudioBufferFMOD::loadWAV(const std::string& filename)
-{
-	// Try to open a wav file from disk.  This will eventually go away, as we don't
-	// really want to block doing this.
-	if (filename.empty())
-	{
-		// invalid filename, abort.
-		return false;
-	}
-
-	if (!LLAPRFile::isExist(filename, NULL, LL_APR_RPB))
-	{
-		// File not found, abort.
-		return false;
-	}
-	
-	if (mSamplep)
-	{
-		// If there's already something loaded in this buffer, clean it up.
-		FSOUND_Sample_Free(mSamplep);
-		mSamplep = NULL;
-	}
-
-	// Load up the wav file into an fmod sample
-#if LL_WINDOWS
-	// MikeS. - Loading the sound file manually and then handing it over to FMOD,
-	//	since FMOD uses posix IO internally,
-	// which doesn't work with unicode file paths.
-	LLFILE* sound_file = LLFile::fopen(filename,"rb");	/* Flawfinder: ignore */
-	if (sound_file)
-	{
-		fseek(sound_file,0,SEEK_END);
-		U32	file_length = ftell(sound_file);	//Find the length of the file by seeking to the end and getting the offset
-		size_t	read_count;
-		fseek(sound_file,0,SEEK_SET);	//Seek back to the beginning
-		char*	buffer = new char[file_length];
-		llassert(buffer);
-		read_count = fread((void*)buffer,file_length,1,sound_file);//Load it..
-		if(ferror(sound_file)==0 && (read_count == 1)){//No read error, and we got 1 chunk of our size...
-			unsigned int mode_flags = FSOUND_LOOP_NORMAL | FSOUND_LOADMEMORY;
-									//FSOUND_16BITS | FSOUND_MONO | FSOUND_LOADMEMORY | FSOUND_LOOP_NORMAL;
-			mSamplep = FSOUND_Sample_Load(FSOUND_UNMANAGED, buffer, mode_flags , 0, file_length);
-		}
-		delete[] buffer;
-		fclose(sound_file);
-	}
-#else
-	mSamplep = FSOUND_Sample_Load(FSOUND_UNMANAGED, filename.c_str(), FSOUND_LOOP_NORMAL, 0, 0);
-#endif
-
-	if (!mSamplep)
-	{
-		// We failed to load the file for some reason.
-		llwarns << "Could not load data '" << filename << "': "
-				<< FMOD_ErrorString(FSOUND_GetError()) << llendl;
-
-		//
-		// If we EVER want to load wav files provided by end users, we need
-		// to rethink this!
-		//
-		// file is probably corrupt - remove it.
-		LLFile::remove(filename);
-		return false;
-	}
-
-	// Everything went well, return true
-	return true;
-}
-
-
-U32 LLAudioBufferFMOD::getLength()
-{
-	if (!mSamplep)
-	{
-		return 0;
-	}
-
-	return FSOUND_Sample_GetLength(mSamplep);
-}
-
-
-void LLAudioBufferFMOD::set3DMode(bool use3d)
-{
-	U16 current_mode = FSOUND_Sample_GetMode(mSamplep);
-	
-	if (use3d)
-	{
-		if (!FSOUND_Sample_SetMode(mSamplep, (current_mode & (~FSOUND_2D))))
-		{
-			llwarns << "LLAudioBufferFMOD::set3DMode error: " << FMOD_ErrorString(FSOUND_GetError()) << llendl;
-		}
-	}
-	else
-	{
-		if (!FSOUND_Sample_SetMode(mSamplep, current_mode | FSOUND_2D))
-		{
-			llwarns << "LLAudioBufferFMOD::set3DMode error: " << FMOD_ErrorString(FSOUND_GetError()) << llendl;
-		}
-	}
-}
-
-
-void * F_CALLBACKAPI windCallback(void *originalbuffer, void *newbuffer, int length, void* userdata)
-{
-	// originalbuffer = fmod's original mixbuffer.
-	// newbuffer = the buffer passed from the previous DSP unit.
-	// length = length in samples at this mix time.
-	// userdata = user parameter passed through in FSOUND_DSP_Create.
-
-	LLWindGen<LLAudioEngine_FMOD::MIXBUFFERFORMAT> *windgen =
-		(LLWindGen<LLAudioEngine_FMOD::MIXBUFFERFORMAT> *)userdata;
-	
-	newbuffer = windgen->windGenerate((LLAudioEngine_FMOD::MIXBUFFERFORMAT *)newbuffer, length);
-
-	return newbuffer;
-}
diff --git a/indra/llaudio/llaudioengine_fmod.h b/indra/llaudio/llaudioengine_fmod.h
deleted file mode 100644
index 4582a5d57e..0000000000
--- a/indra/llaudio/llaudioengine_fmod.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/** 
- * @file audioengine_fmod.h
- * @brief Definition of LLAudioEngine class abstracting the audio
- * support as a FMOD 3D implementation
- *
- * $LicenseInfo:firstyear=2002&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, 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
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_AUDIOENGINE_FMOD_H
-#define LL_AUDIOENGINE_FMOD_H
-
-#include "llaudioengine.h"
-#include "lllistener_fmod.h"
-#include "llwindgen.h"
-
-#include "fmod.h"
-
-class LLAudioStreamManagerFMOD;
-
-class LLAudioEngine_FMOD : public LLAudioEngine 
-{
-public:
-	LLAudioEngine_FMOD();
-	virtual ~LLAudioEngine_FMOD();
-
-	// initialization/startup/shutdown
-	virtual bool init(const S32 num_channels, void *user_data);
-       	virtual std::string getDriverName(bool verbose);
-	virtual void allocateListener();
-
-	virtual void shutdown();
-
-	/*virtual*/ bool initWind();
-	/*virtual*/ void cleanupWind();
-
-	/*virtual*/void updateWind(LLVector3 direction, F32 camera_height_above_water);
-
-#if LL_DARWIN
-	typedef S32 MIXBUFFERFORMAT;
-#else
-	typedef S16 MIXBUFFERFORMAT;
-#endif
-
-protected:
-	/*virtual*/ LLAudioBuffer *createBuffer(); // Get a free buffer, or flush an existing one if you have to.
-	/*virtual*/ LLAudioChannel *createChannel(); // Create a new audio channel.
-
-	/*virtual*/ void setInternalGain(F32 gain);
-protected:
-	static signed char F_CALLBACKAPI callbackMetaData(char* name, char* value, void* userdata);
-
-	//F32 mMinDistance[MAX_BUFFERS];
-	//F32 mMaxDistance[MAX_BUFFERS];
-
-	bool mInited;
-
-	// On Windows, userdata is the HWND of the application window.
-	void* mUserData;
-
-	LLWindGen<MIXBUFFERFORMAT> *mWindGen;
-	FSOUND_DSPUNIT *mWindDSP;
-};
-
-
-class LLAudioChannelFMOD : public LLAudioChannel
-{
-public:
-	LLAudioChannelFMOD();
-	virtual ~LLAudioChannelFMOD();
-
-protected:
-	/*virtual*/ void play();
-	/*virtual*/ void playSynced(LLAudioChannel *channelp);
-	/*virtual*/ void cleanup();
-	/*virtual*/ bool isPlaying();
-
-	/*virtual*/ bool updateBuffer();
-	/*virtual*/ void update3DPosition();
-	/*virtual*/ void updateLoop();
-
-protected:
-	int mChannelID;
-	S32 mLastSamplePos;
-};
-
-
-class LLAudioBufferFMOD : public LLAudioBuffer
-{
-public:
-	LLAudioBufferFMOD();
-	virtual ~LLAudioBufferFMOD();
-
-	/*virtual*/ bool loadWAV(const std::string& filename);
-	/*virtual*/ U32 getLength();
-	friend class LLAudioChannelFMOD;
-
-	void set3DMode(bool use3d);
-protected:
-	FSOUND_SAMPLE *getSample()	{ return mSamplep; }
-protected:
-	FSOUND_SAMPLE *mSamplep;
-};
-
-
-#endif // LL_AUDIOENGINE_FMOD_H
diff --git a/indra/llaudio/llaudioengine_fmodex.h b/indra/llaudio/llaudioengine_fmodex.h
index cf3d967d4f..415a9ed0ef 100644
--- a/indra/llaudio/llaudioengine_fmodex.h
+++ b/indra/llaudio/llaudioengine_fmodex.h
@@ -29,7 +29,6 @@
 #define LL_AUDIOENGINE_FMODEX_H
 
 #include "llaudioengine.h"
-#include "lllistener_fmod.h"
 #include "llwindgen.h"
 
 //Stubs
diff --git a/indra/llaudio/lllistener_fmod.cpp b/indra/llaudio/lllistener_fmod.cpp
deleted file mode 100644
index 0138f4345e..0000000000
--- a/indra/llaudio/lllistener_fmod.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-/** 
- * @file listener_fmod.cpp
- * @brief implementation of LISTENER class abstracting the audio
- * support as a FMOD 3D implementation (windows only)
- *
- * $LicenseInfo:firstyear=2002&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, 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
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#include "linden_common.h"
-#include "llaudioengine.h"
-#include "lllistener_fmod.h"
-#include "fmod.h"
-
-//-----------------------------------------------------------------------
-// constructor
-//-----------------------------------------------------------------------
-LLListener_FMOD::LLListener_FMOD()
-{
-	init();
-}
-
-//-----------------------------------------------------------------------
-LLListener_FMOD::~LLListener_FMOD()
-{
-}
-
-//-----------------------------------------------------------------------
-void LLListener_FMOD::init(void)
-{
-	// do inherited
-	LLListener::init();
-	mDopplerFactor = 1.0f;
-	mRolloffFactor = 1.0f;
-}
-
-//-----------------------------------------------------------------------
-void LLListener_FMOD::translate(LLVector3 offset)
-{
-	LLListener::translate(offset);
-
-	FSOUND_3D_Listener_SetAttributes(mPosition.mV, NULL, mListenAt.mV[0],mListenAt.mV[1],mListenAt.mV[2], mListenUp.mV[0],mListenUp.mV[1],mListenUp.mV[2]);
-}
-
-//-----------------------------------------------------------------------
-void LLListener_FMOD::setPosition(LLVector3 pos)
-{
-	LLListener::setPosition(pos);
-
-	FSOUND_3D_Listener_SetAttributes(pos.mV, NULL, mListenAt.mV[0],mListenAt.mV[1],mListenAt.mV[2], mListenUp.mV[0],mListenUp.mV[1],mListenUp.mV[2]);
-}
-
-//-----------------------------------------------------------------------
-void LLListener_FMOD::setVelocity(LLVector3 vel)
-{
-	LLListener::setVelocity(vel);
-
-	FSOUND_3D_Listener_SetAttributes(NULL, vel.mV, mListenAt.mV[0],mListenAt.mV[1],mListenAt.mV[2], mListenUp.mV[0],mListenUp.mV[1],mListenUp.mV[2]);
-}
-
-//-----------------------------------------------------------------------
-void LLListener_FMOD::orient(LLVector3 up, LLVector3 at)
-{
-	LLListener::orient(up, at);
-
-	// Welcome to the transition between right and left
-	// (coordinate systems, that is)
-	// Leaving the at vector alone results in a L/R reversal
-	// since DX is left-handed and we (LL, OpenGL, OpenAL) are right-handed
-	at = -at;
-
-	FSOUND_3D_Listener_SetAttributes(NULL, NULL, at.mV[0],at.mV[1],at.mV[2], up.mV[0],up.mV[1],up.mV[2]);
-}
-
-//-----------------------------------------------------------------------
-void LLListener_FMOD::commitDeferredChanges()
-{
-	FSOUND_Update();
-}
-
-
-void LLListener_FMOD::setRolloffFactor(F32 factor)
-{
-	mRolloffFactor = factor;
-	FSOUND_3D_SetRolloffFactor(factor);
-}
-
-
-F32 LLListener_FMOD::getRolloffFactor()
-{
-	return mRolloffFactor;
-}
-
-
-void LLListener_FMOD::setDopplerFactor(F32 factor)
-{
-	mDopplerFactor = factor;
-	FSOUND_3D_SetDopplerFactor(factor);
-}
-
-
-F32 LLListener_FMOD::getDopplerFactor()
-{
-	return mDopplerFactor;
-}
-
-
diff --git a/indra/llaudio/lllistener_fmod.h b/indra/llaudio/lllistener_fmod.h
deleted file mode 100644
index 818da05d51..0000000000
--- a/indra/llaudio/lllistener_fmod.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/** 
- * @file listener_fmod.h
- * @brief Description of LISTENER class abstracting the audio support
- * as an FMOD 3D implementation (windows and Linux)
- *
- * $LicenseInfo:firstyear=2002&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, 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
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LISTENER_FMOD_H
-#define LL_LISTENER_FMOD_H
-
-#include "lllistener.h"
-
-class LLListener_FMOD : public LLListener
-{
- public:  
-	LLListener_FMOD();
-	virtual ~LLListener_FMOD();
-	virtual void init();  
-
-	virtual void translate(LLVector3 offset);
-	virtual void setPosition(LLVector3 pos);
-	virtual void setVelocity(LLVector3 vel);
-	virtual void orient(LLVector3 up, LLVector3 at);
-	virtual void commitDeferredChanges();
-
-	virtual void setDopplerFactor(F32 factor);
-	virtual F32 getDopplerFactor();
-	virtual void setRolloffFactor(F32 factor);
-	virtual F32 getRolloffFactor();
-
- protected:
-	 F32 mDopplerFactor;
-	 F32 mRolloffFactor;
-};
-
-#endif
-
-
diff --git a/indra/llaudio/lllistener_fmodex.cpp b/indra/llaudio/lllistener_fmodex.cpp
index 4bc745b89a..2509a7aebc 100644
--- a/indra/llaudio/lllistener_fmodex.cpp
+++ b/indra/llaudio/lllistener_fmodex.cpp
@@ -1,7 +1,7 @@
 /** 
  * @file listener_fmodex.cpp
  * @brief Implementation of LISTENER class abstracting the audio
- * support as a FMODEX implementation (windows only)
+ * support as a FMODEX implementation
  *
  * $LicenseInfo:firstyear=2002&license=viewerlgpl$
  * Second Life Viewer Source Code
diff --git a/indra/llaudio/llstreamingaudio_fmod.cpp b/indra/llaudio/llstreamingaudio_fmod.cpp
deleted file mode 100644
index bcdea771a7..0000000000
--- a/indra/llaudio/llstreamingaudio_fmod.cpp
+++ /dev/null
@@ -1,356 +0,0 @@
-/** 
- * @file streamingaudio_fmod.cpp
- * @brief LLStreamingAudio_FMOD implementation
- *
- * $LicenseInfo:firstyear=2009&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, 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
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#include "linden_common.h"
-
-#include "llmath.h"
-
-#include "fmod.h"
-#include "fmod_errors.h"
-
-#include "llstreamingaudio_fmod.h"
-
-
-class LLAudioStreamManagerFMOD
-{
-public:
-	LLAudioStreamManagerFMOD(const std::string& url);
-	int	startStream();
-	bool stopStream(); // Returns true if the stream was successfully stopped.
-	bool ready();
-
-	const std::string& getURL() 	{ return mInternetStreamURL; }
-
-	int getOpenState();
-protected:
-	FSOUND_STREAM* mInternetStream;
-	bool mReady;
-
-	std::string mInternetStreamURL;
-};
-
-
-
-//---------------------------------------------------------------------------
-// Internet Streaming
-//---------------------------------------------------------------------------
-LLStreamingAudio_FMOD::LLStreamingAudio_FMOD() :
-	mCurrentInternetStreamp(NULL),
-	mFMODInternetStreamChannel(-1),
-	mGain(1.0f)
-{
-	// Number of milliseconds of audio to buffer for the audio card.
-	// Must be larger than the usual Second Life frame stutter time.
-	FSOUND_Stream_SetBufferSize(200);
-
-	// 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 
-	// to prebuffer 40% of that when we first connect, and we want it 
-	// to rebuffer 80% of that whenever we encounter a buffer underrun.
-
-	// Leave the net buffer properties at the default.
-	//FSOUND_Stream_Net_SetBufferProperties(20000, 40, 80);
-}
-
-
-LLStreamingAudio_FMOD::~LLStreamingAudio_FMOD()
-{
-	// nothing interesting/safe to do.
-}
-
-
-void LLStreamingAudio_FMOD::start(const std::string& url)
-{
-	//if (!mInited)
-	//{
-	//	llwarns << "startInternetStream before audio initialized" << llendl;
-	//	return;
-	//}
-
-	// "stop" stream but don't clear url, etc. in case url == mInternetStreamURL
-	stop();
-
-	if (!url.empty())
-	{
-		llinfos << "Starting internet stream: " << url << llendl;
-		mCurrentInternetStreamp = new LLAudioStreamManagerFMOD(url);
-		mURL = url;
-	}
-	else
-	{
-		llinfos << "Set internet stream to null" << llendl;
-		mURL.clear();
-	}
-}
-
-
-void LLStreamingAudio_FMOD::update()
-{
-	// Kill dead internet streams, if possible
-	std::list<LLAudioStreamManagerFMOD *>::iterator iter;
-	for (iter = mDeadStreams.begin(); iter != mDeadStreams.end();)
-	{
-		LLAudioStreamManagerFMOD *streamp = *iter;
-		if (streamp->stopStream())
-		{
-			llinfos << "Closed dead stream" << llendl;
-			delete streamp;
-			mDeadStreams.erase(iter++);
-		}
-		else
-		{
-			iter++;
-		}
-	}
-
-	// Don't do anything if there are no streams playing
-	if (!mCurrentInternetStreamp)
-	{
-		return;
-	}
-
-	int open_state = mCurrentInternetStreamp->getOpenState();
-
-	if (!open_state)
-	{
-		// Stream is live
-
-		// start the stream if it's ready
-		if (mFMODInternetStreamChannel < 0)
-		{
-			mFMODInternetStreamChannel = mCurrentInternetStreamp->startStream();
-
-			if (mFMODInternetStreamChannel != -1)
-			{
-				// Reset volume to previously set volume
-				setGain(getGain());
-				FSOUND_SetPaused(mFMODInternetStreamChannel, false);
-			}
-		}
-	}
-		
-	switch(open_state)
-	{
-	default:
-	case 0:
-		// success
-		break;
-	case -1:
-		// stream handle is invalid
-		llwarns << "InternetStream - invalid handle" << llendl;
-		stop();
-		return;
-	case -2:
-		// opening
-		break;
-	case -3:
-		// failed to open, file not found, perhaps
-		llwarns << "InternetStream - failed to open" << llendl;
-		stop();
-		return;
-	case -4:
-		// connecting
-		break;
-	case -5:
-		// buffering
-		break;
-	}
-
-}
-
-void LLStreamingAudio_FMOD::stop()
-{
-	if (mFMODInternetStreamChannel != -1)
-	{
-		FSOUND_SetPaused(mFMODInternetStreamChannel, true);
-		FSOUND_SetPriority(mFMODInternetStreamChannel, 0);
-		mFMODInternetStreamChannel = -1;
-	}
-
-	if (mCurrentInternetStreamp)
-	{
-		llinfos << "Stopping internet stream: " << mCurrentInternetStreamp->getURL() << llendl;
-		if (mCurrentInternetStreamp->stopStream())
-		{
-			delete mCurrentInternetStreamp;
-		}
-		else
-		{
-			llwarns << "Pushing stream to dead list: " << mCurrentInternetStreamp->getURL() << llendl;
-			mDeadStreams.push_back(mCurrentInternetStreamp);
-		}
-		mCurrentInternetStreamp = NULL;
-		//mURL.clear();
-	}
-}
-
-void LLStreamingAudio_FMOD::pause(int pauseopt)
-{
-	if (pauseopt < 0)
-	{
-		pauseopt = mCurrentInternetStreamp ? 1 : 0;
-	}
-
-	if (pauseopt)
-	{
-		if (mCurrentInternetStreamp)
-		{
-			stop();
-		}
-	}
-	else
-	{
-		start(getURL());
-	}
-}
-
-
-// A stream is "playing" if it has been requested to start.  That
-// doesn't necessarily mean audio is coming out of the speakers.
-int LLStreamingAudio_FMOD::isPlaying()
-{
-	if (mCurrentInternetStreamp)
-	{
-		return 1; // Active and playing
-	}
-	else if (!mURL.empty())
-	{
-		return 2; // "Paused"
-	}
-	else
-	{
-		return 0;
-	}
-}
-
-
-F32 LLStreamingAudio_FMOD::getGain()
-{
-	return mGain;
-}
-
-
-std::string LLStreamingAudio_FMOD::getURL()
-{
-	return mURL;
-}
-
-
-void LLStreamingAudio_FMOD::setGain(F32 vol)
-{
-	mGain = vol;
-
-	if (mFMODInternetStreamChannel != -1)
-	{
-		vol = llclamp(vol * vol, 0.f, 1.f);
-		int vol_int = llround(vol * 255.f);
-		FSOUND_SetVolumeAbsolute(mFMODInternetStreamChannel, vol_int);
-	}
-}
-
-
-///////////////////////////////////////////////////////
-// manager of possibly-multiple internet audio streams
-
-LLAudioStreamManagerFMOD::LLAudioStreamManagerFMOD(const std::string& url) :
-	mInternetStream(NULL),
-	mReady(false)
-{
-	mInternetStreamURL = url;
-	mInternetStream = FSOUND_Stream_Open(url.c_str(), FSOUND_NORMAL | FSOUND_NONBLOCKING, 0, 0);
-	if (!mInternetStream)
-	{
-		llwarns << "Couldn't open fmod stream, error "
-			<< FMOD_ErrorString(FSOUND_GetError())
-			<< llendl;
-		mReady = false;
-		return;
-	}
-
-	mReady = true;
-}
-
-int LLAudioStreamManagerFMOD::startStream()
-{
-	// We need a live and opened stream before we try and play it.
-	if (!mInternetStream || getOpenState())
-	{
-		llwarns << "No internet stream to start playing!" << llendl;
-		return -1;
-	}
-
-	// Make sure the stream is set to 2D mode.
-	FSOUND_Stream_SetMode(mInternetStream, FSOUND_2D);
-
-	return FSOUND_Stream_PlayEx(FSOUND_FREE, mInternetStream, NULL, true);
-}
-
-bool LLAudioStreamManagerFMOD::stopStream()
-{
-	if (mInternetStream)
-	{
-		int read_percent = 0;
-		int status = 0;
-		int bitrate = 0;
-		unsigned int flags = 0x0;
-		FSOUND_Stream_Net_GetStatus(mInternetStream, &status, &read_percent, &bitrate, &flags);
-
-		bool close = true;
-		switch (status)
-		{
-		case FSOUND_STREAM_NET_CONNECTING:
-			close = false;
-			break;
-		case FSOUND_STREAM_NET_NOTCONNECTED:
-		case FSOUND_STREAM_NET_BUFFERING:
-		case FSOUND_STREAM_NET_READY:
-		case FSOUND_STREAM_NET_ERROR:
-		default:
-			close = true;
-		}
-
-		if (close)
-		{
-			FSOUND_Stream_Close(mInternetStream);
-			mInternetStream = NULL;
-			return true;
-		}
-		else
-		{
-			return false;
-		}
-	}
-	else
-	{
-		return true;
-	}
-}
-
-int LLAudioStreamManagerFMOD::getOpenState()
-{
-	int open_state = FSOUND_Stream_GetOpenState(mInternetStream);
-	return open_state;
-}
diff --git a/indra/llaudio/llstreamingaudio_fmod.h b/indra/llaudio/llstreamingaudio_fmod.h
deleted file mode 100644
index 9970f0d03b..0000000000
--- a/indra/llaudio/llstreamingaudio_fmod.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/** 
- * @file streamingaudio_fmod.h
- * @author Tofu Linden
- * @brief Definition of LLStreamingAudio_FMOD implementation
- *
- * $LicenseInfo:firstyear=2009&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, 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
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_STREAMINGAUDIO_FMOD_H
-#define LL_STREAMINGAUDIO_FMOD_H
-
-#include "stdtypes.h" // from llcommon
-
-#include "llstreamingaudio.h"
-
-class LLAudioStreamManagerFMOD;
-
-class LLStreamingAudio_FMOD : public LLStreamingAudioInterface
-{
- public:
-	LLStreamingAudio_FMOD();
-	/*virtual*/ ~LLStreamingAudio_FMOD();
-
-	/*virtual*/ void start(const std::string& url);
-	/*virtual*/ void stop();
-	/*virtual*/ void pause(int pause);
-	/*virtual*/ void update();
-	/*virtual*/ int isPlaying();
-	/*virtual*/ void setGain(F32 vol);
-	/*virtual*/ F32 getGain();
-	/*virtual*/ std::string getURL();
-
-private:
-	LLAudioStreamManagerFMOD *mCurrentInternetStreamp;
-	int mFMODInternetStreamChannel;
-	std::list<LLAudioStreamManagerFMOD *> mDeadStreams;
-
-	std::string mURL;
-	F32 mGain;
-};
-
-
-#endif // LL_STREAMINGAUDIO_FMOD_H
diff --git a/indra/llaudio/llstreamingaudio_fmodex.h b/indra/llaudio/llstreamingaudio_fmodex.h
index 3751dd60ad..42b6b3aaa8 100644
--- a/indra/llaudio/llstreamingaudio_fmodex.h
+++ b/indra/llaudio/llstreamingaudio_fmodex.h
@@ -24,8 +24,8 @@
  * $/LicenseInfo$
  */
 
-#ifndef LL_STREAMINGAUDIO_FMOD_H
-#define LL_STREAMINGAUDIO_FMOD_H
+#ifndef LL_STREAMINGAUDIO_FMODEX_H
+#define LL_STREAMINGAUDIO_FMODEX_H
 
 #include "stdtypes.h" // from llcommon
 
@@ -72,4 +72,4 @@ private:
 };
 
 
-#endif // LL_STREAMINGAUDIO_FMOD_H
+#endif // LL_STREAMINGAUDIO_FMODEX_H
diff --git a/indra/llaudio/llvorbisencode.cpp b/indra/llaudio/llvorbisencode.cpp
index 0e0c80a456..dfd5da12b3 100644
--- a/indra/llaudio/llvorbisencode.cpp
+++ b/indra/llaudio/llvorbisencode.cpp
@@ -35,7 +35,7 @@
 #include "llapr.h"
 
 //#if LL_DARWIN
-// MBW -- XXX -- Getting rid of SecondLifeVorbis for now -- no fmod means no name collisions.
+// MBW -- XXX -- Getting rid of SecondLifeVorbis for now
 #if 0
 #include "VorbisFramework.h"
 
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 793b01baa1..24a35bf8a2 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -11,7 +11,6 @@ include(OpenSSL)
 include(DragDrop)
 include(EXPAT)
 include(FMODEX)
-set(FMOD OFF)
 include(OPENAL)
 include(FindOpenGL)
 include(Hunspell)
@@ -57,10 +56,6 @@ if(FMODEX)
   include_directories(${FMODEX_INCLUDE_DIR})
 endif(FMODEX)
 
-if(FMOD)
-  include_directories(${FMOD_INCLUDE_DIR})
-endif(FMOD)
-
 include_directories(
     ${DBUSGLIB_INCLUDE_DIRS}
     ${JSONCPP_INCLUDE_DIR}
@@ -1527,20 +1522,15 @@ endif (WINDOWS)
 
 if (OPENAL)
   set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_OPENAL")
-endif (OPENAL)
+endif (OPENAL)          
 
-if (FMOD OR FMODEX)
-  if (FMODEX)
-    set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_FMODEX")
-  endif (FMODEX)
-  if (FMOD)
-    set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_FMOD")
-  endif (FMOD)
+if (FMODEX)
+  set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_FMODEX")
 
-  if (DARWIN AND FMOD)
+  if (DARWIN)
     set(fmodwrapper_SOURCE_FILES fmodwrapper.cpp)
     add_library(fmodwrapper SHARED ${fmodwrapper_SOURCE_FILES})
-    set(fmodwrapper_needed_LIBRARIES ${FMOD_LIBRARY} ${CARBON_LIBRARY})
+    set(fmodwrapper_needed_LIBRARIES ${FMODEX_LIBRARY} ${CARBON_LIBRARY})
     set_target_properties(
       fmodwrapper
       PROPERTIES
@@ -1550,16 +1540,11 @@ if (FMOD OR FMODEX)
       )
     set(FMODWRAPPER_LIBRARY fmodwrapper)
     target_link_libraries(fmodwrapper ${fmodwrapper_needed_LIBRARIES})
-  else (DARWIN AND FMOD)
-    # fmodwrapper unnecessary on linux or windows for fmod and darwin for fmodex
-    if (FMODEX)
-       set(FMODWRAPPER_LIBRARY ${FMODEX_LIBRARY})
-    endif (FMODEX)
-    if (FMOD)
-       set(FMODWRAPPER_LIBRARY ${FMOD_LIBRARY})
-    endif (FMOD)
-  endif (DARWIN AND FMOD)
-endif (FMOD OR FMODEX)
+  else (DARWIN)
+    # fmodwrapper unnecessary on linux or windows
+    set(FMODWRAPPER_LIBRARY ${FMODEX_LIBRARY})
+  endif (DARWIN)
+endif (FMODEX)
 
 set_source_files_properties(llstartup.cpp PROPERTIES COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS}")
 
@@ -1705,15 +1690,7 @@ if (WINDOWS)
            ${SHARED_LIB_STAGING_DIR}/Debug/fmodexL.dll
           )
     endif (FMODEX)
-
-    if (FMOD)
-      list(APPEND COPY_INPUT_DEPENDENCIES
-           ${SHARED_LIB_STAGING_DIR}/Release/fmod.dll
-           ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/fmod.dll
-           ${SHARED_LIB_STAGING_DIR}/Debug/fmod.dll
-          )
-    endif (FMOD)
-
+    
     add_custom_command(
       OUTPUT  ${CMAKE_CFG_INTDIR}/copy_touched.bat
       COMMAND ${PYTHON_EXECUTABLE}
diff --git a/indra/newview/fmodwrapper.cpp b/indra/newview/fmodwrapper.cpp
index 16f1d19a78..e74c4a1d7c 100644
--- a/indra/newview/fmodwrapper.cpp
+++ b/indra/newview/fmodwrapper.cpp
@@ -26,12 +26,12 @@
 
 extern "C"
 {
-	void FSOUND_Init(void);
+	void FMOD_System_Init(void);
 }
 
 void* fmodwrapper(void)
 {
 	// When building the fmodwrapper library, the linker doesn't seem to want to bring in libfmod.a unless I explicitly
 	// reference at least one symbol in the library.  This seemed like the simplest way.
-	return (void*)&FSOUND_Init;
+	return (void*)&FMOD_System_Init;
 }
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 1000c0e1e8..55d7a5d45d 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1677,19 +1677,7 @@ bool LLAppViewer::cleanup()
 		gAudiop->setStreamingAudioImpl(NULL);
 
 		// shut down the audio subsystem
-
-		bool want_longname = false;
-		if (gAudiop->getDriverName(want_longname) == "FMOD")
-		{
-			// This hack exists because fmod likes to occasionally
-			// crash or hang forever when shutting down, for no
-			// apparent reason.
-			llwarns << "Hack, skipping FMOD audio engine cleanup" << llendflush;
-		}
-		else
-		{
-			gAudiop->shutdown();
-		}
+        gAudiop->shutdown();
 
 		delete gAudiop;
 		gAudiop = NULL;
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 6a874d1af5..18ef36a893 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -41,10 +41,6 @@
 # include "llaudioengine_fmodex.h"
 #endif
 
-#ifdef LL_FMOD
-# include "llaudioengine_fmod.h"
-#endif
-
 #ifdef LL_OPENAL
 #include "llaudioengine_openal.h"
 #endif
@@ -648,22 +644,11 @@ bool idle_startup()
 				gAudiop = (LLAudioEngine *) new LLAudioEngine_OpenAL();
 			}
 #endif
-
-#ifdef LL_FMOD			
-			if (!gAudiop
-#if !LL_WINDOWS
-			    && NULL == getenv("LL_BAD_FMOD_DRIVER")
-#endif // !LL_WINDOWS
-			    )
-			{
-				gAudiop = (LLAudioEngine *) new LLAudioEngine_FMOD();
-			}
-#endif
-
+            
 			if (gAudiop)
 			{
 #if LL_WINDOWS
-				// FMOD on Windows needs the window handle to stop playing audio
+				// FMOD Ex on Windows needs the window handle to stop playing audio
 				// when window is minimized. JC
 				void* window_handle = (HWND)gViewerWindow->getPlatformWindow();
 #else
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index cdd227e9fe..37b119041f 100644
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -376,10 +376,6 @@ class WindowsManifest(ViewerManifest):
             except:
                 print "Skipping fmodex audio library(assuming other audio engine)"
 
-            # Get fmod dll, continue if missing
-            if not self.path("fmod.dll"):
-                print "Skipping fmod.dll"
-
             # For textures
             if self.args['configuration'].lower() == 'debug':
                 self.path("openjpegd.dll")
-- 
cgit v1.2.3


From 3822600e27c043975407a6b47f18e1af6f3f0847 Mon Sep 17 00:00:00 2001
From: "Graham Madarasz (Graham)" <graham@lindenlab.com>
Date: Fri, 1 Feb 2013 09:33:57 -0800
Subject: Added copy of libfmodex .so for linux

---
 indra/cmake/Copy3rdPartyLibs.cmake | 750 +++++++++++++++++++------------------
 1 file changed, 377 insertions(+), 373 deletions(-)

diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake
index f9e2013483..b267ab9d4e 100644
--- a/indra/cmake/Copy3rdPartyLibs.cmake
+++ b/indra/cmake/Copy3rdPartyLibs.cmake
@@ -1,373 +1,377 @@
-# -*- cmake -*-
-
-# The copy_win_libs folder contains file lists and a script used to
-# copy dlls, exes and such needed to run the SecondLife from within
-# VisualStudio.
-
-include(CMakeCopyIfDifferent)
-include(Linking)
-
-###################################################################
-# set up platform specific lists of files that need to be copied
-###################################################################
-if(WINDOWS)
-    set(SHARED_LIB_STAGING_DIR_DEBUG            "${SHARED_LIB_STAGING_DIR}/Debug")
-    set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO   "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo")
-    set(SHARED_LIB_STAGING_DIR_RELEASE          "${SHARED_LIB_STAGING_DIR}/Release")
-
-    #*******************************
-    # VIVOX - *NOTE: no debug version
-    set(vivox_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
-    set(vivox_files
-        SLVoice.exe
-        libsndfile-1.dll
-        vivoxplatform.dll
-        vivoxsdk.dll
-        ortp.dll
-        zlib1.dll
-        vivoxoal.dll
-        )
-
-    #*******************************
-    # Misc shared libs 
-
-    set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
-    set(debug_files
-        openjpegd.dll
-        libapr-1.dll
-        libaprutil-1.dll
-        libapriconv-1.dll
-        ssleay32.dll
-        libeay32.dll
-        libcollada14dom22-d.dll
-        glod.dll    
-        libhunspell.dll
-        )
-
-    set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
-    set(release_files
-        openjpeg.dll
-        libapr-1.dll
-        libaprutil-1.dll
-        libapriconv-1.dll
-        ssleay32.dll
-        libeay32.dll
-        libcollada14dom22.dll
-        glod.dll
-        libhunspell.dll
-        )
-
-    if(USE_TCMALLOC)
-      set(debug_files ${debug_files} libtcmalloc_minimal-debug.dll)
-      set(release_files ${release_files} libtcmalloc_minimal.dll)
-    endif(USE_TCMALLOC)
-
-    if (FMODEX)
-      set(debug_files ${debug_files} fmodexL.dll)
-      set(release_files ${release_files} fmodex.dll)
-    endif (FMODEX)
-
-#*******************************
-# Copy MS C runtime dlls, required for packaging.
-# *TODO - Adapt this to support VC9
-if (MSVC80)
-    FIND_PATH(debug_msvc8_redist_path msvcr80d.dll
-        PATHS
-        ${MSVC_DEBUG_REDIST_PATH}
-         [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC80.DebugCRT
-        NO_DEFAULT_PATH
-        NO_DEFAULT_PATH
-        )
-
-    if(EXISTS ${debug_msvc8_redist_path})
-        set(debug_msvc8_files
-            msvcr80d.dll
-            msvcp80d.dll
-            Microsoft.VC80.DebugCRT.manifest
-            )
-
-        copy_if_different(
-            ${debug_msvc8_redist_path}
-            "${SHARED_LIB_STAGING_DIR_DEBUG}"
-            out_targets
-            ${debug_msvc8_files}
-            )
-        set(third_party_targets ${third_party_targets} ${out_targets})
-
-    endif (EXISTS ${debug_msvc8_redist_path})
-
-    FIND_PATH(release_msvc8_redist_path msvcr80.dll
-        PATHS
-        ${MSVC_REDIST_PATH}
-         [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC80.CRT
-        NO_DEFAULT_PATH
-        NO_DEFAULT_PATH
-        )
-
-    if(EXISTS ${release_msvc8_redist_path})
-        set(release_msvc8_files
-            msvcr80.dll
-            msvcp80.dll
-            Microsoft.VC80.CRT.manifest
-            )
-
-        copy_if_different(
-            ${release_msvc8_redist_path}
-            "${SHARED_LIB_STAGING_DIR_RELEASE}"
-            out_targets
-            ${release_msvc8_files}
-            )
-        set(third_party_targets ${third_party_targets} ${out_targets})
-
-        copy_if_different(
-            ${release_msvc8_redist_path}
-            "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
-            out_targets
-            ${release_msvc8_files}
-            )
-        set(third_party_targets ${third_party_targets} ${out_targets})
-          
-    endif (EXISTS ${release_msvc8_redist_path})
-elseif (MSVC_VERSION EQUAL 1600) # VisualStudio 2010
-    FIND_PATH(debug_msvc10_redist_path msvcr100d.dll
-        PATHS
-        ${MSVC_DEBUG_REDIST_PATH}
-         [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC100.DebugCRT
-        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/SysWOW64
-        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/System32
-        NO_DEFAULT_PATH
-        )
-
-    if(EXISTS ${debug_msvc10_redist_path})
-        set(debug_msvc10_files
-            msvcr100d.dll
-            msvcp100d.dll
-            )
-
-        copy_if_different(
-            ${debug_msvc10_redist_path}
-            "${SHARED_LIB_STAGING_DIR_DEBUG}"
-            out_targets
-            ${debug_msvc10_files}
-            )
-        set(third_party_targets ${third_party_targets} ${out_targets})
-
-    endif ()
-
-    FIND_PATH(release_msvc10_redist_path msvcr100.dll
-        PATHS
-        ${MSVC_REDIST_PATH}
-         [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC100.CRT
-        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/SysWOW64
-        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/System32
-        NO_DEFAULT_PATH
-        )
-
-    if(EXISTS ${release_msvc10_redist_path})
-        set(release_msvc10_files
-            msvcr100.dll
-            msvcp100.dll
-            )
-
-        copy_if_different(
-            ${release_msvc10_redist_path}
-            "${SHARED_LIB_STAGING_DIR_RELEASE}"
-            out_targets
-            ${release_msvc10_files}
-            )
-        set(third_party_targets ${third_party_targets} ${out_targets})
-
-        copy_if_different(
-            ${release_msvc10_redist_path}
-            "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
-            out_targets
-            ${release_msvc10_files}
-            )
-        set(third_party_targets ${third_party_targets} ${out_targets})
-          
-    endif ()
-endif (MSVC80)
-
-elseif(DARWIN)
-    set(SHARED_LIB_STAGING_DIR_DEBUG            "${SHARED_LIB_STAGING_DIR}/Debug/Resources")
-    set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO   "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/Resources")
-    set(SHARED_LIB_STAGING_DIR_RELEASE          "${SHARED_LIB_STAGING_DIR}/Release/Resources")
-
-    set(vivox_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
-    set(vivox_files
-        SLVoice
-        libsndfile.dylib
-        libvivoxoal.dylib
-        libortp.dylib
-        libvivoxplatform.dylib
-        libvivoxsdk.dylib
-       )
-    set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
-    set(debug_files
-       )
-    set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
-    set(release_files
-        libapr-1.0.dylib
-        libapr-1.dylib
-        libaprutil-1.0.dylib
-        libaprutil-1.dylib
-        libexpat.1.5.2.dylib
-        libexpat.dylib
-        libGLOD.dylib
-        libllqtwebkit.dylib
-        libminizip.a
-        libndofdev.dylib
-        libhunspell-1.3.0.dylib
-        libexception_handler.dylib
-        libcollada14dom.dylib
-       )
-
-    if (FMODEX)
-      #set(debug_files ${debug_files} libfmodexL.dylib)
-      set(release_files ${release_files} libfmodex.dylib)
-    endif (FMODEX)
-
-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...
-    set(SHARED_LIB_STAGING_DIR_DEBUG            "${SHARED_LIB_STAGING_DIR}")
-    set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO   "${SHARED_LIB_STAGING_DIR}")
-    set(SHARED_LIB_STAGING_DIR_RELEASE          "${SHARED_LIB_STAGING_DIR}")
-
-    set(vivox_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
-    set(vivox_files
-        libsndfile.so.1
-        libortp.so
-        libvivoxoal.so.1
-        libvivoxplatform.so
-        libvivoxsdk.so
-        SLVoice
-       )
-    # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
-    # or ARCH_PREBUILT_DIRS
-    set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
-    set(debug_files
-       )
-    # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
-    # or ARCH_PREBUILT_DIRS
-    set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
-    # *FIX - figure out what to do with duplicate libalut.so here -brad
-    set(release_files
-        libapr-1.so.0
-        libaprutil-1.so.0
-        libatk-1.0.so
-        libboost_program_options-mt.so.${BOOST_VERSION}.0
-        libboost_regex-mt.so.${BOOST_VERSION}.0
-        libboost_thread-mt.so.${BOOST_VERSION}.0
-        libboost_filesystem-mt.so.${BOOST_VERSION}.0
-        libboost_signals-mt.so.${BOOST_VERSION}.0
-        libboost_system-mt.so.${BOOST_VERSION}.0
-        libbreakpad_client.so.0
-        libcollada14dom.so
-        libcrypto.so.1.0.0
-        libdb-5.1.so
-        libexpat.so
-        libexpat.so.1
-        libglod.so
-        libgmock_main.so
-        libgmock.so.0
-        libgmodule-2.0.so
-        libgobject-2.0.so
-        libgtest_main.so
-        libgtest.so.0
-        libhunspell-1.3.so.0.0.0
-        libminizip.so
-        libopenal.so
-        libopenjpeg.so
-        libssl.so
-        libuuid.so.16
-        libuuid.so.16.0.22
-        libssl.so.1.0.0
-        libfontconfig.so.1.4.4
-       )
-
-    if (USE_TCMALLOC)
-      set(release_files ${release_files} "libtcmalloc_minimal.so")
-    endif (USE_TCMALLOC)
-
-else(WINDOWS)
-    message(STATUS "WARNING: unrecognized platform for staging 3rd party libs, skipping...")
-    set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-linux")
-    set(vivox_files "")
-    # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
-    # or ARCH_PREBUILT_DIRS
-    set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/debug")
-    set(debug_files "")
-    # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
-    # or ARCH_PREBUILT_DIRS
-    set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/release")
-    set(release_files "")
-
-    set(debug_llkdu_src "")
-    set(debug_llkdu_dst "")
-    set(release_llkdu_src "")
-    set(release_llkdu_dst "")
-    set(relwithdebinfo_llkdu_dst "")
-endif(WINDOWS)
-
-
-################################################################
-# Done building the file lists, now set up the copy commands.
-################################################################
-
-copy_if_different(
-    ${vivox_src_dir}
-    "${SHARED_LIB_STAGING_DIR_DEBUG}"
-    out_targets 
-    ${vivox_files}
-    )
-set(third_party_targets ${third_party_targets} ${out_targets})
-
-copy_if_different(
-    ${vivox_src_dir}
-    "${SHARED_LIB_STAGING_DIR_RELEASE}"
-    out_targets
-    ${vivox_files}
-    )
-set(third_party_targets ${third_party_targets} ${out_targets})
-
-copy_if_different(
-    ${vivox_src_dir}
-    "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
-    out_targets
-    ${vivox_files}
-    )
-set(third_party_targets ${third_party_targets} ${out_targets})
-
-
-
-copy_if_different(
-    ${debug_src_dir}
-    "${SHARED_LIB_STAGING_DIR_DEBUG}"
-    out_targets
-    ${debug_files}
-    )
-set(third_party_targets ${third_party_targets} ${out_targets})
-
-copy_if_different(
-    ${release_src_dir}
-    "${SHARED_LIB_STAGING_DIR_RELEASE}"
-    out_targets
-    ${release_files}
-    )
-set(third_party_targets ${third_party_targets} ${out_targets})
-
-copy_if_different(
-    ${release_src_dir}
-    "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
-    out_targets
-    ${release_files}
-    )
-set(third_party_targets ${third_party_targets} ${out_targets})
-
-if(NOT STANDALONE)
-  add_custom_target(
-      stage_third_party_libs ALL
-      DEPENDS ${third_party_targets}
-      )
-endif(NOT STANDALONE)
+# -*- cmake -*-
+
+# The copy_win_libs folder contains file lists and a script used to
+# copy dlls, exes and such needed to run the SecondLife from within
+# VisualStudio.
+
+include(CMakeCopyIfDifferent)
+include(Linking)
+
+###################################################################
+# set up platform specific lists of files that need to be copied
+###################################################################
+if(WINDOWS)
+    set(SHARED_LIB_STAGING_DIR_DEBUG            "${SHARED_LIB_STAGING_DIR}/Debug")
+    set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO   "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo")
+    set(SHARED_LIB_STAGING_DIR_RELEASE          "${SHARED_LIB_STAGING_DIR}/Release")
+
+    #*******************************
+    # VIVOX - *NOTE: no debug version
+    set(vivox_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
+    set(vivox_files
+        SLVoice.exe
+        libsndfile-1.dll
+        vivoxplatform.dll
+        vivoxsdk.dll
+        ortp.dll
+        zlib1.dll
+        vivoxoal.dll
+        )
+
+    #*******************************
+    # Misc shared libs 
+
+    set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
+    set(debug_files
+        openjpegd.dll
+        libapr-1.dll
+        libaprutil-1.dll
+        libapriconv-1.dll
+        ssleay32.dll
+        libeay32.dll
+        libcollada14dom22-d.dll
+        glod.dll    
+        libhunspell.dll
+        )
+
+    set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
+    set(release_files
+        openjpeg.dll
+        libapr-1.dll
+        libaprutil-1.dll
+        libapriconv-1.dll
+        ssleay32.dll
+        libeay32.dll
+        libcollada14dom22.dll
+        glod.dll
+        libhunspell.dll
+        )
+
+    if(USE_TCMALLOC)
+      set(debug_files ${debug_files} libtcmalloc_minimal-debug.dll)
+      set(release_files ${release_files} libtcmalloc_minimal.dll)
+    endif(USE_TCMALLOC)
+
+    if (FMODEX)
+      set(debug_files ${debug_files} fmodexL.dll)
+      set(release_files ${release_files} fmodex.dll)
+    endif (FMODEX)
+
+#*******************************
+# Copy MS C runtime dlls, required for packaging.
+# *TODO - Adapt this to support VC9
+if (MSVC80)
+    FIND_PATH(debug_msvc8_redist_path msvcr80d.dll
+        PATHS
+        ${MSVC_DEBUG_REDIST_PATH}
+         [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC80.DebugCRT
+        NO_DEFAULT_PATH
+        NO_DEFAULT_PATH
+        )
+
+    if(EXISTS ${debug_msvc8_redist_path})
+        set(debug_msvc8_files
+            msvcr80d.dll
+            msvcp80d.dll
+            Microsoft.VC80.DebugCRT.manifest
+            )
+
+        copy_if_different(
+            ${debug_msvc8_redist_path}
+            "${SHARED_LIB_STAGING_DIR_DEBUG}"
+            out_targets
+            ${debug_msvc8_files}
+            )
+        set(third_party_targets ${third_party_targets} ${out_targets})
+
+    endif (EXISTS ${debug_msvc8_redist_path})
+
+    FIND_PATH(release_msvc8_redist_path msvcr80.dll
+        PATHS
+        ${MSVC_REDIST_PATH}
+         [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC80.CRT
+        NO_DEFAULT_PATH
+        NO_DEFAULT_PATH
+        )
+
+    if(EXISTS ${release_msvc8_redist_path})
+        set(release_msvc8_files
+            msvcr80.dll
+            msvcp80.dll
+            Microsoft.VC80.CRT.manifest
+            )
+
+        copy_if_different(
+            ${release_msvc8_redist_path}
+            "${SHARED_LIB_STAGING_DIR_RELEASE}"
+            out_targets
+            ${release_msvc8_files}
+            )
+        set(third_party_targets ${third_party_targets} ${out_targets})
+
+        copy_if_different(
+            ${release_msvc8_redist_path}
+            "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
+            out_targets
+            ${release_msvc8_files}
+            )
+        set(third_party_targets ${third_party_targets} ${out_targets})
+          
+    endif (EXISTS ${release_msvc8_redist_path})
+elseif (MSVC_VERSION EQUAL 1600) # VisualStudio 2010
+    FIND_PATH(debug_msvc10_redist_path msvcr100d.dll
+        PATHS
+        ${MSVC_DEBUG_REDIST_PATH}
+         [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC100.DebugCRT
+        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/SysWOW64
+        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/System32
+        NO_DEFAULT_PATH
+        )
+
+    if(EXISTS ${debug_msvc10_redist_path})
+        set(debug_msvc10_files
+            msvcr100d.dll
+            msvcp100d.dll
+            )
+
+        copy_if_different(
+            ${debug_msvc10_redist_path}
+            "${SHARED_LIB_STAGING_DIR_DEBUG}"
+            out_targets
+            ${debug_msvc10_files}
+            )
+        set(third_party_targets ${third_party_targets} ${out_targets})
+
+    endif ()
+
+    FIND_PATH(release_msvc10_redist_path msvcr100.dll
+        PATHS
+        ${MSVC_REDIST_PATH}
+         [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC100.CRT
+        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/SysWOW64
+        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/System32
+        NO_DEFAULT_PATH
+        )
+
+    if(EXISTS ${release_msvc10_redist_path})
+        set(release_msvc10_files
+            msvcr100.dll
+            msvcp100.dll
+            )
+
+        copy_if_different(
+            ${release_msvc10_redist_path}
+            "${SHARED_LIB_STAGING_DIR_RELEASE}"
+            out_targets
+            ${release_msvc10_files}
+            )
+        set(third_party_targets ${third_party_targets} ${out_targets})
+
+        copy_if_different(
+            ${release_msvc10_redist_path}
+            "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
+            out_targets
+            ${release_msvc10_files}
+            )
+        set(third_party_targets ${third_party_targets} ${out_targets})
+          
+    endif ()
+endif (MSVC80)
+
+elseif(DARWIN)
+    set(SHARED_LIB_STAGING_DIR_DEBUG            "${SHARED_LIB_STAGING_DIR}/Debug/Resources")
+    set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO   "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/Resources")
+    set(SHARED_LIB_STAGING_DIR_RELEASE          "${SHARED_LIB_STAGING_DIR}/Release/Resources")
+
+    set(vivox_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
+    set(vivox_files
+        SLVoice
+        libsndfile.dylib
+        libvivoxoal.dylib
+        libortp.dylib
+        libvivoxplatform.dylib
+        libvivoxsdk.dylib
+       )
+    set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
+    set(debug_files
+       )
+    set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
+    set(release_files
+        libapr-1.0.dylib
+        libapr-1.dylib
+        libaprutil-1.0.dylib
+        libaprutil-1.dylib
+        libexpat.1.5.2.dylib
+        libexpat.dylib
+        libGLOD.dylib
+        libllqtwebkit.dylib
+        libminizip.a
+        libndofdev.dylib
+        libhunspell-1.3.0.dylib
+        libexception_handler.dylib
+        libcollada14dom.dylib
+       )
+
+    if (FMODEX)
+      #set(debug_files ${debug_files} libfmodexL.dylib)
+      set(release_files ${release_files} libfmodex.dylib)
+    endif (FMODEX)
+
+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...
+    set(SHARED_LIB_STAGING_DIR_DEBUG            "${SHARED_LIB_STAGING_DIR}")
+    set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO   "${SHARED_LIB_STAGING_DIR}")
+    set(SHARED_LIB_STAGING_DIR_RELEASE          "${SHARED_LIB_STAGING_DIR}")
+
+    set(vivox_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
+    set(vivox_files
+        libsndfile.so.1
+        libortp.so
+        libvivoxoal.so.1
+        libvivoxplatform.so
+        libvivoxsdk.so
+        SLVoice
+       )
+    # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
+    # or ARCH_PREBUILT_DIRS
+    set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
+    set(debug_files
+       )
+    # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
+    # or ARCH_PREBUILT_DIRS
+    set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
+    # *FIX - figure out what to do with duplicate libalut.so here -brad
+    set(release_files
+        libapr-1.so.0
+        libaprutil-1.so.0
+        libatk-1.0.so
+        libboost_program_options-mt.so.${BOOST_VERSION}.0
+        libboost_regex-mt.so.${BOOST_VERSION}.0
+        libboost_thread-mt.so.${BOOST_VERSION}.0
+        libboost_filesystem-mt.so.${BOOST_VERSION}.0
+        libboost_signals-mt.so.${BOOST_VERSION}.0
+        libboost_system-mt.so.${BOOST_VERSION}.0
+        libbreakpad_client.so.0
+        libcollada14dom.so
+        libcrypto.so.1.0.0
+        libdb-5.1.so
+        libexpat.so
+        libexpat.so.1
+        libglod.so
+        libgmock_main.so
+        libgmock.so.0
+        libgmodule-2.0.so
+        libgobject-2.0.so
+        libgtest_main.so
+        libgtest.so.0
+        libhunspell-1.3.so.0.0.0
+        libminizip.so
+        libopenal.so
+        libopenjpeg.so
+        libssl.so
+        libuuid.so.16
+        libuuid.so.16.0.22
+        libssl.so.1.0.0
+        libfontconfig.so.1.4.4
+       )
+
+    if (USE_TCMALLOC)
+      set(release_files ${release_files} "libtcmalloc_minimal.so")
+    endif (USE_TCMALLOC)
+
+    if (FMODEX)
+      set(release_file ${release_files} "libfmodex-4.44.so")
+    endif (FMODEX)
+
+else(WINDOWS)
+    message(STATUS "WARNING: unrecognized platform for staging 3rd party libs, skipping...")
+    set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-linux")
+    set(vivox_files "")
+    # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
+    # or ARCH_PREBUILT_DIRS
+    set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/debug")
+    set(debug_files "")
+    # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
+    # or ARCH_PREBUILT_DIRS
+    set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/release")
+    set(release_files "")
+
+    set(debug_llkdu_src "")
+    set(debug_llkdu_dst "")
+    set(release_llkdu_src "")
+    set(release_llkdu_dst "")
+    set(relwithdebinfo_llkdu_dst "")
+endif(WINDOWS)
+
+
+################################################################
+# Done building the file lists, now set up the copy commands.
+################################################################
+
+copy_if_different(
+    ${vivox_src_dir}
+    "${SHARED_LIB_STAGING_DIR_DEBUG}"
+    out_targets 
+    ${vivox_files}
+    )
+set(third_party_targets ${third_party_targets} ${out_targets})
+
+copy_if_different(
+    ${vivox_src_dir}
+    "${SHARED_LIB_STAGING_DIR_RELEASE}"
+    out_targets
+    ${vivox_files}
+    )
+set(third_party_targets ${third_party_targets} ${out_targets})
+
+copy_if_different(
+    ${vivox_src_dir}
+    "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
+    out_targets
+    ${vivox_files}
+    )
+set(third_party_targets ${third_party_targets} ${out_targets})
+
+
+
+copy_if_different(
+    ${debug_src_dir}
+    "${SHARED_LIB_STAGING_DIR_DEBUG}"
+    out_targets
+    ${debug_files}
+    )
+set(third_party_targets ${third_party_targets} ${out_targets})
+
+copy_if_different(
+    ${release_src_dir}
+    "${SHARED_LIB_STAGING_DIR_RELEASE}"
+    out_targets
+    ${release_files}
+    )
+set(third_party_targets ${third_party_targets} ${out_targets})
+
+copy_if_different(
+    ${release_src_dir}
+    "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
+    out_targets
+    ${release_files}
+    )
+set(third_party_targets ${third_party_targets} ${out_targets})
+
+if(NOT STANDALONE)
+  add_custom_target(
+      stage_third_party_libs ALL
+      DEPENDS ${third_party_targets}
+      )
+endif(NOT STANDALONE)
-- 
cgit v1.2.3


From d6130d68d5ad39dacb24a72253ad1814dc38bec3 Mon Sep 17 00:00:00 2001
From: "Graham Madarasz (Graham Linden)" <graham@lindenlab.com>
Date: Sat, 2 Feb 2013 00:23:08 -0800
Subject: Updated fmodex download paths / md5sums from proxy for the first TC
 builds

---
 autobuild.xml | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/autobuild.xml b/autobuild.xml
index caccdf7abc..080ccb7d4c 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -546,9 +546,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>c6f551e728295ff798d5804aa4e3671f</string>
+              <string>5b3e7ac9d43f317a78807ef42d0557cf</string>
               <key>url</key>
-              <string>http://private-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-fmodex-private/arch/Darwin/fmodex-4.44.04-darwin-20130122.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269872/arch/Darwin/installer/fmodex-4.44-darwin-20130201.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin</string>
@@ -558,13 +558,25 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>00f752f73774e0e72d737099860582af</string>
+              <string>b278ee4734ddb050ba2b67bbac709574</string>
               <key>url</key>
-              <string>http://private-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-fmodex-private/arch/CYGWIN/fmodex-4.44.04-windows-20130123.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269873/arch/CYGWIN/installer/fmodex-4.44-windows-201300201.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
           </map>
+          <key>linux</key>
+          <map>
+            <key>archive</key>
+            <map>
+              <key>hash</key>
+              <string>2781f3e844a8c5e6a3633b4d77a018d7</string>
+              <key>url</key>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269873/arch/Linux/installer/fmodex-4.44-linux-201300202.tar.bz2</string>
+            </map>
+            <key>name</key>
+            <string>linux</string>
+          </map>
         </map>
       </map>
       <key>fontconfig</key>
-- 
cgit v1.2.3


From bc161b040a5f6817a9adcec759e48bf590c2ed45 Mon Sep 17 00:00:00 2001
From: Sovereign Engineer <sovereign.engineer@outlook.com>
Date: Mon, 4 Feb 2013 08:21:19 -0500
Subject: Remove FMOD 3.75 leftovers

---
 indra/newview/fmod_hidden_symbols.exp | 240 ----------------------------------
 indra/newview/fmodwrapper.cpp         |  37 ------
 indra/newview/linux_tools/wrapper.sh  |   6 +-
 indra/newview/viewer_manifest.py      |   7 -
 4 files changed, 1 insertion(+), 289 deletions(-)
 delete mode 100644 indra/newview/fmod_hidden_symbols.exp
 delete mode 100644 indra/newview/fmodwrapper.cpp

diff --git a/indra/newview/fmod_hidden_symbols.exp b/indra/newview/fmod_hidden_symbols.exp
deleted file mode 100644
index 1e790255bc..0000000000
--- a/indra/newview/fmod_hidden_symbols.exp
+++ /dev/null
@@ -1,240 +0,0 @@
-_CarbonSndPlayDoubleBuffer
-_ConvertFromIeeeExtended
-__book_maptype1_quantvals
-__book_unquantize
-__float32_pack
-__float32_unpack
-__ilog
-__make_words
-_lpc_clear
-_lpc_init
-__vorbis_block_alloc
-__vorbis_block_ripcord
-__vorbis_apply_window
-__vorbis_window_get
-_vorbis_analysis_blockout
-_vorbis_analysis_buffer
-_vorbis_analysis_wrote
-_vorbis_block_clear
-_vorbis_block_init
-_vorbis_dsp_clear
-_vorbis_synthesis_blockin
-_vorbis_synthesis_init
-_vorbis_synthesis_pcmout
-_vorbis_synthesis_read
-_vorbis_packet_blocksize
-_vorbis_synthesis
-_vorbis_book_clear
-_vorbis_book_decode
-_vorbis_book_decodev_add
-_vorbis_book_decodev_set
-_vorbis_book_decodevs_add
-_vorbis_book_decodevv_add
-_vorbis_book_init_decode
-_vorbis_comment_add
-_vorbis_comment_add_tag
-_vorbis_comment_clear
-_vorbis_comment_init
-_vorbis_comment_query
-_vorbis_comment_query_count
-_vorbis_coslook
-_vorbis_fromdBlook
-_vorbis_info_blocksize
-_vorbis_info_clear
-_vorbis_info_init
-_vorbis_invsq2explook
-_vorbis_invsqlook
-_vorbis_lpc_from_curve
-_vorbis_lpc_from_data
-_vorbis_lpc_predict
-_vorbis_lsp_to_curve
-_vorbis_staticbook_clear
-_vorbis_staticbook_destroy
-_vorbis_staticbook_unpack
-_vorbis_synthesis_headerin
-_vorbis_synthesis_lapout
-_vorbis_synthesis_restart
-_vorbis_synthesis_trackonly
-_vorbis_window
-_ogg_packet_clear
-_ogg_page_bos
-_ogg_page_checksum_set
-_ogg_page_continued
-_ogg_page_eos
-_ogg_page_granulepos
-_ogg_page_packets
-_ogg_page_pageno
-_ogg_page_serialno
-_ogg_page_version
-_ogg_stream_reset_serialno
-_ogg_stream_clear
-_ogg_stream_destroy
-_ogg_stream_eos
-_ogg_stream_flush
-_ogg_stream_init
-_ogg_stream_packetout
-_ogg_stream_packetpeek
-_ogg_stream_pagein
-_ogg_stream_pageout
-_ogg_stream_reset
-_ogg_sync_buffer
-_ogg_sync_clear
-_ogg_sync_destroy
-_ogg_sync_init
-_ogg_sync_pageout
-_ogg_sync_pageseek
-_ogg_sync_reset
-_ogg_sync_wrote
-_ov_bitrate
-_ov_bitrate_instant
-_ov_clear
-_ov_comment
-_ov_info
-_ov_open
-_ov_open_callbacks
-_ov_pcm_seek
-_ov_pcm_seek_page
-_ov_pcm_tell
-_ov_pcm_total
-_ov_raw_seek
-_ov_raw_tell
-_ov_raw_total
-_ov_read
-_ov_read_float
-_ov_seekable
-_ov_serialnumber
-_ov_streams
-_ov_test
-_ov_test_callbacks
-_ov_test_open
-_ov_time_seek
-_ov_time_seek_page
-_ov_time_tell
-_ov_time_total
-_ogg_toupper
-_oggpackB_adv
-_oggpackB_adv1
-_oggpackB_bits
-_oggpackB_bytes
-_oggpackB_get_buffer
-_oggpackB_look
-_oggpackB_look1
-_oggpackB_read
-_oggpackB_read1
-_oggpackB_readinit
-_oggpackB_reset
-_oggpack_adv
-_oggpack_adv1
-_oggpack_bits
-_oggpack_bytes
-_oggpack_get_buffer
-_oggpack_look
-_oggpack_look1
-_oggpack_read
-_oggpack_read1
-_oggpack_readinit
-_oggpack_reset
-_ov_crosslap
-_ov_pcm_seek_lap
-_ov_pcm_seek_page_lap
-_ov_raw_seek_lap
-_ov_time_seek_lap
-_ov_time_seek_page_lap
-_II_step_one
-_II_step_two
-_MyRecComp
-_SampleRates
-_Sinfo
-_ValidStepIndex
-__Z11fmodwrapperv
-__Z11fmodwrapperv.eh
-__floor_P
-__mapping_P
-__residue_P
-__ve_envelope_clear
-__ve_envelope_init
-__ve_envelope_mark
-__ve_envelope_search
-__ve_envelope_shift
-__vi_gpsy_free
-__vi_psy_free
-__vorbis_window_init
-__vp_ampmax_decay
-__vp_couple
-__vp_global_free
-__vp_global_look
-__vp_noise_normalize
-__vp_noise_normalize_sort
-__vp_noisemask
-__vp_offset_and_mix
-__vp_psy_clear
-__vp_psy_init
-__vp_quantize_couple_memo
-__vp_quantize_couple_sort
-__vp_remove_floor
-__vp_tonemask
-_alloc_0
-_alloc_1
-_alloc_2
-_alloc_3
-_alloc_4
-_bandInfo
-_cdcallback
-_cdchannel
-_cdmode
-_cdnumtracks
-_cdstream
-_cdtrack
-_drft_backward
-_drft_clear
-_drft_forward
-_drft_init
-_eatwhite
-_floor0_exportbundle
-_floor1_exportbundle
-_gFreeList
-_gNMRecBusy
-_gNMRecPtr
-_gSilenceOnes
-_gSilenceTwos
-_longLimit
-_mapping0_exportbundle
-_mdct_backward
-_mdct_clear
-_mdct_forward
-_mdct_init
-_muls
-_mystrdup
-_res0_free_info
-_res0_free_look
-_res0_inverse
-_res0_look
-_res0_unpack
-_res1_class
-_res1_inverse
-_res2_inverse
-_residue0_exportbundle
-_residue1_exportbundle
-_residue2_exportbundle
-_scale
-_shortLimit
-_tabsel_123
-_F_Free
-_F_Malloc
-_F_ReAlloc
-_F_memcmp
-_F_memmove
-_F_strcat
-_F_strchr
-_F_strcmp
-_F_strcpy
-_F_stricmp
-_F_strlen
-_F_strncat
-_F_strncmp
-_F_strncpy
-_F_strnicmp
-_F_strstr
-_F_strupr
-_F_tolower
-_F_toupper
diff --git a/indra/newview/fmodwrapper.cpp b/indra/newview/fmodwrapper.cpp
deleted file mode 100644
index e74c4a1d7c..0000000000
--- a/indra/newview/fmodwrapper.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/** 
- * @file fmodwrapper.cpp
- * @brief dummy source file for building a shared library to wrap libfmod.a
- *
- * $LicenseInfo:firstyear=2005&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, 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
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-extern "C"
-{
-	void FMOD_System_Init(void);
-}
-
-void* fmodwrapper(void)
-{
-	// When building the fmodwrapper library, the linker doesn't seem to want to bring in libfmod.a unless I explicitly
-	// reference at least one symbol in the library.  This seemed like the simplest way.
-	return (void*)&FMOD_System_Init;
-}
diff --git a/indra/newview/linux_tools/wrapper.sh b/indra/newview/linux_tools/wrapper.sh
index 71b7e74c63..17f39aaa7e 100755
--- a/indra/newview/linux_tools/wrapper.sh
+++ b/indra/newview/linux_tools/wrapper.sh
@@ -8,17 +8,13 @@
 #export LL_BAD_FMODEX_DRIVER=x
 ## - Avoids using any OpenAL audio driver.
 #export LL_BAD_OPENAL_DRIVER=x
-## - Avoids using any FMOD audio driver.
-#export LL_BAD_FMOD_DRIVER=x
-
+s
 ## - Avoids using the FMOD Ex PulseAudio audio driver.
 #export LL_BAD_FMOD_PULSEAUDIO=x
 ## - Avoids using the FMOD or FMOD Ex ALSA audio driver.
 #export LL_BAD_FMOD_ALSA=x
 ## - Avoids using the FMOD or FMOD Ex OSS audio driver.
 #export LL_BAD_FMOD_OSS=x
-## - Avoids using the FMOD ESD audio driver.
-#export LL_BAD_FMOD_ESD=x
 
 ## - Avoids the optional OpenGL extensions which have proven most problematic
 ##   on some hardware.  Disabling this option may cause BETTER PERFORMANCE but
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 37b119041f..557c213787 100644
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -1124,13 +1124,6 @@ class Linux_i686Manifest(LinuxManifest):
                 print "tcmalloc files not found, skipping"
                 pass
 
-            try:
-                    self.path("libfmod-3.75.so")
-                    pass
-            except:
-                    print "Skipping libfmod-3.75.so - not found"
-                    pass
-
             try:
                     self.path("libfmodex-*.so")
                     self.path("libfmodex.so")
-- 
cgit v1.2.3


From 8cf1d6af0d576ad460e441a45a455fbb45bcb9a7 Mon Sep 17 00:00:00 2001
From: Sovereign Engineer <sovereign.engineer@outlook.com>
Date: Mon, 4 Feb 2013 08:24:35 -0500
Subject: fmodwrapper uneeded with fmodex

---
 indra/newview/CMakeLists.txt     | 19 +------------------
 indra/newview/viewer_manifest.py |  6 +-----
 2 files changed, 2 insertions(+), 23 deletions(-)

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 24a35bf8a2..b860b484dc 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1526,24 +1526,7 @@ endif (OPENAL)
 
 if (FMODEX)
   set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_FMODEX")
-
-  if (DARWIN)
-    set(fmodwrapper_SOURCE_FILES fmodwrapper.cpp)
-    add_library(fmodwrapper SHARED ${fmodwrapper_SOURCE_FILES})
-    set(fmodwrapper_needed_LIBRARIES ${FMODEX_LIBRARY} ${CARBON_LIBRARY})
-    set_target_properties(
-      fmodwrapper
-      PROPERTIES
-      BUILD_WITH_INSTALL_RPATH 1
-      INSTALL_NAME_DIR "@executable_path/../Resources"
-      LINK_FLAGS "-unexported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/fmod_hidden_symbols.exp"
-      )
-    set(FMODWRAPPER_LIBRARY fmodwrapper)
-    target_link_libraries(fmodwrapper ${fmodwrapper_needed_LIBRARIES})
-  else (DARWIN)
-    # fmodwrapper unnecessary on linux or windows
-    set(FMODWRAPPER_LIBRARY ${FMODEX_LIBRARY})
-  endif (DARWIN)
+  set(FMODWRAPPER_LIBRARY ${FMODEX_LIBRARY})
 endif (FMODEX)
 
 set_source_files_properties(llstartup.cpp PROPERTIES COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS}")
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 557c213787..6333c65047 100644
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -762,11 +762,7 @@ class DarwinManifest(ViewerManifest):
                                 'SLVoice',
                                 ):
                      self.path2basename(libdir, libfile)
-                
-                # FMOD for sound
-                libfile = "libfmodwrapper.dylib"
-                path_optional(os.path.join(self.args['configuration'], libfile), libfile)
-                
+
                 # our apps
                 for app_bld_dir, app in (("mac_crash_logger", "mac-crash-logger.app"),
                                          ("mac_updater", "mac-updater.app"),
-- 
cgit v1.2.3


From 3ea6112843e2b83ed0e83976bae730ccaa23176a Mon Sep 17 00:00:00 2001
From: Sovereign Engineer <sovereign.engineer@outlook.com>
Date: Mon, 4 Feb 2013 08:30:42 -0500
Subject: Dos2Unix Line endings

---
 indra/cmake/Copy3rdPartyLibs.cmake | 754 ++++++++++++++++++-------------------
 1 file changed, 377 insertions(+), 377 deletions(-)

diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake
index b267ab9d4e..1d83da4d87 100644
--- a/indra/cmake/Copy3rdPartyLibs.cmake
+++ b/indra/cmake/Copy3rdPartyLibs.cmake
@@ -1,377 +1,377 @@
-# -*- cmake -*-
-
-# The copy_win_libs folder contains file lists and a script used to
-# copy dlls, exes and such needed to run the SecondLife from within
-# VisualStudio.
-
-include(CMakeCopyIfDifferent)
-include(Linking)
-
-###################################################################
-# set up platform specific lists of files that need to be copied
-###################################################################
-if(WINDOWS)
-    set(SHARED_LIB_STAGING_DIR_DEBUG            "${SHARED_LIB_STAGING_DIR}/Debug")
-    set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO   "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo")
-    set(SHARED_LIB_STAGING_DIR_RELEASE          "${SHARED_LIB_STAGING_DIR}/Release")
-
-    #*******************************
-    # VIVOX - *NOTE: no debug version
-    set(vivox_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
-    set(vivox_files
-        SLVoice.exe
-        libsndfile-1.dll
-        vivoxplatform.dll
-        vivoxsdk.dll
-        ortp.dll
-        zlib1.dll
-        vivoxoal.dll
-        )
-
-    #*******************************
-    # Misc shared libs 
-
-    set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
-    set(debug_files
-        openjpegd.dll
-        libapr-1.dll
-        libaprutil-1.dll
-        libapriconv-1.dll
-        ssleay32.dll
-        libeay32.dll
-        libcollada14dom22-d.dll
-        glod.dll    
-        libhunspell.dll
-        )
-
-    set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
-    set(release_files
-        openjpeg.dll
-        libapr-1.dll
-        libaprutil-1.dll
-        libapriconv-1.dll
-        ssleay32.dll
-        libeay32.dll
-        libcollada14dom22.dll
-        glod.dll
-        libhunspell.dll
-        )
-
-    if(USE_TCMALLOC)
-      set(debug_files ${debug_files} libtcmalloc_minimal-debug.dll)
-      set(release_files ${release_files} libtcmalloc_minimal.dll)
-    endif(USE_TCMALLOC)
-
-    if (FMODEX)
-      set(debug_files ${debug_files} fmodexL.dll)
-      set(release_files ${release_files} fmodex.dll)
-    endif (FMODEX)
-
-#*******************************
-# Copy MS C runtime dlls, required for packaging.
-# *TODO - Adapt this to support VC9
-if (MSVC80)
-    FIND_PATH(debug_msvc8_redist_path msvcr80d.dll
-        PATHS
-        ${MSVC_DEBUG_REDIST_PATH}
-         [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC80.DebugCRT
-        NO_DEFAULT_PATH
-        NO_DEFAULT_PATH
-        )
-
-    if(EXISTS ${debug_msvc8_redist_path})
-        set(debug_msvc8_files
-            msvcr80d.dll
-            msvcp80d.dll
-            Microsoft.VC80.DebugCRT.manifest
-            )
-
-        copy_if_different(
-            ${debug_msvc8_redist_path}
-            "${SHARED_LIB_STAGING_DIR_DEBUG}"
-            out_targets
-            ${debug_msvc8_files}
-            )
-        set(third_party_targets ${third_party_targets} ${out_targets})
-
-    endif (EXISTS ${debug_msvc8_redist_path})
-
-    FIND_PATH(release_msvc8_redist_path msvcr80.dll
-        PATHS
-        ${MSVC_REDIST_PATH}
-         [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC80.CRT
-        NO_DEFAULT_PATH
-        NO_DEFAULT_PATH
-        )
-
-    if(EXISTS ${release_msvc8_redist_path})
-        set(release_msvc8_files
-            msvcr80.dll
-            msvcp80.dll
-            Microsoft.VC80.CRT.manifest
-            )
-
-        copy_if_different(
-            ${release_msvc8_redist_path}
-            "${SHARED_LIB_STAGING_DIR_RELEASE}"
-            out_targets
-            ${release_msvc8_files}
-            )
-        set(third_party_targets ${third_party_targets} ${out_targets})
-
-        copy_if_different(
-            ${release_msvc8_redist_path}
-            "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
-            out_targets
-            ${release_msvc8_files}
-            )
-        set(third_party_targets ${third_party_targets} ${out_targets})
-          
-    endif (EXISTS ${release_msvc8_redist_path})
-elseif (MSVC_VERSION EQUAL 1600) # VisualStudio 2010
-    FIND_PATH(debug_msvc10_redist_path msvcr100d.dll
-        PATHS
-        ${MSVC_DEBUG_REDIST_PATH}
-         [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC100.DebugCRT
-        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/SysWOW64
-        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/System32
-        NO_DEFAULT_PATH
-        )
-
-    if(EXISTS ${debug_msvc10_redist_path})
-        set(debug_msvc10_files
-            msvcr100d.dll
-            msvcp100d.dll
-            )
-
-        copy_if_different(
-            ${debug_msvc10_redist_path}
-            "${SHARED_LIB_STAGING_DIR_DEBUG}"
-            out_targets
-            ${debug_msvc10_files}
-            )
-        set(third_party_targets ${third_party_targets} ${out_targets})
-
-    endif ()
-
-    FIND_PATH(release_msvc10_redist_path msvcr100.dll
-        PATHS
-        ${MSVC_REDIST_PATH}
-         [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC100.CRT
-        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/SysWOW64
-        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/System32
-        NO_DEFAULT_PATH
-        )
-
-    if(EXISTS ${release_msvc10_redist_path})
-        set(release_msvc10_files
-            msvcr100.dll
-            msvcp100.dll
-            )
-
-        copy_if_different(
-            ${release_msvc10_redist_path}
-            "${SHARED_LIB_STAGING_DIR_RELEASE}"
-            out_targets
-            ${release_msvc10_files}
-            )
-        set(third_party_targets ${third_party_targets} ${out_targets})
-
-        copy_if_different(
-            ${release_msvc10_redist_path}
-            "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
-            out_targets
-            ${release_msvc10_files}
-            )
-        set(third_party_targets ${third_party_targets} ${out_targets})
-          
-    endif ()
-endif (MSVC80)
-
-elseif(DARWIN)
-    set(SHARED_LIB_STAGING_DIR_DEBUG            "${SHARED_LIB_STAGING_DIR}/Debug/Resources")
-    set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO   "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/Resources")
-    set(SHARED_LIB_STAGING_DIR_RELEASE          "${SHARED_LIB_STAGING_DIR}/Release/Resources")
-
-    set(vivox_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
-    set(vivox_files
-        SLVoice
-        libsndfile.dylib
-        libvivoxoal.dylib
-        libortp.dylib
-        libvivoxplatform.dylib
-        libvivoxsdk.dylib
-       )
-    set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
-    set(debug_files
-       )
-    set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
-    set(release_files
-        libapr-1.0.dylib
-        libapr-1.dylib
-        libaprutil-1.0.dylib
-        libaprutil-1.dylib
-        libexpat.1.5.2.dylib
-        libexpat.dylib
-        libGLOD.dylib
-        libllqtwebkit.dylib
-        libminizip.a
-        libndofdev.dylib
-        libhunspell-1.3.0.dylib
-        libexception_handler.dylib
-        libcollada14dom.dylib
-       )
-
-    if (FMODEX)
-      #set(debug_files ${debug_files} libfmodexL.dylib)
-      set(release_files ${release_files} libfmodex.dylib)
-    endif (FMODEX)
-
-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...
-    set(SHARED_LIB_STAGING_DIR_DEBUG            "${SHARED_LIB_STAGING_DIR}")
-    set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO   "${SHARED_LIB_STAGING_DIR}")
-    set(SHARED_LIB_STAGING_DIR_RELEASE          "${SHARED_LIB_STAGING_DIR}")
-
-    set(vivox_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
-    set(vivox_files
-        libsndfile.so.1
-        libortp.so
-        libvivoxoal.so.1
-        libvivoxplatform.so
-        libvivoxsdk.so
-        SLVoice
-       )
-    # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
-    # or ARCH_PREBUILT_DIRS
-    set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
-    set(debug_files
-       )
-    # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
-    # or ARCH_PREBUILT_DIRS
-    set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
-    # *FIX - figure out what to do with duplicate libalut.so here -brad
-    set(release_files
-        libapr-1.so.0
-        libaprutil-1.so.0
-        libatk-1.0.so
-        libboost_program_options-mt.so.${BOOST_VERSION}.0
-        libboost_regex-mt.so.${BOOST_VERSION}.0
-        libboost_thread-mt.so.${BOOST_VERSION}.0
-        libboost_filesystem-mt.so.${BOOST_VERSION}.0
-        libboost_signals-mt.so.${BOOST_VERSION}.0
-        libboost_system-mt.so.${BOOST_VERSION}.0
-        libbreakpad_client.so.0
-        libcollada14dom.so
-        libcrypto.so.1.0.0
-        libdb-5.1.so
-        libexpat.so
-        libexpat.so.1
-        libglod.so
-        libgmock_main.so
-        libgmock.so.0
-        libgmodule-2.0.so
-        libgobject-2.0.so
-        libgtest_main.so
-        libgtest.so.0
-        libhunspell-1.3.so.0.0.0
-        libminizip.so
-        libopenal.so
-        libopenjpeg.so
-        libssl.so
-        libuuid.so.16
-        libuuid.so.16.0.22
-        libssl.so.1.0.0
-        libfontconfig.so.1.4.4
-       )
-
-    if (USE_TCMALLOC)
-      set(release_files ${release_files} "libtcmalloc_minimal.so")
-    endif (USE_TCMALLOC)
-
-    if (FMODEX)
-      set(release_file ${release_files} "libfmodex-4.44.so")
-    endif (FMODEX)
-
-else(WINDOWS)
-    message(STATUS "WARNING: unrecognized platform for staging 3rd party libs, skipping...")
-    set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-linux")
-    set(vivox_files "")
-    # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
-    # or ARCH_PREBUILT_DIRS
-    set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/debug")
-    set(debug_files "")
-    # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
-    # or ARCH_PREBUILT_DIRS
-    set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/release")
-    set(release_files "")
-
-    set(debug_llkdu_src "")
-    set(debug_llkdu_dst "")
-    set(release_llkdu_src "")
-    set(release_llkdu_dst "")
-    set(relwithdebinfo_llkdu_dst "")
-endif(WINDOWS)
-
-
-################################################################
-# Done building the file lists, now set up the copy commands.
-################################################################
-
-copy_if_different(
-    ${vivox_src_dir}
-    "${SHARED_LIB_STAGING_DIR_DEBUG}"
-    out_targets 
-    ${vivox_files}
-    )
-set(third_party_targets ${third_party_targets} ${out_targets})
-
-copy_if_different(
-    ${vivox_src_dir}
-    "${SHARED_LIB_STAGING_DIR_RELEASE}"
-    out_targets
-    ${vivox_files}
-    )
-set(third_party_targets ${third_party_targets} ${out_targets})
-
-copy_if_different(
-    ${vivox_src_dir}
-    "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
-    out_targets
-    ${vivox_files}
-    )
-set(third_party_targets ${third_party_targets} ${out_targets})
-
-
-
-copy_if_different(
-    ${debug_src_dir}
-    "${SHARED_LIB_STAGING_DIR_DEBUG}"
-    out_targets
-    ${debug_files}
-    )
-set(third_party_targets ${third_party_targets} ${out_targets})
-
-copy_if_different(
-    ${release_src_dir}
-    "${SHARED_LIB_STAGING_DIR_RELEASE}"
-    out_targets
-    ${release_files}
-    )
-set(third_party_targets ${third_party_targets} ${out_targets})
-
-copy_if_different(
-    ${release_src_dir}
-    "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
-    out_targets
-    ${release_files}
-    )
-set(third_party_targets ${third_party_targets} ${out_targets})
-
-if(NOT STANDALONE)
-  add_custom_target(
-      stage_third_party_libs ALL
-      DEPENDS ${third_party_targets}
-      )
-endif(NOT STANDALONE)
+# -*- cmake -*-
+
+# The copy_win_libs folder contains file lists and a script used to
+# copy dlls, exes and such needed to run the SecondLife from within
+# VisualStudio.
+
+include(CMakeCopyIfDifferent)
+include(Linking)
+
+###################################################################
+# set up platform specific lists of files that need to be copied
+###################################################################
+if(WINDOWS)
+    set(SHARED_LIB_STAGING_DIR_DEBUG            "${SHARED_LIB_STAGING_DIR}/Debug")
+    set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO   "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo")
+    set(SHARED_LIB_STAGING_DIR_RELEASE          "${SHARED_LIB_STAGING_DIR}/Release")
+
+    #*******************************
+    # VIVOX - *NOTE: no debug version
+    set(vivox_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
+    set(vivox_files
+        SLVoice.exe
+        libsndfile-1.dll
+        vivoxplatform.dll
+        vivoxsdk.dll
+        ortp.dll
+        zlib1.dll
+        vivoxoal.dll
+        )
+
+    #*******************************
+    # Misc shared libs 
+
+    set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
+    set(debug_files
+        openjpegd.dll
+        libapr-1.dll
+        libaprutil-1.dll
+        libapriconv-1.dll
+        ssleay32.dll
+        libeay32.dll
+        libcollada14dom22-d.dll
+        glod.dll    
+        libhunspell.dll
+        )
+
+    set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
+    set(release_files
+        openjpeg.dll
+        libapr-1.dll
+        libaprutil-1.dll
+        libapriconv-1.dll
+        ssleay32.dll
+        libeay32.dll
+        libcollada14dom22.dll
+        glod.dll
+        libhunspell.dll
+        )
+
+    if(USE_TCMALLOC)
+      set(debug_files ${debug_files} libtcmalloc_minimal-debug.dll)
+      set(release_files ${release_files} libtcmalloc_minimal.dll)
+    endif(USE_TCMALLOC)
+
+    if (FMODEX)
+      set(debug_files ${debug_files} fmodexL.dll)
+      set(release_files ${release_files} fmodex.dll)
+    endif (FMODEX)
+
+#*******************************
+# Copy MS C runtime dlls, required for packaging.
+# *TODO - Adapt this to support VC9
+if (MSVC80)
+    FIND_PATH(debug_msvc8_redist_path msvcr80d.dll
+        PATHS
+        ${MSVC_DEBUG_REDIST_PATH}
+         [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC80.DebugCRT
+        NO_DEFAULT_PATH
+        NO_DEFAULT_PATH
+        )
+
+    if(EXISTS ${debug_msvc8_redist_path})
+        set(debug_msvc8_files
+            msvcr80d.dll
+            msvcp80d.dll
+            Microsoft.VC80.DebugCRT.manifest
+            )
+
+        copy_if_different(
+            ${debug_msvc8_redist_path}
+            "${SHARED_LIB_STAGING_DIR_DEBUG}"
+            out_targets
+            ${debug_msvc8_files}
+            )
+        set(third_party_targets ${third_party_targets} ${out_targets})
+
+    endif (EXISTS ${debug_msvc8_redist_path})
+
+    FIND_PATH(release_msvc8_redist_path msvcr80.dll
+        PATHS
+        ${MSVC_REDIST_PATH}
+         [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC80.CRT
+        NO_DEFAULT_PATH
+        NO_DEFAULT_PATH
+        )
+
+    if(EXISTS ${release_msvc8_redist_path})
+        set(release_msvc8_files
+            msvcr80.dll
+            msvcp80.dll
+            Microsoft.VC80.CRT.manifest
+            )
+
+        copy_if_different(
+            ${release_msvc8_redist_path}
+            "${SHARED_LIB_STAGING_DIR_RELEASE}"
+            out_targets
+            ${release_msvc8_files}
+            )
+        set(third_party_targets ${third_party_targets} ${out_targets})
+
+        copy_if_different(
+            ${release_msvc8_redist_path}
+            "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
+            out_targets
+            ${release_msvc8_files}
+            )
+        set(third_party_targets ${third_party_targets} ${out_targets})
+          
+    endif (EXISTS ${release_msvc8_redist_path})
+elseif (MSVC_VERSION EQUAL 1600) # VisualStudio 2010
+    FIND_PATH(debug_msvc10_redist_path msvcr100d.dll
+        PATHS
+        ${MSVC_DEBUG_REDIST_PATH}
+         [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC100.DebugCRT
+        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/SysWOW64
+        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/System32
+        NO_DEFAULT_PATH
+        )
+
+    if(EXISTS ${debug_msvc10_redist_path})
+        set(debug_msvc10_files
+            msvcr100d.dll
+            msvcp100d.dll
+            )
+
+        copy_if_different(
+            ${debug_msvc10_redist_path}
+            "${SHARED_LIB_STAGING_DIR_DEBUG}"
+            out_targets
+            ${debug_msvc10_files}
+            )
+        set(third_party_targets ${third_party_targets} ${out_targets})
+
+    endif ()
+
+    FIND_PATH(release_msvc10_redist_path msvcr100.dll
+        PATHS
+        ${MSVC_REDIST_PATH}
+         [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC100.CRT
+        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/SysWOW64
+        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/System32
+        NO_DEFAULT_PATH
+        )
+
+    if(EXISTS ${release_msvc10_redist_path})
+        set(release_msvc10_files
+            msvcr100.dll
+            msvcp100.dll
+            )
+
+        copy_if_different(
+            ${release_msvc10_redist_path}
+            "${SHARED_LIB_STAGING_DIR_RELEASE}"
+            out_targets
+            ${release_msvc10_files}
+            )
+        set(third_party_targets ${third_party_targets} ${out_targets})
+
+        copy_if_different(
+            ${release_msvc10_redist_path}
+            "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
+            out_targets
+            ${release_msvc10_files}
+            )
+        set(third_party_targets ${third_party_targets} ${out_targets})
+          
+    endif ()
+endif (MSVC80)
+
+elseif(DARWIN)
+    set(SHARED_LIB_STAGING_DIR_DEBUG            "${SHARED_LIB_STAGING_DIR}/Debug/Resources")
+    set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO   "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/Resources")
+    set(SHARED_LIB_STAGING_DIR_RELEASE          "${SHARED_LIB_STAGING_DIR}/Release/Resources")
+
+    set(vivox_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
+    set(vivox_files
+        SLVoice
+        libsndfile.dylib
+        libvivoxoal.dylib
+        libortp.dylib
+        libvivoxplatform.dylib
+        libvivoxsdk.dylib
+       )
+    set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
+    set(debug_files
+       )
+    set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
+    set(release_files
+        libapr-1.0.dylib
+        libapr-1.dylib
+        libaprutil-1.0.dylib
+        libaprutil-1.dylib
+        libexpat.1.5.2.dylib
+        libexpat.dylib
+        libGLOD.dylib
+        libllqtwebkit.dylib
+        libminizip.a
+        libndofdev.dylib
+        libhunspell-1.3.0.dylib
+        libexception_handler.dylib
+        libcollada14dom.dylib
+       )
+
+    if (FMODEX)
+      #set(debug_files ${debug_files} libfmodexL.dylib)
+      set(release_files ${release_files} libfmodex.dylib)
+    endif (FMODEX)
+
+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...
+    set(SHARED_LIB_STAGING_DIR_DEBUG            "${SHARED_LIB_STAGING_DIR}")
+    set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO   "${SHARED_LIB_STAGING_DIR}")
+    set(SHARED_LIB_STAGING_DIR_RELEASE          "${SHARED_LIB_STAGING_DIR}")
+
+    set(vivox_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
+    set(vivox_files
+        libsndfile.so.1
+        libortp.so
+        libvivoxoal.so.1
+        libvivoxplatform.so
+        libvivoxsdk.so
+        SLVoice
+       )
+    # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
+    # or ARCH_PREBUILT_DIRS
+    set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
+    set(debug_files
+       )
+    # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
+    # or ARCH_PREBUILT_DIRS
+    set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
+    # *FIX - figure out what to do with duplicate libalut.so here -brad
+    set(release_files
+        libapr-1.so.0
+        libaprutil-1.so.0
+        libatk-1.0.so
+        libboost_program_options-mt.so.${BOOST_VERSION}.0
+        libboost_regex-mt.so.${BOOST_VERSION}.0
+        libboost_thread-mt.so.${BOOST_VERSION}.0
+        libboost_filesystem-mt.so.${BOOST_VERSION}.0
+        libboost_signals-mt.so.${BOOST_VERSION}.0
+        libboost_system-mt.so.${BOOST_VERSION}.0
+        libbreakpad_client.so.0
+        libcollada14dom.so
+        libcrypto.so.1.0.0
+        libdb-5.1.so
+        libexpat.so
+        libexpat.so.1
+        libglod.so
+        libgmock_main.so
+        libgmock.so.0
+        libgmodule-2.0.so
+        libgobject-2.0.so
+        libgtest_main.so
+        libgtest.so.0
+        libhunspell-1.3.so.0.0.0
+        libminizip.so
+        libopenal.so
+        libopenjpeg.so
+        libssl.so
+        libuuid.so.16
+        libuuid.so.16.0.22
+        libssl.so.1.0.0
+        libfontconfig.so.1.4.4
+       )
+
+    if (USE_TCMALLOC)
+      set(release_files ${release_files} "libtcmalloc_minimal.so")
+    endif (USE_TCMALLOC)
+
+    if (FMODEX)
+      set(release_file ${release_files} "libfmodex-4.44.so")
+    endif (FMODEX)
+
+else(WINDOWS)
+    message(STATUS "WARNING: unrecognized platform for staging 3rd party libs, skipping...")
+    set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-linux")
+    set(vivox_files "")
+    # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
+    # or ARCH_PREBUILT_DIRS
+    set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/debug")
+    set(debug_files "")
+    # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
+    # or ARCH_PREBUILT_DIRS
+    set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/release")
+    set(release_files "")
+
+    set(debug_llkdu_src "")
+    set(debug_llkdu_dst "")
+    set(release_llkdu_src "")
+    set(release_llkdu_dst "")
+    set(relwithdebinfo_llkdu_dst "")
+endif(WINDOWS)
+
+
+################################################################
+# Done building the file lists, now set up the copy commands.
+################################################################
+
+copy_if_different(
+    ${vivox_src_dir}
+    "${SHARED_LIB_STAGING_DIR_DEBUG}"
+    out_targets 
+    ${vivox_files}
+    )
+set(third_party_targets ${third_party_targets} ${out_targets})
+
+copy_if_different(
+    ${vivox_src_dir}
+    "${SHARED_LIB_STAGING_DIR_RELEASE}"
+    out_targets
+    ${vivox_files}
+    )
+set(third_party_targets ${third_party_targets} ${out_targets})
+
+copy_if_different(
+    ${vivox_src_dir}
+    "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
+    out_targets
+    ${vivox_files}
+    )
+set(third_party_targets ${third_party_targets} ${out_targets})
+
+
+
+copy_if_different(
+    ${debug_src_dir}
+    "${SHARED_LIB_STAGING_DIR_DEBUG}"
+    out_targets
+    ${debug_files}
+    )
+set(third_party_targets ${third_party_targets} ${out_targets})
+
+copy_if_different(
+    ${release_src_dir}
+    "${SHARED_LIB_STAGING_DIR_RELEASE}"
+    out_targets
+    ${release_files}
+    )
+set(third_party_targets ${third_party_targets} ${out_targets})
+
+copy_if_different(
+    ${release_src_dir}
+    "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
+    out_targets
+    ${release_files}
+    )
+set(third_party_targets ${third_party_targets} ${out_targets})
+
+if(NOT STANDALONE)
+  add_custom_target(
+      stage_third_party_libs ALL
+      DEPENDS ${third_party_targets}
+      )
+endif(NOT STANDALONE)
-- 
cgit v1.2.3


From 5030766cf2b16a6ae64c8cec712b3bf9c3cddd9b Mon Sep 17 00:00:00 2001
From: Sovereign Engineer <sovereign.engineer@outlook.com>
Date: Mon, 4 Feb 2013 21:36:12 +0800
Subject: Correct order of autobuild libs

---
 autobuild.xml | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/autobuild.xml b/autobuild.xml
index 8c3c616433..9cb2719eb0 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -505,29 +505,29 @@
             <key>name</key>
             <string>darwin</string>
           </map>
-          <key>windows</key>
+          <key>linux</key>
           <map>
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>b278ee4734ddb050ba2b67bbac709574</string>
+              <string>2781f3e844a8c5e6a3633b4d77a018d7</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269873/arch/CYGWIN/installer/fmodex-4.44-windows-201300201.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269873/arch/Linux/installer/fmodex-4.44-linux-201300202.tar.bz2</string>
             </map>
             <key>name</key>
-            <string>windows</string>
+            <string>linux</string>
           </map>
-          <key>linux</key>
+          <key>windows</key>
           <map>
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>2781f3e844a8c5e6a3633b4d77a018d7</string>
+              <string>b278ee4734ddb050ba2b67bbac709574</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269873/arch/Linux/installer/fmodex-4.44-linux-201300202.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269873/arch/CYGWIN/installer/fmodex-4.44-windows-201300201.tar.bz2</string>
             </map>
             <key>name</key>
-            <string>linux</string>
+            <string>windows</string>
           </map>
         </map>
       </map>
-- 
cgit v1.2.3


From a05afe036cba1a85043db99e80045ae40e6a6d6c Mon Sep 17 00:00:00 2001
From: Sovereign Engineer <sovereign.engineer@outlook.com>
Date: Mon, 4 Feb 2013 10:07:06 -0500
Subject: Removed small typo in linux wrapper script

---
 indra/newview/linux_tools/wrapper.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/linux_tools/wrapper.sh b/indra/newview/linux_tools/wrapper.sh
index 17f39aaa7e..ef3746c90b 100755
--- a/indra/newview/linux_tools/wrapper.sh
+++ b/indra/newview/linux_tools/wrapper.sh
@@ -8,7 +8,7 @@
 #export LL_BAD_FMODEX_DRIVER=x
 ## - Avoids using any OpenAL audio driver.
 #export LL_BAD_OPENAL_DRIVER=x
-s
+
 ## - Avoids using the FMOD Ex PulseAudio audio driver.
 #export LL_BAD_FMOD_PULSEAUDIO=x
 ## - Avoids using the FMOD or FMOD Ex ALSA audio driver.
-- 
cgit v1.2.3


From 3a141d2ff33f21bcd7a8f772f52af9cf04d722b3 Mon Sep 17 00:00:00 2001
From: Sovereign Engineer <sovereign.engineer@outlook.com>
Date: Mon, 4 Feb 2013 10:25:23 -0500
Subject: Cleanup some left over comments in fmodex streaming

---
 indra/llaudio/llstreamingaudio_fmodex.cpp | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/indra/llaudio/llstreamingaudio_fmodex.cpp b/indra/llaudio/llstreamingaudio_fmodex.cpp
index 463d816331..4a74267650 100644
--- a/indra/llaudio/llstreamingaudio_fmodex.cpp
+++ b/indra/llaudio/llstreamingaudio_fmodex.cpp
@@ -291,11 +291,6 @@ LLAudioStreamManagerFMODEX::LLAudioStreamManagerFMODEX(FMOD::System *system, con
 {
 	mInternetStreamURL = url;
 
-	/*FMOD_CREATESOUNDEXINFO exinfo;
-	memset(&exinfo,0,sizeof(exinfo));
-	exinfo.cbsize = sizeof(exinfo);
-	exinfo.suggestedsoundtype = FMOD_SOUND_TYPE_OGGVORBIS;	//Hint to speed up loading.*/
-
 	FMOD_RESULT result = mSystem->createStream(url.c_str(), FMOD_2D | FMOD_NONBLOCKING | FMOD_MPEGSEARCH | FMOD_IGNORETAGS, 0, &mInternetStream);
 
 	if (result!= FMOD_OK)
@@ -338,10 +333,6 @@ bool LLAudioStreamManagerFMODEX::stopStream()
 		case FMOD_OPENSTATE_CONNECTING:
 			close = false;
 			break;
-		/*case FSOUND_STREAM_NET_NOTCONNECTED:
-		case FSOUND_STREAM_NET_BUFFERING:
-		case FSOUND_STREAM_NET_READY:
-		case FSOUND_STREAM_NET_ERROR:*/
 		default:
 			close = true;
 		}
-- 
cgit v1.2.3


From c074456a1e8a99a604d6411629ea4fc2755dd6e6 Mon Sep 17 00:00:00 2001
From: "Graham Madarasz (Graham)" <graham@lindenlab.com>
Date: Mon, 4 Feb 2013 08:58:26 -0800
Subject: Updated md5sums and staged lib paths for FModEx

---
 autobuild.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/autobuild.xml b/autobuild.xml
index 080ccb7d4c..47a910686d 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -558,9 +558,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>b278ee4734ddb050ba2b67bbac709574</string>
+	      <string>6d19913034d44784e82e5ff8e05da3d6</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269873/arch/CYGWIN/installer/fmodex-4.44-windows-201300201.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269881/arch/CYGWIN/installer/fmodex-4.44-windows-20130201.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
@@ -570,9 +570,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>2781f3e844a8c5e6a3633b4d77a018d7</string>
+	      <string>fc26cfdca9351b271a8a21ce002d7613</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269873/arch/Linux/installer/fmodex-4.44-linux-201300202.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269881/arch/Linux/installer/fmodex-4.44-linux-20130202.tar.bz2</string>
             </map>
             <key>name</key>
             <string>linux</string>
-- 
cgit v1.2.3


From d5cafa98a30d13f5c9515a1d6c4e53ebc13d87ad Mon Sep 17 00:00:00 2001
From: "Graham Madarasz (Graham)" <graham@lindenlab.com>
Date: Mon, 4 Feb 2013 09:32:50 -0800
Subject: Point autobuild at latest Mac Fmod Ex package

---
 autobuild.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/autobuild.xml b/autobuild.xml
index 47a910686d..9ee3e08850 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -546,9 +546,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>5b3e7ac9d43f317a78807ef42d0557cf</string>
+	      <string>7c7d0d40327e8d94b45540f50246ec93</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269872/arch/Darwin/installer/fmodex-4.44-darwin-20130201.tar.bz2</string>
+	      <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269882/arch/Darwin/installer/fmodex-4.44-darwin-20130201.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin</string>
-- 
cgit v1.2.3


From c1ccf505b6c29601c9e368c799839a6575e804ce Mon Sep 17 00:00:00 2001
From: "Graham Madarasz (Graham)" <graham@lindenlab.com>
Date: Mon, 4 Feb 2013 10:54:56 -0800
Subject: Fix autobuild.xml to refer to md5sums and paths of newer
 3p-fmodex-private

---
 autobuild.xml | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/autobuild.xml b/autobuild.xml
index dc3548c5c3..6a1db98451 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -498,9 +498,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-	      <string>7c7d0d40327e8d94b45540f50246ec93</string>
+	      <string>39817c0f0961a8b82558d9cef1c759bd</string>
               <key>url</key>
-	      <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269882/arch/Darwin/installer/fmodex-4.44-darwin-20130201.tar.bz2</string>
+	      <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269882/arch/Darwin/installer/fmodex-4.44-darwin-20130204.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin</string>
@@ -510,9 +510,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-	      <string>fc26cfdca9351b271a8a21ce002d7613</string>
+              <string>6edb8c10d6cada8af476c27659dcfb92</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269881/arch/Linux/installer/fmodex-4.44-linux-20130202.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269881/arch/Linux/installer/fmodex-4.44-linux-20130204.tar.bz2</string>
             </map>
             <key>name</key>
             <string>linux</string>
@@ -522,9 +522,10 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-	      <string>6d19913034d44784e82e5ff8e05da3d6</string>
+
+	      <string>a1713cb64a792b0ad44cf640e862dc33</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269881/arch/CYGWIN/installer/fmodex-4.44-windows-20130201.tar.bz2</string>
+	      <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269934/arch/CYGWIN/installer/fmodex-4.44-windows-20130204.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
-- 
cgit v1.2.3


From 0b614a6098e337b97614a1f7881cc5efad6da24d Mon Sep 17 00:00:00 2001
From: Graham Madarasz <graham@lindenlab.com>
Date: Mon, 4 Feb 2013 11:11:12 -0800
Subject: Fixed rev numbers in paths for mac and linux

---
 autobuild.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/autobuild.xml b/autobuild.xml
index 6a1db98451..de4c28c584 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -500,7 +500,7 @@
               <key>hash</key>
 	      <string>39817c0f0961a8b82558d9cef1c759bd</string>
               <key>url</key>
-	      <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269882/arch/Darwin/installer/fmodex-4.44-darwin-20130204.tar.bz2</string>
+	      <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269940/arch/Darwin/installer/fmodex-4.44-darwin-20130204.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin</string>
@@ -512,7 +512,7 @@
               <key>hash</key>
               <string>6edb8c10d6cada8af476c27659dcfb92</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269881/arch/Linux/installer/fmodex-4.44-linux-20130204.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269934/arch/Linux/installer/fmodex-4.44-linux-20130204.tar.bz2</string>
             </map>
             <key>name</key>
             <string>linux</string>
-- 
cgit v1.2.3


From 60448cac910ae7ea7f014976a1015ecb58b215ba Mon Sep 17 00:00:00 2001
From: "Graham Madarasz (Graham)" <graham@lindenlab.com>
Date: Mon, 4 Feb 2013 12:06:17 -0800
Subject: More path fixups in staging

---
 indra/cmake/Copy3rdPartyLibs.cmake | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake
index 1d83da4d87..b11078c9a5 100644
--- a/indra/cmake/Copy3rdPartyLibs.cmake
+++ b/indra/cmake/Copy3rdPartyLibs.cmake
@@ -223,7 +223,7 @@ elseif(DARWIN)
        )
 
     if (FMODEX)
-      #set(debug_files ${debug_files} libfmodexL.dylib)
+      set(debug_files ${debug_files} libfmodexL.dylib)
       set(release_files ${release_files} libfmodex.dylib)
     endif (FMODEX)
 
@@ -291,7 +291,7 @@ elseif(LINUX)
     endif (USE_TCMALLOC)
 
     if (FMODEX)
-      set(release_file ${release_files} "libfmodex-4.44.so")
+      set(release_file ${release_files} "libfmodex.so")
     endif (FMODEX)
 
 else(WINDOWS)
-- 
cgit v1.2.3


From 4c6fc784a685445d22ce7b370d6e376da918e423 Mon Sep 17 00:00:00 2001
From: "Graham Madarasz (Graham)" <graham@lindenlab.com>
Date: Mon, 4 Feb 2013 14:04:22 -0800
Subject: Point autobuild at newer fmodex builds and fix warning being treated
 as error in llaudioengine_fmodex.cpp

---
 autobuild.xml                          | 11 +++++------
 indra/llaudio/llaudioengine_fmodex.cpp |  2 +-
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/autobuild.xml b/autobuild.xml
index de4c28c584..62fa341a06 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -498,9 +498,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-	      <string>39817c0f0961a8b82558d9cef1c759bd</string>
+	      <string>6ce79e860182dceb52bceea943b3cc2c</string>
               <key>url</key>
-	      <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269940/arch/Darwin/installer/fmodex-4.44-darwin-20130204.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269947/arch/Darwin/installer/fmodex-4.44-darwin-20130204.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin</string>
@@ -510,7 +510,7 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>6edb8c10d6cada8af476c27659dcfb92</string>
+	      <string>33e494c9a7044c99bcd6ce2995316659</string>
               <key>url</key>
               <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269934/arch/Linux/installer/fmodex-4.44-linux-20130204.tar.bz2</string>
             </map>
@@ -522,10 +522,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-
-	      <string>a1713cb64a792b0ad44cf640e862dc33</string>
+	      <string>3ae0fb5bdfda862f3e55644eaa9d09c2</string>
               <key>url</key>
-	      <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269934/arch/CYGWIN/installer/fmodex-4.44-windows-20130204.tar.bz2</string>
+	      <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269946/arch/CYGWIN/installer/fmodex-4.44-windows-20130204.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
diff --git a/indra/llaudio/llaudioengine_fmodex.cpp b/indra/llaudio/llaudioengine_fmodex.cpp
index c3c30d87fe..40a43884a1 100644
--- a/indra/llaudio/llaudioengine_fmodex.cpp
+++ b/indra/llaudio/llaudioengine_fmodex.cpp
@@ -260,7 +260,7 @@ bool LLAudioEngine_FMODEX::init(const S32 num_channels, void* userdata)
 	mSystem->getSoftwareFormat(&r_samplerate, NULL, &r_channels, NULL, NULL, &r_bits);
 	mSystem->getDriverInfo(0, r_name, 255, 0);
 	r_name[255] = '\0';
-	int latency = 1000.0 * r_bufferlength * r_numbuffers /r_samplerate;
+	int latency = (int)(1000.0f * r_bufferlength * r_numbuffers / r_samplerate);
 
 	LL_INFOS("AppInit") << "FMOD device: "<< r_name << "\n"
 		<< "FMOD Ex parameters: " << r_samplerate << " Hz * " << r_channels << " * " <<r_bits <<" bit\n"
-- 
cgit v1.2.3


From c7d0a6d25995f2d977042bfe6e1bd7f1b8e889c8 Mon Sep 17 00:00:00 2001
From: "Graham Madarasz (Graham)" <graham@lindenlab.com>
Date: Mon, 4 Feb 2013 14:44:29 -0800
Subject: md5sum and path update redux

---
 autobuild.xml | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/autobuild.xml b/autobuild.xml
index 62fa341a06..139684be20 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -498,9 +498,11 @@
             <key>archive</key>
             <map>
               <key>hash</key>
+
+	      <string>5c214f09e1f4f931e5b15b08223d779e</string>
 	      <string>6ce79e860182dceb52bceea943b3cc2c</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269947/arch/Darwin/installer/fmodex-4.44-darwin-20130204.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269965/arch/Darwin/installer/fmodex-4.44-darwin-20130204.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin</string>
@@ -510,9 +512,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-	      <string>33e494c9a7044c99bcd6ce2995316659</string>
+	      <string>540c0dce069a223498b618727cbad0ba</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269934/arch/Linux/installer/fmodex-4.44-linux-20130204.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269967/arch/Linux/installer/fmodex-4.44-linux-20130204.tar.bz2</string>
             </map>
             <key>name</key>
             <string>linux</string>
@@ -522,9 +524,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-	      <string>3ae0fb5bdfda862f3e55644eaa9d09c2</string>
+	      <string>48f9f771fada89ba49f4c776337a9457</string>
               <key>url</key>
-	      <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269946/arch/CYGWIN/installer/fmodex-4.44-windows-20130204.tar.bz2</string>
+	      <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269965/arch/CYGWIN/installer/fmodex-4.44-windows-20130204.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
-- 
cgit v1.2.3


From b99b9133f4420f0fdbac3fcc49823aa0e61e4cbf Mon Sep 17 00:00:00 2001
From: Graham Madarasz <graham@lindenlab.com>
Date: Mon, 4 Feb 2013 14:46:38 -0800
Subject: Fixed double hash sum entry

---
 autobuild.xml | 2 --
 1 file changed, 2 deletions(-)

diff --git a/autobuild.xml b/autobuild.xml
index 139684be20..e1df10c12c 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -498,9 +498,7 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-
 	      <string>5c214f09e1f4f931e5b15b08223d779e</string>
-	      <string>6ce79e860182dceb52bceea943b3cc2c</string>
               <key>url</key>
               <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269965/arch/Darwin/installer/fmodex-4.44-darwin-20130204.tar.bz2</string>
             </map>
-- 
cgit v1.2.3


From efa7022c3aed38707782ec0ac0396f17c5fa63d9 Mon Sep 17 00:00:00 2001
From: "Graham Madarasz (Graham)" <graham@lindenlab.com>
Date: Mon, 4 Feb 2013 15:10:39 -0800
Subject: Nix trying to copy the debug fmod DLL

---
 autobuild.xml                      | 2 +-
 indra/cmake/Copy3rdPartyLibs.cmake | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/autobuild.xml b/autobuild.xml
index e1df10c12c..bcd16b8ed6 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -524,7 +524,7 @@
               <key>hash</key>
 	      <string>48f9f771fada89ba49f4c776337a9457</string>
               <key>url</key>
-	      <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269965/arch/CYGWIN/installer/fmodex-4.44-windows-20130204.tar.bz2</string>
+	      <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269967/arch/CYGWIN/installer/fmodex-4.44-windows-20130204.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake
index b11078c9a5..b9101dbf53 100644
--- a/indra/cmake/Copy3rdPartyLibs.cmake
+++ b/indra/cmake/Copy3rdPartyLibs.cmake
@@ -63,7 +63,6 @@ if(WINDOWS)
     endif(USE_TCMALLOC)
 
     if (FMODEX)
-      set(debug_files ${debug_files} fmodexL.dll)
       set(release_files ${release_files} fmodex.dll)
     endif (FMODEX)
 
-- 
cgit v1.2.3


From ace38913494c97674a9bc8fa0d55a45cfc45f22d Mon Sep 17 00:00:00 2001
From: "Graham Madarasz (Graham)" <graham@lindenlab.com>
Date: Mon, 4 Feb 2013 16:32:18 -0800
Subject: Point autobuild.xml at yet another 3p-fmodex-private OS X build.

---
 autobuild.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/autobuild.xml b/autobuild.xml
index bcd16b8ed6..3726712de4 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -498,9 +498,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-	      <string>5c214f09e1f4f931e5b15b08223d779e</string>
+	      <string>2709c5580e7f3a07b97622d7ce4ce002</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269965/arch/Darwin/installer/fmodex-4.44-darwin-20130204.tar.bz2</string>
+	      <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269975/arch/Darwin/installer/fmodex-4.44-darwin-20130204.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin</string>
-- 
cgit v1.2.3


From a6742f8e8dc95d76766f0f8e3e69b91c097df38b Mon Sep 17 00:00:00 2001
From: "Graham Madarasz (Graham Linden)" <graham@lindenlab.com>
Date: Mon, 4 Feb 2013 19:57:52 -0800
Subject: Update fmodex sums for new builds

---
 autobuild.xml | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/autobuild.xml b/autobuild.xml
index 3726712de4..67b8aa1ba8 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -498,9 +498,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-	      <string>2709c5580e7f3a07b97622d7ce4ce002</string>
+          <string>00c7d964851121e61c2d0dc33e63ccac</string>
               <key>url</key>
-	      <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269975/arch/Darwin/installer/fmodex-4.44-darwin-20130204.tar.bz2</string>
+	      <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269985/arch/Darwin/installer/fmodex-4.44-darwin-20130204.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin</string>
@@ -510,9 +510,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-	      <string>540c0dce069a223498b618727cbad0ba</string>
+          <string>fd787931f49ece9bf99f4d1d1596f04b</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269967/arch/Linux/installer/fmodex-4.44-linux-20130204.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269984/arch/Linux/installer/fmodex-4.44-linux-20130205.tar.bz2</string>
             </map>
             <key>name</key>
             <string>linux</string>
@@ -522,9 +522,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-	      <string>48f9f771fada89ba49f4c776337a9457</string>
+          <string>5a1286aa4a3485ec86c7657629a0f3d6</string>
               <key>url</key>
-	      <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269967/arch/CYGWIN/installer/fmodex-4.44-windows-20130204.tar.bz2</string>
+	      <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269984/arch/CYGWIN/installer/fmodex-4.44-windows-20130204.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
-- 
cgit v1.2.3


From cd2a6e756eb7d98101fc77bb4f7cbfac9b910651 Mon Sep 17 00:00:00 2001
From: "Graham Madarasz (Graham)" <graham@lindenlab.com>
Date: Tue, 5 Feb 2013 09:50:44 -0800
Subject: Update windows fmodex sums and path for new build

---
 autobuild.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/autobuild.xml b/autobuild.xml
index 67b8aa1ba8..f7b15b9530 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -522,9 +522,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-          <string>5a1286aa4a3485ec86c7657629a0f3d6</string>
+	      <string>9e0f62be63e74af18f670f864cac93da</string>
               <key>url</key>
-	      <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269984/arch/CYGWIN/installer/fmodex-4.44-windows-20130204.tar.bz2</string>
+	      <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/270026/arch/CYGWIN/installer/fmodex-4.44-windows-20130205.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
-- 
cgit v1.2.3


From aed2e90312e932dd6319dabdd793eec064058ee7 Mon Sep 17 00:00:00 2001
From: "Graham Madarasz (Graham)" <graham@lindenlab.com>
Date: Tue, 5 Feb 2013 10:24:56 -0800
Subject: Update fmodex sums to refer to newest OS X 3p-fmodex-private

---
 autobuild.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/autobuild.xml b/autobuild.xml
index f7b15b9530..9c878fd730 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -498,9 +498,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-          <string>00c7d964851121e61c2d0dc33e63ccac</string>
+	      <string>89a3df89da75444877cf3197416fed67</string>
               <key>url</key>
-	      <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/269985/arch/Darwin/installer/fmodex-4.44-darwin-20130204.tar.bz2</string>
+	      <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/270029/arch/Darwin/installer/fmodex-4.44-darwin-20130205.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin</string>
-- 
cgit v1.2.3


From 576659271251e15959c522b3fd45aebc856fb895 Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Wed, 6 Feb 2013 13:57:51 -0800
Subject: Updated contributions text file with people who worked on the FMOD
 upgrade patch

---
 doc/contributions.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 10d6818bd3..c879036b22 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -1065,10 +1065,12 @@ Sheet Spotter
 Shnurui Troughton
 Shyotl Kuhr
 	MAINT-1138
+	MAINT-2334
 Siana Gearz
 	STORM-960
 	STORM-1088
 	MAINT-1138
+	MAINT-2334
 sicarius Thorne
 Sicarius Toxx
 SignpostMarv Martin
@@ -1086,6 +1088,8 @@ SLB Wirefly
 Slee Mayo
     SEC-1075
 snowy Sidran
+Sovereign Engineer
+    MAINT-2334
 SpacedOut Frye
 	VWR-34
 	VWR-45
-- 
cgit v1.2.3


From bfffedaec973948a35ad046769add4fc5ae6e2a1 Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Wed, 6 Feb 2013 15:09:44 -0800
Subject: Trivial whitespace change to ignite new Team City build after some
 admin work

---
 doc/contributions.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index c879036b22..dd33cc5ae5 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -1342,3 +1342,4 @@ Zoex Flanagan
 
 
 
+
-- 
cgit v1.2.3


From 623cb0c39fed147600afe1298d25c5153a6a96a2 Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Wed, 17 Apr 2013 14:31:30 -0700
Subject: fix for missed merge changes

---
 indra/cmake/CMakeLists.txt | 2 --
 1 file changed, 2 deletions(-)

diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt
index 88e1f4a686..10a23ea068 100644
--- a/indra/cmake/CMakeLists.txt
+++ b/indra/cmake/CMakeLists.txt
@@ -24,12 +24,10 @@ set(cmake_SOURCE_FILES
     DragDrop.cmake
     EXPAT.cmake
     ExamplePlugin.cmake
-    FMOD.cmake
     FindAPR.cmake
     FindAutobuild.cmake
     FindBerkeleyDB.cmake
     FindCARes.cmake
-    FindELFIO.cmake
     FindFMODEX.cmake
     FindGLH.cmake
     FindGoogleBreakpad.cmake
-- 
cgit v1.2.3


From 1fa45e7448c82b9c242aafce0f449f925d620e89 Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Wed, 17 Apr 2013 15:46:40 -0700
Subject: Fix for Linux build now that gcc upgraded to 4.6 by default

---
 indra/llaudio/llaudioengine_fmodex.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llaudio/llaudioengine_fmodex.cpp b/indra/llaudio/llaudioengine_fmodex.cpp
index 40a43884a1..183b2f94bc 100644
--- a/indra/llaudio/llaudioengine_fmodex.cpp
+++ b/indra/llaudio/llaudioengine_fmodex.cpp
@@ -476,7 +476,7 @@ bool LLAudioChannelFMODEX::updateBuffer()
 	if (mCurrentSourcep)
 	{
 		// SJB: warnings can spam and hurt framerate, disabling
-		FMOD_RESULT result;
+		//FMOD_RESULT result;
 
 		result = mChannelp->setVolume(getSecondaryGain() * mCurrentSourcep->getGain());
 		//Check_FMOD_Error(result, "FMOD::Channel::setVolume");
-- 
cgit v1.2.3


From 6383c8829f4a34d6b3c0cf26b388b6ddf9746da1 Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Wed, 17 Apr 2013 15:56:45 -0700
Subject: New fix for the fix for Linux build now that gcc upgraded to 4.6 by
 default

---
 indra/llaudio/llaudioengine_fmodex.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/llaudio/llaudioengine_fmodex.cpp b/indra/llaudio/llaudioengine_fmodex.cpp
index 183b2f94bc..5ec30c7d1d 100644
--- a/indra/llaudio/llaudioengine_fmodex.cpp
+++ b/indra/llaudio/llaudioengine_fmodex.cpp
@@ -478,10 +478,10 @@ bool LLAudioChannelFMODEX::updateBuffer()
 		// SJB: warnings can spam and hurt framerate, disabling
 		//FMOD_RESULT result;
 
-		result = mChannelp->setVolume(getSecondaryGain() * mCurrentSourcep->getGain());
+		mChannelp->setVolume(getSecondaryGain() * mCurrentSourcep->getGain());
 		//Check_FMOD_Error(result, "FMOD::Channel::setVolume");
 
-		result = mChannelp->setMode(mCurrentSourcep->isLoop() ? FMOD_LOOP_NORMAL : FMOD_LOOP_OFF);
+		mChannelp->setMode(mCurrentSourcep->isLoop() ? FMOD_LOOP_NORMAL : FMOD_LOOP_OFF);
 		/*if(Check_FMOD_Error(result, "FMOD::Channel::setMode"))
 		{
 			S32 index;
-- 
cgit v1.2.3


From a1ca90f89327c6423acb7328eebf9d8afd49668d Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Thu, 18 Apr 2013 11:50:40 -0700
Subject: Blank line on end of files as per commit hook requirements

---
 indra/cmake/FMODEX.cmake | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/cmake/FMODEX.cmake b/indra/cmake/FMODEX.cmake
index 448392437a..65bc1cabeb 100644
--- a/indra/cmake/FMODEX.cmake
+++ b/indra/cmake/FMODEX.cmake
@@ -42,4 +42,5 @@ if (FMODEX)
       set(FMODEX_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/fmodex)
     endif (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR)
   endif (STANDALONE)
-endif (FMODEX)
\ No newline at end of file
+endif (FMODEX)
+
-- 
cgit v1.2.3


From 35cbd7d7774ce622ad868851776a3bda49b421bc Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Thu, 18 Apr 2013 14:55:03 -0400
Subject: add newline

---
 indra/cmake/FindFMODEX.cmake | 1 -
 1 file changed, 1 deletion(-)

diff --git a/indra/cmake/FindFMODEX.cmake b/indra/cmake/FindFMODEX.cmake
index 9b9b85d73e..b621727c0e 100644
--- a/indra/cmake/FindFMODEX.cmake
+++ b/indra/cmake/FindFMODEX.cmake
@@ -63,4 +63,3 @@ MARK_AS_ADVANCED(
   FMODEX_LIBRARY
   FMODEX_INCLUDE_DIR
   )
-  
\ No newline at end of file
-- 
cgit v1.2.3


From adfa7d49de6d58671bc7121483e306a9f6d705ed Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Thu, 18 Apr 2013 14:55:23 -0400
Subject: tag merge of DRTVWR-298

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 53693c2cdf..e85e6e8575 100644
--- a/.hgtags
+++ b/.hgtags
@@ -438,3 +438,4 @@ adc360e6bf21390d2665380951d85937cd29a604 3.5.0-release
 1ada73295ed0eaa4a772ef079c29f57069342c32 DRTVWR-310
 0ca3910763cec967703e45bc6208a325dccb9f95 3.5.1-beta1
 20cdf370f5c8be6193bef6fb3a81cc3f81275191 3.5.1-beta1
+78a8fe6abf331944d6b6bb1ce1024a6bc08141f4 DRTVWR-298
-- 
cgit v1.2.3