melonDS-emu / melonDS

DS emulator, sorta
https://melonds.kuribo64.net
GNU General Public License v3.0
3.02k stars 499 forks source link

Is it possible to speed the game without speeding the audio? #1476

Open BurstHA opened 2 years ago

BurstHA commented 2 years ago

I've just downloaded th melonDS and I'm in love on how easier it is to configure and understand the stuff you're messing with in the configs. The emulator is great. The only issue I have with it is that when you speed up the game (disable the frame limiter or use the fast forward toggle), the audio also speeds up, which is actually what is intended to happen but I wonder if there are any ways of avoiding it? Thanks in advance for any answers/solutions!

Abbanon commented 2 years ago

I guess having a toggle for "mute audio on speed-up" would be the best way to go about this?

BurstHA commented 2 years ago

I guess having a toggle for "mute audio on speed-up" would be the best way to go about this?

Yeah this could help! Though I was thinking about how it works on switch emulation for example. The game, even being at 2x speed still runs with normal sound, something I've always thought was amazing and was wondering if there's any options for that here but it probably doesn't, which is not actually a bad thing/issue cause it's something more personal than technical

Arisotura commented 2 years ago

Switch emulators might emulate audio at a higher level, where it's not a big concern if it doesn't run in sync with the rest of the system. in melonDS however, we have to emulate audio at a low level and that requires keeping it in sync with the rest of the emulated system, so speeding up the game without speeding up audio isn't possible.

however, we could mute audio while speeding up.

sandwichwater commented 2 years ago

in addition to what arisotura said , another reason why this isnt possible is because of the way the ds handles audio , where nearly all games have sequenced audio , which runs in real time with the game , so think of it as speeding up the game speeds up the sequenced audio as well . the only way i can see your idea happen is if the game had streamed audio , which doesnt run in sync with the game as far as i know , just told to be played and looped indefinitely

Adamillo commented 2 years ago

There have been days where it has been tried to have asynchronous audio emulation like the Switch emulator does with other consoles or handhelds and it had big consequences. Up until 2014 Dolphin had async audio and it was very problematic because it caused tons of crashes and caused tons of audio glitches. The way the GameCube/Wii handles audio MUST be synchronous with the FPS. The same applies to Nintendo DS emulation

BurstHA commented 2 years ago

Thanks for explaining that, people! It's all clear to me now. Probably the best way to handle that would be like Arisotura and Abbanon said, having the option to mute the game while speeding up is a great idea. Hope this gets added! Thanks for your help

poudink commented 2 years ago

DeSmuME has an async audio option. Works fine like 99% of the time. When it doesn't, you can just switch back to synchronous audio. It's a great option to have, IMO. I think of it as an enhancement option, like scaling filters and HD resolutions. If you get inconsistent framerates, async audio is much more pleasant than synchronous audio. Fast forward is another example.

Jules-A commented 2 years ago

DeSmuME has an async audio option. Works fine like 99% of the time. When it doesn't, you can just switch back to synchronous audio. It's a great option to have, IMO. If you get inconsistent framerates, async audio is much more pleasant than synchronous audio. Fast forward is another example. I think of it as an enhancement option, like scaling filters and HD resolutions.

It sounds a whole lot better but it's not what the OP was asking for since it still speeds up the audio.

poudink commented 2 years ago

It partially does. Streamed music and sound effects won't be sped up at all, while sequences will essentially just play at a higher BPM. This can have some side effects when speeding up like in the SM64DS intro where Peach's voice lines will overlap. I'm pretty sure every emulator with asynchronous audio behaves that way, but most of them are for consoles much newer than the DS where sequenced music is much less common. I'm not sure it would be possible for sequences not to be sped up.