Skip to content

Feat: add Chromecast (Google Cast) audio output support - #718

Open
Tomjerri1 wants to merge 12 commits into
SimoHypers:devfrom
Tomjerri1:feature/chromecast
Open

Tomjerri1 wants to merge 12 commits into
SimoHypers:devfrom
Tomjerri1:feature/chromecast

Conversation

@Tomjerri1

@Tomjerri1 Tomjerri1 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Closes: #399

Why

Limusic could only play through the local computer's audio devices. Users with a Chromecast or Google Cast speaker on their network had no way to cast from the desktop app.

What changed

Discovery and Cast session (crates/cast)

  • mDNS discovery of _googlecast._tcp.local devices.
  • CastV2 client over TLS: launches the Default Media Receiver (CC1AD845), heartbeats, play/pause/seek/volume, and a synchronous STOP on disconnect and on app exit, so the receiver does not keep playing from its buffer.

LAN audio proxy and playback sync (src-tauri)

  • Temporary LAN HTTP proxy (only while casting) that serves the resolved YouTube audio to the receiver, with Range support.
  • Security: 128-bit random URL token, private-IP peers only, peer restricted to the connected receiver (not for speaker groups), tokens redacted from logs, listener closed when casting stops.
  • Title, artist and cover art are taken from the queue item and sent to the receiver.
  • Local mpv stays the muted master clock. After the receiver starts, mpv is aligned back to the receiver once, and drift correction runs afterwards. This reduces the ~3 s startup lag to about 1 s.
  • If the receiver does not start within 10 s, a hint about the firewall/network is shown.

UI and docs

  • Chromecast devices are listed in the player bar DevicePicker.
  • docs/CHROMECAST.md: troubleshooting (network, VPN, Windows Firewall) and limitations. README feature line and THIRD-PARTY-NOTICES updated.

Changes to existing behaviour

  • OS media-key / MPRIS seeks now go through AppState::user_seek instead of player.seek, so they are also mirrored to the receiver. As a side effect they are published to device link / Listen Together like a slider seek.
  • Volume changes from the slider, hotkeys and media controls go through one AppState::set_output_volume.
  • audioproxy.rs: the audio route is now a shared function used by the loopback and LAN listeners; loopback behaviour is unchanged.

Dependencies and CI

  • New crates: mdns-sd, rust_cast (pulls protobuf* into Cargo.lock).
  • .github/windows-exe-imports.txt: added iphlpapi.dll (network interface lookup used by mDNS).
  • playback-effects.check.mjs: the mock now provides the cast store functions.

Known limitations

  • YouTube streams only. Local files, live streams and karaoke streams are not cast and keep playing locally.
  • Not gapless: each track change loads the next track on the receiver (1-4 s pause).
  • One-way control: changes made from the TV remote, Google Home or voice are not synced back (to avoid command feedback loops).
  • The PC must stay awake while casting; on Windows the firewall must allow Limusic on private networks.
  • If the app process is killed (crash), the receiver finishes the part of the track it has already buffered.

Testing

Manual, Windows + a physical Chromecast (3rd gen): discovery, casting, play/pause, seek, volume, automatic track change, startup alignment and drift correction, title/artist/cover on the TV, clean stop of the TV and of the LAN proxy when quitting from the tray.
Not tested on hardware: Linux, macOS, speaker groups.
Automated: cargo test -p limusic-app --lib (331 passed), pnpm test, pnpm check (0 errors), CI green.

AI assistance

Partially assisted by Claude.

1 2

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 69913def-f93e-45b5-989c-14035784a0db

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant