Lagrange on Powkiddy RGB30 (RK3566)

📅 2026-03-18

🏷 Lagrange, Gaming

I've had a soft spot for the Sega Game Gear ever since I unwrapped one as a Christmas gift when I was about 11 years old. Handheld gaming has always been a bit of a magical experience; in the late 80s we had the Nintendo Game & Watch gadgets. Vivid memories of a particular orange Donkey Kong device have been burnt into my brain. The Game Gear really leveled up the experience, though, lackluster color LCD and poor battery life notwithstanding.

I did not get much into Nintendo handhelds until much later when I bought the Nintendo DS Lite and played an unhealthy amount of Puzzle Quest on it.

Anyway, nowadays we have awesome hardware in the form of ARM CPUs and GPUs. A random fedi post brought the Powkiddy RGB30 to my attention: a nice little Linux retro-oriented gaming handheld with a quad-core 1.8 GHz ARM Cortex-A55 CPU, Mali G52 GPU, 1 GB RAM, and a 720x720 4" display. Hard to believe this is mid-2000s desktop-class performance in a little pocketable Linux machine.

60€ and a couple of weeks later, I was marveling at the little device in person. Apart from retro gaming, I was immediately intrigued about the potential for running my own software on it.

Cross-compiling

Out of the box, the device runs a build of JELOS from 2023 (a bare-bones aarch64 Linux) with glibc 2.38. There are apparently cross-compilation toolchains available somewhere (and a more modern ROCKNIX OS), but I did not want to bother with those. Surely I can just build on a comparable aarch64 Linux system and, given the dependencies are met, the binary should just work?

After a little sleuthing I settled on an arm64 Debian 12 Bookworm VM. This is only slightly older than the JELOS build, so library dependencies should be compatible.

I was playing around with SDL3 a while back and noticed it has official support for Rockchip GPUs via the `SDL_ROCKCHIP` build option, which depends on a library called libmali. Searching the web turned up multiple variants; fortunately, in the device logs I found details about which one to use (namely, "G52 g13p0"). Next thing I knew, I had a fully-functional build of SDL3 (and later, SDL2) running on the device with access to OpenGL ES 3.2, audio, and gamepad controls.

Handheld Lagrange

The binary compiled on the arm64 Debian ran pretty much out of the box on the RGB30. Of course, the device has no keyboard and mouse, so there was no way to control the UI, or even quit the app.

I've been working on adding gamepad controls to Lagrange. It's somewhat of a mixture of mouse and keyboard input: a virtual pointer you can move with a thumbstick lets you click on arbitrary elements in the UI and page, while the D-pad and buttons are also used for navigation, clicking on buttons, and as shortcuts for actions like opening menus and focusing the URL field. It is really its own input modality alongside the existing mouse, keyboard, and touchscreen controls, remixing some elements while adding a few twists. Some gamepads, like PlayStation ones, also have their own touch input area that can be used as an alternative way to move the virtual pointer and click on buttons and links.

Having a method for entering text is crucial, and on a device that only has basic gamepad controls, text entry must happen using an on-screen keyboard (unless you plug in an external keyboard, I suppose). Given that Lagrange uses a homegrown GUI, there's no ready-made virtual keyboard. I decided to make my own. This was actually a pretty cool challenge. When you consider modern phone keyboards, they have all sorts of built-in language localization features, swipe gestures, mode switches, and emoji pickers. None of that is really mandatory, though. At a really basic level, a plain old U.S. English QWERTY keyboard is quite sufficient. It was fairly easy to make the keyboard configurable with alternative regional layouts. For instance, I wanted a Finnish/Swedish layout for myself. The system lets you lay out rows of keys using a config file, and keys can act as modifiers that switch to different pages of keys.

In the v1.20 release, both the gamepad controls and the handheld UI variant are still in a bit of an experimental state. They could use a little more polish. For instance, a GUI setting for selecting the virtual keyboard layout would be nice.

You can download an RK3566/aarch64 build of Handheld Lagrange here:

CC-BY-SA 4.0

The original Gemtext version of this page can be accessed with a Gemini client: gemini://skyjake.fi/gemlog/2026-03_rgb30.gmi