Mednafen has 1fps with new hrev

Hi!

I found that mednafen became slow like hell on new Haiku builds (x64). Something got wrong between hrev57609 and hrev57898.

Here is the behavior:

  • hrev57609: mednafen works perfect (someting like 60fps)
  • hrev57898: mednafen has only 1fps or someting

When I switch back to the hrev57609 at the booting process, mednafen works perfect. I tested this on three different machines with Haiku, 1 ASUS laptop, 1 HP laptop and 1 MacBook. Same behavior on all.

I tried to open a bug ticket about this, but I dont how to do that. If you consider, maybe you can open a ticket with this issue, or you can ask somebody to investigate if there is time for that kind of bugs.

Cheers!

2 Likes

This is a very large range, and the bug could of course be in a ported library and not in Haiku itself. Can you share more details? What emulator core are you using with Mednafen; or is the problem with all emulator cores?

1 Like

Tested with .nes, .sfc, .srm, .smc and .gba. The same behavior with all cores. I also deleted the /boot/home/config/settings/mednafen and start the emulator again… same behavior, verry verry slow (aprox 1fps, maybe less).

Where can I found the sources ported for Haiku. I can try to recompile it, to see if this will fix the problem.

If I downgrade the whole system to hrev57609, everything is going back to normal.

1 Like

Yes, but when you boot an old state, it also brings along all the old packages that were in that state, not just the system packages. So it’s possible some other package was updated and that’s causing the problem, not the system. But I haven’t looked into it.

2 Likes

https://github.com/haikuports/haikuports/tree/master/games-emulation/mednafen <<< there is the .recipe and a very small patch.

If you have the devel: and cmd: packages for the required libraries, it should compile quite easily from sources if you follow the steps on the recipe (in case you don’t setup/use HaikuPorter).

Given that it uses the following libraries:

	libFLAC
	libGL
	libGLU
	libiconv
	libintl
	liblzo2
	libmpcdec
	libSDL2_2.0
	libsndfile
	libvorbisidec
	libz

You could check the versions of those when things work fine vs slow. (if they are different, you should have their packages on some of the “state” folders under /system/packages/adminitstrative/).

For reference, hrev57609 is from 2024-04-27 (the date might help filter out possible library changes over HaikuPorts).

3 Likes

I would check with an older SDL2 package. At first glance, it seems the one that may cause trouble as it has been updated recently.

1 Like

I dont know how to deal with .recipe files. I m not familiar with Haiku, Just give me a hint, please, and I ll be ok (I gues).

Hmm, donno if this is relevant, but LTris seems to work fine.

Is it even possible to use an older SDL package with everything else updated? Haiku’s dependency hell would probably get in the way.

SDL has not very many dependencies besides Haiku itself, so, probably it is entirely possible.

To start understanding HaikuPorts recipes, the entry point would be it’s documentation wiki.

But given that you have a system where you can boot into hrev57609… what I would try is (as I tried to hint to earlier) is to see if installing an older version of the libraries, on newer Haiku fixes the problem.

For SDL2… find an older version you may have. Assuming your hrev57609 was up-to-date… libsdl2-2.26.4-4 .hpkg file might be under some of the “state” folders in /system/packages/adminitstrative/.

(Other possible options are: libsdl2-2.30.1-1, libsdl2-2.30.2-1 or the newest one… libsdl2-2.30.2-2)

to install one of those old versions… you can use pkgman install <path_to_old_lib.hpkg>.

If after that mednafen gets faster again (on a newer Haiku hrev) that would be a clear indication that issue is with newer SDL2 changes (and not with Haiku itself).

I booted with hrev57609 and libsdl seems to be the same as in hrev57898 (libsdl2-2.30.2-1). Maybe I missed something from what you told me to do. See attachment.

1 Like

Well, if that was the sdl2 version you had installed all along… then I guess the problem is with something else (either other library, or changes in Haiku indeed).

Unless someone has a better idea… I would try to “bisect” the Haiku revisions between hrev57609 and hrev57898.

Something like using:

pkgman add https://eu.hpkg.haiku-os.org/haiku/master/$(getarch)/r1~beta4_hrev57609
pkgman full-sync

But with different hrevs on that range, and testing mednafen each time to see where it starts getting slow.

Not all hrevs numbers will be available, thou. I know there’s an URL one can query to find out the available ones: , but I can’t recall which one. Some other user surely will point it out (in any case, if I’m not mistaken, the hrevs numbers matching the nightly images listed here should work). List of available hrevs.

2 Likes

Yes, I will do that. I have also duplicated version(s) of Haiku installed on an USB dongle. I will test on the USB trying to find whats wrong, but in the meantime I found that the videocodecs are also broken in the new builds. Videos who can be played on hrev57609, now cannot be played, but only audio codec works. I tested with media player, vlc, mpv, smplayer - same behavior. I also created a video by myself with ffmpeg (default codecs, no other magic stuff added) and the result is the same: only audio part works on media player, but not in vlc or mpv, but the video is stucked. I tried to play the video with Falkon and I obtained the same result. Something happen between hrev57609 and hrev57898. I also made this morning the last update and I have no positive results.

I will open a new topic with the video codec problem and I will try to isolate the bug releated to mednafen by using USB dongle with Haiku installed, puting here the result. I will take an eye on the commits from one build to another, to see whats wrong there. Unfortunatelly, I will be stucked on my laptop with hrev57609 until the fixes will came. Haiku is my only operating system and I need at least one working machine in order to continue my work.

2 Likes

Sorry I couldn’t be more helpful (I don’t use mednafen, and I use beta4 99.5% of the time for HaikuPorts related work).

Best of luck with the bug hunting!

1 Like

Whatever problem you are experiencing is probably unrelated to Mednafen or video playback at this point, and there is just some regression in Haiku itself. I haven’t heard anyone else report these problems yet, to my knowledge, and video playback in Falkon still works fine here. So, more information on when the breakage occurred will be needed.