Douglas Teles 5835c74d6c mipi-generator: route Y3506 Soysauce audio through SPKO direct (no amp)
The Y3506 family (V03/V04/V05 soysauce variants) ships without an
external speaker amplifier on the PCB; the rk817 SPKO line drives
the mono speaker directly. The vendor BSP 4.4 hides this with
hardcoded DAPM widgets and routes in rk817_codec.c, but mainline
ASoC respects the DT strictly, so the speaker stayed muted on every
Y3506 board even though the hardware path exists.

Changes:

config/archr-dts/rk3326-gameconsole-r36s.dts
  Adds three pre-defined sound card variants with status=disabled:
    rk817-sound-amplified (external amp gated by GPIO)
    rk817-sound-simple    (external amp on regulator, no GPIO gate)
    rk817-sound-spko-direct (no external amp, SPKO straight to speaker)
  The default rk817-sound stays active with the historic amp routing,
  so any board the overlay generator cannot positively re-classify
  keeps working as it did in v2.0-rc3.

config/mipi-generator/archr-dtbo.py
  - Picks one of the three variants based on flags + vendor signals:
    NAm flag -> spko-direct (Y3506 family)
    spk-con-gpio / spk-ctl-gpios detected -> amplified
    SRs flag without GPIO -> simple
    otherwise -> keep base DTS default (amp routing)
  - Accepts simple-audio-card,hp-det-gpio as a fallback to hp-det-gpio
    so V05 boards that use the canonical mainline name are no longer
    silently skipped by the audio block.
  - Tolerates missing /pinctrl/headphone/hp-det in the vendor DTB
    (some boards bind via the codec phandle only).
  - Short-circuit branch (odroidgo3 + SDORIG) now still toggles the
    sound card variant when NAm is set, so the six Soysauce batches
    that go through that early return still get spko-direct.
  - Fallback branch when the audio block crashes still applies
    spko-direct when NAm is set (covers six Y3506 V03/V04 batches
    where the vendor DTB omits hp-det-gpio entirely).

config/mipi-generator/generator.sh
  - Appends NAm to every overlay generated under soysauce/, in
    stable order with the existing SDORIG and variant flags.

Audit of all 44 vendor DTBs after the change:
  18 clones    -> default (amp routing preserved)
  15 original  -> default (amp routing preserved)
  11 soysauce  -> spko-direct (V03/V04/V05 all classes covered)

Reported by gemstoned via Discord: Soysauce V05 speaker would not
play under v2.0-rc3 even with HPi/SRs overlay flags toggled. Root
cause traced to (a) the variant nodes referenced by archr-dtbo.py
only existing in eeclone.dts and not in r36s.dts, and (b) the
vendor BSP rk817_codec.c hardcoded DAPM that mainline ASoC ignores.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 20:29:37 -03:00
2026-03-23 14:19:12 -03:00
2026-03-18 17:32:41 -03:00

Arch R

Arch Linux-based gaming distribution for handheld devices.

Latest Version Activity Pull Requests


Arch R is a custom Linux distribution for the R36S handheld gaming console and all its variants, built on top of ROCKNIX with an Arch Linux-based build environment. It supports 16 board profiles and 20 display panels across original and clone hardware.

Features

  • Arch Linux-based build system with Docker support.
  • Kernel 6.12 LTS with board auto-detection via SARADC.
  • Mesa Panfrost open-source GPU driver (GLES 3.1, no proprietary blobs).
  • EmulationStation frontend with RetroArch and 18+ cores pre-installed.
  • Full audio support with speaker/headphone auto-switch.
  • Battery monitoring with capacity reporting and LED warning.
  • 43 pre-generated MIPI panel overlays (15 original + 18 clone + 10 soysauce variants), one per motherboard revision.
  • Separate images for original and clone boards, both with hardware auto-detection.
  • Integrated cross-device local and remote network play.
  • Fine-grained control for battery life and performance.
  • Bluetooth audio and controller support.
  • HDMI audio/video output, USB audio.
  • Device sync with Syncthing and rclone.
  • VPN support with WireGuard, Tailscale, and ZeroTier.
  • Built-in scraping and RetroAchievements.

Supported Hardware

Boards

Board Image
R36S (original), R33S Original
Odroid Go Advance / v1.1 / Super Original
Anbernic RG351V / RG351M Original
GameForce Chi, MagicX XU10 Original
K36 / R36S clones / EE Clone Clone
Powkiddy RGB10 / RGB10X / RGB20S Clone
MagicX XU-Mini-M, BatLexp G350 Clone

