[Feature]:
Problem
Keep the Elgato Stream Deck app in charge of actions while DeckBridge plays a local GIF as a continuous background across the AKP05E key displays. The animation should run during normal use and remain visible behind compatible foreground graphics. A separate touch-strip background can follow once the key-grid path is validated.
Proposed solution
Evidence
- On my Windows setup, animated Elgato key icons play reliably through DeckBridge on an AKP05E. A static Elgato page background also reaches the hardware. The Elgato page-background picker does not play a GIF as an animated wallpaper in my setup.
- The AKP05 GIF probe reports that firmware V3.AKP05E.02.007 ignores direct GIF uploads to keys and strip, while host-generated JPEG frames animate the keys. The probe was developer-only in v0.25.0.
- A separate OpenDeck implementation has displayed host-composited GIF backgrounds on my AKP05E. That is evidence for the USB display path, not a result for this DeckBridge implementation.
Proposed implementation
- Add per-device GIF selection, enable/disable, frame-rate cap and a still-frame mode to DeckBridge's settings. Start at 5 FPS and bound file size, decoded dimensions and memory use.
- Decode on the host. Scale and crop once to a shared canvas, then split each frame using the real device mapping. In Plus mode, preserve the Elgato-managed key mapping and existing behavior on the two extra physical keys.
- Composite frames inside the existing image pipeline. Treat incoming Elgato JPEGs as opaque unless a reliable foreground mask is available. First support empty or explicitly opted-in tiles. Validate icon and title layering separately before advertising arbitrary action support.
- Send JPEGs via the existing worker. Keep only the newest pending animation frame, skip unchanged tiles, and prioritize input and normal Elgato updates. Stop animation on disconnect and honor DeckBridge's standby policy. Restore the current page when disabled.
- The extension API can provide a settings UI, but its imageProcessed event exposes metadata rather than image pixels. Keep rendering in DeckBridge itself. If settings are exposed to extensions, offer narrow controls for selecting and managing a background.
Acceptance checks
- With a moving alignment grid, verify tile order, orientation and seams on the physical AKP05E.
- While the animation runs, test key presses, encoder rotation and presses, taps and swipes. Repeat with animated Elgato icons and page changes. Compare input responsiveness with the animation off.
- Check settings persistence, standby and wake, reconnect, and restoration when disabling the GIF. Compare USB output and CPU load at 5 FPS and higher rates before raising the default.
Scope: live page backgrounds. The existing Elgato screensaver and the device's persistent startup image are separate features.
AKP05E animated backgrounds: implementation notes for DeckBridge
Companion to the animated-background feature proposal. These small Rust sketches illustrate the approach used in our separate OpenDeck build. They are illustrative, not tested as a DeckBridge patch. The OpenDeck worktree contains a GPLv3 license file, while DeckBridge uses MIT. Before reusing source verbatim, verify the licensing of the specific code. The sketches below describe the algorithm independently of the plugin code.
1. Crop the entire frame, then split it
Feed this helper an already cropped and scaled frame. The common canvas is 560 × 224 pixels for the physical 5 × 2 grid. In Stream Deck + mode, use DeckBridge's existing mapping from logical keys to physical positions, including its policy for the two extra keys. Do not equate array indices with HID addresses.
use image::{imageops, RgbImage};
fn split_grid(canvas: &RgbImage) -> Option<[RgbImage; 10]> {
if canvas.dimensions() != (560, 224) {
return None;
}
Some(std::array::from_fn(|i| {
let column = (i % 5) as u32;
let row = (i / 5) as u32;
imageops::crop_imm(canvas, column * 112, row * 112, 112, 112).to_image()
}))
}
Decode the GIF on the host. Limit the input size, decoded dimensions and decoded memory before queuing frames. Apply a consistent crop to every frame. The OpenDeck implementation uses a fixed playback rate and limits the key animation to eight decoded frames. A native implementation can retain GIF frame durations while capping the maximum update rate.
2. Composite only when a reliable foreground mask exists
fn blend_channel(background: u8, foreground: u8, opacity: u8) -> u8 {
let a = u32::from(opacity);
let sum = u32::from(background) * (255 - a) + u32::from(foreground) * a;
((sum + 127) / 255) as u8
}
The OpenDeck plugin approximates transparency from pixel brightness in the incoming JPEG. That worked for selected images but can remove dark parts of icons and text. DeckBridge should start with empty or explicitly opted-in tiles and use real alpha only when available. An ordinary Elgato JPEG has no alpha mask.
3. Drop old animation frames
use std::time::Duration;
fn frame_at_fixed_rate(elapsed: Duration, fps: u32, count: usize) -> Option<usize> {
if fps == 0 || count == 0 {
return None;
}
let frame = elapsed.as_millis() * u128::from(fps) / 1_000;
Some((frame % count as u128) as usize)
}
Use this only for fixed-rate playback, or use cumulative frame deadlines for variable GIF delays. Keep one pending animation update per device and replace it with newer work. Skip unchanged tiles. Route JPEGs through DeckBridge's existing USB worker and image mapping. The old OpenDeck loop sends keys serially and can spend considerable time on a full redraw. Preserve input and ordinary Elgato update responsiveness, check standby and reconnect, and restore the current page when disabling the animation.
Touch strip as a second step
The OpenDeck prototype sends the AKP05E strip as one 800 × 112 JPEG, including the gaps between the touch zones. DeckBridge already has its own strip compositor and device mapping. Reuse those and verify rotation, fit and encoded size on hardware.
Local implementation reference points: OpenDeck AKP05 plugin background.rs (load_key_background_frames, key_tiles_from_source, composite) and device.rs (render_key, render_touch_zone, background_animation_task).
Alternatives considered
No response
Thank you for this interesting feature request.
How would you expect GIF selection for the touch strip to work? I’d prefer a simple approach: let the user choose a file from disk. If the GIF’s dimensions aren’t supported, DeckBridge could reject it and show a clear explanation.
A local file picker sounds like a good fit. In my OpenDeck plugin, I handle cropping directly in the plugin. After selecting a GIF, I can zoom in and move the image horizontally or vertically to choose what’s visible on the touch strip. The plugin applies the same crop to every frame, so the framing stays consistent throughout the animation.
That means I don’t have to resize the GIF to the exact display dimensions beforehand. A different aspect ratio can be handled by cropping. I’d show an error if the file can’t be decoded or exceeds a file size or decoded image size limit.
For a first version, I’d be happy with a local file picker and automatic center cropping. Zoom and position controls could come later.
Option A: WebUI allows upload and local path
Pros
- Covers both user types. Phone or LAN browser users upload. Desktop users point at a file they already have.
- Path is a good fit for large or frequently edited GIFs, so there is no re-upload per edit. The worker reads the file itself, so a tweak in the editor needs only a reload.
- No duplicate copy in
/backgrounds/ for path users. - Removes the settings.json hand edit, which is poor UX for a normal user.
Cons
- Security: any WebUI client on the LAN can make DeckBridge read a file at an arbitrary path. The 2 MiB cap plus GIF8 magic limits the leak. It still reveals file existence and size, and error messages can reveal more.
- Needs a guard (loopback-only write, or auth). That adds server code and tests.
- Two sources means more states. path wins over file, the UI needs both rows, and the controller needs both merge rules.
- A path is fragile. The file may move, be deleted, or sit on an unmounted drive. Then the animation breaks after a restart. Upload copies are stable.
- Remote browser: the user types a path on the host, not their own machine. This confuses phone and tablet users.
- This reverses Decision 1 and the "POST rejects path" test in 1D.
Option B: WebUI allows local path only (no upload)
Pros
- Smallest server surface: no upload route, no body-size handling, no hash-named storage, no old-file cleanup.
- No cache copy and no
/backgrounds/ directory. - Simple UI: one text field.
- Good for single-machine desktop use, where the file is already local.
Cons
- Same LAN file-probing risk as A, with no safe alternative path.
- Unusable from a phone, tablet or other LAN browser. The user cannot pick a file from their own device.
- Typing an absolute path is poor UX. There is no file picker, because a browser cannot reveal the full path of a chosen file.
- Fragile: the file moves or disappears and the background breaks silently.
- Windows and WSL paths add edge cases (drive letters, \wsl$, relative vs absolute).
- Cancels the upload work already planned in 1D. A later upload feature would need a new design.
Recommendation
A, with writes of path restricted to loopback clients. It keeps upload as the safe default and adds path for desktop users. LAN clients see the path read-only. B loses the main case (picking a file from any browser) and keeps the main risk.
feel free to create PR
thank you for your PR! 🎉 I will check it tomorrow. Make sure all checks (mise run beforeCommit has no errors/warnings)