Repository navigation
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
|
@mrzhbr Do you have any logging to enable debugging? I have a firewalled network, and tested this out with logging on my router - i'm not seeing the SSDP discovery packet from Spotatui. I can use the Sonos S2 app and it is receiving SSDP messages on the same laptop, at the same time that spotatui isn't finding the players, however is uses both When looking at tcpdump while hitting I get some responses like this after a few seconds: Which seems to match your code for device filtering: However nothing is showing up in the devices pane. |
|
Hi @mrzhbr, thanks a lot for this. Your SOAP transport and the Spotify URI/DIDL mapping saved me a lot of digging. I tested #391 against my S2 setup. Five rooms (one of them a Beam + Sub + 2× One SL home-theater set), reached from another VLAN. What I found with the PR as is
What works: the local WebSocket API (
Proposal
I have this running locally on current Platforms: tested on Linux. The macOS and Windows media-key routing follows the Apple Music pattern (thin mapping onto the same @LargeModGames, three questions before I open anything:
|
|
Closing this in favor of #795. It lists speakers on the network as normal Spotify Connect devices on your own account, so Sonos needs no separate backend there. Sonos still needs the authorization_code login, and @Wassergeist is helping test it on S2. Thanks @mrzhbr for the work here, the UPnP findings showed us the multi-account problem. |
# Summary spotatui only listed devices that were already logged in to the account, so speakers on the local network showed up only after the official app had used them. This finds them with an mDNS browse (`mdns-sd`) and logs them in when you pick one, the way the official client does: - **Google Cast** (`_googlecast._tcp`): a small CASTV2 client starts the Spotify receiver (`CC32E753`), then `getInfo` and `addUser` with a token from `/device-auth/v1/refresh`. - **Spotify Connect speakers** (`_spotify-connect._tcp`): zeroconf `getInfo` and `addUser` with a token from the Connect token exchange (`accounts.spotify.com/api/token`, `resource=urn:spotify:resources:connect`, `audience` = the speaker's client id). Speakers that ask for `tokenType: accesstoken` get an access token; Sonos asks for `authorization_code` and gets an auth code from the same exchange. - **Sonos rooms** are also found over `_sonos._tcp` at `:1400/spotifyzc`, for networks that only pass that record. A room that both services announce is listed once. Picking a speaker logs it in, waits for it to join the cluster, then does the normal transfer. The audio goes from Spotify to the speaker directly, on your own account. No TUI or GUI change: the devices appear in the existing device list. Replaces #391. Closes #251. # Testing - `cargo fmt --all -- --check`: exit 0 - `cargo clippy --locked -- -D warnings`, and with `--no-default-features` for `telemetry,tui`, `telemetry`, `telemetry,streaming` and the `gui` leg: exit 0 on all five - `cargo test --locked --no-default-features --features telemetry,tui`: 1538 passed, 0 failed - `cargo test --locked`: 2007 passed, 0 failed, 7 ignored - `cargo clippy --manifest-path desktop/Cargo.toml -- -D warnings`: exit 0; `cargo test --manifest-path desktop/Cargo.toml`: 6 passed - Live on Windows: a Google Nest Mini and a Denon Home Sound Bar 550, logged in from the device list and played on at 10% volume, from probes and from the TUI. - Live on Linux (NixOS), by @Wassergeist: Sonos S2 (4× One, 1× Beam) behind a VLAN that only passes `_sonos._tcp`. Rooms, groups and the Beam home-theater set show up once; idle rooms log in and play on his own account; play, pause, skip, volume and switching back work. Details in the comment below. # Additional notes - macOS is CI-only so far. - Not yet: speakers that want the encrypted `default` blob, Cast groups, DIAL TVs. - Open from the Sonos test: after a transfer away from spotatui the playbar keeps "Playback moved to another Spotify device." for a while and the native player runs a full recovery; a speaker that left the network stays listed and picking it shows a raw 502 timeout. Not tested yet: a room last used by a second Spotify account in the same Sonos household. - The eSDK zeroconf port changes after each login; the browse picks up the new one. - New crates: `mdns-sd` (+ `flume`, `if-addrs`, `socket-pktinfo`); `rustls` and `tokio-rustls` were already in the lock. `desktop/Cargo.lock` is refreshed here because `mdns-sd` needs a newer `fastrand` than it pinned. --- <sub>💬 Questions or want to chat with other contributors? Join the [spotatui Discord](https://spotatui.com/discord).</sub> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Spotify now discovers compatible Google Cast and Spotify Connect speakers on your local network and includes them in the available device list. * You can transfer playback to a discovered speaker. If it isn’t connected yet, Spotify attempts to connect it before completing the transfer. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
sonos:<UUID>and route local transport, seek, volume, metadata, CLI, and playbar behavior through a dedicated Sonos backendHardware validation
Validated on standalone S1 and S2 rooms, including multiple-room selection:
Grouped-room coordinator behavior is covered by mock integration tests but could not be hardware-tested. Sonos queue viewing and Sonos shuffle/repeat remain intentionally unsupported.
Verification
cargo fmt --all --checkcargo clippy --no-default-features --features telemetry -- -D warningscargo test --no-default-features --features telemetry— 519 passedcargo clippy -- -D warningscargo test— 738 passedcargo clippy --features all-sources -- -D warningsRelated to #251.