Newshot

Pioneer Head Unit Animations

Original text(via Hacker News)
Latest release
Latest release
License
License

Changelog • Roadmap

The live web player: a Pioneer DEH-P7600MP faceplate with a decoded .lkd animation glowing cyan on its OEL screen
The live web player: a Pioneer DEH-P7600MP faceplate with a decoded .lkd animation glowing cyan on its OEL screen

Live and playing right now at carozerra.yousufkhan.uk — click the image, no install.

What it is

Old Pioneer head units (e.g. the DEH-P7600MP) let you upload custom animations to their blue OEL display via CD or PC link, stored as .lkd files no modern software could open. Carozerra decodes them and brings the look back — on the web or on a Linux desktop, with the stereo's own controls doing real things.

How the format works

.lkd turned out to be a thin wrapper around entirely standard formats — no proprietary codec, no guesswork left in the pipeline:


        offset  bytes
0x00    "zLKD"   magic (7A 4C 4B 44)
0x04    uint32   version           = 3
0x08    uint32   (unknown)         = 1
0x0C    uint32   (unknown)         = 7
0x10    uint32   frame count       = 60
0x14    gzip stream ──▶ gunzip ──▶ TAR archive
                         └─ one member = a 24-bit Windows BMP
                            BMP = 256 × 3840, bottom-up, BGR
                                = 60 stacked frames of 256 × 64
      

Strip the 20-byte header → gunzip → tar → read the BMP → slice it into 60 frames of 256 × 64. Native palette is cyan-blue rgb(7,158,175) + white on black — the classic blue-OEL glow — and artwork is dithered (mountains, waterfalls, leaping dolphins, etc.).

Web player

Decodes fully client-side — DecompressionStream for gzip, an inline tar reader, a BMP parser to canvas. 83 built-in clips (movies, backgrounds, stills, level meters, and a full-color set — see assets/clips/) can be picked from a gallery with category filters. Small posters load as they enter view; full clips load when selected or intentionally previewed. Previews animate on hover or keyboard focus, respecting reduced-motion preferences; drag-and-drop (or click) still lets you load any other .lkd file — nothing is uploaded anywhere. GIF and WebM export (with the retro phosphor glow baked into the output) are available via the Export buttons.

Requires a browser with DecompressionStream (current Chrome/Firefox/Edge).

←→ browse the gallery, and the footer's Changelog link opens CHANGELOG.md in a modal — fetched at click time, so it never drifts from the file in the repo.

To build and preview locally:


        python3 packaging/build-web.py
python3 -m http.server -d dist/web 8000
      

Open http://localhost:8000. The build stages the player, faceplate, all clips, and changelog into dist/web/. The faceplate is web/pioneer.webp, a committed WebP copy of assets/pioneer.png; regenerate it if the PNG changes.

The live player is hosted on Cloudflare Pages at carozerra.yousufkhan.uk. The Cloudflare Pages project carozerra is connected to this GitHub repository: production branch main, build command python3 packaging/build-web.py, and output directory dist/web. Cloudflare manages the custom domain's DNS and HTTPS certificate. Every push to main deploys through Cloudflare's native Git integration; no deployment token or Node dependencies are needed.

The old GitHub Pages address stays online as a small browser redirect, preserving paths, query parameters, and fragments. Its no-JavaScript fallback redirects to the new homepage. GitHub Pages does not provide configurable HTTP redirects, so this is not an HTTP 301. The redirect is published only after the same commit is live on Cloudflare. The custom domain belongs to the Cloudflare Pages project; do not assign it to the GitHub Pages site.

The player advertises its new canonical URL, robots.txt, and sitemap.xml. The existing Google Analytics measurement ID is unchanged. After migrating, update the Analytics web stream URL and add/verify the new URL in Search Console, then submit https://carozerra.yousufkhan.uk/sitemap.xml.

Adsterra placements are configured in web/ads.js: one banner below the player (728×90 on viewports at least 808px wide, otherwise 320×50) and a native unit below About. Each placement loads when it approaches the viewport. The banner runs in its own iframe so the provider's atOptions global stays separate from the player; crossing the desktop breakpoint replaces it with the other size. The 300×250 unit is unused. Browser checks mock ad scripts, so they do not generate live ad impressions. Verify actual delivery and impression reporting on the production domain after deployment.

The web player uses a graphite and silver palette with locally hosted IBM Plex Sans. On phones, it opens with an enlarged animation view; View full stereo switches to the faceplate without restarting playback. Speed, glow, and frame scrubbing are under Playback settings, and Export offers GIF and WebM.

After changing bundled clips, regenerate the committed gallery posters with python3 packaging/build-web-previews.py (requires Pillow). The fonts and their license are in web/fonts/.

With the local server running, browser checks can be run with python3 tests/web_player.py using Python's playwright package and Google Chrome at /usr/bin/google-chrome. Set CAROZERRA_URL to test another local server. Screenshots are written under .superpowers/implementation/.

Desktop app (Linux / Debian)