Display Panels

Arch R ships 43 pre-generated MIPI panel overlays covering all known R36S display variants, named after the exact motherboard revision (e.g. R36S-V21_2024-12-18_2551.dtbo, G80CA-MB_V1.3-20251212_Panel_8.dtbo). Panel selection is done by copying the correct .dtbo file to overlays/mipi-panel.dtbo on the boot partition. Sources live under config/archr-dts/{original,clone,soysauce}/<MB-revision>/; the build extracts the panel description from each revision's rk3326-r36s-linux.dtb via config/mipi-generator/generator.sh.

Quick Start

Download the latest images from Releases:

  • Original image -- for genuine R36S and compatible boards.
  • Clone image -- for K36 clones and compatible boards.

Flash to a MicroSD card:

xz -d ArchR-R36S-*.img.xz
sudo dd if=ArchR-R36S-*.img of=/dev/sdX bs=4M status=progress
sync

Insert the SD card and power on. The correct board DTB is selected automatically.

Building from Source

Requirements

  • Docker (recommended) or native Linux build environment
  • ~40 GB free disk space
  • ~8 GB RAM recommended

Build

git clone https://github.com/archr-linux/Arch-R.git
cd Arch-R

# Build Docker image (first time only)
make docker-image-build

# Build for R36S (all variants)
make docker-RK3326

Output images are generated in target/.

Build Commands

Command Description
make docker-RK3326 Full build inside Docker
make RK3326 Native build (requires all dependencies)
make docker-image-build Build the Docker build environment
make clean Remove build artifacts

Architecture

Arch R separates board configuration from panel configuration:

  • Board DTB = hardware profile (GPIOs, PMIC, joypad, audio codec). Selected automatically by U-Boot via SARADC.
  • Panel overlay = display init sequence and timings. Applied on top of the board DTB at boot time.

This means the same image works on all boards of a variant. Only the panel overlay needs to match the specific display.

Boot Flow

Power On
  U-Boot (BSP or mainline)
    boot.scr: read SARADC hwrev, select board DTB
    sysboot: load kernel + DTB + overlay from extlinux.conf
  Kernel 6.12 + initramfs
    mount root (ext4) + storage
    switch_root to systemd
  systemd
    archr-autostart (quirks, governors, audio)
    EmulationStation

Partition Layout

Partition Filesystem Label Purpose
1 FAT32 ARCHR Boot (kernel, DTBs, overlays, boot.scr)
2 ext4 ARCHR_ROOT Root filesystem
3 ext4 STORAGE User data, ROMs, configs

Community

Contributions are welcome. Please open issues or pull requests on GitHub.

Licenses

Arch R is a fork of ROCKNIX, which is a fork of JELOS. All upstream licenses apply.

You are free to:

  • Share: copy and redistribute the material in any medium or format.
  • Adapt: remix, transform, and build upon the material.

Under the following terms:

  • Attribution: You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • NonCommercial: You may not use the material for commercial purposes.
  • ShareAlike: If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.

Arch R Software

Copyright (C) 2026-present Arch R

Original software and scripts developed by Arch R are licensed under the terms of the GNU GPL Version 2. The full license can be found in this project's licenses folder.

Bundled Works

All other software is provided under each component's respective license. These licenses can be found in the software sources or in this project's licenses folder. Modifications to bundled software and scripts by upstream projects are licensed under the terms of the software being modified.

Credits

Like any Linux distribution, this project is not the work of one person. It is the work of many people around the world who have developed the open-source components without which this project could not exist.

Special thanks to:

  • ROCKNIX -- the upstream distribution that Arch R is forked from. ROCKNIX provided the complete build system, device support, EmulationStation integration, and the foundation for handheld gaming on Linux.
  • JELOS -- the project that ROCKNIX was originally forked from.
  • CoreELEC and LibreELEC -- the embedded Linux distributions whose build system forms the backbone of this project.
  • Hardkernel -- for the Odroid Go Advance BSP U-Boot and kernel device trees.
  • Rockchip -- for the RK3326 SoC and rkbin firmware.
  • Mesa -- for the Panfrost open-source GPU driver.
  • RetroArch and Libretro -- for the emulation framework and cores.
  • EmulationStation -- for the frontend.
  • All developers and contributors across the open-source community who made this possible.
S
Description
No description provided
Readme 473 MiB
Languages
Makefile 52.4%
Shell 36.1%
Python 7.4%
C 2%
C++ 0.9%
Other 1.2%