Hatari loads slow and reports errors on RPi3B running Raspbian

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

Moderators: simonsunnyboy, thothy, Moderator Team

handsomegenius
Atarian
Atarian
Posts: 2
Joined: Thu Aug 23, 2018 2:11 am

Hatari loads slow and reports errors on RPi3B running Raspbian

Postby handsomegenius » Thu Aug 23, 2018 7:47 am

Hey everyone,

Total noob at this so I hope I am not asking something that's been answered a million times. But I've had a go at searching for an answer and nothing's come up.

I recently got interested in emulating an ST after reading about how widely used it was as a MIDI sequencer back in the day.

I have a spare pi just for fiddling with, so I went and got a new SD card and flashed a fresh image of Raspbian on it and started it up.

Then I updated packages and installed Hatari using apt-get. I went to run it and it said that tos.img wasn't in the right directory.

So I did a bit of a google of what that meant and then went and downloaded EmuTOS from Sourceforge. I put the image file in the and renamed it to tos.img.

Now, it starts up.. but it takes AGES to load. And then when I exit, the terminal is full of error messages like "bus error" and "illegal instruction".. so clearly something is a bit off.

What am I doing wrong? Is there a better way to install hatari? Should I be compiling it from the source? Have I done something wrong with emutos?

ThorstenOtto
Atari Super Hero
Atari Super Hero
Posts: 798
Joined: Sun Aug 03, 2014 5:54 pm

Re: Hatari loads slow and reports errors on RPi3B running Raspbian

Postby ThorstenOtto » Thu Aug 23, 2018 9:38 am

handsomegenius wrote:Have I done something wrong with emutos?


The current EmuTOS version is hosted on github, maybe you are using an older version?

Also, at least some of the bus-error messages are normal, unlike TOS, EmuTOS checks the available hardware, and you will get those message from hardwre that is not present on the machine you are emulating. As long as your programs don't crash with a panic message, you don't have to worry about that.

czietz
Hardware Guru
Hardware Guru
Posts: 1006
Joined: Tue May 24, 2016 6:47 pm

Re: Hatari loads slow and reports errors on RPi3B running Raspbian

Postby czietz » Thu Aug 23, 2018 9:48 am

Please define "ages". Also: What do you mean by "load"? To the boot screen? To the desktop? How long does it take for the EmuTOS boot screen to appear? How long does it take for the desktop to appear?

Atari TOS and EmuTOS try to read the floppy drive (on Hatari as well as on real hardware). If there is no floppy (i.e. floppy image on an emulator) inserted, it will repeatedly try until a timeout occurs. This prolongs the boot time of Atari TOS and EmuTOS. Try creating an empty floppy image within Hatari and load the image into drive A:. Does it speed up things?

handsomegenius
Atarian
Atarian
Posts: 2
Joined: Thu Aug 23, 2018 2:11 am

Re: Hatari loads slow and reports errors on RPi3B running Raspbian

Postby handsomegenius » Thu Aug 23, 2018 10:43 am

Thanks guys, much appreciated and genuinely helpful.

czietz, it gets to the EmuTOS boot screen almost instantly.. it's going from there to the desktop that takes a while.. I haven't run a stopwatch on it but it's several minutes. Then when it's up to the desktop, it's laggy as hell.

I didn't know about the floppy thing, I will try with that :)

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

Re: Hatari loads slow and reports errors on RPi3B running Raspbian

Postby Eero Tamminen » Thu Aug 23, 2018 10:10 pm

If it's several minutes, your Hatari version isn't built properly, or your raspi is otherwise too slow for Hatari.

Are you by any chance emulating something else than 8Mhz ST / STE?

siriushardware
Captain Atari
Captain Atari
Posts: 482
Joined: Thu Aug 21, 2014 7:55 pm
Location: UK

Re: Hatari loads slow and reports errors on RPi3B running Raspbian

Postby siriushardware » Thu Aug 22, 2019 7:42 pm

Just thread jacking because the subject is similar and I think it's a good idea to try to keep all related material in one thread rather than scattering it all over.

