SDL env var for audio buffer size?

SDL has some environment variables which can be set to tell SDL what
video driver to use, right?

Has anyone thought of providing a variable to allow the user to set their
preferred audio buffer size?

In Tux Paint, for example, we’re currently using this:

#ifndef WIN32
if (Mix_OpenAudio(44100, AUDIO_S16, 2, 1024) < 0)
#else
if (Mix_OpenAudio(44100, AUDIO_S16, 2, 2048) < 0)
#endif

Which seems to work fine for most people. However, one person has reported
that audio on one computer running XP sounds terrible in Tux Paint
(and in another SDL-based app which happened to be written in Python,
so they were able to quickly and easily change the setting to find the
best value).

While I could add an “–audiobuffersize” option, or some-such, I wonder
if maybe SDL would benefit from having an $SDL_AUDIO_BUFFER_SIZE env.
variable which would allow users to tweak it without having to do it for
/every/ application…?

Comments? :slight_smile:

-bill!
bill at newbreedsoftware.com New Breed Software
http://www.newbreedsoftware.com/ Tux Paint 0.9.14 – Coming soon!

Bill,

Perhaps a per arch api (like everything else in SDL) that takes the
channels, sample size, and sample rate, and returns to optimal buffer
size for that configuration. That would be nice. That same function
could check for an env var, but hopefully most programs would never
need that env var set to work well from then on.

-LIM-

Bill Kendrick wrote:> SDL has some environment variables which can be set to tell SDL what

video driver to use, right?

Has anyone thought of providing a variable to allow the user to set their
preferred audio buffer size?

In Tux Paint, for example, we’re currently using this:

#ifndef WIN32
if (Mix_OpenAudio(44100, AUDIO_S16, 2, 1024) < 0)
#else
if (Mix_OpenAudio(44100, AUDIO_S16, 2, 2048) < 0)
#endif

Which seems to work fine for most people. However, one person has reported
that audio on one computer running XP sounds terrible in Tux Paint
(and in another SDL-based app which happened to be written in Python,
so they were able to quickly and easily change the setting to find the
best value).

While I could add an “–audiobuffersize” option, or some-such, I wonder
if maybe SDL would benefit from having an $SDL_AUDIO_BUFFER_SIZE env.
variable which would allow users to tweak it without having to do it for
/every/ application…?

Comments? :slight_smile:

-bill!
bill at newbreedsoftware.com New Breed Software
http://www.newbreedsoftware.com/ Tux Paint 0.9.14 – Coming soon!

Perhaps a per arch api (like everything else in SDL) that takes the
channels, sample size, and sample rate, and returns to optimal buffer
size for that configuration.

That would be difficult I think, because two different windows pc can
need different buffer sizes. IIRC, it also depends on what you want to
play (I remember that XM mods required a bigger buffer than
OGG/Vorbis).
For my current game, 1024 is fine here under win 98, but 2048 is
required on a friend’s (more powerful) PC running XP.On 11/10/2004, Jonathan Atkins, you wrote:


Please remove “.ARGL.invalid” from my email when replying.
Incoming HTML mails are automatically deleted.

That was the issue this person saw in Tux Paint. All XP PCs he tried
it on except one (which had a particular kind of sound card) worked okay.

-bill!
bill at newbreedsoftware.com New Breed Software
http://www.newbreedsoftware.com/ Tux Paint 0.9.14 – Coming soon!On Mon, Oct 11, 2004 at 04:10:10PM +0200, Olivier Fabre wrote:

That would be difficult I think, because two different windows pc can
need different buffer sizes.