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 3726 - PSP audio driver screws up if >2 channels are requested (patch included)
Summary: PSP audio driver screws up if >2 channels are requested (patch included)
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: audio (show other bugs)
Version: 2.0.5
Hardware: Other Other
: P2 minor
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-04 19:41 UTC by Solra Bizna
Modified: 2017-08-04 20:19 UTC (History)
0 users

See Also:


Attachments
Let SDL_OpenAudioDevice know when we've rejected a surround configuration (458 bytes, patch)
2017-08-04 19:41 UTC, Solra Bizna
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Solra Bizna 2017-08-04 19:41:31 UTC
Created attachment 2819 [details]
Let SDL_OpenAudioDevice know when we've rejected a surround configuration

The PSP audio driver assumes that "channels == 1" means mono and anything else means stereo. If channels is greater than 2, this will result in the driver processing surround sound data as stereo, without informing SDL or the application.

I found this purely by reading SDL source, so I don't have a way to test it, but from my understanding of the SDL audio driver architecture, the attached patch is the proper fix. If more than 2 channels are requested, 2 will be obtained. SDL_OpenAudioDevice will then set up downmixing or inform the application, depending on whether SDL_AUDIO_ALLOW_CHANNELS_CHANGE is in effect.

I didn't find a similar bug in any other audio drivers.
Comment 1 Ryan C. Gordon 2017-08-04 20:19:17 UTC
Good catch; this patch is now https://hg.libsdl.org/SDL/rev/04063928c4a8, thanks!

--ryan.