Balun jm2
Install Balun with WinGet
winget install --id=jm2.Balun -e Balun is a lightweight cross-platform HDHomeRun live TV viewer.
winget install --id=jm2.Balun -e Balun is a lightweight cross-platform HDHomeRun live TV viewer.
A lightweight, cross-platform HDHomeRun live TV viewer written in Rust with GTK 4, libadwaita, and GStreamer.
Balun lists every HDHomeRun on your network in one sidebar, shows the selected device's own channel lineup in a second, and plays unprotected channels in a live-video pane. Lineups are never merged across devices, no stream URL ever reaches the user interface, and the media framework receives neither a device address nor a stream URL. Playback errors may name the device and its address so you know which tuner failed.

> v0.2.2. Balun plays live TV on Linux, macOS, and Windows and has been verified against real
> tuners. Pre-built packages are on the Releases page;
> the countable status is in docs/task.md.
| Feature | Status |
|---|---|
| Local HDHomeRun discovery (IPv4 broadcast, IPv6 multicast) | ✅ |
| Find a routed tuner by IP address or hostname (WireGuard and other tunnels) | ✅ Remembered across launches |
Search one private subnet (/23 to /32), confirmed before every search | ✅ Linux, macOS, Windows; also balun-discover --approved-range |
| Remember a discovered tuner from its right-click menu | ✅ Same list as devices added by address |
| Multiple devices, each with its own channel lineup | ✅ |
| Device metadata and lineup inspection without allocating a tuner | ✅ |
| Reload the selected device's channels after a failure or lineup change | ✅ Reload channels in the channel header |
| Adaptive three-pane GTK 4 / libadwaita window | ✅ |
| Window size and maximized state remembered across launches | ✅ |
Live playback of unprotected channels (playbin3 + gtk4paintablesink) | ✅ Verified on Linux, macOS, and Windows against real tuners |
| Native media failure boundary | ⚠️ In-process native hangs can block the UI/close path; network bytes do not guarantee useful media. Accepted limits and review triggers |
| Stop, volume, mute, and fullscreen controls | ✅ Stop and switching account for overlapping startup and partial worker creation before completing teardown |
| Software deinterlacing | ✅ Adaptive YADIF, automatic field order, full field rate; mixed-stream transition cadence remains under investigation |
| Keep the display and computer awake during playback | ✅ While playing or buffering, where the desktop permits inhibition |
| Favorite, HD, and protected channel badges | ✅ Protected channels are listed but disabled |
| Playback errors that name the device and channel | ✅ |
| Channel search and favorites-only filter | ✅ |
| Fixed, endpoint-free playback error messages | ✅ |
| Windows local discovery | ✅ |
| Network-change handling | 🚧 Linux, macOS, and Windows: stale addresses expire when adapters, addresses, or routes change, and nothing rescans on its own; macOS and Windows await real-network confirmation |
| Program guide (in-band PSIP/EIT, XMLTV) | 🚧 Future release |
| Hostname entry | ✅ Resolved to at most four unicast addresses; remembered by name; stuck name lookups cannot block closing the viewer |
| Audible output and complete codec contract | ✅ Audio verified across Linux, macOS, and Windows; live timing accounts for delayed media arrival; codec contract frozen, see the support matrix |
| ATSC 3.0 channels | ⚠️ HEVC video needs gst-libav or a platform decoder; AC-4 audio has no open decoder |
| Protected (DRM) channels | ❌ Out of scope |
| Packages (Flatpak, deb, rpm, Arch, DMG, Windows ZIP/installer) | ✅ Releases page downloads and Fedora COPR; AUR and winget pending |
| Cross-platform: Linux, macOS, Windows | ✅ Linux, macOS, and Windows verified with real tuners; live playback and audio confirmed |
| Private local settings | ✅ Pinned profile, schema-preserving transactions, and two-second load/close waits; a stalled save may leave the newest preferences unsaved; a notice appears when settings cannot be saved |
| Light & dark mode | ✅ Automatic (libadwaita) |
| i18n/l10n framework (13 catalogs, auto locale detection) | 🚧 Most window, player, and dialog copy; remaining scope |
Local broadcast and multicast discovery, exact IP or hostname discovery, remembered targets, and network-change handling work on Linux, macOS, and Windows.
Settings support a private local profile under the account's existing configuration parent, which may be group-writable only for the account's own user-private group. Windows retains that parent's inherited permissions; shared or network profiles are outside the contract. A load timeout uses defaults with persistence disabled for that session. A save timeout allows closing with the newest preferences potentially unsaved; an OS publication already in progress may finish later. See the settings boundary for the accepted limits and review triggers.
The product plan is docs/plan-v0.1.md, the countable ledger is
docs/task.md, sanitized hardware observations are in
docs/compatibility-v0.1.md, the evidence-backed support matrix is
docs/support-v0.1.md, the playback contract is in
docs/playback.md, and the v0.1 security and privacy review is in
docs/security-review-v0.1.md.
┌─────────────────────────────────────────────────────────────┐
│ GTK 4 / libadwaita UI │
│ device sidebar · channel sidebar · live-TV player │
├─────────────────────────────────────────────────────────────┤
│ Controller: one Tokio worker publishing URL-free snapshots │
├──────────────────────────────┬──────────────────────────────┤
│ HDHomeRun core │ Playback │
│ discovery · registry · │ session · source policy · │
│ device HTTP · lineup │ HTTP transport → appsrc → │
│ │ playbin3 → gtk4paintablesink │
└──────────────────────────────┴──────────────────────────────┘
Source admission, rejection, and retirement share ownership of the stream workers. Rejection cancels an overlapping startup while retaining those workers for the normal teardown join.
The GTK layer only ever sees stable device and channel identities plus immutable, URL-free snapshots published by one controller thread. Stream URLs stay inside the controller and the playback library.
GStreamer never receives a device address either. playbin3 is given the constant
appsrc://balun URI, and Balun's own HTTP client, with proxies, redirects, and DNS disabled,
fetches the MPEG-TS stream and feeds the built-in appsrc.
ADR-0001 records that decision.
Pre-built packages for Linux (Flatpak, .deb, .rpm, Arch), macOS (.dmg), and Windows
(.exe installer, .zip) are available on the Releases
page; Fedora users can install from COPR instead. Download
SHA256SUMS.txt with a Releases package and verify its SHA-256 entry before installing.
Balun is available from the jmsqrd/balun COPR repository:
sudo dnf copr enable jmsqrd/balun
sudo dnf install balun
Balun is on the AUR in three variants, but they still build 0.1.0 until they are updated:
| Package | Description |
|---|---|
balun | Build from the latest release source |
balun-bin | Pre-built binary from the latest release |
balun-git | Build from the latest main branch commit |
Install with your preferred AUR helper, for example:
yay -S balun-bin
The winget package is awaiting review in microsoft/winget-pkgs; once accepted:
winget install jm2.Balun
| Distribution | Assets |
|---|---|
| Any (Flatpak) | balun-linux-x86_64.flatpak, balun-linux-aarch64.flatpak |
| Debian / Ubuntu | balun-amd64.deb, balun-arm64.deb |
| Fedora / RPM-based | balun-x86_64.rpm, balun-aarch64.rpm |
| Arch Linux | balun-x86_64.pkg.tar.zst |
flatpak install --user ./balun-linux-x86_64.flatpak
sudo apt install ./balun-amd64.deb
sudo dnf install ./balun-x86_64.rpm
sudo pacman -U ./balun-x86_64.pkg.tar.zst
Native packages need GTK 4.16 and libadwaita 1.6 from the distribution; use the Flatpak where the host repositories are older.
Apple Silicon, macOS 15 or later: balun-macos-aarch64.dmg. Mount it and drag Balun to
Applications.
> macOS note: The .dmg is ad-hoc signed but not notarized, so Gatekeeper will block it on
> first launch. After mounting the DMG and dragging Balun to Applications, run:
>
> bash > xattr -cr /Applications/Balun.app >
>
> Then open normally. This is only needed once.
balun-windows-x86_64-setup.exe or balun-windows-aarch64-setup.exe installs Balun. The matching
.zip is a portable tree: unpack it to balun-windows\ and run bin\balun.exe.
Cargo.toml,
verified by a dedicated CI jobgtk4paintablesink) plugins;
gst-libav supplies the usual MPEG-2, H.264, AC-3, and AAC broadcast decoderspkg-configThe default feature set builds the GTK-free core library and balun-discover; the desktop
application needs --features desktop.
Check pkg-config --modversion gtk4 first. Debian 12 and Ubuntu 24.04 ship GTK and libadwaita
versions below Balun's floors, so their standard repositories are not sufficient without a newer
distribution or backports; the Flatpak avoids that host-toolkit requirement.
Debian / Ubuntu:
sudo apt install libgtk-4-dev libadwaita-1-dev libgstreamer1.0-dev \
gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad \
gstreamer1.0-gtk4 gstreamer1.0-libav pkg-config build-essential
Fedora:
sudo dnf install gtk4-devel libadwaita-devel gstreamer1-devel \
gstreamer1-plugins-base gstreamer1-plugins-good gstreamer1-plugins-bad-free \
gstreamer1-plugin-gtk4 gstreamer1-plugin-libav pkgconf-pkg-config gcc binutils
Arch Linux:
sudo pacman -S gtk4 libadwaita gstreamer gst-plugins-base gst-plugins-good \
gst-plugins-bad-libs gst-plugin-gtk4 gst-libav pkgconf base-devel
Then build:
cargo build --release --locked --features desktop --bin balun
# or use the helper script:
./scripts/build-linux.sh
The helper checks the development-library floors and GStreamer plugin files before building,
names the package for anything missing, and writes target//release/balun. Its
--deb, --rpm, and --arch-pkg modes build and reopen the native package for the current
supported architecture; they require the pinned packager to be installed already and never
install tools or dependencies themselves.
Requires Homebrew:
brew install gtk4 libadwaita adwaita-icon-theme pkgconf gstreamer
./scripts/build-macos.sh
The gstreamer formula supplies the base, good, bad, and gst-plugins-rs plugins. The helper
validates the resulting Mach-O against the release component policy and writes
target//release/balun. Use --app to assemble, ad-hoc sign, relocate, and probe
dist/Balun.app, or --dmg to add a reopened drag-to-Applications dist/Balun.dmg.
Packaging also requires Python 3 and the system sandbox-exec tool. Native dependency
validation covers all Mach-O members and architectures, including dynamically loaded
pixbuf modules. Only Apple system library/framework paths may resolve outside the app.
The relocated probe denies reads from the Homebrew prefix, /opt/homebrew, and /usr/local.
Use --run to launch from the build tree with only Balun's playback plugins enabled.
macOS prefers libav for MPEG-2 broadcasts because VideoToolbox advertises MPEG-2 even on
Macs that cannot decode it; H.264 and HEVC retain their usual hardware decoder selection.
Requires MSYS2 with the native LLVM environment:
| Windows architecture | MSYS2 shell | Package prefix | Rust target |
|---|---|---|---|
| x86_64 | CLANG64 | mingw-w64-clang-x86_64 | x86_64-pc-windows-gnullvm |
| ARM64 | CLANGARM64 | mingw-w64-clang-aarch64 | aarch64-pc-windows-gnullvm |
In the matching MSYS2 shell, its MINGW_PACKAGE_PREFIX selects the native packages:
pacman -S "${MINGW_PACKAGE_PREFIX}-gtk4" \
"${MINGW_PACKAGE_PREFIX}-libadwaita" \
"${MINGW_PACKAGE_PREFIX}-gstreamer" \
"${MINGW_PACKAGE_PREFIX}-gst-plugins-base" \
"${MINGW_PACKAGE_PREFIX}-gst-plugins-good" \
"${MINGW_PACKAGE_PREFIX}-gst-plugins-bad" \
"${MINGW_PACKAGE_PREFIX}-gst-plugins-rs" \
"${MINGW_PACKAGE_PREFIX}-gst-libav" \
"${MINGW_PACKAGE_PREFIX}-pkg-config" \
"${MINGW_PACKAGE_PREFIX}-toolchain"
Then install the matching Rust target and build in PowerShell:
# x86_64 Windows:
rustup target add x86_64-pc-windows-gnullvm
# ARM64 Windows (use this target instead):
rustup target add aarch64-pc-windows-gnullvm
# Build the desktop shell (add -Run to launch it):
.\scripts\build-windows.ps1
The helper detects a standard MSYS2 installation (pass -Msys2Root C:\path\to\msys64 otherwise),
selects the profile matching native Windows unless RUST_TARGET names one explicitly, rejects a
mixed CLANG64/CLANGARM64 environment, verifies every PE architecture and plugin file, and writes
the executable under target\\release\balun.exe. This is a developer build against
the installed MSYS2 runtime, not a portable bundle or installer.
To package it:
# Stage dist\balun-windows, probe it, and create dist\balun-windows.zip:
.\scripts\build-windows.ps1 -Zip
# Also compile dist\balun-setup.exe (requires a preinstalled Inno Setup 6):
.\scripts\build-windows.ps1 -InnoSetup
The package keeps the MSYS2 prefix shape (bin\balun.exe beside its DLLs, lib\gstreamer-1.0,
libexec\gstreamer-1.0, share) and contains only the reviewed GStreamer plugin closure and the
DLLs those binaries import. Before the archive is written, the helper runs the staged balun.exe
itself with a sanitized environment so the bundled scanner, a fresh registry, and the synthetic
MPEG-2 fixture are proven inside the tree, then reopens the ZIP against it. -InnoSetup -SkipBundle rebuilds only the installer from a tree whose complete-payload probe receipt
still matches. Changes to any staged member or local packaging policy require a fresh
bundle/probe. The local receipt detects stale state; it is not a signature or provenance
attestation. -InnoSetup also requires the pinned BALUN_INNOEXTRACT_DIR build tool and
independently extracts and compares the complete installer payload, repeats native/resource
checks, and probes the extracted runtime before success. See the
installer inspection procedure for tool setup and limits.
# Desktop application:
cargo run --locked --features desktop --bin balun
# With debug logging on standard error:
RUST_LOG=balun=debug cargo run --locked --features desktop --bin balun
# With GStreamer's own element warnings as well:
GST_DEBUG=2 RUST_LOG=balun=debug cargo run --locked --features desktop --bin balun
Balun logs discovery, lineup, tune, and playback outcomes to standard error at info by default;
RUST_LOG selects the level, as in Tributary. Native playback reports retain known error domains,
numeric codes, closed media/format labels, and typed counters. Plugin error/debug text, stream
identifiers, arbitrary caps values, and unknown marker names are discarded. GStreamer's own
opt-in GST_DEBUG output bypasses Balun's filtering and can contain stream-derived text.
./scripts/build-linux.sh --run and ./scripts/build-macos.sh --run
build the desktop and launch it in the same terminal. On Windows,
.\scripts\build-windows.ps1 -Run uses a console-attached
release-profile developer build, so those logs remain visible in the invoking PowerShell session.
The distributed ZIP and installer remain GUI-subsystem applications and do not attach a console.
For bounded per-generation tune startup records, use
RUST_LOG=off,balun::playback::timing=debug. The phase definitions
distinguish retirement, handoff, graph setup, worker-captured HTTP/appsrc observations,
and received pipeline notifications;
decoded/rendered media timing and usable-media deadlines remain V2.1 work.
balun-discover is the GTK-free command-line tool behind the desktop's discovery. It never opens
a channel stream or allocates a tuner.
# Ordinary local discovery:
cargo run --locked --bin balun-discover
# Also fetch device metadata and lineup summaries:
cargo run --locked --bin balun-discover -- --inspect --local
# Probe one known device address, for example across WireGuard:
cargo run --locked --bin balun-discover -- --target 192.168.50.20
# Search one explicitly approved private subnet:
cargo run --locked --bin balun-discover -- --approved-range 192.168.2.0/23
--approved-range is that invocation's confirmation of one canonical RFC 1918 subnet from /23
to /32: at most 510 addresses, two requests each, 64 per second, for 30 seconds, and only while
network changes are observed. Only search a network you own or administer, and prefer --target
whenever the address is known. Ctrl+C cancels any run.
--target applies the desktop's unicast address rules and accepts no URL, hostname, port,
loopback, multicast, unspecified, broadcast, or scoped/link-local IPv6 address. Each exact
probe sends at most two requests, waits 200 ms per attempt, and accepts at most 16 reply
datagrams and one device identity. One invocation admits at most 32 actions and one
--approved-range.
On Windows, .\scripts\build-windows.ps1 -InspectLocal builds the diagnostic and runs exactly
--inspect --local.
Balun includes a pre-commit hook that runs cargo fmt --check to prevent formatting errors from
being committed. To enable it after cloning:
git config core.hooksPath hooks
All three platform build scripts support quick-exit modes for formatting, type-checking, linting, coverage, and the installed-runtime playback probes:
# Linux / macOS:
./scripts/build-linux.sh --fmt # or build-macos.sh --fmt
./scripts/build-linux.sh --check # or build-macos.sh --check
./scripts/build-linux.sh --clippy # or build-macos.sh --clippy
./scripts/build-linux.sh --coverage # or build-macos.sh --coverage
./scripts/build-linux.sh --probe-playback # or build-macos.sh --probe-playback
./scripts/build-linux.sh --run # build, then launch (or build-macos.sh --run)
./scripts/build-linux.sh --diagnostic # GTK-free balun-discover build
./scripts/build-linux.sh --deb # native Debian package
./scripts/build-linux.sh --rpm # native RPM package
./scripts/build-linux.sh --arch-pkg # x86_64 Arch package
./scripts/build-macos.sh --app # self-contained app bundle
./scripts/build-macos.sh --dmg # app bundle and disk image
# Windows (PowerShell):
.\scripts\build-windows.ps1 -Fmt
.\scripts\build-windows.ps1 -Check
.\scripts\build-windows.ps1 -Clippy
.\scripts\build-windows.ps1 -Test
.\scripts\build-windows.ps1 -Coverage
.\scripts\build-windows.ps1 -ProbePlayback
.\scripts\build-windows.ps1 -Bundle # stage and probe dist\balun-windows
.\scripts\build-windows.ps1 -Zip # ... and create dist\balun-windows.zip
.\scripts\build-windows.ps1 -InnoSetup # ... and compile dist\balun-setup.exe
.\scripts\build-windows.ps1 -Diagnostic
.\scripts\build-windows.ps1 -InspectLocal
.\scripts\build-windows.ps1 -Run
The check, Clippy, and coverage modes include the desktop feature by default, and Clippy runs with
-D warnings in both the debug and release profiles. --probe-playback (-ProbePlayback) runs the
same installed-runtime probes CI uses on every platform, prints the installed decoder and audio-sink
inventory for the codec contract, and cannot be combined with --diagnostic. The Linux helper's
--deb, --rpm, and --arch-pkg build and reopen a native package with a preinstalled pinned
packager; --flatpak stays release-workflow-owned. The macOS helper's --app and --dmg and the
Windows helper's -Bundle, -Zip, and -InnoSetup use the selected profile to stage, probe, and
archive the package as described under Windows. None of the helpers installs its
packagers or dependencies. The helpers keep Tributary's filenames and flags;
docs/tributary-build-infrastructure.md is the port
ledger.
Linux native package inspection also requires Python 3 and freezes one bounded private input snapshot for all metadata and payload tools. RPM, Debian, and Arch payloads receive bounded decoding and member preflight before extraction. Debian inspection requires GNU tar; Arch requires zstd and GNU tar. Native parser isolation and extraction containment remain pending; the release workflow continues to accept only locally produced packages.
The native-failure study uses owned child processes to exercise stuck GStreamer calls without hanging the test runner. The adversarial regression suites run short, replayable parser and policy corpora in PR CI and longer generated corpora daily. CI also enforces critical-path coverage baselines, with separate Rust, Python, and PowerShell measurements and explicit gaps.
# Core checks (GTK- and GStreamer-free), as run by CI:
cargo fmt --all -- --check
cargo clippy --all-targets --locked -- -D warnings
cargo test --all-targets --locked
cargo test --release --all-targets --locked
# Real-tuner proofs (opt-in, never run by CI; see src/playback/live_hardware.rs):
BALUN_LIVE_HARDWARE=1 cargo test --features desktop --lib live_hardware -- \
--ignored --nocapture --test-threads=1
# Desktop and playback lifecycle smokes under an isolated headless compositor:
scripts/test-desktop-lifecycle.sh
# Helper self-tests:
scripts/test-build-linux-policy.sh
scripts/test-build-macos-policy.sh
pwsh -NoProfile -File scripts/test-build-windows-routing.ps1
test-desktop-lifecycle.sh prefers a headless Weston session and falls back to Xvfb only when
Weston is unavailable. Set BALUN_DESKTOP_TEST_BACKEND to wayland or x11 to require one
backend; auto is the default, and CI requires Wayland.
CI automatically runs on every push/PR:
cargo fmt, strict Clippy, and debug plus release testscargo audit, npm audit on the lint tools, and an OSV query for the
pinned Python CI toolscargo check --all-features on the declared Rust 1.98 minimum--probe-playback, and
drives the Wayland lifecycle smokesv tag against every version
declaration, builds internal diagnostics and 12 public binary artifacts, requires the exact
inventory with SHA256SUMS.txt, and creates a draft release from a job that checks out no
source. The public set is two Flatpaks; Debian amd64 and arm64, RPM x86_64 and aarch64, and Arch
x86_64 packages; an Apple Silicon DMG; and x86_64 and ARM64 Windows ZIPs and installers. Every
action it runs is pinned to an immutable commitCI and Linux release job containers use reviewed image-index digests, checked against an explicit inventory. Pinning packages installed afterward and other mutable build inputs is deferred (H2.2).
build-aux/toolchain/rust-toolchain.toml declares the compiler floor; its nested location keeps
it from acting as a repository-wide rustup override.
python3 scripts/test_rust_toolchain_policy.py
python3 scripts/sync_rust_toolchain.py --check
# After raising the floor in build-aux/toolchain/rust-toolchain.toml:
python3 scripts/sync_rust_toolchain.py --from-toolchain
Bump the version in Cargo.toml (and Cargo.lock), the pkgver in build-aux/arch/PKGBUILD
(a prerelease such as 0.2.0-alpha.1 is spelled 0.2.0pre.1.alpha.0.1 there; the check prints
the expected value), and upstream_version plus Version in build-aux/rpm/balun.spec
(0.2.0-alpha.1 and 0.2.0~alpha.1), add the ## [version] changelog section and its compare
link, add the
`` to the AppStream metainfo, then confirm they agree before tagging:
python3 scripts/release_check.py --tag v0.2.2
Push an annotated v tag and run the Release candidate workflow with it. Tag signing is
deferred (H2.1); releases so far used unsigned annotated tags by maintainer approval. The workflow
repeats the check, builds every artifact from that one commit, verifies the exact inventory, and
creates a draft GitHub release with SHA256SUMS.txt and the changelog section as its notes. It
refuses to touch a release that is already published; publishing the draft is a manual step.
Balun does not play DVDs, Blu-ray discs, or DRM-protected channels, and a shared, fail-closed policy keeps dedicated optical-disc decryption and proprietary DRM components out of every release input. Ordinary codecs, containers, TLS, and general-purpose cryptography are outside that deny list. See the release component policy for the current and future enforcement boundary.
src/
├── main.rs # Desktop application entry point
├── lib.rs # GTK-free core library
├── app.rs # GTK application lifecycle (io.github.jm2.Balun)
├── bin/
│ └── balun-discover.rs # GTK-free discovery and inspection diagnostic
├── domain/
│ ├── device.rs # HDHomeRun DeviceID identity and checksum
│ └── channel.rs # Guide number and device-scoped ChannelKey
├── hdhr/
│ ├── protocol.rs # UDP discovery frames, TLVs, and CRCs
│ ├── http.rs # Bounded, responder-pinned discover.json / lineup.json client
│ ├── lineup.rs # Streaming, bounded lineup parsing
│ ├── inspection.rs # Identity-safe device inspection with locator fallback
│ ├── resolver.rs # Selected-device snapshot resolution
│ ├── fallback.rs # Preferred-first locator ordering
│ └── fake_device.rs # Loopback fake HDHomeRun for end-to-end tests
├── discovery/
│ ├── mod.rs # Bounded discovery orchestration
│ ├── client.rs # Bounded UDP probe client
│ ├── local.rs # Per-interface broadcast and multicast endpoints
│ ├── manual.rs # Exact-address target validation
│ ├── registry.rs # Device registry with locator claims and expiry
│ ├── changes.rs # Debounced network-change coalescing and interface inventory
│ ├── changes/ # rtnetlink, routing-socket, and IP Helper change watchers
│ ├── typed_subnet.rs # Typed RFC 1918 subnet scope and search budget
│ └── subnet.rs # Paced, bounded search of one confirmed subnet
├── controller/
│ ├── runtime.rs # Controller thread, command ingress, snapshot publishing
│ ├── state.rs # Immutable URL-free device and channel projections
│ ├── network.rs # Network-change source boundary and native watcher thread
│ └── handoff.rs # One-shot, URL-redacted stream handoff
├── settings/
│ ├── mod.rs # Versioned settings schema and validation
│ └── store.rs # Pinned private-profile transactions
├── localization.rs # Compiled catalogs and startup locale selection
├── localization/ # Translated presentation copy for each interface area
├── playback/
│ ├── runtime.rs # GStreamer initialization and factory snapshot
│ ├── session.rs # Generation-owned playbin3 session and teardown
│ ├── source_policy.rs # Fail-closed appsrc source-setup policy
│ ├── transport.rs # Balun-owned HTTP transport feeding appsrc
│ ├── pipeline_failure.rs # Endpoint-free failure classification
│ └── fake_device_e2e.rs # End-to-end proofs against the fake device
└── ui/
├── window.rs # Adaptive three-pane window and controller bridge
├── device_sidebar.rs # Device list with Refresh, Find by address, Search a subnet, and Stop
├── channel_sidebar.rs # Selected device's channel list and badges
├── exact_discovery_dialog.rs # Find device by address dialog
├── subnet_search_dialog.rs # Subnet entry and per-search confirmation
├── player_view.rs # Live-TV picture, status, and playback controls
├── settings_session.rs # Bounded asynchronous settings load and close
├── settings_session/ # One worker and the latest queued settings snapshot
└── objects.rs # GObject wrappers for the sidebar models
scripts/
├── build-linux.sh # Linux build and native-package helper
├── build-macos.sh # macOS build, app, and DMG helper
├── build-windows.ps1 # Windows build helper (MSYS2 CLANG64/CLANGARM64)
├── test-desktop-lifecycle.sh # Headless Wayland/Xvfb desktop and playback smokes
├── test-build-* # Helper routing tests
├── macos-*-policy.sh # macOS bundle and icon policy helpers
├── render-icons.py # Renders every icon raster from the SVG source
└── sync_rust_toolchain.py # Rust floor synchronization
build-aux/
├── arch/ # x86_64 Arch package recipe
├── flatpak/ # Flatpak manifest, pinned Cargo-source generator, permission/bundle validators
├── inno/ # x86_64/ARM64 Windows installer recipe
├── linux/ # Native Linux package payload and metadata validators
├── packaging/ # Shared forbidden-component policy and validator
├── release-toolchain/ # Reviewed release-job Rust compiler
├── rpm/ # Fedora COPR (Packit) RPM spec
└── toolchain/ # Rust compiler floor declaration
data/
├── io.github.jm2.Balun.desktop # Desktop entry
├── io.github.jm2.Balun.metainfo.xml # AppStream metadata
├── icons/hicolor/ # Application icon: SVG source, symbolic SVG, 16-512 px renders
├── balun.iconset/ # macOS icon set rendered from the SVG (up to 1024 px)
├── balun.png # 1024 px master render
└── balun.ico # Windows icon rendered from the SVG
hooks/pre-commit # cargo fmt check
tests/ # Synthetic MPEG-2 fixture and display-backed playback test
docs/ # Plan, task ledger, playback contract, compatibility notes, ADRs
At launch Balun runs one bounded local discovery over every attached interface and then probes
the addresses you previously added; nothing rescans on its own after that. Refresh devices
runs the same local discovery again.
Find device by address probes one numeric IPv4 or unscoped IPv6 address, or a hostname, for a
tuner behind WireGuard or another routed link. It accepts no port or range; a name resolves to at
most four unicast addresses that are probed one at a time, each probe sends at most two requests,
and up to 32 distinct addresses are admitted per session. A tuner that answers is remembered, by
name when you entered a name, and probed again at the next launch; right-click a listed device,
or press Menu or Shift+F10 on it, and choose Forget device to drop that entry, or Remember
device to add one for a tuner that has none. Search a subnet searches one private IPv4 subnet,
/23 to /32, only after you confirm its address count and request budget each time; the dialog
offers the last subnet you searched, and Forget subnet removes it. Stop device discovery
cancels any search and any remaining launch probes.
On Windows, local discovery uses the limited broadcast from each interface. If a host firewall blocks the replies, use Find device by address with the tuner's IPv4 address.
Select a device to load its channel lineup. Type in the search field above the list to match a channel number or name, or press the star to show favorites only. Click a channel or press Enter to play it; moving the keyboard highlight alone never tunes. Protected channels are listed but cannot be activated. The player header has Stop, a volume slider, a mute toggle, and a fullscreen button; volume and mute carry across channel changes for the running session. Balun requests that the display and computer stay awake while playing or buffering, and releases that request on Stop, failure, device change, or close. The desktop's power policy may override it.
Use Reload channels in the channel header to retry a failed lineup or fetch changes directly from the selected device. Reloading stops the current channel; select a channel again to resume.
| Shortcut | Action |
|---|---|
F11 | Toggle fullscreen |
Escape | Exit fullscreen |
Ctrl+F (⌘F on macOS) | Focus channel search |
Ctrl+R (⌘R on macOS) | Refresh devices |
F5 | Refresh devices |
F11, F5, and Escape are recognized only without modifier keys. Window shortcuts are ignored
while a dialog is open.
Balun is a viewer, not a DVR or tuner administration tool. Recording, timeshift, protected-channel playback, firmware management, transcoding, and a merged cross-device channel list are outside the v0.1 scope.
CONTRIBUTING.md covers the build, the pull-request flow, the ledger and docs
register, and the contracts a change must not weaken. Report vulnerabilities privately as
described in SECURITY.md, not in a public issue.
Balun is licensed under the GNU General Public License v3.0 or later.