We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1345 - SDL apparently doesn't emulate float 32bit audio on top of signed 16 bit audio -> audio fails
Summary: SDL apparently doesn't emulate float 32bit audio on top of signed 16 bit audi...
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: audio (show other bugs)
Version: HG 2.0
Hardware: x86 Windows (All)
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords: target-2.0.0
Depends on:
Blocks:
 
Reported: 2011-12-15 17:29 UTC by Ellie
Modified: 2013-07-27 14:08 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ellie 2011-12-15 17:29:19 UTC
When using SDL_OpenAudio(&fmt, NULL) and demanding float 32bit audio, I had multiple testers confirm that the call fails. However, using signed 16bit audio works in all those cases. (probably audio driver not liking f32 audio I guess)

My application now tries 16bit audio every time after a failed float 32bit audio SDL_OpenAudio() call and converts the float samples itself to signed ints and passes those to SDL.

However, from the description of SDL_OpenAudio() which states that for NULL as a second value, SDL will convert to the available audio format for me, I'd expect that SDL does this - or that the documentation is changed to exclude the f32 > s16 conversion case explicitely.
Comment 1 Ryan C. Gordon 2013-07-12 22:16:01 UTC
(Sorry if you get a lot of copies of this email, we're touching dozens of bug reports right now.)

Tagging a bunch of bugs as target-2.0.0, Priority 2.

This means we're in the final stretch for an official SDL 2.0.0 release! These are the bugs we really want to fix before shipping if humanly possible.

That being said, we don't promise to fix them because of this tag, we just want to make sure we don't forget to deal with them before we bless a final 2.0.0 release, and generally be organized about what we're aiming to ship.

Hopefully you'll hear more about this bug soon. If you have more information (including "this got fixed at some point, nevermind"), we would love to have you come add more information to the bug report when you have a moment.

Thanks!
--ryan.
Comment 2 Ryan C. Gordon 2013-07-26 17:19:44 UTC
This _should_ be converting it. Is this still busted for you on the latest hg snapshot? It appears to be working here.

--ryan.
Comment 3 Sam Lantinga 2013-07-27 04:09:38 UTC
FYI, I verified that at least on the pulseaudio driver with the latest SDL code this works.  I fixed a crash in there yesterday, so definitely get the latest version before testing this again.
Comment 4 Ellie 2013-07-27 14:08:39 UTC
I think I originally reproduced this in wine since f32 audio didn't work there for me. I can no longer do that with both "winmm" and "directsound", I always succcessfully get handed an f32 output.

This could either mean that the bug was fixed in SDL, or that wine now supports f32 audio properly :-) but if you attempted to fix this and you're convinced there is now code that handles this, I suppose it has been successfully fixed in SDL!

I'll go ahead and mark it as fixed (please hit me with a bat if that was too early)