feat(kiosk): graphics tiers + Settings knob; network map kiosk mode
Demo images / Build & push demo images (push) Successful in 3m51s

The animated federation map froze the framework-pt 4K TV: the launcher
held every machine to the HD 5500-era choppy-audio flags (single raster
thread, GpuRasterization banned) while the map wrote SVG attrs at 60fps.

- Launcher: two flag tiers. legacy = the proven conservative set; modern
  (Intel gen8+, 'NNth Gen' models, AMD Ryzen) = default raster threads +
  GPU rasterization. Classified from /proc/cpuinfo (11 model strings
  covered by tests in-session); KIOSK_GRAPHICS=performance|quality in
  kiosk-display.conf overrides; headless unchanged. Reaches deployed
  kiosks via the include_str! self-heal, same as the vsync fix.
- system.kiosk-display.get/set: carries a 'graphics' field alongside
  'preset'; setting one no longer clobbers the other.
- Settings → Display: Graphics picker (Auto / Compatibility / Quality).
- NetworkMap3D: kiosks default to the 2D projection (remembered toggle
  still works) and tick at half rate with carried-over deltas — same
  spin speed, half the paint cost.
- Changelog: curated Unreleased notes for all of the above + the gate
  frame-embedding fix.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
archipelago
2026-08-13 09:23:07 -04:00
co-authored by Claude Fable 5
parent 6672d978f7
commit 9243babcdb
5 changed files with 203 additions and 30 deletions
+6
View File
@@ -1,5 +1,11 @@
# Changelog
## Unreleased
- **Apps that refused to open inside the dashboard now embed like everything else.** Some apps ship browser headers that forbid being shown inside another page — correct hardening on the open web, but inside Archipelago it produced a dead grey pane when you opened them from My Apps (Alby Hub was the first to hit it). The app gate, which already checks your login on every request to an app, now removes just those framing headers on the way through; each app's own content-security rules pass through untouched. No more per-app proxy workarounds.
- **The network map no longer freezes kiosk TVs.** The animated federation map at 4K was too much for the deliberately conservative graphics settings the on-screen display used on every machine — settings chosen years back to stop audio crackle on much older hardware. Two fixes: on kiosk screens the map now opens in its flat 2D view (the 3D globe is one tap away, and remembered) and animates at half rate — invisible from the couch, half the work. And the display itself now recognizes what machine it runs on: older kiosk boxes keep the proven careful settings, modern ones finally get real GPU rendering.
- **New Settings → Display → Graphics choice for the on-screen display.** Auto (recommended) picks the right rendering mode for the machine by itself; Compatibility forces the most conservative mode if a screen ever stutters, tears, or crackles; Quality forces full GPU rendering on hardware the automatic detection doesn't recognize. Changing it restarts the on-screen display, like the size presets.
## v1.8.0-alpha (2026-08-12)
- **Archipelago is now open source.** The full source code of the node you are running — the orchestrator, the dashboard, the app platform, the mesh, the release tooling — is published for anyone to read, build and audit at source.archipelago-foundation.org/lfg2025/archy. A node that holds your money, your files and your communications should not ask to be taken on faith: from this release onward you, or anyone you trust, can see exactly what it does and follow every change we make in the open.
+52 -13
View File
@@ -1268,7 +1268,14 @@ impl RpcHandler {
} else {
"auto"
};
Ok(serde_json::json!({ "has_kiosk": has_kiosk, "preset": preset }))
let graphics = if conf.contains("KIOSK_GRAPHICS=performance") {
"performance"
} else if conf.contains("KIOSK_GRAPHICS=quality") {
"quality"
} else {
"auto"
};
Ok(serde_json::json!({ "has_kiosk": has_kiosk, "preset": preset, "graphics": graphics }))
}
/// system.kiosk-display.set — Write the kiosk display preset and restart
@@ -1279,24 +1286,56 @@ impl RpcHandler {
params: Option<serde_json::Value>,
) -> Result<serde_json::Value> {
let params = params.ok_or_else(|| anyhow::anyhow!("Missing params"))?;
let preset = params
.get("preset")
.and_then(|v| v.as_str())
.ok_or_else(|| anyhow::anyhow!("Missing preset"))?;
let preset = params.get("preset").and_then(|v| v.as_str());
let graphics = params.get("graphics").and_then(|v| v.as_str());
if preset.is_none() && graphics.is_none() {
anyhow::bail!("Missing preset or graphics");
}
let conf = match preset {
// The conf carries two independent settings (display scale preset +
// graphics tier). A set of one must not clobber the other, so the
// half not being changed is carried over from the file as-is.
let existing = tokio::fs::read_to_string(KIOSK_DISPLAY_CONF)
.await
.unwrap_or_default();
let display_part = match preset {
// Resolution-derived default: 4K -> 2.0 (1920-wide layout),
// 1080p TV -> 1.5, laptop panels -> 1.0.
"auto" => String::new(),
Some("auto") => String::new(),
// Biggest UI: every panel targets a 1280-wide layout.
"large" => "ARCHIPELAGO_KIOSK_TARGET_CSS_WIDTH=1280\n".to_string(),
Some("large") => "ARCHIPELAGO_KIOSK_TARGET_CSS_WIDTH=1280\n".to_string(),
// Full-HD layout on any panel that can carry it.
"balanced" => "ARCHIPELAGO_KIOSK_TARGET_CSS_WIDTH=1920\n".to_string(),
Some("balanced") => "ARCHIPELAGO_KIOSK_TARGET_CSS_WIDTH=1920\n".to_string(),
// No scaling: native CSS viewport, most content, smallest UI.
"native" => "ARCHIPELAGO_KIOSK_SCALE=1\n".to_string(),
other => anyhow::bail!("Unknown display preset: {other}"),
Some("native") => "ARCHIPELAGO_KIOSK_SCALE=1\n".to_string(),
Some(other) => anyhow::bail!("Unknown display preset: {other}"),
None => existing
.lines()
.filter(|l| l.starts_with("ARCHIPELAGO_KIOSK_"))
.map(|l| format!("{l}\n"))
.collect(),
};
let graphics_part = match graphics {
// Auto: the launcher classifies the hardware itself (CPU/iGPU
// generation) — legacy boxes keep the choppy-audio-safe flags,
// modern iGPUs get GPU rasterization.
Some("auto") => String::new(),
// Force the conservative legacy flag set (troubleshooting).
Some("performance") => "KIOSK_GRAPHICS=performance\n".to_string(),
// Force the modern flag set even on unclassified hardware.
Some("quality") => "KIOSK_GRAPHICS=quality\n".to_string(),
Some(other) => anyhow::bail!("Unknown graphics mode: {other}"),
None => existing
.lines()
.find(|l| l.starts_with("KIOSK_GRAPHICS="))
.map(|l| format!("{l}\n"))
.unwrap_or_default(),
};
let conf = format!("{display_part}{graphics_part}");
host_sudo(&["/usr/bin/mkdir", "-p", "/etc/archipelago"]).await?;
if conf.is_empty() {
let _ = host_sudo(&["/usr/bin/rm", "-f", KIOSK_DISPLAY_CONF]).await;
@@ -1332,8 +1371,8 @@ impl RpcHandler {
])
.await;
info!(preset, "Kiosk display preset applied");
Ok(serde_json::json!({ "preset": preset, "applied": true }))
info!(?preset, ?graphics, "Kiosk display settings applied");
Ok(serde_json::json!({ "preset": preset, "graphics": graphics, "applied": true }))
}
}
@@ -172,23 +172,70 @@ xset s noblank 2>/dev/null || true
pkill -u archipelago -f 'chromium.*localhost' 2>/dev/null || true
sleep 1
# GPU vs headless (#36, choppy-audio incident 2026-06-28). --enable-gpu-rasterization
# spins a dedicated GPU process at 55-92% CPU even on real GPU hardware (Intel HD 5500)
# because under X11 it falls back to software compositing anyway — that CPU
# starvation is what caused choppy HDMI audio. --in-process-gpu avoids the
# separate process; GpuRasterization is also disabled via --disable-features below.
# On a GPU-less / headless server (no /dev/dri), disable GPU entirely instead.
# ── Graphics tier ────────────────────────────────────────────────────────
# One flag set does not fit all kiosk hardware. The June-2026 choppy-audio
# incident (#36) proved HD 5500-era boxes melt with GPU rasterization on
# (under X11 they fall back to software compositing while a GPU process
# burns 55-92% CPU) — but holding MODERN iGPUs to those same defensive
# flags (single raster thread, raster ban) froze framework-pt outright on
# the animated network map at 4K (2026-08-13). So: two tiers.
#
# legacy — the proven HD 5500 tuning: --in-process-gpu, ONE raster
# thread, GpuRasterization banned via --disable-features.
# modern — --in-process-gpu, Chromium's default raster threads,
# GpuRasterization allowed.
#
# KIOSK_GRAPHICS in /etc/archipelago/kiosk-display.conf overrides:
# auto (default) | performance (force legacy) | quality (force modern)
# Set from Settings → Display; sourced with the rest of the conf above.
#
# Auto classifies by CPU model string — transparent and greppable, and the
# iGPU generation tracks the CPU generation on this hardware. Rules:
# * "NNth Gen Intel" → only stamped on gen 10+ model names → modern
# * AMD Ryzen → modern
# * Intel iN-NNNNN (5 dig)→ gen 10+ desktop → modern
# * Intel iN-8xxx/9xxx → gen 8/9 → modern
# * anything else → legacy (fail conservative: slow-but-stable)
detect_graphics_tier() {
case "${KIOSK_GRAPHICS:-auto}" in
performance) echo legacy; return ;;
quality) echo modern; return ;;
esac
_cpu=$(grep -m1 '^model name' /proc/cpuinfo 2>/dev/null || true)
case "$_cpu" in
*"Gen Intel"*) echo modern; return ;;
*AMD*Ryzen*) echo modern; return ;;
esac
_num=$(printf '%s' "$_cpu" | grep -oE 'i[3579]-[0-9]{4,5}' | head -1 | cut -d- -f2)
case "$_num" in
[0-9][0-9][0-9][0-9][0-9]) echo modern; return ;; # 5 digits = gen 10+
[89][0-9][0-9][0-9]) echo modern; return ;; # gen 8/9
esac
echo legacy
}
if [ -e /dev/dri/card0 ] || [ -e /dev/dri/renderD128 ]; then
GPU_FLAGS="--in-process-gpu --num-raster-threads=1"
# Hardware VIDEO DECODE (VA-API) on GPU hardware. Orthogonal to the
# GpuRasterization ban above: decode offload REDUCES the CPU pressure
# that caused the choppy-audio incident, it doesn't re-create it.
# Falls back silently to software decode when the platform lacks a
# va driver — never a black player. IgnoreDriverChecks: older Intel
# gens (HD 5500-era kiosks) are wrongly blocklisted upstream.
ENABLE_FEATURES="OverlayScrollbar,VaapiVideoDecodeLinuxGL,VaapiIgnoreDriverChecks"
GRAPHICS_TIER=$(detect_graphics_tier)
if [ "$GRAPHICS_TIER" = "modern" ]; then
GPU_FLAGS="--in-process-gpu"
EXTRA_DISABLED_FEATURES=""
else
GPU_FLAGS="--in-process-gpu --num-raster-threads=1"
EXTRA_DISABLED_FEATURES=",GpuRasterization"
fi
# Hardware VIDEO DECODE (VA-API) on GPU hardware — both tiers. Decode
# offload REDUCES the CPU pressure that caused the choppy-audio
# incident, it doesn't re-create it. Falls back silently to software
# decode when the platform lacks a va driver — never a black player.
# IgnoreDriverChecks: older Intel gens (HD 5500-era kiosks) are wrongly
# blocklisted upstream.
ENABLE_FEATURES="OverlayScrollbar,VaapiVideoDecodeLinuxGL,VaapiIgnoreDriverChecks"
echo "archipelago-kiosk: graphics tier=$GRAPHICS_TIER (KIOSK_GRAPHICS=${KIOSK_GRAPHICS:-auto})"
else
# GPU-less / headless server (no /dev/dri): no GPU at all.
GRAPHICS_TIER=headless
GPU_FLAGS="--disable-gpu --num-raster-threads=1"
EXTRA_DISABLED_FEATURES=",GpuRasterization"
ENABLE_FEATURES="OverlayScrollbar"
fi
@@ -224,7 +271,7 @@ while true; do
--disable-translate \
--no-first-run \
--check-for-update-interval=31536000 \
--disable-features=TranslateUI,MetricsReporting,AutofillServerCommunication,PasswordManagerEnabled,GpuRasterization \
--disable-features=TranslateUI,MetricsReporting,AutofillServerCommunication,PasswordManagerEnabled${EXTRA_DISABLED_FEATURES} \
--enable-features=$ENABLE_FEATURES \
--disable-session-crashed-bubble \
--disable-save-password-bubble \
@@ -853,7 +853,25 @@ function render() {
}
}
/** Kiosk TVs run the kiosk image's conservative rasterizer (single raster
* thread, GPU raster off the June choppy-audio tuning), so a 60fps
* SVG-attribute animation at 4K froze the browser outright (framework-pt,
* 2026-08-12). On kiosks the ticker renders every OTHER frame (~30fps at a
* 60Hz panel) with the skipped frame's delta carried over so spin speed is
* unchanged at couch distance the half rate is invisible, the paint cost
* halves. */
const kioskLowPower =
typeof document !== 'undefined' && document.documentElement.classList.contains('kiosk-mode')
let lowPowerPhase = 0
let carriedDeltaMS = 0
function tick(_time: number, deltaMS: number) {
if (kioskLowPower) {
carriedDeltaMS += deltaMS
if ((lowPowerPhase++ & 1) === 1) return
deltaMS = carriedDeltaMS
carriedDeltaMS = 0
}
elapsed += deltaMS / 1000
if (!dragging) cam.rotY += cam.spin * (deltaMS / 1000)
render()
@@ -1169,11 +1187,14 @@ function initialBuild() {
applyGraph()
// First measurement decides the default projection: saved preference wins,
// otherwise portrait containers (phone/companion) open in the flat 2D view.
// otherwise portrait containers (phone/companion) AND kiosk TVs open in the
// flat 2D view the depth view stays one tap away and is remembered. The
// kiosk default exists for the same reason as the half-rate ticker above.
modeInitialized = true
let saved: string | null = null
try { saved = localStorage.getItem('federation-map-projection') } catch { /* private mode */ }
viewMode.value = saved === '2d' || saved === '3d' ? saved : (height > width ? '2d' : '3d')
viewMode.value =
saved === '2d' || saved === '3d' ? saved : (kioskLowPower || height > width ? '2d' : '3d')
applyMode(viewMode.value, false)
if (staticMode) {
@@ -6,6 +6,7 @@ import { rpcClient } from '@/api/rpc-client'
// have a kiosk display (has_kiosk from the backend).
const hasKiosk = ref(false)
const preset = ref('auto')
const graphics = ref('auto')
const applying = ref(false)
const error = ref('')
@@ -32,11 +33,35 @@ const presets = [
},
]
// Graphics tier: which browser rendering flags the on-screen display runs
// with. Auto classifies the hardware (older kiosk boxes keep the proven
// conservative flags; modern chips get GPU rendering); the two overrides
// exist for troubleshooting and unclassified hardware.
const graphicsModes = [
{
id: 'auto',
label: 'Auto (recommended)',
description: 'Detect this machines graphics hardware and pick the right rendering mode for it.',
},
{
id: 'performance',
label: 'Compatibility',
description: 'Most conservative rendering — use if the screen stutters, tears, or the audio crackles.',
},
{
id: 'quality',
label: 'Quality',
description: 'Full GPU rendering — smoothest animations on capable hardware. If unsure, use Auto.',
},
]
onMounted(async () => {
try {
const res = await rpcClient.call<{ has_kiosk: boolean; preset: string }>({ method: 'system.kiosk-display.get' })
const res = await rpcClient.call<{ has_kiosk: boolean; preset: string; graphics?: string }>({ method: 'system.kiosk-display.get' })
hasKiosk.value = res.has_kiosk
preset.value = res.preset
// Older backend without the graphics field: hide nothing, default Auto.
graphics.value = res.graphics ?? 'auto'
} catch { /* backend without the RPC — leave the section hidden */ }
})
@@ -55,6 +80,22 @@ async function apply(id: string) {
applying.value = false
}
}
async function applyGraphics(id: string) {
if (applying.value || id === graphics.value) return
applying.value = true
error.value = ''
const prev = graphics.value
graphics.value = id
try {
await rpcClient.call({ method: 'system.kiosk-display.set', params: { graphics: id }, timeout: 20000 })
} catch (e: unknown) {
graphics.value = prev
error.value = e instanceof Error ? e.message : 'Failed to apply graphics setting'
} finally {
applying.value = false
}
}
</script>
<template>
@@ -77,6 +118,25 @@ async function apply(id: string) {
<p class="text-sm text-white/60">{{ p.description }}</p>
</button>
</div>
<h3 class="text-lg font-semibold text-white/96 mt-8 mb-2">Graphics</h3>
<p class="text-sm text-white/60 mb-6">
How the on-screen display uses this machine&rsquo;s graphics hardware. Changing this restarts the on-screen display.
</p>
<div data-controller-container tabindex="0" class="grid grid-cols-1 md:grid-cols-3 gap-4">
<button
v-for="g in graphicsModes"
:key="g.id"
:disabled="applying"
@click="applyGraphics(g.id)"
class="path-option-card text-left p-5 disabled:opacity-60"
:class="{ 'path-option-card--selected': graphics === g.id }"
>
<div class="font-medium text-white/90 mb-1">{{ g.label }}</div>
<p class="text-sm text-white/60">{{ g.description }}</p>
</button>
</div>
<div v-if="error" class="mt-4 alert-error text-sm">{{ error }}</div>
</div>
</template>