Page 1 of 1

hatari v 2.0.0 running ultra slow on most Raspberry machines

Posted: Sat Dec 23, 2017 6:59 pm
by patrick295767
Hello,

There is today a big slow down due to change from 1.2 to 2.0 SDL.

RPI with opengl and sdl 2.0 cannot play any single games.

I must say that OPENGL + SDL 2.0 is really bloated.

Any improvements in the future to play a 16 bits machine ;) ?

Re: hatari v 2.0.0 running ultra slow on most Raspberry machines

Posted: Sat Dec 23, 2017 7:47 pm
by troed
If the problem is with SDL 2.0 then it should affect all SDL 2 using games/applications. Have people asked the SDL project about this?

Re: hatari v 2.0.0 running ultra slow on most Raspberry machines

Posted: Sat Dec 23, 2017 9:11 pm
by patrick295767
Linux Gaming & Programming industry is doomed by high-end OPENGL and SDL.

Pitty, that old good graphic libraries aren't available.

Re: hatari v 2.0.0 running ultra slow on most Raspberry machines

Posted: Mon Dec 25, 2017 12:13 pm
by solskogen
You can still compile hatari yourself with SDL 1.2.

Re: hatari v 2.0.0 running ultra slow on most Raspberry machines

Posted: Tue Dec 26, 2017 4:20 pm
by Eero Tamminen
Few minutes of googling gave this:
https://raspberrypi.stackexchange.com/q ... -with-sdl2

(One needs to enable HW acceleration.)

Re: hatari v 2.0.0 running ultra slow on most Raspberry machines

Posted: Tue Dec 26, 2017 6:24 pm
by solskogen
Even the fkms driver with SDL2 is pretty slow compared to SDL1.
I can do some benchmarks, if you want.

Re: hatari v 2.0.0 running ultra slow on most Raspberry machines

Posted: Tue Dec 26, 2017 10:04 pm
by Eero Tamminen
There were no mentions of used resolutions. What is the monitor resolution, what resolution Hatari is configured to use etc.

I.e. is the difference mainly due to used resolution? With SDL2 build of Hatari, Atari screen is by default scaled to monitor resolution, by SDL2. With SDL1 build, a smaller resolution typically gets used with ST/STE emulation. If monitor doesn't support suitable resolution(s), with SDL1 there can be large black borders around the Atari screen.

-> If GL implementation is "bad", or device HW memory bandwidth sucks, device itself doing scaling instead of the monitor could be visibly slower.

Re: hatari v 2.0.0 running ultra slow on most Raspberry machines

Posted: Wed Dec 27, 2017 12:03 am
by Estrayk
Not Atari related but a friend fo mine, try to compile 2.0 version to MorphOS and works extremely slooooow in a PowerPC G4 1000Mhz !
I love Hatari but sometimes I miss that ASM emulators in old machines.

that nobody gets angry but I remember play to some Atari ST games in an Amiga 500 at 7Mhz. hows is possible that nowadays we need 2000Mhz? :? :(

Re: hatari v 2.0.0 running ultra slow on most Raspberry machines

Posted: Wed Dec 27, 2017 11:25 pm
by Eero Tamminen
When one considers just output memory writes, not any reads, or the code necessary to decide what to write out...

Typical Atari ST game: partial updates of 320x200 pixels @ 4-bits, no overdraw, no blending = max 32kB / frame

Typical modern game: fullscreen 1920x1080 @ 32-bit updates, 1-10x overdraw, window contents blended together (single blend by compositor = 2 reads, 1 write) = 1920*1080*4*(1..10+3) = 30 - 100MB / frame

-> 1000x more memory bandwidth needed per frame.

Things add up quickly with larger resolutions, higher bit depths and compositing done by the OS desktop....

Text output isn't quite as bad.

Atari text output: 8x8 pix, 1 bit, monospaced, no blending, output to 4-bit interleaved screen = 8 bytes / char

Modern OS text output: 8x18 pix, 4-bit grayscale for anti-aliasing, blended to 32-bit window, window composited to screen = at least 1KB / char

With fullscreen, compositing drops off, which reduces the minimum required bandwidth quite a bit.

Re: hatari v 2.0.0 running ultra slow on most Raspberry machines

Posted: Sat Dec 30, 2017 1:40 pm
by thothy
Two questions / ideas:

1) Which color depth is the Raspi using? 16 bpp or 32 bpp? You could try whether starting Hatari with "--bpp 16" makes a difference when using SDL 2.0.

