Danfun64 Posted October 9, 2017 (edited) I bumped into a bug when running using Mupen64Plus's audio plugin (detailed here ) Quote SDL 2.0.6 changed the audio backend on Windows to WASAPI, with that change, the audio format is forced to 32bit floating point samples. Audio-sdl only outputs 16 bit integer samples currently, so it needs to convert the samples to the proper format before feeding them to SDL This bug affects other software that uses SDL2, which includes PrBoom-Plus (and possibly the SDL2 branches of Chocolate Doom and Eternity as well, though i haven't tested those two personally). Edited October 9, 2017 by Danfun64 2 Quote Share this post Link to post
Altazimuth Posted October 9, 2017 (edited) This bug has been reported by fraggle, https://bugzilla.libsdl.org/show_bug.cgi?id=3858 which apparently is an amalgam of issues https://bugzilla.libsdl.org/show_bug.cgi?id=3848 and https://bugzilla.libsdl.org/show_bug.cgi?id=3849. I also spotted this when I switched to SDL2.0.6 release for Eternity on the SDL2 branch. It's worth noting that I found this post, which seemingly managed to fix the bug when I applied the code therein (#if guarded so it only executes on Windows): https://discourse.libsdl.org/t/sdl-2-0-6-released/23109/21 Edited October 9, 2017 by Altazimuth 2 Quote Share this post Link to post
RjY Posted October 9, 2017 @Altazimuth thanks! Those bugtracker links are the most likely explanation for the following observation. Since libsdl2 2.0.6 went in to Debian, Chocolate Doom sd2-branch segfaults instantly somewhere deep inside the library whenever the game tries to play a sound. This only happens with normal sounds - PC speaker emulation and OPL music are fine. PrBoom+ is likewise unaffected. I hadn't had chance to debug it further but it seems @fraggle is already on top of it. 1 Quote Share this post Link to post
fraggle Posted October 9, 2017 Thanks for bringing more visibility to this. From following @sdl_commits on Twitter, I know there have been a bunch of audio-related changes over the past month or so. I suspect these are to blame. 1 Quote Share this post Link to post
Coraline Posted October 14, 2017 I also had to move down to SDL2 2.0.5, as I suspected like @fraggle said -- they made a bunch of audio changes which caused a no-sound situation in EDGE. I wonder if they are going to fix those issues for SDL 2.0.7, or if our ports should manually patch the sound processing oddities. . or just "stick with SDL2 2.0.5". :S 0 Quote Share this post Link to post
fabian Posted October 16, 2017 (edited) Reportedly, this issue will be fixed in the SDL 2.0.7 release. Edited October 17, 2017 by fabian Turns out 2.0.7 hasn't been released yet 2 Quote Share this post Link to post
Altazimuth Posted October 22, 2017 Looks like there's gonna be SDL2_mixer 2.0.2 which is updated for 2.0.6+. https://discourse.libsdl.org/t/sdl2-mixer-2-0-2-prerelease/ 0 Quote Share this post Link to post
bradharding Posted October 22, 2017 I can confirm that the prerelease versions of SDL 2.0.7 and SDL_mixer 2.0.2 used together do work, and the full versions won't be very far away. 1 Quote Share this post Link to post
Altazimuth Posted October 23, 2017 (edited) EDIT: I still have to have the #if EE_CURRENT_PLATFORM == EE_PLATFORM_WINDOWS SDL_setenv("SDL_AUDIODRIVER", "directsound", true); #endif otherwise all sound effects are pitched too high. Anybody else get that? Edited October 23, 2017 by Altazimuth 1 Quote Share this post Link to post
bradharding Posted October 24, 2017 (edited) 11 hours ago, Altazimuth said: I still have to have the #if EE_CURRENT_PLATFORM == EE_PLATFORM_WINDOWS SDL_setenv("SDL_AUDIODRIVER", "directsound", true); #endif otherwise all sound effects are pitched too high. Anybody else get that? Yes, I have. My solution was to stop using SDL_BuildAudioCVT(), do the conversion manually and then apply a low pass filter. See here. Might not be appropriate for Eternity though. Also, apparently support for the DirectSound audio driver will eventually be removed. EDIT: There's also the new SDL_HINT_AUDIO_RESAMPLING_MODE hint, which may come in handy. Edited October 24, 2017 by bradharding 0 Quote Share this post Link to post
Altazimuth Posted October 24, 2017 OK so I have this weird-ass bug where eventually SDL_Init(SDL_INIT_JOYSTICK) doesn't just not fail, but the program hangs on it. Like mysteriously even the version that worked earlier today that I compiled has stopped working. 0 Quote Share this post Link to post
Julia Nechaevskaya Posted October 25, 2017 Another problem that may occur with 2.0.7 - if the game/port is started in fullscreen mode and then changed to windowed (by Alt+Enter combination), window frame will be borderless. However, after pressing Alt+arrows borders will appear. 0 Quote Share this post Link to post
Coraline Posted October 25, 2017 What is the benefit, slightly off-topic, of using SDL_Mixer? EDGE doesn't use it as it has its own internal sound mixing stuff -- is it worth it to support a broader range of audio formats and effects? For instance, if it supports VOC then I would definitely incorporate it as I need a VOC decoder for ROTT SFX, but would I have to change the rest of the sound code around to compensate? 0 Quote Share this post Link to post
Graf Zahl Posted October 26, 2017 AFAIK the main benefit is music playback. IIRC most SDL-based ports still mix the game sound effects on their own. I'm far more curious why basically no port aside from the ZDoom family has ever considered to use a real sound API like OpenAL instead and still stick to the same minimalistic approach that was originally used in 1993. 1 Quote Share this post Link to post
Gez Posted October 26, 2017 10 hours ago, Coraline said: For instance, if it supports VOC then I would definitely incorporate it as I need a VOC decoder for ROTT SFX, but would I have to change the rest of the sound code around to compensate? Decoding VOC is pretty simple because it's just PCM data (technically there are other formats but in practice, in all the games I have, I've only found PCM vocs); you can find code in SLADE that converts it to WAV on-the-fly. 1 Quote Share this post Link to post
Coraline Posted October 27, 2017 (edited) 17 hours ago, Graf Zahl said: AFAIK the main benefit is music playback. IIRC most SDL-based ports still mix the game sound effects on their own. I'm far more curious why basically no port aside from the ZDoom family has ever considered to use a real sound API like OpenAL instead and still stick to the same minimalistic approach that was originally used in 1993. EDGE, at one point, did in fact use OpenAL. I briefly considered restoring it, but, why fix what isn't broken? :-) i don't remember why it reverted to SDL (actually based on SDL_Sound), but I think it works out fine. Not sure if OpenAL works on Linux or not either. Also I remember needing to actually install OpenAL in earlier EDGE builds, and at least the way we do it, we don't need to install anything ^_^ Edited October 27, 2017 by Coraline 0 Quote Share this post Link to post
Graf Zahl Posted October 27, 2017 I guess it used the 'official' OpenAL, which indeed is not the greatest package out there. It's old and essentially unsupported. ZDoom uses OpenAL Soft which is being developed for all relevant OSs there. 1 Quote Share this post Link to post
Coraline Posted October 27, 2017 Do you use OpenAL Soft for Windows midi playback? Ive been hunting for an alternative, because if you aren't using WinXP, all EDGE offers ATM is OPL/OPL3 and Timidity. I think the system mixer works on Linux, but if it will get native MIDI under Windows, I'm all ears :-) 0 Quote Share this post Link to post
Coraline Posted October 27, 2017 On 10/26/2017 at 2:45 AM, Gez said: Decoding VOC is pretty simple because it's just PCM data (technically there are other formats but in practice, in all the games I have, I've only found PCM vocs); you can find code in SLADE that converts it to WAV on-the-fly. Also, thank you so much Gez!! That's exactly what I needed :-) I might hit you up (just a warning) about other ROTT format intricies (I see SLADE3 supports nearly all of the IWAD data). :-) 0 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.