Raspberry Pi performance

Discussions related specifically to the Windows, Linux (86), Mac OS-X and Raspberry Pi editions of BB4W and BBCSDL
guest
Posts: 268
Joined: Mon 02 Apr 2018, 09:12

Raspberry Pi performance

Post by guest » Fri 02 Nov 2018, 13:02

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
Posts: 86
Joined: Wed 04 Jul 2018, 16:23

Re: Raspberry Pi performance

Post by David Williams » Fri 02 Nov 2018, 15:24

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
Posts: 268
Joined: Mon 02 Apr 2018, 09:12

Re: Raspberry Pi performance

Post by guest » Fri 02 Nov 2018, 15:47

David Williams wrote:
Fri 02 Nov 2018, 15:24
I'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
Posts: 86
Joined: Wed 04 Jul 2018, 16:23

Re: Raspberry Pi performance

Post by David Williams » Sun 04 Nov 2018, 14:37

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
Posts: 268
Joined: Mon 02 Apr 2018, 09:12

Re: Raspberry Pi performance

Post by guest » Sun 04 Nov 2018, 15:24

David Williams wrote:
Sun 04 Nov 2018, 14:37
Typing '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
Posts: 268
Joined: Mon 02 Apr 2018, 09:12

Re: Raspberry Pi performance

Post by guest » Sun 04 Nov 2018, 15:37

David Williams wrote:
Sun 04 Nov 2018, 14:37
I 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
Posts: 86
Joined: Wed 04 Jul 2018, 16:23

Re: Raspberry Pi performance

Post by David Williams » Sun 04 Nov 2018, 17:10

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
Posts: 268
Joined: Mon 02 Apr 2018, 09:12

Re: Raspberry Pi performance

Post by guest » Sun 04 Nov 2018, 17:40

David Williams wrote:
Sun 04 Nov 2018, 17:10
My 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
Posts: 268
Joined: Mon 02 Apr 2018, 09:12

Re: Raspberry Pi performance

Post by guest » Sun 04 Nov 2018, 18:45

David Williams wrote:
Sun 04 Nov 2018, 17:10
However, 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: 138
Joined: Mon 02 Apr 2018, 21:51

Re: Raspberry Pi performance

Post by p_m21987 » Sun 04 Nov 2018, 19:58

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

Post Reply