Closed MrHuu closed 3 years ago
Status update: 3DS SDL is a cursed codebase that works by accident I am in the process of fixing things to work with libctru 3.0. I have fixed bugs in libctru as a result, and also rewritten the audio driver. With a different test program it works fine, and suspending/closing works.
It turns out the test program you provided has several issues (including the fact that it seems to be designed for an older version of 3ds-sdl that had fake keyboard support and linked to vorbis in a different way). Also, it seems to randomly crash due to heap corruption (?). Something is really off with FreeType, as many of the crash dumps I retrieved had crashes within said library.
Tldr we are still in the process of fixing 3ds-sdl. Expect an update soon, although you will very likely need to change your software to be compatible with recent versions of 3ds-sdl anyway.
This is absolutely great! Thanks. You are absolutely right for me not having the latest version installed, i'm terribly sorry about that.
After updating to the latest builds as of now, i was able to get the example from my previous post working, despite the sdl audio generation being horribly broken. But looking at the graphical part, as basic as it gets, i can't seem to find any cause for heap corruption. Nor do i have the knowledge to identify or debug these issues. Always struggling with gdb and probably using it wrong.
Unfortunately, with the latest updates both devilutionx-3ds and openbor-3ds are having issues and are not in a working state. Looking at the example, it should be working correct now, but i can't tell how this affects existing ports. I'll start updating to reflect the latest changes and hopefully have the issues resolved soon.
Much appreciation for looking into this, and updating 3ds-sdl-1.2.
With devilutionx up and running, I can only conclude this particular issue is resolved. Should any other issues occur, it won't be related to this case.
Thanks a lot for having the SDL audio re-worked so fast. Also to both @fincs and @WinterMute (and all others involved) for constantly improving and updating these awesome and sophisticated development tools.
Please don't be offended by my lack of knowledge on how to use them properly. I'm having tons of fun learning.
Case closed.
@MrHuu do you have a Discord id?
No, unfortunately i'm not active on discord. Mostly only on github.
I there anything i could help you with, or have any suggestions? Feel free to ask, if it's appropriate here.
Issue:
After an audio device is opened for a second instance, the 3ds will lock-up upon exit, suspend or sleep.
This happens, for example, by switching from SDL_OpenAudio() to Mix_OpenAudio() (SDL_mixer) or vice-versa. But also when just re-creating an SDL audio device (without SDL_mixer).
Playing audio still works after switching devices.
The issue exists for both SDL and / or SDL_mixer
Reproducing the Issue:
or
but also
I've made an (probably over-complicated) application to demonstrate the behavior. It allows you to:
*screenshot of emulator locking up upon SDL_Quit() 3ds_sdl_audio_example_3dsx.zip 3ds_sdl_audio_example_src.zip
An other example would be the DevilutionX-3ds port i'm working on. This uses the SDL audio callback for the cinematics, than switches to SDL_mixer for the rest of the game. Resulting in having to force (hold-the-button) the 3ds to shutdown upon exit, suspend or sleep.
Desired behaviour:
Being able to re-initialize an SDL or SDL_mixer audio device multiple times, and still be able to exit or suspend the application.
Any help would be much appreciated !