barbudreadmon / fbalpha-backup-dontuse-ty

Deprecated port of Final Burn Alpha to Libretro (v0.2.97.43).
61 stars 43 forks source link

Read ahead input lag feature and sound issues #197

Closed Tatsuya79 closed 5 years ago

Tatsuya79 commented 6 years ago

The new read ahead feature in the Frame Throttle menu can work with some games and cause issues with some other ones in fbalpha.

Viewpoint or Armed Police Batrider will have messed up sound, mainly the bgm.

Is there anything possible to do about that? Cleaning up the save state or something?

Perhaps @Dwedit knows?

barbudreadmon commented 6 years ago

Hmm is that related to high cpu usage ? does the feature use the retro_serialize methods ?

Tatsuya79 commented 6 years ago

It uses states yes, can't do without them. Not a CPU limit in my tests.

barbudreadmon commented 6 years ago

netplay/rewind working properly with those games ? did you run them at normal cpu clock ?

furiadeoso commented 6 years ago

Hi! I've just spent some time doing netplay in Armed Police Batrider and all ok. I hope that helps. Tell me if you need something more

Tatsuya79 commented 6 years ago

The problem happens at normal clock. I don't do much netplay and never use rewind so I can't really say.

The problem could be that the save states need to be cleaned of any sound information? I think that's what Dwedit was doing in several cores starting with snes9x. That can be complicated in fba if every game has its particularities.

barbudreadmon commented 6 years ago

@Tatsuya79 well, 2 out of 3 features relying on retro_serialize methods work properly with sound information included, my guess is the read ahead feature is early beta and need some fix.

Removing sound data from the savestates in fba is not a realistic solution : it could affect other features and would require large amount of work on a per system basis.

barbudreadmon commented 6 years ago

I re-enabled USE_SPEEDHACKS in the neogeo driver, this code should be safe since https://github.com/libretro/fbalpha/commit/980171e5efff1730588c8a2d156f894b7655253b, is actually enabled upstream, and it seems to introduce something in the savestates related to sound. @Tatsuya79 let me know how it affects viewpoint and other neogeo games. @furiadeoso perhaps trying netplay after this change would be a nice idea too.

furiadeoso commented 6 years ago

Ok. I'll do ASAP, but certainly I'm very busy today. Thanks.

furiadeoso commented 6 years ago

I've just tested one minute metal slug in cross-play win64-android32 and seems to be ok.

Tatsuya79 commented 6 years ago

Sadly it doesn't help for read ahead, same stuck notes in Viewpoint music.

furiadeoso commented 6 years ago

@Tatsuya79 Have you identified any FBA game or driver working well with read ahead? And what settings have you used to notice the effect? I would like to test it in netplay. Surely it will have undesirable effects, but I'm curious.

Tatsuya79 commented 6 years ago

Dodonpachi works fine until the end, I remember playing some espgaluda too. I used "second instance" and 1 frame for both games.

Tatsuya79 commented 6 years ago

Run Ahead isn't working at all since I updated the core to 0.2.97.43. The message "Core doesn't support save states, Run Ahead disabled." is always shown while save states are still working.

barbudreadmon commented 6 years ago

Well, if the core support save states and the feature says the core doesn't support save states, that doesn't seem like an issue in the core.

furiadeoso commented 6 years ago

@Tatsuya79 Have you been able to find out what happened?

Dwedit commented 6 years ago

Also how do I make MSVC builds? Would like a DLL with PDB file, don't care if it's my own build or not.

I'm seeing memory leaks.

barbudreadmon commented 6 years ago

@Dwedit https://github.com/libretro/libretro-super/tree/master/recipes/windows No idea how you use this since i'm a gcc user.

Dwedit commented 6 years ago

At least any idea how to build a non-stripped binary?

barbudreadmon commented 6 years ago

In gcc i build it with -O0 -g, toggleable by adding DEBUG=1 to make command.

Tatsuya79 commented 6 years ago

@furiadeoso Yes, I think run ahead was defaulting to 1 instance mode. That would explain the sound issues. I opened this one in RA issues about the most recent problem (sorry if that's too many).

barbudreadmon commented 6 years ago

What's the status of this ?

Tatsuya79 commented 6 years ago

Unchanged.

It works only if you start run ahead in 1 instance mode (which causes sound issues with many games) and slows the emulation down after a while (after several minutes of gameplay with hard sync 0 + some frame delay, I have to remove the frame delay, then the hard sync).

I tried hacking through runahead.cpp to force 2 instances:

When I'm in a game and activate it, I still hear the sound and gameplay of the 1st core but the picture is the one of the 2nd core booting the game from the beginning instead of loading the state.

FrozenFish24 commented 5 years ago

As discussed in this issue, a fix for this problem is to make retro_serialize and retro_unserialize not dependent on a prior call to retro_serialize_size having happened, allowing secondary core mode to work. This could be done by removing the if statements in each function, or performing retro_serialize_size as part of each function. Opinions?

barbudreadmon commented 5 years ago

@FrozenFish24 Commited, let me know if it works.

FrozenFish24 commented 5 years ago

Yep, working properly. Thanks @barbudreadmon!

Tatsuya79 commented 5 years ago

Yes that works thanks! I have to see if that still slows down after a while now... but that would be a new issue. Closing this one.