Commit graph

171 commits

Author SHA1 Message Date
yubiuser
dcd592bafb
Update MSRV to 1.74.0 and sysinfo to 0.31.3
Signed-off-by: yubiuser <github@yubiuser.dev>
2024-08-27 23:16:48 +02:00
Christian König
b0170d142b
Bump MSRV to 1.73
Signed-off-by: Christian König <ckoenig@posteo.de>
2024-06-10 18:50:38 +00:00
George Hahn
e1113dd5e2 cargo fmt 2024-06-06 21:37:26 -06:00
George Hahn
6a4053e871 Update audio to hyper 1.x 2024-06-06 03:06:45 -06:00
George Hahn
98a97588d3 Enable deprecation warnings and address 2024-06-06 03:06:44 -06:00
Christian König
ca035c9d17
Set MSRV in Cargo.toml files to 1.71
Signed-off-by: Christian König <ckoenig@posteo.de>
2024-05-11 19:03:06 +00:00
Domenico Cerasuolo
e175a88f5b Make audio fetch parameters tunable
This change collects all those audio fetch parameters that were defined as
static constants into a dedicated struct, AudioFetchParams.
This struct can be read and set statically, allowing a user of the library to
modify those parameters without the need to recompile.
2023-12-20 22:07:42 +01:00
Petr Tesarik
c600297f52 Fix newly reported clippy errors
- Use variables directly in format strings.
  As reported by clippy, variables can be used directly in the
  `format!` string.
- Use rewind() instead of seeking to 0.
- Remove superfluous & and ref.

Signed-off-by: Petr Tesarik <petr@tesarici.cz>
2023-01-27 23:15:51 +01:00
Roderick van Domburg
eb1472c713
Various loading improvements
- Improve responsiveness by downloading the smallest possible chunk
  size when seeking or first loading.

- Improve download time and decrease CPU usage by downloading the
  largest possible chunk size as throughput allows, still allowing
  for reasonable seek responsiveness (~1 second).

- As a result, take refactoring opportunities: simplify prefetching
  logic, download threading, command sending, and some ergonomics.

- Fix disappearing controls in the Spotify mobile UI while loading.

- Fix handling of seek, pause, and play commands while loading.

