Commit graph

285 commits

Author SHA1 Message Date
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
c1965198fc
Move DeviceType to core 2022-01-06 09:48:11 +01:00
Roderick van Domburg
cc9a574b2e
Move ConnectConfig to connect 2022-01-05 21:15:19 +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
Guillaume Desmottes
3ce9854df5 player: ensure load threads are done when dropping PlayerInternal
Fix a race where the load operation was trying to use a disposed tokio
context, resulting in panic.
2021-12-29 16:00:45 +01:00
Roderick van Domburg
95776de74a
Fix compilation for with-dns-sd 2021-12-27 00:21:42 +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
2f7b9863d9
Implement CDN for audio files 2021-12-16 22:42:37 +01:00
Roderick van Domburg
9a0d2390b7
Get user attributes and updates 2021-12-11 00:03:35 +01:00
Roderick van Domburg
33620280f5
Fix build on Cargo 1.48 2021-12-08 20:44:48 +01:00
Roderick van Domburg
f03a7e95c1
Merge remote-tracking branch 'librespot-org/dev' into new-api-wip 2021-12-08 19:11:53 +01:00
Roderick van Domburg
0e2686863a
Major metadata refactoring and enhancement
* Expose all fields of recent protobufs

 * Add support for user-scoped playlists, user root playlists and
   playlist annotations

 * Convert messages with the Rust type system

 * Attempt to adhere to embargos (tracks and episodes scheduled for
   future release)

 * Return `Result`s with meaningful errors instead of panicking on
   `unwrap`s

 * Add foundation for future playlist editing

 * Up version in connection handshake to get all version-gated features
2021-12-07 23:22:24 +01:00
Roderick van Domburg
47badd61e0
Update tokio and fix build 2021-11-27 14:26:13 +01:00
Roderick van Domburg
d19fd24074
Add spclient and HTTPS support
* Change metadata to use spclient
 * Add support for HTTPS proxies
 * Start purging unwraps and using Result instead
2021-11-26 23:28:37 +01:00
Roderick van Domburg
72b2c01b3a
Update crates 2021-10-26 20:10:39 +02:00
Roderick van Domburg
c1ac4cbb3a
Update Cargo.lock for 0.3.1 2021-10-24 20:24:28 +02:00
Roderick van Domburg
ff3648434b
Change hand-picked RNGs back to SmallRng
While `Xoshiro256+` is faster on 64-bit, it has low linear complexity in the
lower three bits, which *are* used when generating dither.

