Rene KievitsandClaude Opus 5 f3a4cddfd6 Package through a pinned Node, not whatever the host has
Found the real cause of "-5: ipk verify failed": ares-package's own
packaging code (ar-async/fstream/tar, last touched 2017-2019) silently
zeroes every file's mtime in the ipk when run under a sufficiently new
Node (reproduced on v25.8.1; a Node-18 container was unaffected).
Confirmed by unpacking data.tar.gz from our built ipk (every entry
1970-01-01) versus webosbrew/hyperhdr-webos-loader's real published
ipk, structurally identical to ours (web app + native service, same
control file, same ares-cli) but with genuine October 2025 timestamps.
The archive still parses fine everywhere generic tooling looks —
Python's tarfile, our own ar/tar inspection — so nothing here ever
errors. The TV's own installer is what eventually rejects it, and it
gives no hint why.

This took three rounds of elimination to isolate: root elevation
wasn't it (Homebrew Channel's own root status was "ok"), and
system-wide native-code verification wasn't it either (a real
native-service app installed fine on the same TV). Comparing our ipk
against that known-good one byte-for-byte was what surfaced the
timestamp anomaly, and rebuilding under Node 18 reproduced correct
timestamps immediately.

build.sh now runs ares-package inside a pinned node:18 container by
default, falling back to the host's Node with a warning if Docker
isn't available. Rebuilt the actual release ipk this way and
regenerated manifest.json/repo.json against its corrected hash.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-26 12:51:13 +02:00

LG TV Audio Cap

Captures the audio playing on an LG webOS 5 or 6 TV and streams it off the set. The reason it exists is HyperHDR: ambient lighting that reacts to what the TV is actually playing, without a microphone in the room or an audio splitter behind the telly.

It installs through the Homebrew Channel and runs as a native background service with a remote-friendly UI in front of it.

┌────────────────────── LG webOS TV ──────────────────────┐
│  PulseAudio / ALSA / a command                          │
│              │                                          │
│         capture ─► level + 16-band analysis             │
│              │                                          │
│              ├─► RTP/L16 ──────────────► HyperHDR host  │  ← the main path
│              ├─► Flatbuffers images ───► HyperHDR       │
│              ├─► raw PCM over UDP                       │
│              ├─► raw PCM over TCP                       │
│              └─► WAV over HTTP                          │
└─────────────────────────────────────────────────────────┘

Why it works this way

HyperHDR has no network audio input. Its sound-reactive effects read a local capture device. So the main path here does not try to talk to HyperHDR at all: it sends the TV's audio to the HyperHDR machine as RTP/L16, and a small receiver there turns it into a normal sound device that HyperHDR can select. That is host/lgtv-audiocap-receiver.py, and host/install-loopback.sh sets up the loopback for it.

If you would rather not run anything on the HyperHDR machine, there is a second path: the TV does the frequency analysis itself and sends finished images to HyperHDR's Flatbuffers port. Fewer moving parts, but the lights react to the TV's idea of the spectrum rather than to real audio.

See docs/hyperhdr.md for both, step by step.

Requirements

  • An LG TV on webOS 5 or 6, rooted, with the Homebrew Channel installed.
  • Root for the service. The TV's audio devices are not readable otherwise; the app has a Grant root access button that calls the Homebrew Channel's elevate-service for you.
  • For the main HyperHDR path: a Linux machine running HyperHDR with either snd-aloop or PulseAudio/PipeWire available.

Installing

This app is not in the official Homebrew Channel repository (that needs a review submission — see docs/development.md). Two ways to get it onto the TV instead, neither needing SSH or Developer Mode:

Add it as a custom repository (recommended). The Homebrew Channel can browse-and-install from any repository URL you give it, not just the official one. Build the ipk, publish it plus a generated repo index, then add that URL on the TV:

npm install                                  # ares-cli, only needed for step 2
./tools/docker-build.sh                      # cross-compile; Linux: ./tools/build.sh native
./tools/build.sh package                     # -> out/*.ipk
python3 tools/make-manifest.py --base-url <where you'll host the release assets>
# -> out/repo.json, out/manifest.json

Attach the ipk, frontend/assets/icon.png and out/repo.json to a release at that URL, then on the TV: Homebrew Channel → ⚙ → Add repository → paste the repo.json URL → back to Browse → Audio Cap → Install. Full walkthrough, including why the URLs have to match exactly, in docs/development.md.

Install the ipk directly, if you do have ares-cli talking to the TV (e.g. LG Developer Mode's ssh on port 9922, or a root SSH server you've enabled):

ares-install --device tv out/org.webosbrew.audiocap_1.0.0_all.ipk

First run

  1. Launch Audio Cap on the TV.
  2. System → Root access: press Grant root access if it says the service is not root. It restarts itself.
  3. Capture → Backend: leave it on Automatic to begin with. If nothing is captured, run tools/tv-probe.sh on the TV to see what your firmware actually offers, then pick a backend by hand.
  4. Outputs → HyperHDR audio (RTP/L16): turn it on and enter the address of the machine running HyperHDR.
  5. On that machine: sudo ./host/install-loopback.sh --install-service, then point HyperHDR's sound capture at the device it prints.
  6. Press Start on the TV. The level meter should move.

Nothing captured, no idea why? docs/troubleshooting.md.

The other outputs

Each can run at the same time as the others.

Output What it is Use it for
HyperHDR audio RTP/L16, port 5004 the main path; also readable by PulseAudio's module-rtp-recv with no custom software
HyperHDR visualiser Flatbuffers images, port 19400 HyperHDR with nothing installed on the host
Raw PCM over UDP S16LE datagrams, port 4010 your own scripts; lowest latency
Raw PCM over TCP S16LE stream, port 4011 anything that would rather connect than listen
HTTP WAV http://tv:4012/audio.wav opening the TV's audio in VLC

Layout

native/        the webOS service: capture, DSP, sinks, Luna API (C)
frontend/      the on-TV app (plain HTML/CSS/JS, no framework)
servicefiles/  services.json, package.json and the boot script
host/          the receiver and loopback setup for the HyperHDR machine
tools/         build, packaging, asset generation, on-TV probe
test/          host-side tests: wire formats, the capture pipeline, the UI
docs/          the longer explanations

Documentation

License

MIT.

S
Description
No description provided
Readme
630 KiB
1.0.0
Latest
2026-08-26 12:16:58 +02:00
Languages
C 61.1%
JavaScript 16.2%
Python 11%
Shell 7.5%
CSS 2.1%
Other 2.1%