- Fix download rate calculation (don't use the Mercury rate).

- Fix ping time calculation under lock contention.
2022-09-28 21:25:56 +02:00
Roderick van Domburg
5451d14972
Rate limit audio file streaming too 2022-09-01 22:35:03 +02:00
Roderick van Domburg
2a79af1f0a
Migrate to Rust 2021 2022-08-02 21:42:38 +02:00
sqozz
d09ee4206c Add minimum rust version 2022-08-01 15:14:17 +02:00
Roderick van Domburg
786f8832d1
Update version numbers to 0.5.0-dev 2022-07-30 22:28:12 +02:00
Roderick van Domburg
37794c5b78
Merge branch 'new-api' into dev 2022-07-29 23:39:06 +02:00
Roderick van Domburg
6537c441c3
Update Cargo.lock 2022-07-29 22:05:10 +02:00
Roderick van Domburg
05b9b13cf8
Merge branch 'dev' into new-api and update crates 2022-07-27 23:31:11 +02:00
Roderick van Domburg
88e64bd884
Update Cargo.lock 2022-05-23 21:43:16 +02:00
Roderick van Domburg
8ad5a78bf6
Add repository URL 2022-05-21 22:51:30 +02:00
Roderick van Domburg
dff19377fa
Update version numbers to 0.4.0 2022-05-21 22:31:15 +02:00
Roderick van Domburg
1290ee9925
Fix clippy warnings 2022-04-07 22:32:43 +02:00
Roderick van Domburg
44860f4738
Remove assertions for what we know works well 2022-01-25 20:58:39 +01:00
Roderick van Domburg
7fe13be564
Fix audio file streaming 2022-01-14 23:24:43 +01:00
Roderick van Domburg
0cc4466245
Improve range checks 2022-01-13 21:15:27 +01:00
Roderick van Domburg
ab67370dc8
Improve checking of download chunks 2022-01-13 21:03:09 +01:00
Roderick van Domburg
8d8d6d4fd8
Fail opening the stream for anything but HTTP 206 2022-01-12 22:22:44 +01:00
Roderick van Domburg
0b7ccc803c
Fix streaming on slow connections 2022-01-11 23:45:20 +01:00
Roderick van Domburg
42455e0cdd
Merge branch 'new-api' of github.com:librespot-org/librespot into new-api 2022-01-08 23:29:57 +01:00
Roderick van Domburg
f202f364c9
Update tempfile 2022-01-08 21:27:45 +01:00
Roderick van Domburg
5cc3040bd8
Update futures 2022-01-08 21:21:31 +01:00
Roderick van Domburg
89a5133bd7
Upgrade aes-ctr to latest aes 2022-01-08 20:51:51 +01:00
Roderick van Domburg
62ccdbc580
Improve performance of getting/setting download mode 2022-01-07 11:38:24 +01:00
Roderick van Domburg
8d74d48809
Audio file seeking improvements
- Ensure there is enough disk space for the write file
- Switch streaming mode only if necessary
- Return `Err` on seeking errors, instead of exiting
- Use the actual position after seeking
2022-01-06 21:55:08 +01:00
Roderick van Domburg
1a7c440bd7
Improve lock ordering and contention 2022-01-05 20:44:08 +01:00
Roderick van Domburg
5c2b5a21c1
Fix audio file caching 2022-01-05 16:43:46 +01:00
Roderick van Domburg
3e09eff906
Improve initial loading time
- Configure the decoder according to Spotify's metadata, don't probe

- Return from `AudioFile::open` as soon as possible, with the smallest
  possible block size suitable for opening the decoder, so the UI
  transitions from loading to playing/paused state. From there,
  the regular prefetching will take over.
2022-01-04 23:23:20 +01:00
Roderick van Domburg
7921f23927
Improve format handling and support MP3
- Switch from `lewton` to `Symphonia`. This is a pure Rust demuxer
  and decoder in active development that supports a wide range of
  formats, including Ogg Vorbis, MP3, AAC and FLAC for future HiFi
  support. At the moment only Ogg Vorbis and MP3 are enabled; all
  AAC files are DRM-protected.

- Bump MSRV to 1.51, required for `Symphonia`.

- Filter out all files whose format is not specified.

- Not all episodes seem to be encrypted. If we can't get an audio
  key, try and see if we can play the file without decryption.

- After seeking, report the actual position instead of the target.

- Remove the 0xa7 bytes offset from `Subfile`, `Symphonia` does
  not balk at Spotify's custom Ogg packet before it. This also
  simplifies handling of formats other than Ogg Vorbis.

- When there is no next track to load, signal the UI that the
  player has stopped. Before, the player would get stuck in an
  infinite reloading loop when there was only one track in the
  queue and that track could not be loaded.
2022-01-03 00:13:28 +01:00
Roderick van Domburg
286a031d94
Always seek to starting position 2021-12-30 21:52:15 +01:00
Roderick van Domburg
9b6e02fa0d
Prevent a few potential panics 2021-12-29 23:15:08 +01:00
Roderick van Domburg
e51f475a00
Further initial loading improvements
This should fix remaining cases of a client connecting, and failing
to start playback from *beyond* the beginning when `librespot` is
still loading that track.

This undoes the `suppress_loading_status` workaround from #430,
under the assumption that the race condition reported there has
since been fixed on Spotify's end.
2021-12-29 22:27:31 +01:00
Roderick van Domburg
332f9f04b1
Fix error hitting play when loading
Further changes:

 - Improve some debug and trace messages

 - Default to streaming download strategy

 - Synchronize mixer volume on loading play

 - Use default normalisation values when the file position isn't
   exactly what we need it to be

 - Update track position only when the decoder reports a
   successful seek
2021-12-28 23:46:37 +01:00
Roderick van Domburg
0f78fc277e
Call stream_from_cdn with CdnUrl 2021-12-27 21:42:57 +01:00
Roderick van Domburg
8aa23ed0c6
Drop locks as soon as possible 2021-12-27 00:11:07 +01:00
Roderick van Domburg
b4f7a9e35e
Change to parking_lot and remove remaining panics 2021-12-26 23:02:02 +01:00
Roderick van Domburg
62461be1fc
Change panics into Result<_, librespot_core::Error> 2021-12-26 21:18:42 +01:00
Roderick van Domburg
a297c68913
Make ping estimation less chatty 2021-12-19 00:14:00 +01:00
Roderick van Domburg
0d51fd43dc
Remove unwraps from librespot-audio 2021-12-18 23:44:13 +01:00
Roderick van Domburg
d18a0d1803
Fix caching message when cache is disabled 2021-12-18 14:02:28 +01:00
Roderick van Domburg
9d88ac59c6
Configure User-Agent once 2021-12-18 13:39:41 +01:00
Roderick van Domburg
3b07a6bcb9
Support user-defined temp directories 2021-12-17 20:58:05 +01:00
Roderick van Domburg
2f7b9863d9
Implement CDN for audio files 2021-12-16 22:42:37 +01:00