Skip to content

chamika/DashTune

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

76 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DashTune

A fully-featured Jellyfin music and audiobook player for Android Automotive OS (AAOS) with offline download capabilities.

Overview

DashTune brings the complete Jellyfin music library experience to your car's infotainment system. Stream your music collection, browse audiobooks, download tracks for offline playback, and enjoy seamless integration with Android Automotive OS.

Features

🎡 Music Streaming & Playback

  • Media3 ExoPlayer - Modern, high-performance audio playback
  • Configurable Browse Categories - Choose 2-4 categories from Latest, Favourites, Books, Playlists, Random
  • Search - Find artists, albums, playlists, and tracks
  • Playback Controls - Play, pause, skip, seek with shuffle and repeat modes
  • State Persistence - Automatically resume where you left off

πŸ“š Audiobook Support

  • Browsable Library - Books appear as a top-level category with folder hierarchy
  • Multi-Chapter Playback - Chapters play as an ordered playlist with next/previous navigation
  • Server-Synced Position - Playback position saved to Jellyfin server on pause/stop
  • Resume Anywhere - Resume from saved position after app restart or on another device
  • Progress Indicators - AAOS completion status shows read progress on chapter items
  • Auto-Disable Shuffle - Shuffle automatically turns off for audiobook playback

πŸ“₯ Offline Playback

  • Smart Caching - Automatic caching of streamed tracks (configurable size: 100MB - 2GB)
  • Prefetch Next Tracks - Downloads next 5 tracks in queue respecting shuffle/repeat
  • DownloadManager Integration - Efficient background downloads with 3 parallel connections
  • LRU Cache Eviction - Automatically manages storage by removing least recently used tracks

πŸ” Authentication

  • QuickConnect - Pair with Jellyfin server using a simple code
  • Username/Password - Traditional login support
  • Android AccountManager - Secure token storage and management
  • Multi-Server Support - Switch between different Jellyfin servers

🎨 AAOS Integration

  • Native Media UI - Integrated with Android Automotive media player
  • Album Art - ContentProvider-based album art delivery with disk caching
  • Scrobbling - Automatic playback tracking to Jellyfin
  • Favorites - Heart/unheart tracks with HeartRating API
  • Dark Theme - Optimized for in-car viewing with high contrast

βš™οΈ Settings

  • Bitrate Selection - Direct stream or transcode (320/256/192/160/128 kbps)
  • Cache Size - Configure offline storage (100MB/200MB/500MB/1GB/2GB)
  • Browse Categories - Choose which categories appear in the media player (min 2, max 4)
  • Version Info - Display app and Jellyfin SDK versions

Tech Stack

  • Language: Kotlin
  • Min SDK: 28 (Android 9.0)
  • Target SDK: 36
  • Architecture: Single automotive module with Hilt DI
  • Media: AndroidX Media3 (ExoPlayer + MediaLibraryService) 1.9.2
  • Jellyfin SDK: org.jellyfin.sdk:jellyfin-core:1.8.6
  • Dependency Injection: Hilt 2.59.1
  • HTTP Client: OkHttp 5.3.2
  • Database: Room (media cache, parent relationships)
  • UI: XML layouts with ViewBinding
  • Caching: Guava cache for metadata, SimpleCache for media files

Project Structure

DashTune/
β”œβ”€β”€ automotive/
β”‚   └── src/main/
β”‚       β”œβ”€β”€ java/com/chamika/dashtune/
β”‚       β”‚   β”œβ”€β”€ DashTuneApplication.kt          # Hilt app
β”‚       β”‚   β”œβ”€β”€ DashTuneMusicService.kt         # MediaLibraryService with offline cache
β”‚       β”‚   β”œβ”€β”€ DashTuneSessionCallback.kt      # Media session callbacks
β”‚       β”‚   β”œβ”€β”€ AlbumArtContentProvider.kt      # Album art delivery
β”‚       β”‚   β”œβ”€β”€ CommandButtons.kt               # Shuffle/Repeat buttons
β”‚       β”‚   β”œβ”€β”€ auth/                           # Authentication & account management
β”‚       β”‚   β”œβ”€β”€ data/                           # MediaRepository, Room DB (cache + position)
β”‚       β”‚   β”œβ”€β”€ di/                             # Hilt dependency injection
β”‚       β”‚   β”œβ”€β”€ media/                          # Media tree & item factory
β”‚       β”‚   β”œβ”€β”€ settings/                       # Settings UI
β”‚       β”‚   └── signin/                         # Sign-in flow (server + credentials)
β”‚       └── res/
β”‚           β”œβ”€β”€ drawable/                       # Vector icons for categories
β”‚           β”œβ”€β”€ layout/                         # Sign-in & settings layouts
β”‚           β”œβ”€β”€ mipmap-*/                       # App launcher icons
β”‚           β”œβ”€β”€ values/                         # Strings, colors, themes, arrays
β”‚           └── xml/                            # Preferences, authenticator, AAOS config
└── gradle/                                     # Gradle wrapper & version catalog

