Ryan's sandbox

So I’m experimenting with mangling SDL things outside of the main repo,
because the ability to do this is a huge benefit to using Mercurial.

You can see what I’ve been up to here:

 http://hg.icculus.org/icculus/SDL-experimental/

This is NOT an official branch, if you pull from it you may regret it,
it probably doesn’t compile, and everything in it that might make it
into the official repo will probably go through history editing before
it is pushed anyhow.

But in making sweeping changes, it’s nice to not care if what you
publish is breaking everything, so it’s in a different repository.

Anyhow: this week was audio work. Windows is getting an XAudio2 target
(which works on Xbox360 too, at least in theory), Mac OS X and iOS’s
CoreAudio targets are merging together, winmm (formerly “waveout”) got
multiple device support, DirectSound got moved from version 5 to 8.
Things got moved around and cleaned up, and cut-and-pasted code in
various drivers got moved up to the higher level.

There’s still a lot of stuff I’d like to do to the audio subsystem, but
this is a first start.

My next focus is going to be going through the patch queue. There’s a
big pile of good changes to SDL and SDL_mixer, etc, on the mailing list
and in Bugzilla that haven’t made it to revision control, and I’m going
to spend some time sorting through that.

–ryan.

Ryan,

If you get to a point where the code is compilable and you want some
testing done, just drop a note to the list and I’ll grab it. Right now
I can only test iOS for 1.3, but the audio problem is something that’s
driving me crazy so I’d love to seek out any solutions :slight_smile:

If you want a OS X/Windows test for SDL 1.3, when you guys get in
relative mouse movement, I’ll start testing that too.

Note I only use SDL proper (I have my own mixer, but use SDL audio, I
have my own network code and don’t use SDL at all for that, and use
libPNG to load images.) I use SDL for video, events, sound, and some
misc stuff like threads, so no external SDL libraries.

Again, get to a point where you’d like some testing, please drop a line
and I’ll get it in ASAP.

[>] Brian

So I’m experimenting with mangling SDL things outside of the main repo,
because the ability to do this is a huge benefit to using Mercurial.

These changes are now in the main repo…biggest wins are:

  • DirectSound and winmm audio targets now support multiple devices.
  • XAudio2 audio target.
  • The Mac and iPhone code is merged into one target now.
  • Lots of cleanup that no one cares about but me. :slight_smile:

Next up: the patch queue! (and some good ideas that have been floating
around the mailing list in the past few weeks, too!)

–ryan.

Hi Ryan, thank you very much for these changes :slight_smile:

Just a small note, line 508 of SDL_directsound.c doesn’t compile for me. It’s trying to use a HWND variable called “mainwin” that does not exist to get better mixing privileges when calling CreateSecondary() :slight_smile: I’ll be using a NULL for now, as it’s good enough to go :stuck_out_tongue:

Hi,On Thu, Aug 4, 2011 at 8:37 AM, Ryan C. Gordon wrote:

?- XAudio2 audio target.

What is the reason of implementing XAudio2 target? In my understanding
you should use XAudio2 when you want multiple sound source mixing and
resampling. When you don’t want that you can simply use WASAPI
directly - it provides raw buffer where you write samples, and it
plays back then. XAudio2 itself is mixer/resampler and 3d effects
(with help of X3DAudio) that uses WASAPI as it’s backend (on Vista/7)
or DirectSound (on XP). Wouldn’t be WASAPI better choice for SDL?


M?rti?? Mo?eiko

I agree, though I didn’t find WASAPI quite as easy to program, but hey, I
guess that’s why SDL exists, right?

Still, the XAudio2 does have the usage of an XBox360 sound target.

PatrickOn Thu, Aug 4, 2011 at 11:04 AM, M?rti?? Mo?eiko <martins.mozeiko at gmail.com>wrote:

Hi,

On Thu, Aug 4, 2011 at 8:37 AM, Ryan C. Gordon wrote:

  • XAudio2 audio target.

What is the reason of implementing XAudio2 target? In my understanding
you should use XAudio2 when you want multiple sound source mixing and
resampling. When you don’t want that you can simply use WASAPI
directly - it provides raw buffer where you write samples, and it
plays back then. XAudio2 itself is mixer/resampler and 3d effects
(with help of X3DAudio) that uses WASAPI as it’s backend (on Vista/7)
or DirectSound (on XP). Wouldn’t be WASAPI better choice for SDL?


M?rti?? Mo?eiko


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Just a small note, line 508 of SDL_directsound.c doesn’t compile for me.
It’s trying to use a HWND variable called “mainwin” that does not exist
to get better mixing privileges when calling CreateSecondary() Smile
I’ll be using a NULL for now, as it’s good enough to go Razz

Crap, that was a last-minute, untested change. My fault, I’m fixing it now.

–ryan.

Wouldn’t be WASAPI better choice for SDL?

  • WASAPI doesn’t offer resampling. At all.
  • XAudio2 is usable on the Xbox360, if we ever find a need to be on that
    platform.

(That being said, we’ll probably end up using WASAPI for audio capture,
and pushing it through XAudio2 to resample.)

–ryan.