hatari v 2.0.0 running ultra slow on most Raspberry machines

A forum about the Hatari ST/STE/Falcon emulator - the current version is v2.1.0

Moderators: simonsunnyboy, thothy, Moderator Team

User avatar
patrick295767
Captain Atari
Captain Atari
Posts: 265
Joined: Sun Aug 13, 2006 2:15 pm
Contact:

hatari v 2.0.0 running ultra slow on most Raspberry machines

Postby patrick295767 » Sat Dec 23, 2017 6:59 pm

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 ;) ?

User avatar
troed
Atari God
Atari God
Posts: 1314
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

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

Postby troed » Sat Dec 23, 2017 7:47 pm

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?

User avatar
patrick295767
Captain Atari
Captain Atari
Posts: 265
Joined: Sun Aug 13, 2006 2:15 pm
Contact:

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

Postby patrick295767 » Sat Dec 23, 2017 9:11 pm

Linux Gaming & Programming industry is doomed by high-end OPENGL and SDL.

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

solskogen
Atariator
Atariator
Posts: 26
Joined: Sun Jul 27, 2008 4:03 pm

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

Postby solskogen » Mon Dec 25, 2017 12:13 pm

You can still compile hatari yourself with SDL 1.2.

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1606
Joined: Sun Jul 31, 2011 1:11 pm

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

Postby Eero Tamminen » Tue Dec 26, 2017 4:20 pm

Few minutes of googling gave this:
https://raspberrypi.stackexchange.com/q ... -with-sdl2

(One needs to enable HW acceleration.)

solskogen
Atariator
Atariator
Posts: 26
Joined: Sun Jul 27, 2008 4:03 pm

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

Postby solskogen » Tue Dec 26, 2017 6:24 pm

Even the fkms driver with SDL2 is pretty slow compared to SDL1.
I can do some benchmarks, if you want.

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1606
Joined: Sun Jul 31, 2011 1:11 pm

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

Postby Eero Tamminen » Tue Dec 26, 2017 10:04 pm

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.

User avatar
Estrayk
Captain Atari
Captain Atari
Posts: 167
Joined: Mon Nov 23, 2015 2:52 pm
Location: Spain

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

Postby Estrayk » Wed Dec 27, 2017 12:03 am

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? :? :(
・Falcon 030+FPU 14mb CosmosEX・Atari MegaSTE 4Mb CosmosEX・Atari STe 4Mb GotekHxC+Satan・Amiga A600 Vampire V2・Amiga A1200 030/50・MIST・

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1606
Joined: Sun Jul 31, 2011 1:11 pm

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

Postby Eero Tamminen » Wed Dec 27, 2017 11:25 pm

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.

User avatar
thothy
Hatari Developer
Hatari Developer
Posts: 420
Joined: Fri Jul 25, 2003 9:36 am
Location: Germany
Contact:

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

Postby thothy » Sat Dec 30, 2017 1:40 pm

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.

solskogen
Atariator
Atariator
Posts: 26
Joined: Sun Jul 27, 2008 4:03 pm

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

Postby solskogen » Sat Dec 30, 2017 10:07 pm

With SDL2_RENDERER set to 1, the cannon balls gos very fast. But both are pretty smooth,

arf
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 118
Joined: Thu May 17, 2012 9:56 pm
Location: Germany

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

Postby arf » Sat Dec 30, 2017 10:48 pm

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.

User avatar
thothy
Hatari Developer
Hatari Developer
Posts: 420
Joined: Fri Jul 25, 2003 9:36 am
Location: Germany
Contact:

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

Postby thothy » Mon Jan 01, 2018 9:16 am

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.

User avatar
thothy
Hatari Developer
Hatari Developer
Posts: 420
Joined: Fri Jul 25, 2003 9:36 am
Location: Germany
Contact:

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

Postby thothy » Mon Jan 01, 2018 9:22 am

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.

solskogen
Atariator
Atariator
Posts: 26
Joined: Sun Jul 27, 2008 4:03 pm

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

Postby solskogen » Mon Jan 01, 2018 11:44 am

Not much change with bUseSdlRenderer = FALSE. And full screen didn't really work.

User avatar
thothy
Hatari Developer
Hatari Developer
Posts: 420
Joined: Fri Jul 25, 2003 9:36 am
Location: Germany
Contact:

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

Postby thothy » Wed Jan 03, 2018 8:20 pm

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)

solskogen
Atariator
Atariator
Posts: 26
Joined: Sun Jul 27, 2008 4:03 pm

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

Postby solskogen » Thu Jan 04, 2018 7:42 am

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.


Social Media

     

Return to “Hatari”

Who is online

Users browsing this forum: No registered users and 1 guest