Also, while `Xoshiro128StarStar` access one less variable from the heap,
multiplication is generally slower than addition in hardware.
2021-10-21 19:31:58 +02:00
Roderick van Domburg
4c89a721ee
Improve dithering CPU usage (#866) 2021-10-19 22:33:04 +02:00
Sasha Hilton
afbdd11f45 Update Cargo.lock for 0.3.0 2021-10-13 15:30:13 +01:00
Roderick van Domburg
de177f1260
Update num-bigint 2021-09-20 20:12:57 +02:00
sigaloid
efd4a02896 Cargo update 2021-08-20 16:13:39 -04:00
Roderick van Domburg
b519a4a47d
Update crates (#817) 2021-06-30 21:39:55 +02:00
Roderick van Domburg
7cd1b7a26a
Merge branch 'dev' into new-api-client 2021-06-26 00:14:20 +02:00
Roderick van Domburg
0703630041
Use PacketType instead of hex identifiers 2021-06-22 23:57:38 +02:00
Roderick van Domburg
d4f466ef58
Revert math::round_half_to_even
This caused quite a bump in CPU usage, which be acceptable if this
actually improved sound quality. However, it turns out that this
function only has one decimal precision, i.e. it would consider
all values from `0.50..0.60` (exclusive) as `0.5` which is in
error for our purposes.
2021-05-31 23:35:48 +02:00
Roderick van Domburg
8062bd2518
Improve sample rounding and clean up noise shaping leftovers (#771) 2021-05-29 22:53:19 +02:00
johannesd3
a2fde0a1d6 Run cargo update 2021-05-28 19:55:57 +02:00
Roderick van Domburg
11dfedea3b
Remove with-vorbis and with-tremor features (#750) 2021-05-26 21:43:20 +02:00
Roderick van Domburg
bb3dd64c87
Implement dithering (#694)
Dithering lowers digital-to-analog conversion ("requantization") error, linearizing output, lowering distortion and replacing it with a constant, fixed noise level, which is more pleasant to the ear than the distortion.

Guidance:

- On S24, S24_3 and S24, the default is to use triangular dithering. Depending on personal preference you may use Gaussian dithering instead; it's not as good objectively, but it may be preferred subjectively if you are looking for a more "analog" sound akin to tape hiss.

- Advanced users who know that they have a DAC without noise shaping have a third option: high-passed dithering, which is like triangular dithering except that it moves dithering noise up in frequency where it is less audible. Note: 99% of DACs are of delta-sigma design with noise shaping, so unless you have a multibit / R2R DAC, or otherwise know what you are doing, this is not for you.

- Don't dither or shape noise on S32 or F32. On F32 it's not supported anyway (there are no integer conversions and so no rounding errors) and on S32 the noise level is so far down that it is simply inaudible even after volume normalisation and control.

New command line option:

--dither DITHER Specify the dither algorithm to use - [none, gpdf,
                tpdf, tpdf_hp]. Defaults to 'tpdf' for formats S16
                S24, S24_3 and 'none' for other formats.

Notes:

This PR also features some opportunistic improvements. Worthy of mention are:
- matching reference Vorbis sample conversion techniques for lower noise
- a cleanup of the convert API
2021-05-26 21:19:17 +02:00
Roderick van Domburg
d8ec98015c
Merge pull request #673 from Johannesd3/discovery-crate
Create separate discovery crate
2021-05-26 20:21:43 +02:00
johannesd3
1ade02b7ad
Add basic websocket support 2021-05-26 16:51:13 +02:00
Roderick van Domburg
a590b778de
Bump jack and Rodio crates 2021-05-25 22:35:35 +02:00
johannesd3
9b6ba49026
Add "discovery" compat layer to "connect" 2021-05-19 21:09:38 +02:00
johannesd3
a7f9e0a20b
Add an error type to librespot_discovery 2021-05-19 21:05:20 +02:00
johannesd3
1ec5dd21fa
Add discovery example 2021-05-19 21:05:20 +02:00
Johannesd3
ebea5397b9
Add librespot-discovery crate 2021-05-19 21:05:19 +02:00
dependabot[bot]
3134e1a0c5 Bump sha-1 from 0.9.5 to 0.9.6
Bumps [sha-1](https://github.com/RustCrypto/hashes) from 0.9.5 to 0.9.6.
- [Release notes](https://github.com/RustCrypto/hashes/releases)
- [Commits](https://github.com/RustCrypto/hashes/compare/sha-1-v0.9.5...sha-1-v0.9.6)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-12 17:12:11 +02:00
dependabot[bot]
48c5a82071 Bump futures-executor from 0.3.14 to 0.3.15
Bumps [futures-executor](https://github.com/rust-lang/futures-rs) from 0.3.14 to 0.3.15.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.14...0.3.15)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-12 17:11:36 +02:00
johannesd3
555274b5af
Move decoder to playback crate 2021-05-11 20:36:53 +02:00
dependabot[bot]
255f0c6ccf Bump js-sys from 0.3.50 to 0.3.51
Bumps [js-sys](https://github.com/rustwasm/wasm-bindgen) from 0.3.50 to 0.3.51.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-11 13:43:09 +02:00
dependabot[bot]
b7d1199068 Bump wasm-bindgen from 0.2.73 to 0.2.74
Bumps [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen) from 0.2.73 to 0.2.74.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/compare/0.2.73...0.2.74)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-11 13:42:36 +02:00
dependabot[bot]
fce91f4e61
Bump jack from 0.6.6 to 0.7.0 (#720) 2021-05-09 21:03:25 +00:00
dependabot[bot]
539e9669a4
Merge pull request #717 from librespot-org/dependabot/cargo/url-2.2.2 2021-05-09 08:11:10 +00:00
johannesd3
85aa4eed89
Bump url and update Cargo.lock 2021-05-09 09:53:20 +02:00
dependabot[bot]
91a60ccac7
Bump sha-1 from 0.9.4 to 0.9.5 (#725) 2021-05-08 22:46:35 +00:00
johannesd3
1c62af9160
Unpin protobuf version 2021-05-08 22:09:37 +02:00
Sasha Hilton
59683d7965 Update Cargo.lock 2021-05-04 13:27:57 +01:00