Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL mikmod music not working #113

Open
protoman opened this issue Mar 21, 2020 · 7 comments
Open

SDL mikmod music not working #113

protoman opened this issue Mar 21, 2020 · 7 comments

Comments

@protoman
Copy link

Using Amiga-Mod music, in a few devices, it seems there is a audio problem that causes a buzz.
Sadly I could not reproduce it on my devices, but a user sent my a video of the problem:
https://drive.google.com/open?id=13OLXUkIjNxveJie-Un5MABXBbjpB7jJ2

This started after I updated my local git with latest changes - I had a very old (+1 year) version locally.

@pelya
Copy link
Owner

pelya commented Mar 23, 2020 via email

@protoman
Copy link
Author

protoman commented Mar 23, 2020 via email

@protoman
Copy link
Author

protoman commented Mar 23, 2020 via email

@protoman
Copy link
Author

protoman commented Apr 7, 2020

OK, so I've tried to increase audio buffer size, first to 4096, then to 8192, also changed rate frequency, but nothing seems to work.
I still find if funny, because before I've updated the SDL version, it was working for those people. But maybe it is related to the NDK that I also had to update, or the ARM-64 build. There are several possibilities there :(

@protoman
Copy link
Author

@pelya I finnally was able to get someone to test it for me, so I will try to get as much details as possible. The bug only affects music, not other sound effects (wav filed playing with Mix_PlayChannel). I am using NDK 20r, my code is available at https://github.com/protoman/rockbot, the sound lib is here: https://github.com/protoman/rockbot/blob/master/soundlib.cpp

First, I am using Amiga-MOD music format, I tried to just use an mp3 or ogg, but just using Mix_LoadMUS and Mix_PlayMusic with it, did not make it work, music went silent (sound effects still play fine), interestingly, the buzz sound does not happen in this case. I've asked the person to try changing the audio buffer size (I've added an option in SDL itself and on my game to change it), but the only thing it did was to change the pitch of the noise, it still does not play the music.

I've also tried to change the cfg flag's, CompatibilityHacksPreventAudioChopping, CompatibilityHacksAppIgnoresAudioBufferSize and CompatibilityHacksStaticInit. The one that made a little difference was CompatibilityHacksStaticInit, that made the music play just for a second or two, before the buzz returning.

Sadly, before I could do more testing, the person asked me to forfeit, so I won't keep further bothering him with APK files for testing. But maybe you can have a better guess with those clues.
Hope you are safe and good. Regards, Iuri.

@protoman
Copy link
Author

@pelya I got someone else to help me. Tried to enable all hacks in the cfg at same time, but the game crashed with "repeated errors". Then, I used a OGG Vorbis file converted from my MOD ones, and the problem vanished.
I will add a hack into the Android port, so that it will use OGG instead of MOD, but it would be great if this problem is fixed someday :)

@protoman protoman changed the title SDL Audio Issue SDL mikmod music not working Jul 15, 2020
@Serosis
Copy link

Serosis commented Jul 24, 2021

Can confirm that this happens with The Ur-Quan Masters MegaMod under arm64-v8a.

OGG files play perfectly fine but MOD tracker files give off a horrible sound.
Here is an example: https://streamable.com/wlbi68

I've tried screwing around with MikMod and only managed to make the game crash whenever .mod files were loaded.
Audio engine stuff is way out of my depth.

UPDATE:

Michael Martin (Main Dev for UQM) updated the built-in MikMod to 3.3.11.1 and that solved the corrupted audio issues when building arm64-v8a binaries.

I suspect the same would need to be done to the MikMod included in commandergenius.

ReinhardPrix added a commit to ReinhardPrix/FreedroidClassic that referenced this issue Jan 7, 2024
- SDL1.2 mixer support for mod-tracker music seems broken on ARM,
  see also pelya/commandergenius#113
- ogg playing works fine, so easier to convert music files rather
  than fixing sdl-mixer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants