Commit graph

98 commits

Author SHA1 Message Date
johannesd3
b4f9ae31e2 Fix clippy warnings 2021-04-10 14:06:41 +02:00
johannesd3
26c127c2ec Merge branch 'dev' into tokio_migration 2021-04-10 12:59:47 +02:00
johannesd3
5435ab3270 Fix compile errors in backends
fe37186 added the restriction that `Sink`s must be `Send`. It turned
out later that this restrictions was unnecessary, and since some
`Sink`s aren't `Send` yet, this restriction is lifted again.

librespot-org/librespot#601 refactored the `RodioSink` in order to make
it `Send`. These changes are partly reverted in favour of the initial
simpler design.

Furthermore, there were some compile errors in the gstreamer backend
which are hereby fixed.
2021-04-10 12:50:30 +02:00
Roderick van Domburg
309e26456e Rename steepness to knee 2021-03-14 14:28:16 +01:00
Roderick van Domburg
5257be7824 Add command-line option to set F32 or S16 bit output
Usage: `--format {F32|S16}`. Default is F32.

 - Implemented for all backends, except for JACK audio which itself
 only supports 32-bit output at this time. Setting JACK audio to S16
 will panic and instruct the user to set output to F32.

 - The F32 default works fine for Rodio on macOS, but not on Raspian 10
 with Alsa as host. Therefore users on Linux systems are warned to set
 output to S16 in case of garbled sound with Rodio. This seems an issue
 with cpal incorrectly detecting the output stream format.

 - While at it, DRY up lots of code in the backends and by that virtue,
 also enable OggData passthrough on the subprocess backend.

 - I tested Rodio, ALSA, pipe and subprocess quite a bit, and call on
 others to join in and test the other backends.
2021-03-12 23:09:15 +01:00
Roderick van Domburg
1672eb87ab Fix build on Rust < 1.50.0 2021-03-12 23:09:15 +01:00
Roderick van Domburg
f29e5212c4 High-resolution volume control and normalisation
- Store and output samples as 32-bit floats instead of 16-bit integers.
   This provides 24-25 bits of transparency, allowing for 42-48 dB of
   headroom to do volume control and normalisation without throwing
   away bits or dropping dynamic range below 96 dB CD quality.

 - Perform volume control and normalisation in 64-bit arithmetic.

 - Add a dynamic limiter with configurable threshold, attack time,
   release or decay time, and steepness for the sigmoid transfer
   function. This mimics the native Spotify limiter, offering greater
   dynamic range than the old limiter, that just reduced overall gain
   to prevent clipping.

 - Make the configurable threshold also apply to the old limiter, which
   is still available.

