Repository navigation
feat: add RK3566 / ROCKNIX port - #279
Closed
hansfbaier wants to merge 2 commits into
Closed
hansfbaier wants to merge 2 commits into
hansfbaier wants to merge 2 commits into
Conversation
Cross-compiles LittleGPTracker for RK3566 handhelds running ROCKNIX (Powkiddy RGB30 and friends), linking against the target's own SDL2 so the deliverable is a single executable. Verified on an RGB30: it launches, fills the 720x720 panel, reads the gamepad and plays audio. Port files: - projects/Makefile.RK3566: build target, with RK3566DIRS/RK3566FILES registered in projects/Makefile and the packaging script - projects/resources/RK3566: config.xml, mapping.xml, launch script, sysroot setup and a demo-song fetcher Shared SDL2 adapter changes: - SDLGUIWindowImp: separate drawing from presentation. The 320x240 screen is drawn at 1:1 into a fixed surface and Flush() scales it onto the window with SDL_BlitScaled, so the UI can fill a panel that is not a whole multiple of the app resolution. A fullscreen window used to keep its app-sized surface, and whole-number scaling capped a 720x720 panel at 2x, which left the text unreadably small. Adds an opt-in LGPT_SCREENSHOT diagnostic. - SDLEventManager: configurable quit hotkey (QUITBUTTONS), because the tracker's only quit control is the project picker's Exit button, which cannot be reached once a project is loaded. Also map SDL joystick instance ids back to the index the device was opened with, rather than indexing four-element arrays with them directly - which overran as soon as a second controller was hotplugged. - SDLAudioDriver: include <string.h> for memcpy/memmove, which newer libstdc++ headers no longer pull in transitively.
The port was built with DUMMYMIDI, so the tracker had a stub that enumerated nothing and opened nothing. Build the bundled RtMidi with its ALSA sequencer backend instead and link libasound: the ALSA sequencer is how the kernel presents USB MIDI interfaces (snd-usb-audio is built into ROCKNIX), and it is independent of the audio server, so PipeWire and aseqnet ports work through it too. - projects/Makefile.RK3566: RTMIDI plus __LINUX_ALSA__/__LINUX_ALSASEQ__ instead of DUMMYMIDI, and -lasound. Both spellings are defined because RtMidi 1.0.8 guards its ALSA code with the ALSASEQ one, which the desktop makefiles only get right by accident. - setup-sysroot.sh: fetch the alsa-lib headers matching the device's libasound and copy the library itself into the sysroot. A runtime image has neither. - Application::initMidiInput: accept "*" for MIDICTRLDEVICE, meaning every input present. The name of an interface has to be known in advance to be written into a config file, and on a handheld it is not; without a match the tracker opens no MIDI input at all. - RTMidiInDevice/RTMidiOutDevice: RtMidi signals failure by throwing, and the port index comes from a list built earlier, so an interface unplugged in between took the tracker down with it. Report the failure and disable that one device instead. This is the case USB MIDI makes ordinary. - config.xml: MIDICTRLDEVICE='*', documented together with how MIDI events are mapped onto tracker controls. Verified on the device over the kernel's Midi Through loopback, which is an ordinary sequencer client and so exercises the same code a USB interface would. Input: a note 60 received through the mapping moved the song grid cursor, by the press-plus-autorepeat count a held button produces. Output: playback opened the tracked output port and aseqdump captured the Start byte and 238 clock messages. The desktop X64 target still builds with the shared adapter changes. The RGB30's USB-C port is a peripheral in the device tree and ROCKNIX binds its MTP/CDC gadget to it, so a keyboard attached there will not enumerate. That is a property of the port; everything above the kernel is in place.
Owner
|
Thank you for contributing to Little Piggy Tracker. I currently have very little time for maintaining this fork, thank you for understanding. From what I can tell, this device combination is compatible with portmaster that can install Piggy. Maintaining a device is continuous work, rarely a one-shot. What does this merge request contribute that can't be achieved using Portmaster? |
Author
|
Ok understood. Thanks for explaining. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a build target and platform resources for RK3566 handhelds running
ROCKNIX — Powkiddy RGB30, Anbernic RG-ARC and friends.
The port is cross-compiled on an x86_64 host but links against the target's own
SDL2, so the deliverable is a single executable: no bundled libraries, fonts or
C library.
What is added
projects/Makefile.RK3566projects/MakefileRK3566DIRS/RK3566FILESprojects/resources/RK3566/config.xml,mapping.xml, launch script, sysroot setup, demo-song fetcherprojects/resources/packaging/lgpt_package.shREADME.mddocs/RK3566_PORT.mdShared changes
SDLGUIWindowImp— drawing and presentation are now separate. The 320x240screen is drawn at 1:1 into a fixed surface and
Flush()scales it onto thewindow with
SDL_BlitScaled. Previously a fullscreen window kept its app-sizedsurface, and whole-number scaling capped a 720x720 panel at 2x, which left the
text unreadably small (an 8x8 glyph is about 1.6 mm on that display).
This is the one change that touches other platforms, so in detail:
SCREENMULTtimes theapp size and the app fills it;
SCREENMULTbecomes a presentation scale rather than a drawing scale, so aplatform setting it (RG35XXPLUS sets 2) gets the same picture as before;
centred, instead of drawing at whole multiples in a corner;
Flush()always presents the full window rather than partial update rects.SDLEventManager— quit hotkey and an array overrun. A configurableQUITBUTTONSvalue quits the tracker when those joystick buttons are heldtogether, because its only quit control is the project picker's Exit button,
which cannot be reached once a project is loaded. Separately, SDL2 reports a
joystick instance id in
event.jbutton.which; the code indexed four-elementarrays with it directly, which overran as soon as a second controller was
hotplugged. Events are now mapped back to the index the device was opened with.
SDLAudioDriver— includes<string.h>formemcpy/memmove, which newerlibstdc++ headers no longer pull in transitively.
Verified on
Powkiddy RGB30, ROCKNIX 20240815, kernel 6.9.12, glibc 2.38, SDL2 2.30.5:
GLIBC_2.38/GLIBCXX_3.4.32; the device providesGLIBC_2.38/GLIBCXX_3.4.33;button numbers derived from the kernel's evdev layout and cross-checked
against EmulationStation's own controller configuration;
Bootloop-FastJump.Caveats for review
SDLGUIWindowImpchange isplatform-neutral as far as I can tell, but X64, X86 and RG35XXPLUS were not
run — worth a look before merging.
framebuffer_path used to skip presenting entirely;Flush()nowalways presents. That should be an improvement for fbcon targets but is
untested there.
DUMMYMIDI) and ffmpeg sample import is not compiled in, ason the other handheld ports.
docs/RK3566_PORT.mdhas the full build and deploy instructions.