$OpenBSD: patch-src_audio_arts_SDL_artsaudio_c,v 1.1 2008/03/19 13:33:29 jakemsr Exp $
--- src/audio/arts/SDL_artsaudio.c.orig	Sun Dec 30 20:47:57 2007
+++ src/audio/arts/SDL_artsaudio.c	Mon Mar 10 00:04:32 2008
@@ -307,29 +307,21 @@ static int ARTS_OpenAudio(_THIS, SDL_AudioSpec *spec)
 		SDL_SetError("Unable to initialize ARTS: %s", SDL_NAME(arts_error_text)(error_code));
 		return(-1);
 	}
+#if 0
 	if ( ! SDL_NAME(arts_suspended)() ) {
 		SDL_SetError("ARTS can not open audio device");
 		return(-1);
 	}
+#endif
 	stream = SDL_NAME(arts_play_stream)(spec->freq, bits, spec->channels, "SDL");
 
 	/* Calculate the final parameters for this audio specification */
 	SDL_CalculateAudioSpec(spec);
 
-	/* Determine the power of two of the fragment size */
-	for ( frag_spec = 0; (0x01<<frag_spec) < spec->size; ++frag_spec );
-	if ( (0x01<<frag_spec) != spec->size ) {
-		SDL_SetError("Fragment size must be a power of two");
-		return(-1);
-	}
-	frag_spec |= 0x00020000;	/* two fragments, for low latency */
+	/* set total buffer size (latency) to what we expect */
+	SDL_NAME(arts_stream_set)(stream, ARTS_P_BUFFER_SIZE, spec->size);
 
-#ifdef ARTS_P_PACKET_SETTINGS
-	SDL_NAME(arts_stream_set)(stream, ARTS_P_PACKET_SETTINGS, frag_spec);
-#else
-	SDL_NAME(arts_stream_set)(stream, ARTS_P_PACKET_SIZE, frag_spec&0xffff);
-	SDL_NAME(arts_stream_set)(stream, ARTS_P_PACKET_COUNT, frag_spec>>16);
-#endif
+	/* and use artsd's preferred write() size */
 	spec->size = SDL_NAME(arts_stream_get)(stream, ARTS_P_PACKET_SIZE);
 
 	/* Allocate mixing buffer */
