Index: lib/sound/audio.c
===================================================================
--- lib/sound/audio.c	(revision 6180)
+++ 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 6180)
+++ 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 6180)
+++ lib/sound/openal_track.c	(working copy)
@@ -131,14 +131,25 @@
 // =======================================================================================================================
 // =======================================================================================================================
 //
-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: Generic Software has 256 sources available.
+	// NULL is any available, however, it may get Generic Hardware which has 16 sources available.
+	// Software uses more CPU time though.
+	if (HWopenAL)
+	{
+		device = alcOpenDevice(NULL);
+	}
+	else
+	{
+		device = alcOpenDevice("Generic Software");
+		debug(LOG_SOUND, "Using software acceleration for openAL");
+	}
 	if (!device)
 	{
 		PrintOpenALVersion(LOG_ERROR);
@@ -1333,7 +1344,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 6180)
+++ 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 6180)
+++ 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 6180)
+++ 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 6180)
+++ src/configuration.c	(working copy)
@@ -219,6 +219,15 @@
 		setWarzoneKeyNumeric( "sound", true );
 	}
 
+	if(getWarzoneKeyNumeric("HWopenal", &val))
+	{
+		war_SetHWopenAL( val );
+	}
+	else
+	{
+		war_SetHWopenAL( false );
+		setWarzoneKeyNumeric( "HWopenal", true );
+	}
 	// //////////////////////////
 	// invert mouse
 	if(getWarzoneKeyNumeric("mouseflip", &val))
@@ -667,6 +676,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 6180)
+++ 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 6180)
+++ 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,19 @@
 	war_SetPauseOnFocusLoss(true);
 	war_SetColouredCursor(false);
 	war_SetMusicEnabled(true);
+	war_SetHWopenAL(false);
 }
 
+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 6180)
+++ 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);

