[SDL] GameCube audio back end, format conversion
Peter Mackay
mackay.pete+sdl at gmail.com
Tue Aug 7 06:01:17 PDT 2007
Hello,
Thank you Ryan for your detailed reply.
> A Gamecube backend? Sweet. :)
Yes I hope with the release of the Wii that GameCube homebrew will see
a bit of a revival. The toolchain is pretty much all there now. (For
anyone interested, I should be releasing a Quake port inside a week's
time. Probably not using SDL unfortunately.)
> Look at what the Mac OS 9 target does. It fires the SDL audio callback
> in a hardware interrupt, and takes some effort to deal with long-running
> callbacks, without using real threads for any of it.
>
> http://www.libsdl.org/cgi/viewvc.cgi?view=rev&revision=579
>
> Look for "SDL_LockAudio on MacOS" emails in the mailing list archives
> around March 2002 for all the discussion about how this works.
Thanks, I'll do that.
> SDL 1.2 will only resample audio if it's a power of two (11025 -> 22050
> -> 44100, etc, but not 44100 -> 48000). If you have to resample to
> something else, bad things happen.
Ahh I was afraid of that.
> This is long overdue to be fixed, and will be fixed for SDL 1.3.
That would be cool. In the mean time, what would you say my best
option would be?
I could tell SDL that I'm using the sample rate it suggested but go on
to resample the audio when I write to the DMA buffer, but it may be
tricky for me to guarantee that buffer sizes are both still a power of
two for SDL and a multiple of 32 bytes for the GameCube.
Hmm, or maybe I can write an equation to figure out the buffer sizes,
I'll have a think.
> > If it's possible I would love to have someone peek at my source code
> > to see if I'm doing anything wrong. I've attached it to this mail.
>
> In this case, it's probably 100% not your bug. :/
Ah, well thanks again for looking!
Pete
More information about the SDL
mailing list