- Add pre-computed knee factor to eliminate division in sample loop
- Replace if-else chain with match pattern for cleaner branching
- Use direct references to reduce repeated array indexing
- Maintain existing stereo imaging via channel coupling
Addresses review comments from #1485 and incorporates optimizations
inspired by Rodio's limiter implementation for improved performance
in the stereo case.
Since Spotify audio is always 16-bit depth, optimize the conversion pipeline:
- Always dither at 16-bit level regardless of output format
- Preserve fractional precision until final rounding for better requantization
- Replace floating-point multiplication with compile-time bit shifts
- Add comprehensive inlining to eliminate function call overhead
- Specialize 24-bit clamping to remove runtime branching
This maintains proper dithering of the original 16-bit quantization artifacts
while maximizing performance through bit-shift operations and eliminating
unnecessary runtime calculations.
- Update MSRV to 1.85 and Rust edition to 2024.
- Refactor all logging macros to use inline argument formatting.
- Fix import order in main.rs and examples.
- Add async environment variable setter to main.rs as safe facade.
- Update many dependencies to latest versions across all crates
- Switch from `once_cell::OnceCell` to `std::sync::OnceLock` where appropriate
- Update OAuth to use stateful `reqwest` for HTTP requests
- Fix Rodio backend to honor the requested sample format
- Updated `MaybeExpiringUrls` to handle `verify` query parameter.
- Extracted expiry timestamp from `verify` parameter if present.
- Adjusted test cases to include URLs with `verify` parameter.
- Updated assertions to account for the new URL format.
This change ensures compatibility with URLs containing the `verify`
query parameter, improving the flexibility of the CDN URL handling.
Solves #1512
* re-add support to play a set of tracks
* connect: reduce some cloning
* connect: derive clone for LoadRequest
* apply review, improve function naming
* clippy fix
* Send play progress as PlayerEvent::PositionChanged
* Replaced PlayerEvent::PositionChanged with set_progress_callback() method
* Revert "Replaced PlayerEvent::PositionChanged with set_progress_callback() method"
This reverts commit f26e3de07b.
* Added opt-in config in PlayerConfig for progress event
* Added doc comments and set default position interval to 1sec for standalone
* Remove handling of PositionChanged in standalone binary
* Fixed wrong event handling
* spirc: Configurable volume control steps
Allow the volume control steps to be configured via the `--volume-steps`
command line parameter. The author personally found the default volume
steps of `1024` to be completely unusable, and is presently using `128`
as his configuration. Perhaps consider this as a more reasonable
default.
Additionally, reduce the delay in volume update from a wopping two
seconds to 500ms, again for usability.
Also clean up the seemingly unnecessary use of a pattern match on
whether or not `--initial-volume` was supplied.
* fixup! spirc: Configurable volume control steps
* fixup! spirc: Configurable volume control steps
* fixup! spirc: Configurable volume control steps
* fixup! spirc: Configurable volume control steps
* fixup! spirc: Configurable volume control steps
* fixup! spirc: Configurable volume control steps
---------
Co-authored-by: Scott S. McCoy <scott.s.mccoy@acm.org>
* removes homething devicetype
fixes#1470
From the comments about "homething" support in spotify:
"Did they ever release their homething product? I assumed not and guess they removed all support for it. We could just remove this footgun."
* mention breaking homething change in Changelog
* restructure connect and add initial docs
* replace inline crate rustdoc with README.md
* connect: make metadata trait less visible
* connect: add some more docs
* chore: remove clippy warning
* update CHANGELOG.md
* revert unrelated changes
* enforce separation of autoplay and options
* hide and improve docs of uid
* remove/rename remarks
* update connect example and link in docs
* fixup rebase and clippy warnings
* Use ring instead of aws-lc as the default backend for hyper-rustls
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
* Cross-compile with libmdns
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
* Simplify Docker image to cross-compile for armv6hf (RPi 1)
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
* Revert "Use ring instead of aws-lc as the default backend for hyper-rustls"
This reverts commit faeaf506d6.
* Fix bindgen issues (aws-lc-rs) when cross-compiling for armv6hf
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
* Add git to the Docker image for cross-compiling
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
---------
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
Co-authored-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
* connect: add shuffle_vec.rs
* connect: shuffle in place
* add shuffle with seed option
* reduce complexity to add new metadata fields
* add context index to metadata
* use seed for shuffle
When losing the connection and restarting the dealer, the seed is now stored in the context metadata. So on transfer we can pickup the seed again and shuffle the context as it was previously
* add log for shuffle seed
* connect: use small_rng, derive Default
* Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update softmixer.rs
Use AtomicU64 from atomic_shim, so that librespot works with MIPS and MIPSEL
* Update Cargo.toml with atomic-shim dependency
Added atomic-shim dependency
* Update Cargo.lock with atomic-shim package
Added atomic-shim package
* connect: simplify `handle_command` for SpircCommand
* connect: simplify `handle_player_event`
* connect: `handle_player_event` update log entries
* connect: set `playback_speed` according to player state
* connect: reduce/group state updates by delaying them slightly
* connect: load entire context at once
* connect: use is_playing from connect_state
* connect: move `ResolveContext` in own file
* connect: handle metadata correct
* connect: resolve context rework
- resolved contexts independently, by that we don't block our main loop
- move resolve logic into own file
- polish handling for play and transfer
* connect: rework aftermath
* general logging and comment fixups
* connect: fix incorrect stopping
* connect: always handle player seek event
* connect: adjust behavior
- rename `handle_context` to `handle_next_context`
- disconnect should only pause the playback
- find_next should not exceed queue length
* fix typo and `find_next`
* connect: fixes for context and transfer
- fix context_metadata and restriction incorrect reset
- do some state updates earlier
- add more logging
* revert removal of state setup
* `clear_next_tracks` should never clear queued items
just mimics official client behavior
* connect: make `playing_track` optional and handle it correctly
* connect: adjust finish of context resolving
* connect: set track position when shuffling
* example: adjust to model change
* connect: remove duplicate track
* connect: provide all recently played tracks to autoplay request
- removes previously added workaround
* connect: apply review suggestions
- use drain instead of for with pop
- use for instead of loop
- use or_else instead of match
- use Self::Error instead of the value
- free memory for metadata and restrictions
* connect: impl trait for player context
* connect: fix incorrect playing and paused
* connect: apply options as official clients
* protocol: move trait impls into impl_trait mod