Resolves: librespot-org/librespot#608
2021-03-12 23:09:15 +01:00
johannesd3
059b9029de Remove redundant field names 2021-03-10 22:41:46 +01:00
johannesd3
5616004dbe Fix many clippy lints
...and other small improvements
2021-03-10 22:41:44 +01:00
Evan Cameron
6a33eb4efa
minor cleanup 2021-02-28 21:54:19 -05:00
johannesd3
45f42acb82 Refactor 'find_available_alternatives' 2021-02-23 22:22:52 +01:00
johannesd3
5aeb733ad9 Clean up dependencies in librespot-playback
* Use futures-util instead of futures
* Use tokio channels instead of futures channels
* Removed "extern crate"s
2021-02-23 22:22:52 +01:00
johannesd3
678d1777fd Merge branch 'dev' into tokio_migration 2021-02-23 22:22:49 +01:00
Philippe G
34bc286d9b ogg passthrough
rename
2021-02-22 13:45:53 -08:00
johannesd3
007e653f3d Restore original blocking player behaviour 2021-02-21 17:04:44 +01:00
johannesd3
b77f0a18ce Fix formatting 2021-02-13 10:29:00 +01:00
johannesd3
2f05ddfbc2 Fix bugs in player 2021-02-12 18:19:04 +01:00
johannesd3
872fab62d8 Merge branch 'dev' into tokio_migration 2021-02-10 21:51:33 +01:00
Sasha Hilton
b72485cf46
Merge pull request #593 from Johannesd3/fix-issue-591 2021-02-09 13:54:47 +00:00
johannesd3
2f660f74ec Small refactor 2021-02-09 09:15:55 +01:00
johannesd3
f67ceb5f6d Small refactoring 2021-02-02 02:19:15 +01:00
johannesd3
3446864838 Handle corrupt cache files (#591) 2021-02-02 02:18:58 +01:00
johannesd3
fe37186804 Make librespot_playback work 2021-01-25 09:04:33 +01:00
johannesd3
0895f17f8a Migrated playback crate to futures 0.3 2021-01-25 09:04:33 +01:00
Sasha Hilton
37a5796a86 Add option to choose between track or album normalisation gain, default album. 2021-01-21 19:16:05 +00:00
maxthiel
2f7bf54076 Add a preload event to warn about new track coming soon 2020-12-10 21:17:41 +00:00
Sasha Hilton
6eabf4a75c
Merge pull request #449 from kaymes/blocking_sink_events
Add blocking SinkActive|SinkInactive events
2020-07-24 03:07:38 +01:00
ashthespy
172cb945c4 Merge branch 'dev' of https://github.com/librespot-org/librespot into skip_unplayable 2020-05-13 12:19:33 +02:00
ashthespy
14709b9f8d Let spirc handle unavailable tracks 2020-05-13 11:49:26 +02:00
ashthespy
902440925d Handle unplayable tracks during prefetch 2020-05-10 14:31:43 +02:00
ashthespy
b63199743a Skip unplayable tracks instead of stopping 2020-05-09 13:59:28 +02:00
Konstantin Seiler
223b8d611e Roll back the meta data processing. 2020-03-20 17:31:18 +11:00
Konstantin Seiler
c9117542eb Refactor TrackMetaData in the player and add the metadata to the player events.
Fire more events in the --onevent script and set more variables.
2020-03-12 23:01:45 +11:00
Konstantin Seiler
d4d55254b0 address merge conflict 2020-03-10 23:53:58 +11:00
Konstantin Seiler
667e559340 Merge remote-tracking branch 'origin/dev' into blocking_sink_events 2020-03-10 23:52:20 +11:00
Konstantin Seiler
6f28b0486f Emit blocking sink events 2020-03-10 23:26:01 +11:00
Ash
ef27b4bce3
Disable gapless playback via runtime flag (#444)
* Enable gapless playback via runtime flag

* Set gapless playback as default, use `--disable-gapless` to turn it off

* Ensure sink restarts b/w tracks when gapless is disabled
2020-03-10 13:00:57 +01:00
Konstantin Seiler
873f86bb96 Cancel preload requests to free bandwidth when repeating the same track. 2020-02-07 23:54:09 +11:00
Konstantin Seiler
18d1181bf5 Clean up some code
Ensure the player events are emitted correctly.
Only call the external script on events we want to notify about.
Stop sink when loading to pause.
cargo fmt
2020-02-03 18:58:44 +11:00
Konstantin Seiler
ead794f4fd Correct notifications when loading the same track again. 2020-02-03 14:31:15 +11:00
Konstantin Seiler
499824a6ba rust fmt 2020-02-03 11:57:09 +11:00
Konstantin Seiler
981b76bace Keep the sink open
Fix typo
2020-02-03 10:11:27 +11:00
Konstantin Seiler
6fed8d0413 Make preloading work. 2020-02-03 09:15:56 +11:00
Konstantin Seiler
349e182d41 Smarter handling of preloading and loading of tracks that are already loaded. 2020-02-03 09:15:48 +11:00
Konstantin Seiler
8756341201 Remove debug message 2020-02-02 11:12:17 +11:00
Konstantin Seiler
9eef690a22 Some clean up 2020-02-02 11:08:46 +11:00
Konstantin Seiler
5784b4652c Prepare for gapless play.
- change communication between player and spirc to use player events channel.
- enhance player events channel
- have spirc send loading messages to Spotify
- enable preloading of tracks in the player
2020-02-01 08:41:11 +11:00
Sasha Hilton
e9c3357e41 Run cargo fmt 2020-01-24 02:26:16 +01:00
Sasha Hilton
cdcb919c08
Merge branch 'dev' into connection-lost-crash 2020-01-24 01:02:40 +01:00
Konstantin Seiler
04b52d7878 Have player handle Mercury errors while loading tracks. 2020-01-23 01:15:30 +11:00