| Summary: | SDL_MixAudioFormat does not support audio format AUDIO_U16LSB/AUDIO_U16MSB | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Simon Sandström <simon> |
| Component: | audio | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED WORKSFORME | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | saurabh.tw, simon, zambotti |
| Version: | 2.0.2 | Keywords: | target-2.0.12 |
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: | Testcase that works on Windows Mingw64 but fails on Ubuntu 18.04 | ||
Facing the same issue. Any plan to fix this? Fixed, thanks! https://hg.libsdl.org/SDL/rev/f660a6ed9dcf Created attachment 3435 [details]
Testcase that works on Windows Mingw64 but fails on Ubuntu 18.04
make the code
To execute
$ ./sdlaudio(.exe)
plays audio2.wav
$ ./sdlaudio(.exe) r
plays audio2.raw
I suspect there to be an underlying problem in SDL_audio as these same two audio formats do not work under Linux using SDL2 (2.0.8) basic audio. When the same code base is compiled on MINGW under windows the code works fine. Under Linux the SDL_OpenAudioDevice succeeds, returns a valid deviceID but refuses to play these formats. A comparison of the requested format vs obtained format also shows no discrepancies. (Sorry if you get several emails like this, we're marking a bunch of bugs.) We're hoping to ship SDL 2.0.11 on a much shorter timeframe than we have historically done releases, so I'm starting to tag bugs we hope to have closed in this release cycle. Note that this tag means we just intend to scrutinize this bug for the 2.0.11 release: we may fix it, reject it, or even push it back to a later release for now, but this helps give us both a goal and a wishlist for the next release. If this bug has been quiet for a few months and you have new information (such as, "this is definitely still broken" or "this got fixed at some point"), please feel free to retest and/or add more notes to the bug. --ryan. It's possible we fixed this since 2018, but this definitely works on Ubuntu 18.04 here, both with the PulseAudio and ALSA targets. --ryan. We're changing how we do SDL release versions; now releases will be even numbers (2.0.10, 2.0.12, etc), and as soon as we tag a release, we'll move the internal version number to an odd number (2.0.12 ships, we tag the latest in revision control as 2.0.13 immediately, which will become 2.0.14 on release, etc). As such, I'm moving the bugs tagged with target-2.0.11 to target 2.0.12. Sorry if you get a lot of email from this change! Thanks, --ryan. We're changing how we do SDL release versions; now releases will be even numbers (2.0.10, 2.0.12, etc), and as soon as we tag a release, we'll move the internal version number to an odd number (2.0.12 ships, we tag the latest in revision control as 2.0.13 immediately, which will become 2.0.14 on release, etc). As such, I'm moving the bugs tagged with target-2.0.11 to target 2.0.12. Sorry if you get a lot of email from this change! Thanks, --ryan. |
As stated in Summary. The switch statement will execute the default case and set a SDL error message: "SDL_MixAudio(): unknown audio format". There are atleast two more problems here: 1. SDL_MixAudioFormat does not notify the user that an error has occured and that a SDL error message was set. It took me awhile to understand why I couldn't mix down the volume on my AUDIO_U16LSB formatted audio stream.. until I started digging in the SDL source code. 2. The error message is incorrect, it should read: "SDL_MixAudioFormat(): unknown audio format". Reproduced with SDL 2.0.2 on Debian Jessie: $ apt-cache policy libsdl2-dev libsdl2-dev: Installed: 2.0.2+dfsg1-6 Candidate: 2.0.2+dfsg1-6 Version table: *** 2.0.2+dfsg1-6 0 500 http://ftp.acc.umu.se/debian/ jessie/main amd64 Packages 100 /var/lib/dpkg/status $ uname -a Linux debian-testing-vm 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt9-2 (2015-04-13) x86_64 GNU/Linux