I've just complied the latest build of Hatari 2.2.1 and bearing in mind that the Pi 3 is not the speediest platform around I intentionally compiled it with the --disable-sdl2 switch to force it to use SDL1.2 instead. I then discovered that I didn't have SDL (any version) installed anyway, so I went to the SDL website and obtained the source for the latest / final version of SDL1.2 and compiled that, then finally I was able to compile Hatari 2.2.1 for SDL1.2.

I haven't got so far that I can say what the running performance of Hatari is like on the Pi 3, as I have another obstacle to overcome first.

When Hatari runs, the display output it produces is a lot smaller than the available pixel height on the screen, maybe a little over half the total height of the screen. I'm sure that on other versions of Hatari that I have compiled I can remember seeing a checkable 'zoom' box in the display options in the F12 menu which, if I remember correctly, made Hatari render all pixels at double size (width and height) to make the rendered atari screen twice as high and twice as wide. Trouble is I can't see that 'zoom' option anywhere in the F12 GUI in this compiled version.

I've also tried invoking this feature from the command line by running Hatari with the --zoom parameter, but this does not appear to have any effect.

Faucon2001
Atari Super Hero
Atari Super Hero
Posts: 770
Joined: Sat Oct 26, 2013 11:19 pm
Location: France
Contact:

Re: Hatari loads slow and reports errors on RPi3B running Raspbian

Postby Faucon2001 » Fri Aug 23, 2019 9:32 am

Hi,
Well, the easy and fast answer to your need is : “install BeePi “ which is already optimized for RPI3 (see link in my signature)
But as BeePi also include Aranym and a complete Mint OS, it could be too much for you. It’s up to you.

Now, if you want to build Hatari to run on a Pi, it’s kind of tricky, as SDL2 by default is build to run on X only and is not accelerated. As a result, Hatari will be slow like hell (1-2 FPS) and unusable. If you build Hatari with SDL 1.2 on the over hand, it runs at a decent speed under the console frame-buffer, but can’t scale the output full screen.

You have 2 solutions :
1 : use SDL 1.2 and decrease the console resolution to 640x480 and let your monitor do the scaling
2 : build SDL2 for the frame-buffer accelerated dispmanx driver (good luck!) or easier, scavenge a SDL2 build from RetroPie which is already built for the dispmanx :-)
https://files.retropie.org.uk/binaries/ ... _armhf.deb

Regarding using Hatari with midi on a RPI3, it works but not very well. I have done only quick tests, but every time the synchronization was chaotic . The same version of Hatari on a X86 was working perfectly, so I am afraid that the RPI3 may be to slow for midi emulation. But as I said, I have not done deep tests, so it could also come from an incompatibility of my midi usb interface and Raspbian, or a bad optimization.
Philippe

Firebee, Falcon, STE, Aranym Box, Hatari Pi Box.
My music http://www.philippeworld.net/
My photography http://phil-67.deviantart.com/
EasyAraMint, BeeKey and BeePi https://sites.google.com/site/beebox68k/

siriushardware
Captain Atari
Captain Atari
Posts: 482
Joined: Thu Aug 21, 2014 7:55 pm
Location: UK

Re: Hatari loads slow and reports errors on RPi3B running Raspbian

Postby siriushardware » Fri Aug 23, 2019 4:44 pm

Right, the option of setting Raspbian's own graphics resolution lower, closer to ST-resolution did occur to me although it would be a shame to have to alter the overall graphics resolution of the Raspbian install just to make Hatari 'big' enough to use - but there again, another OS is just an SD card swap away, so if that was the only practical method I could have an SD card set up just to run Hatari from.

The information about MIDI is more worrying, though, as that is exactly what I wanted to do with this, to have a pocket-portable version of Cubase2 that I could take anywhere where there's a monitor with an HDMI input. I may as well try it, but I am braced for disappointment.

User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1273
Joined: Fri Feb 08, 2013 12:15 pm
Contact:

Re: Hatari loads slow and reports errors on RPi3B running Raspbian

Postby MasterOfGizmo » Fri Aug 23, 2019 5:35 pm

