Skip to content
corebontsPublic

About

A lightweight, native Android and Android TV client for Tvheadend.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

MuxGrid — Modern Tvheadend client for Android & Android TV (Live TV, EPG Guide, Recordings)

Latest Release License: Apache-2.0 minSdk 28 (Android 9+)

MuxGrid is a lightweight Tvheadend (4.3+) client for Android and Android TV, with experimental desktop builds for Linux and Windows. It offers sub-second channel zapping, local live pause/rewind (timeshift), smooth playback of completed and actively recording DVR shows, background audio playback on mobile, and a low-glare Broadcast Monitor dark interface across four themes (Amber, Carbon, Aurora, and Indigo).

A single codebase produces ABI-split APKs for Android phones, tablets, and Android TV / Google TV devices (Android 9+), a Linux x86-64 AppImage, and a Windows x64 portable ZIP. See the desktop guide for setup and controls.

Screenshots

Android Phone

Live Channels Program Guide (EPG) DVR & Recordings
Phone Live Channels Phone Program Guide Phone Recordings

Phone Live Player & Timeshift HUD

Android TV

Live Channels Program Guide (EPG)
Android TV Live Channels Android TV Program Guide
Live Player & Timeshift OSD DVR & Recordings
Android TV Live Player Android TV Recordings

Features

  • Live TV & Radio:
    • Instant channel zapping on LAN via Tvheadend's pass (MPEG-TS) stream profile with zero server-side transcoding.
    • Native broadcast decoding via libmpv: 1080i interlaced H.264 (with bwdif software deinterlacing on mobile and zero-copy hardware decoding on TV), MP2/AC3/AAC audio track switching, and bitmap DVB subtitles (DVBSUB).
    • Channel filtering (All, TV, Radio, Favorites, and server channel tags), automatic real-time metadata sync, audio-reactive Ambient Radio Glow stage for radio channels, and clear tuner-conflict notices on single-tuner servers.
  • Live Timeshift (Pause & Rewind):
    • Disk-backed local libmpv ring buffer with configurable size limits in Settings (Off, 512 MB, 1 GB, 2 GB, 4 GB), free-space checks, and automatic recovery when pause reaches the forward buffer cap.
    • Buffered-range seekbar with -MM:SS · Back to Live quick jump.
  • Program Guide (EPG):
    • Phone & Tablet: Free 2D-scrolling horizontal multi-channel timeline grid across portrait, landscape, and tablet (with a collapsible icon-only channel column when scrolling forward in portrait, plus keyboard/gamepad auto-follow), day tabs, Now jump, expandable icon-triggered search, and a unified program detail bottom sheet (Watch Live, Watch from Start / Resume Chase Play, Start Over, Record, Stop & Save, Cancel Timer).
    • Android TV: Continuous horizontal timeline grid with sticky channel column, live "Now" hairline, D-pad Left/Right focus auto-follow across hours and days, top-bar program search, a fixed-height bottom details bar for focused programs, and a unified show details & DVR actions modal.
  • DVR & Recording Management:
    • Dedicated sections/shelves for Recording Now, Completed (grouped by series/title), and Scheduled timers.
    • Schedule, stop, cancel, and delete recordings directly via HTSP.
    • Watch from Start (Chase-Play) & Start Over: Seamless Live ↔ Chase-Play handoff, Start Over, and fast seeking of actively growing recordings over an in-process HTSP VFS tail-follow loopback proxy (LocalMediaProxy).
    • Server-side resume position (playposition) and watched state (playcount) synced across devices, with local fallback for read-only users.
  • Background Audio & Picture-in-Picture (Phone & Tablet):
    • Media3 MediaSessionService foreground playback with lock-screen controls, Bluetooth/headset media keys, audio focus handling, headphone-disconnect pause, and Wi-Fi/partial wake locks.
    • Persistent mini-player bar and unified Background Playback selector (Off, Audio with vid=no backgrounding, or PiP) in Settings, with automatic radio backgrounding.
  • Tailored Mobile & 10-ft TV Controls:
    • Mobile: Swipeable category/filter tabs on Live TV and Recordings, unified player timeline transport (|< / >| for Start Over, Chase-Play, and Live), double-tap seek (-10s / +30s), vertical edge drags for brightness and volume, aspect ratio selector, in-player Playback Info diagnostics, persisted subtitle preferences, Quick-Zap channel drawer, adaptive tablet/landscape layout, 4 dark themes (Amber, Carbon, Aurora, Indigo) with shader-backed backdrops, Radio Ambient Glow toggle, in-app Language selector (English, Hungarian, German, French, Spanish, and Polish, plus Android 13+ per-app language), configurable Start Screen, and Haze backdrop blur on non-video chrome.
    • Android TV: Collapsible left Navigation Rail, instant Ch+/Ch- / D-pad Up/Down zapping with minimal OSD, unified player timeline transport (|< / >|), progressive D-pad seeking (10s → 30s → 1m → 5m → 10m tap ladder with gear-locked continuous hold capped at 30s), in-player Playback Info panel, 4 dark themes (Amber, Carbon, Aurora, Indigo) with shader-backed backdrops, Radio Ambient Glow toggle, in-app Language selector, configurable Start Screen, and an overlay Quick Channel Strip.
    • Desktop on Linux and Windows x64 (Experimental): Reuses :feature:tv via Compose Multiplatform Desktop (Windows x64 tuned for D3D11VA / d3d11va-copy + bwdif deinterlacing) with keyboard navigation (Tab, Shift+Tab, and the arrow keys move focus, and Enter activates the focused control). Playback shortcuts include Esc/Backspace, Space/K to play or pause, J/L to seek, PageUp/PageDown to change channels, F/F11/Alt+Enter for fullscreen, S for tracks and aspect ratio, and I for playback info. Use 1–4 to switch tabs and / to search the EPG. The sidebar expands on hover, and moving the mouse over the player reveals the controls, including the top-right close button that stops playback. Double-click the video to toggle fullscreen or click the timeline to seek. Android & Android TV remain the primary target.

