Skip to content

Fix ROCKNIX credentials and offline caching on dual-screen devices (#92, #95) - #98

Merged
misantronic merged 2 commits into
mainfrom
fix/92-95-rocknix-cheevos-config
Aug 10, 2026
Merged

Fix ROCKNIX credentials and offline caching on dual-screen devices (#92, #95)#98
misantronic merged 2 commits into
mainfrom
fix/92-95-rocknix-cheevos-config

Conversation

@misantronic

Copy link
Copy Markdown
Owner

Fixes #92. Fixes #95.

Both issues come from the same fact: on ROCKNIX, retroarch.cfg is not the source of truth. RetroArch is launched as --config .../retroarch.cfg --appendconfig /tmp/.retroarch.cfg, and the append layer outranks the main config.

#92 — "Login Required"

setsettings.sh runs on every game launch and, for each key it manages, seds it out of retroarch.cfg and writes the live value into the appendconfig instead. cheevos_username and cheevos_password are managed that way; cheevos_token and cheevos_custom_host are not, which is why the symptom only appears on devices without a persisted token.

The reporter's device showed the failure exactly: retroarch.cfg held a cheevos_token with no cheevos_username (unusable, since both are required), while the username/password pair sat in the appendconfig we never read.

Both credential paths now consult it:

  • auth.resolve_credentials — the service path, used for caching and awards
  • retroarch_cfg.load_retroarch_credentials — the menu path behind is_logged_in, which draws the status line

Missing the second one is what made alpha8 still report "Login Required" while the service could log in perfectly well. That path had no test coverage at all; it does now.

The appendconfig is written to without truncation between launches, so it is parsed last-wins to match RetroArch.

#95 — "Invalid JSON" offline

On dual-screen devices runemu.sh appends cheevos_custom_host = "http://127.0.0.1:4874" and starts /usr/share/lowerdeck/ra_proxy.py, ROCKNIX's own proxy for the bottom-screen achievement UI. It is a verbatim pass-through with no cache, and offline it answers 502 with an empty body — which RetroArch reports as "Invalid JSON". Because it arrives via the appendconfig, our patched host can never win.

Rather than compete for the port, we start their script ourselves using its own documented flags:

RetroArch -> lowerdeck ra_proxy :4874 -> RAOfflineProxy -> retroachievements.org

runemu.sh only starts an instance when its pgrep finds none, so ours stays in charge. --retroarch-process-match "" disables their watchdog, which would otherwise shut our instance down and let ROCKNIX restart it pointed straight at RetroAchievements. Because that watchdog is off, we stop the child on service shutdown — leaving it behind would point RetroArch at a dead port and break achievements outright, which is worse than the bug.

Every gate fails closed: nothing happens off ROCKNIX, on single-screen devices, or when the script is absent.

Note that DEVICE_HAS_DUAL_SCREEN is not a device whitelist — ROCKNIX counts connected connectors with modetest at boot, so a single-screen handheld booted with HDMI attached also qualifies.

Verification

Confirmed on an AYN Thor (ROCKNIX 20260801) over SSH:

Started lowerdeck ra_proxy chained through http://127.0.0.1:8080
Request: GET /dorequest.php?r=gameid&m=b259... online=True

A request sent to their proxy on 4874 came out of our service log. Then confirmed on a clean install: credentials resolved, login and status correct, game cached, and offline play working.

The reporter independently confirmed both fixes on the same hardware, and that the bottom screen still displays achievements — so chaining preserves ROCKNIX's feature rather than displacing it.

18 new tests, 439 passing.

@misantronic
misantronic merged commit 2c8d9df into main Aug 10, 2026
2 checks passed
@misantronic
misantronic deleted the fix/92-95-rocknix-cheevos-config branch August 10, 2026 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RAOfflineProxy not working on ROCKNIX RAOfflineProxy stuck on Login Required

1 participant