Index: lib/sound/audio.c
===================================================================
--- lib/sound/audio.c	(revision 6187)
+++ lib/sound/audio.c	(working copy)
@@ -92,14 +92,14 @@
 // =======================================================================================================================
 // =======================================================================================================================
 //
-BOOL audio_Init( AUDIO_CALLBACK pStopTrackCallback )
+BOOL audio_Init( AUDIO_CALLBACK pStopTrackCallback, bool HWopenAL )
 {
 	// init audio system
 	g_sPreviousSample.iTrack = NO_SAMPLE;
 	g_sPreviousSample.x = SAMPLE_COORD_INVALID;
 	g_sPreviousSample.y = SAMPLE_COORD_INVALID;
 	g_sPreviousSample.z = SAMPLE_COORD_INVALID;
-	g_bAudioEnabled = sound_Init();
+	g_bAudioEnabled = sound_Init(HWopenAL);
 	if (g_bAudioEnabled)
 	{
 		sound_SetStoppedCallback( pStopTrackCallback );
@@ -1132,7 +1132,7 @@
 		(void)dummyCB;
 
 		assert(audio_Shutdown());
-		assert(audio_Init(dummyCB));
+		assert(audio_Init(dummyCB,0));
 		assert(!audio_Disabled());
 		audio_Update();
 	}
Index: lib/sound/audio.h
===================================================================
--- lib/sound/audio.h	(revision 6187)
+++ lib/sound/audio.h	(working copy)
@@ -28,7 +28,7 @@
 {
 #endif
 
-extern BOOL		audio_Init( AUDIO_CALLBACK pStopTrackCallback );
+extern BOOL		audio_Init( AUDIO_CALLBACK pStopTrackCallback, bool HWopenAL );
 extern void		audio_Update(void);
 extern BOOL		audio_Shutdown(void);
 extern BOOL		audio_Disabled( void );
Index: lib/sound/openal_track.c
===================================================================
--- lib/sound/openal_track.c	(revision 6187)
+++ lib/sound/openal_track.c	(working copy)
@@ -120,10 +120,20 @@
 #ifndef WZ_NOSOUND
 static void PrintOpenALVersion(code_part part)
 {
+	const ALchar* pDeviceNames = NULL;
+
 	debug(part, "OpenAL Vendor: %s", alGetString(AL_VENDOR));
 	debug(part, "OpenAL Version: %s", alGetString(AL_VERSION));
 	debug(part, "OpenAL Renderer: %s", alGetString(AL_RENDERER));
 	debug(part, "OpenAL Extensions: %s", alGetString(AL_EXTENSIONS));
+
+	// We are parsing to see what devices are available.
+	pDeviceNames = alcGetString( NULL, ALC_DEVICE_SPECIFIER );
+	while (strlen(pDeviceNames))
+	{
+		debug(LOG_SOUND, "available openAL device(s) are: %s", pDeviceNames);
+		pDeviceNames += strlen(pDeviceNames)+1;
+	}
 }
 #endif
 
@@ -131,14 +141,45 @@
 // =======================================================================================================================
 // =======================================================================================================================
 //
-BOOL sound_InitLibrary( void )
+BOOL sound_InitLibrary( bool HWopenAL )
 {
 #ifndef WZ_NOSOUND
 	int err;
 	const ALfloat listenerVel[3] = { 0.0, 0.0, 0.0 };
 	const ALfloat listenerOri[6] = { 0.0, 0.0, 1.0, 0.0, 1.0, 0.0 };
 
-	device = alcOpenDevice(0);
+	// NOTE: on linux, it *defaults* to 'ALSA Software' (on debian at least)
+	// On windows, unless we specify 'Generic Software', it *defaults* to a hardware device.
+	// This is with openALsoft (on linux) & creative's openAL (on windows) implementation.
+	//
+	// NULL means pick any device available.
+	// Software uses more CPU time but has allot more sources (up to 256).
+	// Hardware uses less CPU time, but on most hardware, it is 16 sources, unless you
+	// have a dedicated sound card, like the Xfi or whatever.  That is 64+ HW sources.
+
+	if (HWopenAL)
+	{
+		debug(LOG_SOUND, "OpenAL hardware mode requested.");
+#ifdef WZ_OS_WIN
+		debug(LOG_SOUND, "NOT recommended, unless you have a dedicated soundcard.");
+#endif
+		// We want *any* device as default for linux (& mac?)
+		device = alcOpenDevice(NULL);
+	}
+	else
+	{
+		debug(LOG_SOUND, "OpenAL software mode requested.");
+
+		// We want this device as default for windows (using creative's openAL drivers!)
+		device = alcOpenDevice("Generic Software");
+		if (!device)
+		{
+#ifdef WZ_OS_WIN
+			debug(LOG_ERROR, "Generic Software was NOT found! Did you install the correct openAL drivers?");
+#endif
+			device = alcOpenDevice(NULL);		//fallback to any device.
+		}
+	}
 	if (!device)
 	{
 		PrintOpenALVersion(LOG_ERROR);
@@ -1333,7 +1374,7 @@
 
 	for (i = 0; i < 25; i++)
 	{
-		assert(sound_InitLibrary());
+		assert(sound_InitLibrary(0));
 		sound_ShutdownLibrary();
 	}
 	fprintf(stdout, "\tSound self-test: PASSED\n");
Index: lib/sound/track.c
===================================================================
--- lib/sound/track.c	(revision 6187)
+++ lib/sound/track.c	(working copy)
@@ -45,10 +45,10 @@
 // =======================================================================================================================
 // =======================================================================================================================
 //
-BOOL sound_Init()
+BOOL sound_Init( bool HWopenAL)
 {
 	g_iCurTracks = 0;
-	if (!sound_InitLibrary())
+	if (!sound_InitLibrary(HWopenAL))
 	{
 		debug(LOG_ERROR, "Cannot init sound library");
 		return false;
Index: lib/sound/track.h
===================================================================
--- lib/sound/track.h	(revision 6187)
+++ lib/sound/track.h	(working copy)
@@ -83,7 +83,7 @@
 /* functions
  */
 
-BOOL	sound_Init(void);
+BOOL	sound_Init( bool HWopenAL);
 BOOL	sound_Shutdown(void);
 
 TRACK *	sound_LoadTrackFromFile(const char *fileName);
Index: lib/sound/tracklib.h
===================================================================
--- lib/sound/tracklib.h	(revision 6187)
+++ lib/sound/tracklib.h	(working copy)
@@ -33,7 +33,7 @@
 {
 #endif
 
-BOOL	sound_InitLibrary( void );
+BOOL	sound_InitLibrary( bool HWopenAL );
 void	sound_ShutdownLibrary( void );
 
 void	sound_FreeTrack( TRACK * psTrack );
Index: src/configuration.c
===================================================================
--- src/configuration.c	(revision 6187)
+++ src/configuration.c	(working copy)
@@ -219,6 +219,22 @@
 		setWarzoneKeyNumeric( "sound", true );
 	}
 
+	if(getWarzoneKeyNumeric("HWopenal", &val))
+	{
+		war_SetHWopenAL( val );
+	}
+	else
+	{
+		// we want true for linux & (mac?), and false for windows (default)
+#ifdef WZ_OS_WIN
+		war_SetHWopenAL(false);
+		setWarzoneKeyNumeric( "HWopenal", false );
+#else
+		war_SetHWopenAL(true);
+		setWarzoneKeyNumeric( "HWopenal", true );
+#endif
+
+	}
 	// //////////////////////////
 	// invert mouse
 	if(getWarzoneKeyNumeric("mouseflip", &val))
@@ -667,6 +683,7 @@
 	setWarzoneKeyNumeric("mouseflip",(SDWORD)(getInvertMouseStatus()));	// flipmouse
 	setWarzoneKeyNumeric("shadows",(SDWORD)(getDrawShadows()));	// shadows
 	setWarzoneKeyNumeric("sound", (SDWORD)war_getSoundEnabled());
+	setWarzoneKeyNumeric("HWopenal",(SDWORD)war_GetHWopenAL());
 	setWarzoneKeyNumeric("FMVmode",(SDWORD)(war_GetFMVmode()));		// sequences
 	setWarzoneKeyNumeric("subtitles",(SDWORD)(seq_GetSubtitles()));		// subtitles
 	setWarzoneKeyNumeric("reopenBuild",(SDWORD)(intGetReopenBuild()));	// build menu
Index: src/init.c
===================================================================
--- src/init.c	(revision 6187)
+++ src/init.c	(working copy)
@@ -418,7 +418,7 @@
 	
 	if ( war_getSoundEnabled() )
 	{
-		if (!audio_Init(droidAudioTrackStopped))
+		if (!audio_Init(droidAudioTrackStopped, war_GetHWopenAL()) )
 		{
 			debug(LOG_SOUND, "Could not initialise audio system: Continuing without audio");
 		}
Index: src/warzoneconfig.c
===================================================================
--- src/warzoneconfig.c	(revision 6187)
+++ src/warzoneconfig.c	(working copy)
@@ -53,9 +53,10 @@
 	UDWORD		width;
 	UDWORD		height;
 	bool		vsync;
-	bool            pauseOnFocusLoss;
-	bool            ColouredCursor;
-	bool            MusicEnabled;
+	bool		pauseOnFocusLoss;
+	bool		ColouredCursor;
+	bool		MusicEnabled;
+	bool		HWopenAL;
 } WARZONE_GLOBALS;
 
 /***************************************************************************/
@@ -85,8 +86,24 @@
 	war_SetPauseOnFocusLoss(true);
 	war_SetColouredCursor(false);
 	war_SetMusicEnabled(true);
+	// we want true for linux & (mac?), and false for windows (default)
+#ifdef WZ_OS_WIN
+	war_SetHWopenAL(false);
+#else
+	war_SetHWopenAL(true);
+#endif
 }
 
+void war_SetHWopenAL(bool b)
+{
+	warGlobs.HWopenAL = b;
+}
+
+bool war_GetHWopenAL(void)
+{
+	return warGlobs.HWopenAL;
+}
+
 void war_SetAllowSubtitles(BOOL b) {
 	warGlobs.allowSubtitles = b;
 }
Index: src/warzoneconfig.h
===================================================================
--- src/warzoneconfig.h	(revision 6187)
+++ src/warzoneconfig.h	(working copy)
@@ -50,6 +50,8 @@
 extern BOOL war_GetFog(void);
 extern void war_SetFMVmode(FMV_MODE mode);
 extern FMV_MODE war_GetFMVmode(void);
+extern void war_SetHWopenAL(bool b);
+extern bool war_GetHWopenAL(void);
 extern void war_SetAllowSubtitles(BOOL);
 extern BOOL war_GetAllowSubtitles(void);
 extern void war_setFullscreen(BOOL);