2) SDL 2.0 still has a way of using the old software blitting mechanisms without Open GL. They are just not supported by Hatari yet. But I've got both mechanisms in Ballerburg SDL, so you could try whether it makes a difference there: Get it from git (git clone git://git.tuxfamily.org/gitroot/baller/baller.git), then use "./configure --enable-sdl2" and "make" to compile with SDL 2.0 and then have a look whether it works smoothly when shooting a cannon ball. Then enable the renderer by changing "#define USE_SDL2_RENDERER 0" to "#define USE_SDL2_RENDERER 1" in screen.c, re-compile and check again whether it still works smoothly when shooting a cannon ball. If you see a difference, there's a chance that we could speed up Hatari with SDL 2.0 by using the software blitting functions here instead of going through the GL rendering functions.

Re: hatari v 2.0.0 running ultra slow on most Raspberry machines

Posted: Sat Dec 30, 2017 10:07 pm
by solskogen
With SDL2_RENDERER set to 1, the cannon balls gos very fast. But both are pretty smooth,

Re: hatari v 2.0.0 running ultra slow on most Raspberry machines

Posted: Sat Dec 30, 2017 10:48 pm
by arf
Estrayk wrote:Not Atari related but a friend fo mine, try to compile 2.0 version to MorphOS and works extremely slooooow in a PowerPC G4 1000Mhz !
I love Hatari but sometimes I miss that ASM emulators in old machines.


There are “ASM” emulators for emulating the Atari ST series. But as currently no volunteer has been found to replicate the success of x86-64 again on ARM32, ARM64, POWER32, POWER64, PPC32 and PPC64, it is indeed a pity and we have to live the hard life to have the choice what to use with that open source piece done by volunteers. EDIT: Sorry, I forgot MIPS32, MIPS64, SPARC32, SPARC64, PA-RISC32, PA-RISC64 and — of course — AXP. EDIT2: And m88k!

Estrayk wrote:that nobody gets angry but I remember play to some Atari ST games in an Amiga 500 at 7Mhz. hows is possible that nowadays we need 2000Mhz? :? :(


Angry? About software product written by others, and given to us all not only as free as in beer, but as free as in free speech?

Ah, BTW: We actually don’t need 2000 MHz to play these games. We’re absolutely free to get our Ataris and Amigas out of the closet and use them. You won’t notice any speed degradation compared to the good ol’ times. Even if your battery in your 68k is empty.

Re: hatari v 2.0.0 running ultra slow on most Raspberry machines

Posted: Mon Jan 01, 2018 9:16 am
by thothy
No need to get sarcastic ;-)
Estrayk: There are simply two things to consider here: First, Hatari (and other software) is way more accurate nowadays, which needs more CPU power, of course. If you don't need accuracy, feel free to use an older version of Hatari or another emulator (like CaSTaway maybe) which should work fine on CPUs with maybe 500 MHz only, too.
Second, SDL2 apparently has some issues on the Raspi. That's either a bug, or a driver issue (no OpenGL support?), so you can not hold this against the applications like Hatari.

Re: hatari v 2.0.0 running ultra slow on most Raspberry machines

Posted: Mon Jan 01, 2018 9:22 am
by thothy
solskogen wrote:With SDL2_RENDERER set to 1, the cannon balls gos very fast. But both are pretty smooth,


Ok, so if both modes are pretty fast, I was maybe wrong and using the non-renderer mode won't help much with Hatari. Anyway, I had some spare minutes and added basic support for the old software blitting in Hatari now, too:

https://hg.tuxfamily.org/mercurialroot/ ... a9175c8c51

After updating to the latest version from the mercurial repository, you can enable the non-renderer mode by setting "bUseSdlRenderer = FALSE" in the "[Screen]" section of your ~/.config/hatari/hatari.cfg file (I consider this as an very experimental mode, so I only added the config file switch but no GUI option to enable it). In case you try it, please let me know whether this makes a difference on the Raspi.

Re: hatari v 2.0.0 running ultra slow on most Raspberry machines

Posted: Mon Jan 01, 2018 11:44 am
by solskogen
Not much change with bUseSdlRenderer = FALSE. And full screen didn't really work.

Re: hatari v 2.0.0 running ultra slow on most Raspberry machines

Posted: Wed Jan 03, 2018 8:20 pm
by thothy
Too bad :-( At least it was worth a try...
Looks like you've got to life with SDL1.2 on the Raspi until the SDL folks fixed the problems there... (I hope they are aware of it, otherwise you should maybe file a bug report in their bugtracker)

Re: hatari v 2.0.0 running ultra slow on most Raspberry machines

Posted: Thu Jan 04, 2018 7:42 am
by solskogen
SDL2 have two, or three if you count x11, drivers for rPI. One legacy one (is enabled by default, if you compile it yourself, but is not enabled in Raspbian nor Arch Linux) - which is quite fast - and then it has a kmsdrm. The last one is a bit slow, but it's not using the legacy rpi drivers.
kmsdrm is not enabled by default, even if you compile it yourself.
None of them are as fast as SDL1, but it's getting better.