Server Setup (Tvheadend)

MuxGrid includes a guided 3-step Onboarding Wizard & Server Preflight Diagnostics (accessible during setup and in Settings → Server Diagnostics) to verify HTSP (9982/tcp), HTTP (9981/tcp), DVR permissions, pass stream profile availability, clock drift, and DVR disk space.

MuxGrid requires Tvheadend 4.3+ with both HTSP (9982/tcp) and HTTP (9981/tcp) reachable over your LAN or VPN, and the pass stream profile enabled.

See docs/SERVER_SETUP.md for a complete step-by-step guide covering:

  • Stream profiles (pass, htsp, matroska) and DVR profile settings
  • Creating a least-privilege Tvheadend user (full DVR vs. read-only permissions)
  • Server-side vs. local timeshift, single-tuner considerations, and VPN remote access
  • Verification commands (curl, nc) and troubleshooting

Download & Install

Prebuilt signed APKs are published on GitHub Releases (minSdk 28 / Android 9+):

  • Phone / Tablet / 64-bit Android TV (arm64-v8a): muxgrid-vX.Y.Z-arm64-v8a.apk
  • 32-bit Android TV (armeabi-v7a): muxgrid-vX.Y.Z-armeabi-v7a.apk

Each release includes a SHA256SUMS.txt file for verifying downloads.

Desktop previews use a Linux x86-64 AppImage or a Windows x64 portable ZIP. Both include Java, libmpv, and FFmpeg. See the desktop guide for downloads, setup, controls, and licenses.

Build & Install from Source

Prerequisites

  • JDK 17
  • Android SDK with compileSdk 37.2 (release(37), minor 2) and build tools installed (or let Gradle download missing SDK components if configured)
  • Target device running Android 9 (API 28) or newer

Build & Run Tests

./gradlew test assembleDebug

ABI-split debug APKs are generated at:

  • Phone / Tablet / 64-bit TV (arm64-v8a): app/build/outputs/apk/debug/app-arm64-v8a-debug.apk
  • 32-bit Android TV (armeabi-v7a): app/build/outputs/apk/debug/app-armeabi-v7a-debug.apk

Sideload via ADB

adb install -r app/build/outputs/apk/debug/app-arm64-v8a-debug.apk
# or for 32-bit Android TV devices:
adb install -r app/build/outputs/apk/debug/app-armeabi-v7a-debug.apk

