I continue to receive some complaints/comments about the Android and iOS editions of BBC BASIC for SDL 2.0. Although I have tried to provide answers previously, I am going to attempt a more detailed explanation here, in the hope that it will forestall further queries:
What happens?
If you run many programs from the touchide menu in one 'session', BBC BASIC may eventually become unresponsive (e.g. display a blank screen or not react to touch gestures). This is more likely to happen when running programs which switch between OpenGLES 1 and OpenGLES 2 contexts, such as 3D or shader graphics. I don't think BBC BASIC actually 'crashes', because that would normally close the app, but the end result is similar.
Why does it happen?
I strongly suspect that the cause is a resource leak, most likely of a GPU resource like a texture or a buffer object. Eventually, the memory available is filled, no more textures can be created the the app becomes unresponsive. The leak may be in OpenGL, in SDL2 or in the BASIC programs themselves. I think it's highly unlikely to be in BBC BASIC for SDL 2.0, because that would affect all platforms and I've not experienced it in desktop editions.
What can be done about it?
By far the most straightforward solution is simply to close-and-reopen the BBC BASIC app when it happens. This can be done in less than a second, and is harmless. Indeed many years ago I was advised, by somebody who worked in the Apple Store at Lakeside Shopping Centre, that one should always 'force close' an app when it is not in use. He explained that leaving apps running 'in the background' can waste memory and shorten battery life. So I routinely 'swipe away' background apps and for that reason rarely see the issue.
Can't the bug be fixed?
That depends on where it originates. If it's in one or more of the BASIC programs or libraries themselves then certainly it should be possible to fix it, but I've not found any place where a leak might be happening. If it's in SDL2 or OpenGL it's unlikely that anything can be done (I'm not using the very latest version of SDL2, so it's possible that updating it - not easy - might help). Although switching between OpenGLES 1 & 2 contexts is 'supported', it's very unusual and it wouldn't surprise me if it's buggy.
What if I'm still dissatisfied?
Since BBC BASIC for SDL 2.0 is completely free your legal rights to redress are limited - nobody is forcing you to use it! You could complain to my local Trading Standards Department (Norfolk) but I don't think you would get much help from them. You could make a formal complaint to me, perhaps with a request for compensation. Or you could take advantage of the mediation service provided by SafeBuy, details are here.
Complaints about Android and iOS editions
Re: Complaints about Android and iOS editions
I would want to emphasise that the issue discussed does not affect programs developed in BBC BASIC, only programs run multiple times from the touchide utility. I am confident that you can use BBC BASIC to develop applications for Android and iOS which are completely reliable. Indeed, as some of you are aware, I have recently developed the Inverter program and published it on the iOS App Store.Hated Moron wrote: ↑Tue 27 Dec 2022, 10:49 I continue to receive some complaints/comments about the Android and iOS editions of BBC BASIC for SDL 2.0...
If I am right in my suspicion that the issue arises from switching between OpenGLES contexts multiple times, then it simply will not occur in any normal program. Such a program will either be an OpenGLES 1 program (e.g. using only 2D graphics), not involving any context switches at all, or an OpenGLES 2 program (e.g. using 3D or shader graphics) which will require just one context switch at the start.
Re: Complaints about Android and iOS editions
Version 1.34a does use the very latest release of SDL (2.26.2), and now they are putting their effort into SDL3 it's likely to be one of the last ever releases of SDL2. Whether this has had any impact on the occasional crashes of the Android and iOS editions I have no idea, it's too new for any statistics to have been gathered, but if it hasn't helped at least we know that using an old version of SDL2 (2.0.10) wasn't the cause.Hated Moron wrote: ↑Tue 27 Dec 2022, 10:49 If it's in SDL2 or OpenGL it's unlikely that anything can be done (I'm not using the very latest version of SDL2, so it's possible that updating it - not easy - might help).