If all you want is a small and robust cubase2 solution then the MIST board may be a solution for you.
MIST board, FPGA based Atari STE and more: https://github.com/mist-devel/mist-board/wiki

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

Re: Hatari loads slow and reports errors on RPi3B running Raspbian

Postby Eero Tamminen » Sat Aug 24, 2019 7:07 pm

MIDI emulation in Hatari isn't a performance problem, but if you would want to use use something like FluidSynth to emulate also a MIDI device, instead of connecting a real MIDI device to Rpi (don't know how), know that FluidSynth is also fairly CPU intensive.

Faucon2001
Atari Super Hero
Atari Super Hero
Posts: 770
Joined: Sat Oct 26, 2013 11:19 pm
Location: France
Contact:

Re: Hatari loads slow and reports errors on RPi3B running Raspbian

Postby Faucon2001 » Sun Aug 25, 2019 2:25 pm

Use a basic usb to midi interface recognized by RaspBian : mostly all work :-)

I am afraid that’s more Cubase accurate emulation which drains the RPI3. May be a better setup could improve the synchronization?
I believe that Midi on a RPI3 definitely needs to be investigated deeper.

Unfortunately, I ‘ll be far from my midi setup for the next 2 years, until my house be built :-(

It would be nice to dig it.
Philippe

Firebee, Falcon, STE, Aranym Box, Hatari Pi Box.
My music http://www.philippeworld.net/
My photography http://phil-67.deviantart.com/
EasyAraMint, BeeKey and BeePi https://sites.google.com/site/beebox68k/

siriushardware
Captain Atari
Captain Atari
Posts: 482
Joined: Thu Aug 21, 2014 7:55 pm
Location: UK

Re: Hatari loads slow and reports errors on RPi3B running Raspbian

Postby siriushardware » Sun Aug 25, 2019 8:03 pm

Faucon2001, Mist, which I have not looked into at all yet, may indeed be a way forward, but since I already have a Pi 3 and good experiences running Cubase 2 under Hatari for Linux on x86 systems, you will forgive me If I try getting it to work on the Pi first.

Eero, no, all my MIDI is strictly old school midi hardware (synths / tone modules) communicating at 31250 baud, no soft synths in sight. I find that cheap USB to 5-din MIDI interfaces work well with Cubase running under Hatari Linux on x86 systems, I am sure the same interface will be recognised as a MIDI interface under Rasbian, it's just a question of whether it will have the legs to run error free at full Atari speed.

Faucon2001
Atari Super Hero
Atari Super Hero
Posts: 770
Joined: Sat Oct 26, 2013 11:19 pm
Location: France
Contact:

Re: Hatari loads slow and reports errors on RPi3B running Raspbian

Postby Faucon2001 » Mon Aug 26, 2019 4:39 pm

:cheers:
Philippe

Firebee, Falcon, STE, Aranym Box, Hatari Pi Box.
My music http://www.philippeworld.net/
My photography http://phil-67.deviantart.com/
EasyAraMint, BeeKey and BeePi https://sites.google.com/site/beebox68k/

siriushardware
Captain Atari
Captain Atari
Posts: 482
Joined: Thu Aug 21, 2014 7:55 pm
Location: UK

Re: Hatari loads slow and reports errors on RPi3B running Raspbian

Postby siriushardware » Thu Aug 29, 2019 9:02 pm

I finally got everything together to try, and to my amazement it actually works quite well.

Summary:
Raspberry Pi 3 running Raspbian, nothing much altered, except for the display resolution which was altered to 800*600 in the 'Advanced Settings' part of Raspi-Config - this was to get the Hatari screen to occupy a reasonable percentage of the height and width of the display area.

Hatari 2.2.1 compiled from recent build on Github, crucially, with the --disable-sdl2 switch.
Hatari configured for 8Mhz ST, Mono display, 4MB RAM, MIDI enabled

Yamaha SY22 synth in multitimbral mode.

Cheap USB to 5-DIN midi adaptor cable.

I first of all used a self-authored ST MIDI sysex dump utility to load my custom voices into the SY22 - (if not used for a while the internal battery or supercap runs down and it forgets everything) - that worked fine.

Loaded up Cubase 2.0 and loaded a fairly 'busy' 8-track song and started it playing. While playing through the song the CPU usage indicator on the Pi was showing just 21% - however, maybe once or twice during the song replay there was a tiny bit of hesitation, while all the rest of the time replay was perfectly slick and smooth.

I went into the F12 menu / CPU and turned off 'Cycle Exact' emulation - played the song through again quite few times over and there was no sign of the occasional hesitation that there had been before.

At the moment I've only tried Cubase 2 which is the main software I needed to work well on the Pi. I'll try a few hardworking demos in due course, to see how they run.

Faucon2001
Atari Super Hero
Atari Super Hero
Posts: 770
Joined: Sat Oct 26, 2013 11:19 pm
Location: France
Contact:

Re: Hatari loads slow and reports errors on RPi3B running Raspbian

Postby Faucon2001 » Fri Aug 30, 2019 9:19 am

Excellent news !!!
Have you tried the version of SDL2 from retropie ? It works under the console and is accelerated, so it shouldn’t put the cpu under stress and allows you to use Hatari video scaling.
Can you post your hatari config file ? it will be good for others to replicate.
Philippe

Firebee, Falcon, STE, Aranym Box, Hatari Pi Box.
My music http://www.philippeworld.net/
My photography http://phil-67.deviantart.com/
EasyAraMint, BeeKey and BeePi https://sites.google.com/site/beebox68k/

siriushardware
Captain Atari
Captain Atari
Posts: 482
Joined: Thu Aug 21, 2014 7:55 pm
Location: UK

Re: Hatari loads slow and reports errors on RPi3B running Raspbian

Postby siriushardware » Fri Aug 30, 2019 5:16 pm

There's hardly any need for me to post the config file - ST, Mono mode, 4MB, these are settings which anyone running Cubase under Hatari will probably choose by themselves. The only tweak in addition to that was to turn off cycle-exact emulation.

The Pi was running a normal full-fat Raspbian with all the background activity that entails - I think it could be made further immune to occasional 'staggering' If I turned off all the stuff that isn't necessary, such as wifi and so on. I haven't actually tried running Hatari from a pure command line, only from within a terminal in the desktop environment.

My knowledge of Linux is pretty limited so it seems the easiest way for me to try out Retropie's accelerated version of SDL2 is, well, just to load up another card with a version of Retropie which is optimised for the Pi 3. I understand they are still tinkering with optimisation of RetroPie for the Pi 4 so there is not, at present (August '19) an official Pi 4 'spin' of RetroPie.

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

