Browse Source

Optimize SpoolBuddy kiosk performance on Raspberry Pi

  Override Debian's default Chromium flags via /etc/chromium.d/spoolbuddy-kiosk
  to disable GPU rasterization, enable low-end device mode, and disable smooth
  scrolling/background networking. The system default --enable-gpu-rasterization
  conflicted with per-launch flags — the new config replaces all system defaults
  so kiosk flags take effect cleanly.

  Expand service/package stripping to disable pipewire audio stack, CUPS
  printing, rpcbind, upower, polkit, accounts-daemon, xdg-desktop-portal,
  and mpris-proxy. Add user-level service masking for pipewire/portals
  that system-level disable misses.
maziggy 2 months ago
parent
commit
54c67f9e4e
2 changed files with 17 additions and 6 deletions
  1. 1 1
      CHANGELOG.md
  2. 16 5
      spoolbuddy/install/install.sh

+ 1 - 1
CHANGELOG.md

@@ -12,7 +12,7 @@ All notable changes to Bambuddy will be documented in this file.
 - **External Folder Mounting for File Manager** ([#124](https://github.com/maziggy/bambuddy/issues/124)) — Host directories (NAS shares, USB drives, network storage) can now be mounted into the File Manager without copying files. Click "Link External" to point at a Docker bind-mounted path. Files are indexed into the database on scan but accessed directly from their original location — nothing is copied. Supports read-only mode (default, blocks uploads/moves/deletes), hidden file filtering, and automatic thumbnail extraction for 3MF, STL, gcode, and image files. External folders show a distinct icon and info bar with a rescan button. Deleting an external folder only removes the database index, never the actual files. Requested by @S1N4X.
 - **External Folder Mounting for File Manager** ([#124](https://github.com/maziggy/bambuddy/issues/124)) — Host directories (NAS shares, USB drives, network storage) can now be mounted into the File Manager without copying files. Click "Link External" to point at a Docker bind-mounted path. Files are indexed into the database on scan but accessed directly from their original location — nothing is copied. Supports read-only mode (default, blocks uploads/moves/deletes), hidden file filtering, and automatic thumbnail extraction for 3MF, STL, gcode, and image files. External folders show a distinct icon and info bar with a rescan button. Deleting an external folder only removes the database index, never the actual files. Requested by @S1N4X.
 
 
 ### Improved
 ### Improved
-- **SpoolBuddy Kiosk Performance Optimizations** — Added Chromium flags to reduce CPU usage on Raspberry Pi 4B: `--disable-gpu-rasterization` (stops overloading CPU when GPU can't keep up), `--enable-low-end-device-mode`, `--disable-smooth-scrolling`, `--disable-background-networking`, and `--disable-dev-shm-usage`. Also expanded the install script's service/package stripping to disable pipewire audio stack, CUPS printing, PipeWire/PulseAudio, rpcbind, upower, polkit, accounts-daemon, xdg-desktop-portal, and mpris-proxy — none of which are needed on a dedicated spool reader. User-level services (pipewire, portals) are now masked via `systemctl --user` since system-level disable doesn't catch them.
+- **SpoolBuddy Kiosk Performance Optimizations** — Reduced CPU load on Raspberry Pi by overriding Debian's default Chromium flags via `/etc/chromium.d/spoolbuddy-kiosk`. Disables GPU rasterization (which falls back to CPU on Pi's VideoCore VI), enables low-end device mode (caps memory/reduces background work on ≤2GB Pis), and disables smooth scrolling and background networking. The system default `--enable-gpu-rasterization` was conflicting with per-launch flags — the new config file replaces all system defaults so kiosk flags take effect cleanly. Also expanded the install script's service/package stripping to disable pipewire audio stack, CUPS printing, rpcbind, upower, polkit, accounts-daemon, xdg-desktop-portal, and mpris-proxy — none needed on a dedicated spool reader. User-level services (pipewire, portals) are now masked via `systemctl --user` since system-level disable doesn't catch them.
 - **SpoolBuddy AMS Slot Action Picker** — Clicking an AMS slot on the SpoolBuddy AMS page now shows a picker with contextual actions: Configure AMS Slot (set filament preset, K-profile, color), and either Assign Spool / Link to Spoolman (when no spool is mapped) or Unassign / Unlink (when one is). Works with both internal inventory and Spoolman. Previously the slot click went straight to the configure modal with no way to manage spool assignments.
 - **SpoolBuddy AMS Slot Action Picker** — Clicking an AMS slot on the SpoolBuddy AMS page now shows a picker with contextual actions: Configure AMS Slot (set filament preset, K-profile, color), and either Assign Spool / Link to Spoolman (when no spool is mapped) or Unassign / Unlink (when one is). Works with both internal inventory and Spoolman. Previously the slot click went straight to the configure modal with no way to manage spool assignments.
 - **Unassign Button in Edit Spool Modal** — The edit spool modal now has an "Unassign" button next to "Delete Tag" that removes the spool's AMS slot assignment, clearing the location column in the inventory table.
 - **Unassign Button in Edit Spool Modal** — The edit spool modal now has an "Unassign" button next to "Delete Tag" that removes the spool's AMS slot assignment, clearing the location column in the inventory table.
 - **SpoolBuddy Settings Device Tab No Longer Scrolls** — Removed the branding card, folded Device ID into the Device Info card, placed Backend/Auth config and diagnostic buttons side by side in a 2-column layout, removed the redundant online/offline status row from Device Info, and tightened spacing throughout. The Device tab now fits on the small SpoolBuddy touchscreen without scrolling.
 - **SpoolBuddy Settings Device Tab No Longer Scrolls** — Removed the branding card, folded Device ID into the Device Info card, placed Backend/Auth config and diagnostic buttons side by side in a 2-column layout, removed the redundant online/offline status row from Device Info, and tightened spacing throughout. The Device tab now fits on the small SpoolBuddy touchscreen without scrolling.

+ 16 - 5
spoolbuddy/install/install.sh

@@ -1107,6 +1107,22 @@ EOF
 </labwc_config>
 </labwc_config>
 EOF
 EOF
 
 
+        # ── Override Debian/RPi Chromium defaults for kiosk performance ──────
+        cat > /etc/chromium.d/spoolbuddy-kiosk << 'CHROMIUM_EOF'
+# SpoolBuddy kiosk: override system defaults for low-end Pi hardware.
+# Replaces CHROMIUM_FLAGS entirely — system defaults (gpu-rasterization,
+# remote-extensions, pings, media-router) are not needed in kiosk mode.
+CHROMIUM_FLAGS="--disable-gpu-rasterization"
+CHROMIUM_FLAGS="$CHROMIUM_FLAGS --disable-smooth-scrolling"
+CHROMIUM_FLAGS="$CHROMIUM_FLAGS --enable-low-end-device-mode"
+CHROMIUM_FLAGS="$CHROMIUM_FLAGS --disable-background-networking"
+CHROMIUM_FLAGS="$CHROMIUM_FLAGS --disable-dev-shm-usage"
+CHROMIUM_FLAGS="$CHROMIUM_FLAGS --disable-pings"
+CHROMIUM_FLAGS="$CHROMIUM_FLAGS --no-default-browser-check"
+CHROMIUM_FLAGS="$CHROMIUM_FLAGS --show-component-extension-options"
+CHROMIUM_EOF
+        success "Chromium kiosk performance flags installed"
+
         # ── kiosk launcher (dynamic URL from spoolbuddy/.env) ─────────────────
         # ── kiosk launcher (dynamic URL from spoolbuddy/.env) ─────────────────
         local kiosk_launcher="/usr/local/bin/spoolbuddy-kiosk-launch"
         local kiosk_launcher="/usr/local/bin/spoolbuddy-kiosk-launch"
         cat > "$kiosk_launcher" << EOF
         cat > "$kiosk_launcher" << EOF
@@ -1144,11 +1160,6 @@ exec chromium --kiosk --no-first-run --disable-infobars \
     --noerrdialogs --disable-component-update \
     --noerrdialogs --disable-component-update \
     --overscroll-history-navigation=0 \
     --overscroll-history-navigation=0 \
     --ozone-platform=wayland \
     --ozone-platform=wayland \
-    --disable-gpu-rasterization \
-    --disable-smooth-scrolling \
-    --enable-low-end-device-mode \
-    --disable-background-networking \
-    --disable-dev-shm-usage \
     "\$kiosk_url"
     "\$kiosk_url"
 EOF
 EOF