-
Notifications
You must be signed in to change notification settings - Fork 32
R36 Control Centre
Customisable Battery Warning LEDs + Hardware Detection for R36S / Clones / Soy Sauce
This service solves the biggest pain point for RK3326 R36S-style handhelds on dArkOS RE:
Different mainboards use different GPIO pins for status LEDs (or PMIC control), and many DTBs define these GPIOs → causing conflicts or no LED control in userspace.
The solution:
- Remove LED / battery / charger GPIO definitions from DTB nodes (or override them) so userspace owns the LEDs.
- Early-boot script (
r36_config.sh) detects hardware via/proc/cpuinfo. - Selects the correct battery warning Python script from
/usr/local/bin/r36_config/batt_life_warning/. - Persists settings in
/etc/r36_config.ini. - Provides a friendly R36 Control menu (under Options) to change LED behaviour, gamma, audio path, boot volume, etc.
Goal: Support R36 variants — genuine R36S (PMIC LEDs), Soy Sauce (Y3506), clones (G80C / G80CA / etc.) — without breaking DTB compatibility for screen / other hardware.
- Automatic hardware detection & LED script selection on first boot/hardware change
- Safe override: LED control moved to Python scripts (no DTB GPIO conflict)
- Gamma correction persistence (Soy Sauce often oversaturated, clones under-saturated)
- ALSA Playback Path (SPK_HP vs SPK) + optional persistent boot volume
- User-friendly R36 Control menu:
- Choose LED warning style (Blue/Purple/Red, Off variants, etc.)
- Adjust gamma (0.4–1.8, live preview hint)
- Toggle audio routing & set/clear boot volume
- View/delete config (reset to defaults on reboot)
- Logging to
/boot/darkosre_device.log - Updated DTBs included (UHS removed from Soy Sauce for max compatibility)
-
Early boot (
r36-config.service→r36_config.sh):- Reads Hardware string from
/proc/cpuinfo - Looks up variant in
/boot/dtb/r36_devices.ini - If no
/etc/r36_config.inior hardware changed → creates config + selects matching LED script - Applies gamma, ALSA path, default 80% volume (only on first boot/change)
- Symlinks correct
batt_life_warning.py
- Reads Hardware string from
-
Battery warning (
batt_led.service):- Runs the selected Python script
- Monitors battery → controls LEDs via sysfs (
/sys/class/leds/or exported GPIOs) - Different scripts for each variant (colour/thresholds)
-
User changes via R36 Control menu:
- Overrides script, gamma, audio path/volume
- Persisted in config.ini
(Assumes you're on dArkOS RE from southoz repos)
-
Update your image or copy files manually:
/usr/local/bin/r36_config.sh-
/usr/local/bin/r36_config/batt_life_warning/(all .py scripts) -
/etc/r36_config.ini(created automatically) /boot/dtb/r36_devices.ini- Systemd service:
/etc/systemd/system/r36-config.service - Menu integration for "R36 Control" under Options
-
DTB preparation (critical for clones/Soy Sauce):
- Use the updated DTBs included (or from your repo)
- Ensure LED/charger/battery GPIO nodes are removed or disabled in the DTB → otherwise DTB fights userspace → LEDs may not work or conflict
-
Reboot → service runs → config created → LEDs should work.
Launch from EmulationStation → Options → R36 Control
Main options:
-
Select Battery LED Warning Type
Pick script matching your variant (filtered for known devices; full list for unknown) -
Adjust Gamma Correction
0.4–1.8 range. Changes apply on reboot.
Tip: Hold R3 + D-Pad Left/Right for live preview (if gamma tool supports it) -
Audio Controls
- Playback Path: SPK_HP (jack detection) or SPK (speaker only)
- Boot Volume: Set fixed % or Clear to regain manual control
-
Utilities
- View current config
- Delete config (resets to defaults on reboot)
| File | Fully Charged | 🔌 | 🔋 | 🔋 | 🔋 |
|---|---|---|---|---|---|
| Clone_Blue_30_Purple_10_Red.py | TBA | 🔴 | >30% 🔵 | >10% Purple | <=10% 🔴 |
| Clone_Off_30_Purple_10_Red.py | TBA | 🔴 | >30% Off | >10% Purple | <=10% 🔴 |
| Clone_Off_10_Red.py | TBA | 🔴 | >10% Off | <=10% 🔴 | |
| Clone_PMIC_Controlled.py | TBA | 🔴 | |||
| SoySauce_Blue_30_Pink_10_Red.py | TBA | 🔴 | >30% 🔵 | >10% Pink | <=10% 🔴 |
| SoySauce_Off_30_Pink_10_Red .py | TBA | 🔴 | >30% Off | >10% Pink | <=10% 🔴 |
| SoySauce_Off_10_Red.py | TBA | 🔴 | >10% Off | <=10% 🔴 | |
| SoySauce_PMIC_Controlled.py | TBA | 🔴 | |||
| R36S_Green_30_Red.py | TBA | Orange | >30% 🟢🔵 | <=30% 🔴 | |
| R36S_Green_20_Red.py | TBA | Orange | >20% 🟢🔵 | <=20% 🔴 | |
| R36S_Green_10_Red.py | TBA | Orange | >10% 🟢🔵 | <=10% 🔴 | |
| R36S_PMIC_Controlled.py | TBA | 🔴 | 🟢🔵 |
- Genuine R36S often use PMIC-controlled LEDs (Green/Orange) → limited userspace control. Scripts focus on Red warning.
- Soy Sauce DTBs have UHS removed from SD card → better compatibility (no speed loss — see linked test).
- Audio init issues on some V12 clones → may need sleep/wake cycle (handled in some ogage binaries).
- If LEDs don't work → check DTB has no conflicting GPIO definitions.
- Unknown hardware → defaults to clone-like behavior + full script list.
- Logs:
/boot/darkosre_device.log
Untested boards welcome!
Report:
- Motherboard string (
cat /proc/cpuinfo | grep Hardware) - Which LED script works best
- Any GPIO / DTB conflicts
Pull requests for new scripts, DTB tweaks, or ini entries are appreciated.
Thanks to testers: 66dude, darrynmelck, Ace007186 (Discord), and the broader R36S community.
- Firmware Installation
- Firmware Upgrade
- Audio and Screen Controls
- EmulationStation
- Retroarch Hotkeys
- Kodi
- PortMaster
- Customising your Device
- Arcade (arcade)
- CAPCOM Play System 1 (cps1)
- CAPCOM Play System 2 (cps2)
- CAPCOM Play System 3 (cps3)
- MAME 2003 (mame2003)
- MAME 2010 (mame)
- Nintendo 64 (n64)
- Nintendo Entertainment System (nes)
- Nintendo Famicom (famicom)
- Nintendo Famicom Disk System (fds)
- Super Nintendo Entertainment System (snes)
- NEC PCE Engine (pcengine)
- NEC PC Engine CD (pcenginecd)
- NEC Turbografx 16 (turbografx)
- NEC Turbografx 16 CD (turbografxcd)
- Nintendo Super Famicom (sfc)
- Sega Master System (mastersystem)
- Sega Megadrive (megadrive)
- Sega Genesis (genesis)
- Sega CD (segacd)
- Sega 32x (sega32x)
- Sega Dreamcast (dc)
- Sega Saturn (saturn)
- Sony Playstation (psx)
- SNK Neo Geo (neogeo)
- SNK Neo Geo CD (neogeocd)
- Nintendo DS (nds)
- Nintendo GameBoy (gb)
- Nintendo Gameboy Color (gbc)
- Nintendo Gameboy Advanced (gba)
- Sega Game Gear (gamegear)
- Sony Playstation Portable (psp)
The guides below are for ArkOS-G80CA; once they are above this marker, they are relevant.
- Commodore 64 (c64)
- Amiga (amiga)
- Amiga CD32 (amigacd32)
- ZX Spectrum (zxspectrum)
- Doom (doom)
- SNK Neo Geo Pocket (ngp)
- SNK Neo Geo Pocket Color (ngpc)
- MSX (msx)
- MSX2 (msx2)
- Atari ST (atarist}
- Atari 2600 (atari2600)
- Atari 5200 (atari5200)
- Atari 7800 (atari7800)
- Mattel Intellivision (intellivision)
- Sega SG‐1000 (sg‐1000)
- Atari Lynx (atarilynx}
- Bandai WonderSwan (wonderswan)
- Bandai WonderSwan Color (wonderswancolor)
- Amstrad CPC (amstradcpc)
- Apple II (apple2)
- Atari 800 (atari800)
- BBC Micro (bbcmicro)
- Ports (ports)