Building

Prerequisites

  • Android Studio Hedgehog (2023.1.1) or later
  • JDK 11 or later
  • Android SDK with API 36

Build Commands

Build debug APK:

./gradlew :automotive:assembleDebug

Build release APK:

./gradlew :automotive:assembleRelease

Install to connected device:

./gradlew :automotive:installDebug

Running on AAOS

Android Automotive OS Emulator

  1. Open Android Studio β†’ AVD Manager
  2. Create New Virtual Device β†’ Automotive β†’ Polestar 2
  3. Select system image (API 33+ recommended)
  4. Launch emulator and install APK

Physical AAOS Device

  1. Enable Developer Options on your AAOS head unit
  2. Enable USB debugging
  3. Connect via USB and install:
adb install automotive/build/outputs/apk/debug/automotive-debug.apk

The app will appear in the car's media app list.

Initial Setup

  1. Launch DashTune from the AAOS media apps
  2. Enter Server URL - Your Jellyfin server address (e.g., https://jellyfin.myserver.com:8096)
  3. Authenticate - Use QuickConnect or username/password
  4. Browse & Play - Start streaming your music!

Features in Detail

Browse Categories

  • Latest - Recently added albums
  • Favourites - Your hearted tracks, albums, and artists
  • Books - Audiobooks with folder hierarchy and chapter navigation
  • Playlists - All your Jellyfin playlists
  • Random - Shuffled album discovery

Categories are configurable in Settings (min 2, max 4). Defaults: Latest, Favourites, Books, Playlists.

Audiobook Playback

  • Browse audiobooks in a folder hierarchy (collections β†’ books β†’ chapters)
  • Multi-chapter audiobooks play as ordered playlists
  • Playback position synced to Jellyfin server via UserData API
  • Resume from last position after app restart
  • Progress indicators show completion percentage in browse UI
  • Shuffle auto-disabled during audiobook playback (restored when switching to music)

Offline Mode

  • Tracks are automatically cached as you stream
  • Next 5 tracks in queue are prefetched in the background
  • Works seamlessly even when network is unavailable
  • Configure cache size in Settings

Playback State Persistence

  • Current playlist, position, and track are saved
  • Shuffle and repeat modes are preserved
  • Resume playback after app restart or device reboot

Dependencies

Key libraries:

  • androidx.media3:media3-exoplayer:1.9.2
  • androidx.media3:media3-session:1.9.2
  • org.jellyfin.sdk:jellyfin-core:1.8.6
  • com.google.dagger:hilt-android:2.59.1
  • com.squareup.okhttp3:okhttp:5.3.2
  • androidx.preference:preference-ktx:1.2.1
  • androidx.lifecycle:lifecycle-viewmodel-ktx:2.10.0
  • androidx.room:room-runtime (media cache database)

See gradle/libs.versions.toml for complete dependency list.

Known Limitations

  • Requires Android Automotive OS (not compatible with Android Auto projection)
  • Offline playback limited by configured cache size
  • Album art requires network connection for first load (then cached)
  • Video playback not supported (audio only)

Troubleshooting

Icon doesn't appear in media player:

  • Completely uninstall and reinstall the app
  • Clear AAOS media cache: Settings β†’ Apps β†’ Media β†’ Storage β†’ Clear Cache

Authentication fails:

  • Verify server URL is correct and reachable
  • Check that Jellyfin server allows remote connections
  • For QuickConnect: ensure it's enabled in Jellyfin server settings

Playback issues:

  • Check network connectivity
  • Try different bitrate settings
  • Verify audio codec compatibility (app supports: FLAC, MP3, M4A, AAC, OGG)

Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues.

License

TBD

Acknowledgments

Built with reference to:


Note: This is an unofficial third-party client for Jellyfin. Not affiliated with the Jellyfin project.

About

An Android Automotive OS (AAOS) music player for Jellyfin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages