sQLux Foibles

Discussion and advice about emulating the QL on other machines.
User avatar
NormanDunbar
Forum Moderator
Posts: 1227
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

sQLux Foibles

Postby NormanDunbar » Wed Jul 15, 2020 10:46 am

This topic is a continuation from one about uqlx, but this is specific to sQLux.

I've cloned the SinclairQL/sQLux repository (https://github.com/SinclairQL/sQLux.git) onto my pi Zero 32 bit Arm, and onto my Linux Mint AMD-64 bit laptop.

Both required libsdl2-dev to be installed:

Code: Select all

sudo apt install libsdl2-dev


32MB later, it compiled with the 'make' command and created qlux. Running 'make install' failed as there is no rule to make target 'qm', needed by install. Looking at the make file, it looks like even if qm existed, nothing would happen. No problem.

Running './qlux -?' works fine and shows the command-line options.

Running './qlux -??' to browse the manuals falls over with a segfault. I tracked this down to the browse_manuals() function in file unixstuff.c. It calls 'loc = qm_findx ("browse_manual");' but doesn't check 'loc' for NULL on return before attempting a 'strncpy()'. It looks like 'qm_findx()' is trying to find the location of the executable to pick up a utility named browse_manual which doesn't (yet?) exist. The search paths in use appear all wrong given where the executable could be running from. (Why not save argv[0] away somewhere? (If the executable path is required?) Or why actually bother if the 'browse_manual' utility is misisng.

Anyway, here are the foibles:

On my pi Zero, it runs. the 'file' command tells me it's an ELF 32-bit executable. I can run it from the command line or in the GUI, with no problems. Other than being diabolically slow, probably due to the SDL stuff as the 2017 X11 version was miles quicker. Startup takes about 5 minutes.

On my laptop, the 'file' command says that it's an Elf 64-bit shared object. It will not run from the file manager, but will from the command line. When it runs, I can type a command, but the RETURN key doesn't get accepted so I cannot actually do anything! I think this is also an SDL foible as I have tried to use another app in the past, written in JavaFX, which I think also uses SDL, and that app has exactly the same problem.


So, in summary:

SDL looks to be a right drag on the pi Zero, better off sticking with the 2017 X11 version, which works far quicker. But can't be used in command line mode, only under the GUI - for obvious (X11) reasons.

SDL looks to be a right pita on my laptop as well!

Not a very successful day so far! :( But when I have more time, I'm at work now, I'll take another look.


Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals - https://www.amazon.co.uk/Arduino-Softwa ... 1484257898, https://www.apress.com/gb/book/9781484257890
Derek_Stewart
Font of All Knowledge
Posts: 2062
Joined: Mon Dec 20, 2010 11:40 am
Location: Runcorn, Cheshire, UK

Re: sQLux Foibles

Postby Derek_Stewart » Fri Jul 17, 2020 7:41 pm

Hi Norm,

I installed SDL2 and compiled sQLux on a Raspberry Pi 3B+, I guess the extra horse power is required.

I was hoping to try all this on my Pi Zero v1.2, with no WiFi or Camera port. But it only does 700Mhz maybe too slow.


Regards,

Derek
swensont
Forum Moderator
Posts: 190
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: sQLux Foibles

Postby swensont » Fri Jul 17, 2020 8:33 pm

I've got sQLux installed on a little netbook ( Intel Atom @ 1.44 Ghz) and it runs just fine. I thought it was an under powered system. I guess the PI is really under powered.

Tim


Derek_Stewart
Font of All Knowledge
Posts: 2062
Joined: Mon Dec 20, 2010 11:40 am
Location: Runcorn, Cheshire, UK

Re: sQLux Foibles

Postby Derek_Stewart » Fri Jul 17, 2020 9:51 pm

swensont wrote:I've got sQLux installed on a little netbook ( Intel Atom @ 1.44 Ghz) and it runs just fine. I thought it was an under powered system. I guess the PI is really under powered.

Tim

Hi Tim,

I have sQLux running on a Pi 3B+ runs okay, I have a Pi 2B+ which runs RISCOS very nicely, I will try running sQLux on it to see the difference.


Regards,

Derek
User avatar
NormanDunbar
Forum Moderator
Posts: 1227
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: sQLux Foibles

Postby NormanDunbar » Sat Jul 18, 2020 8:51 pm

Evening All (did I just hear Dixon of Dock Green?)

I grabbed a book on SDL programming from Packt and wrote a really basic SDL program on the Pi Zero. It displays a window, delays 10 seconds, then exits.

Performance is dire. On my laptop, the window appears, waits, then dies as expected. On the Pi a window appears for a second, vanishes, then the actual window appears, delays and exits. Getting the program to run after pressing Return is very slow indeed. My SD card is a 10 speed one. The whole X11 version of uQLx is up and running quicker than this tiny SDL demo.

I'm running at 700 MHz and in raspi-config's advanced features, I have the default for the GL Driver. I did try the Full option, but on rebooting to command line, logins were not possible as there was no prompt. Ssh logins were ok though. I didn't try the Fake option.

I agree that the Pi might need some extra horse power for running SDL based applications.


Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals - https://www.amazon.co.uk/Arduino-Softwa ... 1484257898, https://www.apress.com/gb/book/9781484257890
User avatar
XorA
Super Gold Card
Posts: 646
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: sQLux Foibles

Postby XorA » Sat Jul 18, 2020 9:13 pm

On a Pi0 setting the zoom to 1 will speed it up massively.

Pi0 basically sucks for GFX scaling, but it seems to run on my Pi0 a little faster than yours :-D


User avatar
NormanDunbar
Forum Moderator
Posts: 1227
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: sQLux Foibles

Postby NormanDunbar » Sat Jul 18, 2020 10:24 pm

Thanks XorA, I'll see what zoom=1 does on my Pi Zero on my next playtime.

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals - https://www.amazon.co.uk/Arduino-Softwa ... 1484257898, https://www.apress.com/gb/book/9781484257890
User avatar
XorA
Super Gold Card
Posts: 646
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: sQLux Foibles

Postby XorA » Sat Jul 18, 2020 11:31 pm

Ok, something has gone really wrong with SDL2 on ARM, as even on my pinebook pro its taking ages to "boot" sQLux. Ive never seen this until now so its something new!


User avatar
XorA
Super Gold Card
Posts: 646
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: sQLux Foibles

Postby XorA » Sun Jul 19, 2020 1:07 pm

This diff should massively speed up the system on a Pi0, it changes the screen refresh to 25 Hz

Code: Select all

diff --git a/SDL2screen.c b/SDL2screen.c
index f522f71..1507289 100644
--- a/SDL2screen.c
+++ b/SDL2screen.c
@@ -82,7 +82,7 @@ int QLSDLScreen(void)
                SDLcolors[i] = SDL_MapRGB(ql_window_format, QLcolors[i].r, QLcolors[i].g, QLcolors[i].b);
 
     SDL_AtomicSet(&doPoll, 0);
-       fiftyhz_timer = SDL_AddTimer(20, QLSDL50Hz, NULL);
+       fiftyhz_timer = SDL_AddTimer(40, QLSDL50Hz, NULL);
 
 }


User avatar
NormanDunbar
Forum Moderator
Posts: 1227
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: sQLux Foibles

Postby NormanDunbar » Sun Jul 19, 2020 3:37 pm

Afternoon XorA,

That helped a lot! Thanks.

It only works in the GUI though, running in terminal mode - as my Pi Zero does, it made zero difference; it took 6 minutes 47 to get from start to exit with me waiting to type in F1 to pick the screen, any key to exit BOOT, then kill_uqlx to exit.

In the GUI though, it's miles better.

So, that solved my first problem, now, how do I get it to use the flipping internationalisation settings for a GB keyboard? Do you know? Everything else I run uses the correct settings, but sQLux seems to think it's using a US keyboard. I get an '@' sign when I want a double quote etc. (I'm not au-fait enough with SDL to figure it out yet.)


Thanks for your help.


Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals - https://www.amazon.co.uk/Arduino-Softwa ... 1484257898, https://www.apress.com/gb/book/9781484257890

Who is online

Users browsing this forum: No registered users and 4 guests