Raspberry Pi performance

Discussions related specifically to the Windows, Linux (86), Mac OS-X and Raspberry Pi editions of BB4W and BBCSDL
guest

Raspberry Pi performance

Post by guest »

In another thread the relatively poor performance of BBCSDL on a Raspberry Pi has been commented upon. I don't think this should be at all surprising: the RPi is a £35 computer with a significantly slower CPU and a significantly poorer GPU than would be found in a typical modern smartphone or tablet. Also, the RPi doesn't officially support hardware-accelerated OpenGL (although the 'experimental' VC4 driver goes some way to addressing this).

Nevertheless I don't actually believe its performance is too bad given the circumstances. Here is a video of a sprite 'stress test' running on a Raspberry Pi 3 (not the latest model); there are 80 large sprites (full 32-bit RGBA), being scaled and rotated in real time, plotted with shadows over a 640 x 480 bitmap image background, at a fairly constant 50 fps (the frame rate of the attached TV):

http://www.youtube.com/watch?v=00SoJIN3wak
David Williams

Re: Raspberry Pi performance

Post by David Williams »

guest wrote: Fri 02 Nov 2018, 13:02 Nevertheless I don't actually believe its performance is too bad given the circumstances. Here is a video of a sprite 'stress test' running on a Raspberry Pi 3 (not the latest model); there are 80 large sprites (full 32-bit RGBA), being scaled and rotated in real time, plotted with shadows over a 640 x 480 bitmap image background, at a fairly constant 50 fps (the frame rate of the attached TV):
http://www.youtube.com/watch?v=00SoJIN3wak
Good show.

I would be very pleased with that performance, and I'd like to try it on my Raspberry Pi 3 model B, and study the source code for its instructive value.

David.
--

PS. I'm thinking of treating myself to an RPi 3B+ for that extra 200 MHz of CPU horsepower :D
guest

Re: Raspberry Pi performance

Post by guest »

David Williams wrote: Fri 02 Nov 2018, 15:24I'd like to try it on my Raspberry Pi 3 model B, and study the source code for its instructive value.
I expect I will include it as an example with the next release (should be quite soon); that is my usual habit. But the sprite plotting code is substantially identical to that in the BBCSDL version of snake.bbc (or indeed the BBCSDL version of Forces of Darkness), so nothing you're not familiar with.
David Williams

Re: Raspberry Pi performance

Post by David Williams »

I have just installed BBCSDL (Raspberry Pi) v0.26a on my Raspberry Pi 3 model B, running the latest version of Raspbian Stretch.

Having followed your installation instructions to the letter, I understand the 'experimental' VC4 GL Driver to be enabled.

Running the '80 Aliens' demo (aliens.bbc) on this machine, I get 38 fps/avg with pretty jerky movement, and after reducing the number of aliens to 5, I get around 51 fps on a 60 Hz monitor.

Running the glxgears demo (which I realise is not a benchmark) shows the animation running at 60 fps.

Typing 'glxgears -info' in the Linux terminal produces the following information (severely snipped for brevity):

Code: Select all

libGL error: MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to retrieve device information
Running synchronized to the vertical refresh. The frame rate should be approximately the same as the monitor refresh rate.
GL_RENDERER = Gallium 0.4 on VC4 V3D 2.1
GL_VERSION = 2.1 Mesa 13.0.0
GL_VENDOR = Broadcom
GL_EXTENSIONS = (long list of extensions)

I have no idea what the cause of the poor '80 Aliens' performance is on my machine.


David.
--
guest

Re: Raspberry Pi performance

Post by guest »

David Williams wrote: Sun 04 Nov 2018, 14:37Typing 'glxgears -info' in the Linux terminal produces the following information (severely snipped for brevity)
The only difference here is:

Code: Select all

GL_VERSION = 2.1 Mesa 13.0.6
What kind and resolution of monitor are you using? Mine's an HDTV running at 720p (1280 x 720 x 50Hz); I assume it's likely that if you ask the RPi to run at a higher resolution and/or framerate the performance could be impacted. For a more 'informed' response you should probably ask at the Raspberry Pi forum.

Incidentally if you think the RPi is slow my Samsung Galaxy Tab S2 runs 'aliens.bbc' at only about 25 fps, making it on that measure the slowest of all my devices. On the other hand my fastest Windows 10 PC can manage 60 fps even with the number of aliens increased to 800!! Running the 64-bit Windows edition of BBCSDL (that's the interpreter compiled from C) it can still do 800 aliens at 60 fps which I think is bloody amazing.
guest

Re: Raspberry Pi performance

Post by guest »

David Williams wrote: Sun 04 Nov 2018, 14:37I get 38 fps/avg with pretty jerky movement
I should add that (and I know you're perfectly well aware of this) the "jerky movement" isn't meaningful. As soon as the rendering cannot keep up with the display refresh rate of course the movement will become jerky, because sometimes the animation 'period' will be (in my 50 fps case) 1/50 second and sometimes 1/25 second. What I would do in those circumstances is to code the program so that it always runs at half the monitor's refresh rate (25 fps or 30 fps as appropriate) because that way the movement will at least be 'smooth'. Much as I personally dislike it, many producers and directors are quite convinced that 25Hz ('film') motion is not only acceptable but actually improves the subjective quality!
David Williams

Re: Raspberry Pi performance

Post by David Williams »

guest wrote: Sun 04 Nov 2018, 15:24 What kind and resolution of monitor are you using? Mine's an HDTV running at 720p (1280 x 720 x 50Hz); I assume it's likely that if you ask the RPi to run at a higher resolution and/or framerate the performance could be impacted.


Samsung S22F350 22-Inch HDMI LED Monitor
Max. resolution: 1920 x 1080 pixels (1080p Full HD)

However, I don't know if that's the resolution the Raspbian desktop is running at.

When I try to change/set the resoluton via Applications Menu -> Preferences -> Raspberry Pi Configuration -> (under System tab) Set Resolution,
the machine just hangs without displaying anything at all. Just clicking "Set Resolution" instantly hangs the machine. My presumption (and you''ll set me straight!) is that after clicking that button, the current display resolution will be shown.

Does it cause your RPi to hang as well?

Running the 64-bit Windows edition of BBCSDL (that's the interpreter compiled from C) it can still do 800 aliens at 60 fps which I think is bloody amazing.
Indeed it is.


David.
--
guest

Re: Raspberry Pi performance

Post by guest »

David Williams wrote: Sun 04 Nov 2018, 17:10My presumption (and you''ll set me straight!) is that after clicking that button, the current display resolution will be shown.
Don't assume I know more about the RPi than you do!
Does it cause your RPi to hang as well?
Yes ('The window "Raspberry Pi Configuration" does not seem to be responding'). Nasty.
Indeed it is.
It even breaks Windows Game Recorder's MPEG4 encoding:

http://www.youtube.com/watch?v=wzTaJhaF47Q
guest

Re: Raspberry Pi performance

Post by guest »

David Williams wrote: Sun 04 Nov 2018, 17:10However, I don't know if that's the resolution the Raspbian desktop is running at.
I'm thinking that a low-tech approach (display a known window size in BBC BASIC and use a ruler!) will get you pretty close to the answer.
p_m21987
Posts: 177
Joined: Mon 02 Apr 2018, 21:51

Re: Raspberry Pi performance

Post by p_m21987 »

The "xrandr" command should tell you the current display resolution. I don't remember if it's installed by default.