Re: Hatari loads slow and reports errors on RPi3B running Raspbian

Postby Eero Tamminen » Sat Aug 31, 2019 8:31 am

siriushardware wrote:Loaded up Cubase 2.0 and loaded a fairly 'busy' 8-track song and started it playing. While playing through the song the CPU usage indicator on the Pi was showing just 21% - however, maybe once or twice during the song replay there was a tiny bit of hesitation, while all the rest of the time replay was perfectly slick and smooth.

I went into the F12 menu / CPU and turned off 'Cycle Exact' emulation - played the song through again quite few times over and there was no sign of the occasional hesitation that there had been before.


If you used "top" to check CPU usage, press '1' key to see utilization of individual CPU cores. Or, use "htop" which shows that by default.

Hatari is mainly single-threaded (only SDL/pulseaudio audio handling and MIDI read queue run in separate threads), so it can be CPU limited although your average CPU core utilization would be 21%.

If you haven't disabled automatic frame skipping, "FS:" part in statusbar will tell when your machine isn't fast enough to run Hatari at full speed. If that value is sometimes higher than 0, Hatari is skipping displaying video frames in effort to try to catch up.

Hatari manual has some advise on what to do to improve Hatari performance, and what impact they have to emulation: https://hatari.tuxfamily.org/doc/manual ... erformance


Social Media

     

Return to “Hatari”

Who is online

Users browsing this forum: No registered users and 3 guests