Running headless on a Raspberry Pi

Discussions related specifically to the Windows, Linux (86), Mac OS-X and Raspberry Pi editions of BB4W and BBCSDL
Richard Russell
Posts: 702
Joined: Tue 18 Jun 2024, 09:32

Running headless on a Raspberry Pi

Post by Richard Russell »

I discovered that a program which I was running 'continuously' on a Raspberry Pi 4 slowed down significantly when I turned off the (HDMI) monitor it was feeding. The culprit was a *REFRESH command, which waits for the next 'vertical sync'; evidently without the monitor running this was taking much longer than the usual maximum of 20 ms.

The solution was to remove all the *REFRESH commands from the program; this introduced display flicker, but I was able to use a different approach to eliminate it. I suppose it should have been obvious that I shouldn't include a *REFRESH in a program designed to run 'headless' (outputting to the screen, but only for information and diagnostic purposes).

An alternative solution might be to adapt the program to run in the Console Mode edition of BBC BASIC, but that would need a significant amount of effort.