You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Collapse src/anthias_viewer/ (~1.8k lines of Python) and src/anthias_webview/ (~700 lines of C++ at HEAD; ~1.4k after #2905 lands) into a single Qt 6/C++ binary called AnthiasViewer. Eliminate the Python interpreter, pydbus, D-Bus session, dbus-run-session wrapping, the Qt 5 cross-compile toolchain, and the parent/child process boundary in the viewer image.
What the Python viewer currently does (must be absorbed)
File
Responsibility
Port difficulty
__init__.py
Lifecycle, D-Bus glue, rotation (linuxfb env + wlr-randr + eglfs-rotate on Pi 4), watchdog, recheck POST, splash
Low once D-Bus goes away. wlr-randr stays a QProcess call; the Pi-4 eglfs rotation primitive (added by #2905) goes via QT_QPA_EGLFS_ROTATION / KMS transform.
Source tree: src/anthias_webview/ → src/anthias_viewer/ (freed once the Python package is deleted)
AnthiasWebview.pro → AnthiasViewer.pro
Runtime state paths in bin/start_viewer.sh (/data/.local/share/AnthiasWebview, /data/.cache/AnthiasWebview) — one-shot symlink migration at container startup so upgraded devices don't lose QtWebEngine cookies/local-storage
D-Bus service name anthias.webview — deleted entirely, no IPC in the new world
Phasing (each will be tracked as a sub-issue)
REST-shim (server-side, no viewer changes). Add /api/v2/viewer/playlist (active assets + next deadline) and /api/v2/viewer/settings. Move Asset.is_active() evaluation, shuffle, and deadline computation server-side. Python viewer keeps working unchanged. Largest single de-risking step.
Build-matrix flip (no viewer code changes). is_qt6 = True for all boards; Pi 2 builds against Trixie's qt6-*-dev apt packages; Pi 3 switches target_platform to linux/arm64/v8 and folds into the existing arm64 image. Real-hardware QA on Pi 2 during this phase.
C++ port (scheduling, messaging, lifecycle, ALSA, rotation) into the single Qt 6 binary. New code is Qt 6-only — no Qt 5 macros needed.
Rename + path migration.
Delete src/anthias_viewer/ Python package, the viewer uv group, all pydbus/gi stubs, dbus-run-session from start_viewer.sh.
Risks
Pi 2 perf unknown. Cortex-A7 @ 900MHz + 1GB RAM + Qt 6.8 Chromium-based WebEngine has no proven baseline in this project. Pi 4 1GB SKU runs the stack today so the memory envelope is plausible; the CPU envelope on the A7 isn't. Mitigation: real-hardware QA on Pi 2 during Phase 2. If unacceptable → deprecate Pi 2 specifically; the Qt 5 toolchain still gets deleted because Pi 3 has moved to arm64.
Pi 3 reflash requires operator action. Existing Pi 3 deployments are on armhf images and won't auto-upgrade to arm64. Needs a release-notes call-out and probably a migration guide.
Schema coupling avoided by REST-shim (Phase 1). Without that, viewer reads SQLite directly and every model migration becomes a viewer release.
Internal auth token (anthias_common.internal_auth.internal_auth_token) — needs a C++ equivalent. HMAC-style derivation from a shared secret read from anthias.conf is straightforward but new code.
Goal
Collapse
src/anthias_viewer/(~1.8k lines of Python) andsrc/anthias_webview/(~700 lines of C++ at HEAD; ~1.4k after #2905 lands) into a single Qt 6/C++ binary called AnthiasViewer. Eliminate the Python interpreter, pydbus, D-Bus session,dbus-run-sessionwrapping, the Qt 5 cross-compile toolchain, and the parent/child process boundary in the viewer image.Why
bin/start_viewer.sh's bash watchdog exists only because of the split. PR feat(viewer,webview): embed QtMultimedia in AnthiasWebview, eliminate two-process DRM contention + Pi 4 drops #2905 already proves the model works (mpv subprocess folded into the Qt process).loadPage/loadImage/setReloadInterval/playVideo/stopVideo(the latter two added by feat(viewer,webview): embed QtMultimedia in AnthiasWebview, eliminate two-process DRM contention + Pi 4 drops #2905) become method calls. No more version skew (see_webview_supports_set_reload_intervallatch insrc/anthias_viewer/__init__.py:69)./venv, nopython3, no python-vlc / pydbus / gi.AnthiasWebviewis already inaccurate.qt6-base-dev,qt6-webengine-dev, andqt6-multimedia-dev6.8.2-8 — the exact Qt 6.8 ffmpeg-backed multimedia that feat(viewer,webview): embed QtMultimedia in AnthiasWebview, eliminate two-process DRM contention + Pi 4 drops #2905 relies on. The Qt 5 cross-compile toolchain becomes deletable.Dependencies
media_player.pyrewrite conflicts hard with anything that touches the same files. Wait for the stack to land on master before starting this work.What the Python viewer currently does (must be absorbed)
__init__.pyQProcesscall; the Pi-4 eglfs rotation primitive (added by #2905) goes viaQT_QPA_EGLFS_ROTATION/ KMS transform.scheduling.pyAsset.objects+Asset.is_active()+Asset.has_window_filter()messaging.pyanthias.viewer, retry+backoff, readiness keyQSocketNotifier.media_player.py{audio-device, video-rotate}only) + ALSA HDMI-A-1/A-2 autodetect on Pi 5playback.pythreading.Eventskip, scheduler reverse/extra-assetQWaitCondition.utils.pywait_for_server, watchdog file touchExternal contracts to preserve:
anthias.viewer(commands:next,previous,asset&<id>,reload,stop,play,current_asset_id&<corr>)anthias.reply.<corr>for thecurrent_asset_idrequest/reply pathviewer:display_resolution(60s cadence, 180s TTL) — read by the System Info card/data/.local/share/AnthiasWebview/+/data/.cache/AnthiasWebview/(QtWebEngine state) — need symlink migration to the renamed pathsBuild matrix consolidation
Today: Qt 6 (pi4-64, pi5, x86, arm64) + Qt 5 cross-compiled (pi2, pi3). Two Dockerfiles, two toolchains.
After:
Deletions:
docker/Dockerfile.qt5-webview-builder.j2bin/rebuild_qt5_toolchain.shqt5_toolchain_urlintools/image_builder/utils.pyWebView-v2026.04.1GH release pin (toolchain artifact stays on the release page for archival; just unreferenced)qt_version = '6.4.2' if is_qt6 else '5.15.14'branch — single Qt 6.8 from Debian apt{% if is_qt6 %} {% else %} {% include 'Dockerfile.qt5-webview-builder.j2' %} {% endif %}block inDockerfile.viewer.j2Rename: AnthiasWebview → AnthiasViewer
/usr/local/bin/AnthiasWebview→/usr/local/bin/AnthiasViewersrc/anthias_webview/→src/anthias_viewer/(freed once the Python package is deleted)AnthiasWebview.pro→AnthiasViewer.probin/start_viewer.sh(/data/.local/share/AnthiasWebview,/data/.cache/AnthiasWebview) — one-shot symlink migration at container startup so upgraded devices don't lose QtWebEngine cookies/local-storageanthias.webview— deleted entirely, no IPC in the new worldPhasing (each will be tracked as a sub-issue)
/api/v2/viewer/playlist(active assets + next deadline) and/api/v2/viewer/settings. MoveAsset.is_active()evaluation, shuffle, and deadline computation server-side. Python viewer keeps working unchanged. Largest single de-risking step.is_qt6 = Truefor all boards; Pi 2 builds against Trixie'sqt6-*-devapt packages; Pi 3 switchestarget_platformtolinux/arm64/v8and folds into the existing arm64 image. Real-hardware QA on Pi 2 during this phase.src/anthias_viewer/Python package, thevieweruv group, all pydbus/gi stubs,dbus-run-sessionfromstart_viewer.sh.Risks
tests/test_viewer.py,test_scheduler.py,test_messaging.py,test_media_player.py(all pytest) need Qt Test equivalents insrc/anthias_webview/tests/(suite created by feat(viewer,webview): embed QtMultimedia in AnthiasWebview, eliminate two-process DRM contention + Pi 4 drops #2905), or the REST endpoints absorb most of what they assert.anthias_common.internal_auth.internal_auth_token) — needs a C++ equivalent. HMAC-style derivation from a shared secret read fromanthias.confis straightforward but new code.Out of scope
_handle_reload.Sub-issues
To be opened once this issue is filed:
/api/v2/viewer/playlistand/api/v2/viewer/settings(feat(api,viewer): viewer REST shim + rename AnthiasWebview → AnthiasViewer #2907)AnthiasWebview→AnthiasViewerbinary, paths, source tree, D-Bus removal — binary + runtime paths + D-Bus removal done in feat(api,viewer): viewer REST shim + rename AnthiasWebview → AnthiasViewer #2907; source-tree rename deferred to Phase 5src/anthias_viewer/Python package +dbus-run-sessionfromstart_viewer.sh