A frameless, transparent, stereo-shaped window: the faceplate floats on your desktop and animations play on its OEL screen, with the stereo's own controls wired to real actions.

The Linux desktop app: the same Pioneer faceplate floating as a transparent window, playing a dolphin animation
The Linux desktop app: the same Pioneer faceplate floating as a transparent window, playing a dolphin animation
ControlAction
Presets 1–6switch animation (first six clips)
Left knobdrag to rotate / scroll wheel → system volume
Right nav knobleft/right = prev/next clip · up/down = animation speed
FUNC (by the display)toggle retro glow
ESC (top-right)quit
drag body / edgesmove / resize the window (aspect-locked)

Keyboard: ←→ clip, ↑↓ speed, F glow, 1–6, F1 control map, Esc.

The control map above is also shown on the faceplate for a few seconds at launch, and F1 brings it back. Esc closes it rather than quitting, so dismissing the overlay can't take the app down with it.

Install the .deb (see Releases for the latest build):


        sudo apt install ./carozerra_<version>_all.deb
carozerra
      

Or run from source — dependencies are standard Debian/Ubuntu packages, no pip install:


        sudo apt install python3-pyqt6 python3-pil
python3 carozerra.py
      

System volume uses wpctl (PipeWire) with a pactl fallback. All 8 animations are preloaded from assets/ — no drag-drop or upload in the desktop app (that's a web-player-only feature).

Windows (beta)

Install: grab carozerra_<version>_windows_x64.exe from the latest prerelease and run it. First launch will trigger a SmartScreen warning — the binary isn't code-signed (see below).

Or build it yourself:


        pip install PyQt6 pillow pyinstaller
python packaging/make-ico.py            # icon, generated from the faceplate art
pyinstaller --clean --noconfirm packaging/carozerra.spec
dist\carozerra.exe
      

Every push touching the app or its packaging builds that .exe on a windows-latest runner and smoke-tests it via packaging/smoke-windows.ps1: first carozerra.exe --selftest out.png, which renders one frame and exits (so a build can be checked without a human at a screen), then a real interactive launch that has to survive, own a top-level window, and be screenshotted. release.yml runs the same sequence again before attaching the .exe to a tagged release.

Why beta, not a full release:

  • The volume knob does nothing. It drives wpctl/pactl, neither of which exists on Windows, so get_volume() returns a fixed 50 and the knob turns while lying. Needs either pycaw or an explicit disable.
  • The exe is unsigned, so SmartScreen will warn, and antivirus false positives on PyInstaller output are common. (UPX compression is off in the spec for the same reason.) Code signing costs money; not done yet.

It is large (46.7 MB, because a onefile PyQt6 bundle carries all of Qt) but otherwise works: CI's launch screenshot shows DWM compositing the frameless translucent window correctly with a clip playing, and the author has run it by hand on a real Windows machine, resize and HiDPI included.

Geometry (screen rect, knob centers, button hitboxes) lives in the G dict at the top of carozerra.py as fractions of the faceplate, so it scales with the window and is easy to re-tune against a different photo.

Android (beta)

A native app for Android-based aftermarket head units — the same faceplate and decoder, running fullscreen on the dashboard instead of floating on a desktop.

Sideload only — no Play Store listing. These units ship without Play Services, so install is a plain APK from the latest prerelease:


        adb install carozerra_<version>_android.apk
      

Or build it yourself (needs JDK 21 and the Android SDK — AGP 8.13 does not support newer JDKs):


        cd android
./gradlew assembleDebug
adb install app/build/outputs/apk/debug/app-debug.apk
      

minSdk 29 (Android 10), locked to sensorLandscape, immersive fullscreen (system bars hidden, swipe to reveal), and FLAG_KEEP_SCREEN_ON so the display doesn't blank part-way through a clip — a dashboard has no reason to sleep. All 17 faceplate controls are live, each mapped to the function the DEH-P7600MP owner's manual prints against it:

ControlAction
TAmute
VOLUME turnsystem volume
VOLUME pressblackout · any touch wakes
DISPLAYclean / clock / clock + info
TEXTscrolling text line
FUNCTIONglow on/off
AUDIOlevel meters
NAV left/rightprevious / next track
NAV up/downanimation speed
NAV pressplay / pause
OPENcontrol map / about card
BANDclose · hold to exit
ENTERTAINMENTclip gallery (all 83 clips)
EQ-EXscanlines
1–6presets — clips 1-6 of the category
EQglow intensity
SOURCEnext category

Track skip and play/pause go through permission-free media keys rather than a media-session/notification-listener integration. On first launch the app explains, then asks for, microphone access (RECORD_AUDIO) — that's for the AUDIO level meters, which read what the device is playing via Visualizer. Android gates that behind the same permission as the microphone; the app never reads microphone audio. "Not now" skips it and the meters stay off.

Why beta, not a full release:

  • Debug-signed. There's no release keystore yet — same open item as the Windows build's missing code signing. Uninstall the app before sideloading a newer build; Android won't install a differently-signed APK over an existing one.
  • The level meters don't work on at least one real phone. AUDIO reads output-mix levels via the legacy Visualizer(0) API. On a Redmi Note 14 (Android 16) playing YouTube Music, with the permission granted, it still shows NO SIGNAL — modern Android and OEM skins often don't feed whole-device playback through that API (offloaded playback bypasses it, or the OS refuses to attach it). The development emulator, which has no audio HAL, fails the same way (ERROR_NO_INIT). Either way the app says "no signal" and keeps the meter zone hidden instead of showing frozen or invented bars. Making the meters work reliably means moving to Android's playback-capture API (MediaProjection), which is planned, not done.
  • Untested on real head-unit hardware. Built and verified on an Android emulator (API 29, landscape, both a generic Pixel profile and an Automotive profile) and hand-tested on one phone — not yet on the actual target, a head unit.

decode.py — batch converter


        python decode.py                             # assets/clips/*.lkd -> out/<name>_clean.gif + _glow.gif
python decode.py assets/clips/movie6.lkd --mp4 --frames   # + MP4 + raw PNG frames
python decode.py --glow --scale 6 --fps 12    # glow only, 6x, 12fps
      

Options: --outdir (default out/), --scale (default 4 → 1024×256), --fps (default 60 ms/frame), --clean, --glow, --mp4, --frames. Importable too: frames, meta = decode_lkd("assets/clips/movie1.lkd") returns 60 RGB PIL.Image frames.

clean = faithful nearest-neighbor upscale. glow = OEL phosphor look (bloom + scanlines on black). Needs Pillow (and ffmpeg on PATH for MP4). Output goes to out/ (gitignored — fully regenerable, not shipped).

Releasing

Order matters: Cloudflare Pages deploys pushes to main, not tags, so the website must go out before (or with) the tag — otherwise a new Release ships alongside a site still serving the previous player.


        git push origin main          # triggers packaging-check.yml + windows-check.yml + android-check.yml + pages.yml
# wait for all green, and confirm the live site picked up the new build
git tag v1.2.0
git push origin v1.2.0        # triggers release.yml
      

Use the two-step push rather than git push --tags: that pushes only the tag, leaving main (and the site) behind.

release.yml builds the .deb, the Windows .exe, and the Android .apk, and attaches all three to a new GitHub Release automatically. A tag with a - suffix (e.g. v1.3.0-beta.1) is published as a prerelease; a clean vX.Y.Z is a normal release — the workflow reads that off the tag name, nothing to set by hand. (The .deb's own version string swaps that - for dpkg's ~, which sorts a prerelease before the final version it precedes — verify with dpkg --compare-versions if you're inventing a new prerelease scheme.)

Before tagging, also bump versionName/versionCode in android/app/build.gradle.kts to match — unlike the .deb (which takes its version as a build argument) and the .exe (whose filename is derived from the tag), the Android build has no mechanism to pick up the tag automatically yet, so its internal version has to be updated by hand or it will silently ship stale.

To build locally without releasing:


        packaging/build-deb.sh 1.2.0
# -> packaging/dist/carozerra_1.2.0_all.deb
      

License

MIT — covers the code (decode.py, carozerra.py, web/, packaging/, .github/). The Pioneer product photography under assets/pioneer.png and reference/ is not original work of this project and isn't covered by the license — it's included for reverse-engineering documentation and UI purposes only. The Android app's display font, Smallest Pixel-7 by Sizenko Alexander (android/app/src/main/res/font/), isn't covered either: it's freeware, usable in freeware software with credit — terms in android/licenses/smallest-pixel-7.txt.


        carozerra/
├── web/                # Cloudflare Pages player — decodes .lkd fully client-side
│   ├── index.html
│   ├── pioneer.webp      # WebP copy of assets/pioneer.png (the page's LCP image)
│   └── gifenc.esm.js     # vendored GIF encoder (mattdesl/gifenc, MIT) used by GIF export
├── carozerra.py         # Linux desktop visualizer (PyQt6)
├── decode.py             # .lkd decoder — CLI + importable library
├── assets/
│   ├── pioneer.png        # faceplate cutout, shared by desktop + Android (web uses a WebP copy)
│   ├── clips/               # the 83 preloaded .lkd animations (movies, bgv, bgp, level meters, color)
│   └── readme/                # this README's hero SVG + proof screenshots
├── reference/              # provenance only — not used by any code
│   ├── pioneer-original.jpeg
│   └── 1.gif
├── packaging/
│   ├── build-deb.sh         # -> packaging/dist/carozerra_<version>_all.deb
│   └── debian/                # control file template + .desktop entry
└── .github/workflows/
    ├── pages.yml               # waits for Cloudflare, then deploys GitHub Pages redirect
    ├── packaging-check.yml      # build-validates the .deb whenever app/packaging files change
    └── release.yml               # builds + attaches the .deb to a GitHub Release on every v* tag
      

The text above was extracted automatically from the source page and may miss images, tables or code blocks. The original is authoritative.

Published by Hacker News
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