For fast local testing with release-like ART AOT performance on Android TV (skipping R8 while setting isDebuggable = false and keeping debug signing), use the noDebug build type:

./gradlew assembleNoDebug -x lintVitalNoDebug
adb install -r app/build/outputs/apk/noDebug/app-armeabi-v7a-noDebug.apk

Desktop on Linux and Windows x64 (Experimental)

See the desktop guide for local runs, app images, and packages.

Signed Release Builds (Optional)

To sign release builds (./gradlew assembleRelease), create a gitignored keystore.properties in the repo root:

storeFile=/path/to/your-release.keystore
storePassword=...
keyAlias=...
keyPassword=...

Alternatively, provide MUXGRID_KEYSTORE_PATH, MUXGRID_KEYSTORE_PASSWORD, MUXGRID_KEY_ALIAS, and MUXGRID_KEY_PASSWORD environment variables. Without signing credentials, assembleRelease produces unsigned minified APKs.

Architecture at a Glance

┌─────────────────────────────────────────────────────────────────────────┐
│       Unified Multiplatform Core + Android (Primary) + Desktop (Exp.)   │
│                                                                         │
│  :feature:mobile (Android M3)     :feature:tv (KMP Android + Desktop)   │
│                └──────────────┬───────────────┘                         │
│                               ▼                                         │
│     :core:data (KMP StateFlow Store + DataStore + Encrypted Creds)      │
│     :core:designsystem (KMP Tokens, Shaders, Generated String Catalog)  │
│              ┌────────────────┴─────────────────┐                       │
│              ▼                                  ▼                       │
│  :core:htsp (Pure Kotlin TCP)      :core:player-core (Playback + Seek)  │
│  • Channels, EPG, DVR push sync    ├── :core:player (Android + Media3)  │
│  • Auth tickets & VFS tail-follow  └── :desktop:player (Exp. JNA mpv)   │
└──────────────┬──────────────────────────────────┬───────────────────────┘
               │ HTSP (9982/tcp)                  │ HTTP (9981/tcp, pass / dvrfile)
               ▼                                  ▼
                    Tvheadend 4.3+ Server (LAN / VPN)

Documentation

Document Purpose
docs/SERVER_SETUP.md Step-by-step Tvheadend server configuration, ACL permissions, verification & troubleshooting
docs/ARCHITECTURE.md Multi-module architecture, hybrid HTSP/HTTP proxy design, and verified platform/protocol notes
docs/DESIGN.md Broadcast Monitor visual tokens, mobile/TV layouts, player HUD, gestures & D-pad rules
docs/PROTOCOL.md Tvheadend HTSP binary wire format, RPC subset, and LocalMediaProxy contract
docs/TRANSLATIONS.md Community translation guide, string resource conventions, and validation steps
CHANGELOG.md Release and implementation history
ROADMAP.md Planned features and upcoming platform work

Acknowledgments & Attribution

Third-Party Projects & Libraries

See NOTICE for full third-party copyright and license notices. The same attributions plus the complete GPLv3 and Apache-2.0 license texts are bundled and readable offline in Settings → App Info → Licenses & Notices.

AI Assistance

Architected, researched, designed, and implemented with the assistance of Google Antigravity (powered by Gemini), including the clean-room HTSP protocol implementation, SVG iconography, and multi-module Kotlin/Compose codebase.

License

  • Source Code (LICENSE): The original Kotlin source code, documentation, and assets in this repository are licensed under the Apache License, Version 2.0.
  • Android APKs: The APKs link and bundle prebuilt libmpv and FFmpeg native binaries via io.github.abdallahmehiz:mpv-android-lib:0.2.1 (built with --enable-gpl --enable-version3), so distributed APKs are governed by the GNU General Public License v3.0 or later (GPL-3.0-or-later). Upstream source and build scripts for the bundled native libraries are available at abdallahmehiz/mpv-android, mpv-player/mpv, and FFmpeg/FFmpeg. The playback engine is isolated behind the PlaybackEngine interface in :core:player so the rest of the codebase remains modular and reusable under Apache-2.0.
  • Desktop previews: See the desktop package notices for the bundled OpenJDK, AppImage runtime, libmpv, and FFmpeg licenses and source.

About

A lightweight, native Android and Android TV client for Tvheadend.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages