From 8c355cb4522aed0ee1e6a2094aecaa5d23343448 Mon Sep 17 00:00:00 2001 From: awiouy Date: Mon, 13 Jul 2020 19:51:56 +0200 Subject: [PATCH 1/3] rust: update to 1.44.1 --- packages/addons/addon-depends/librespot-depends/rust/package.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/addons/addon-depends/librespot-depends/rust/package.mk b/packages/addons/addon-depends/librespot-depends/rust/package.mk index dfbf0ff731..d67318299d 100644 --- a/packages/addons/addon-depends/librespot-depends/rust/package.mk +++ b/packages/addons/addon-depends/librespot-depends/rust/package.mk @@ -2,7 +2,7 @@ # Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv) PKG_NAME="rust" -PKG_VERSION="1.39.0" +PKG_VERSION="1.44.1" PKG_LICENSE="MIT" PKG_SITE="https://www.rust-lang.org" PKG_DEPENDS_TARGET="toolchain rustup.rs" From 38c5dcc56ccee1c9bbd83cb862ed1358959ec600 Mon Sep 17 00:00:00 2001 From: awiouy Date: Mon, 13 Jul 2020 19:52:27 +0200 Subject: [PATCH 2/3] rustup.rs: update to 1.22.1 --- .../addon-depends/librespot-depends/rustup.rs/package.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/addons/addon-depends/librespot-depends/rustup.rs/package.mk b/packages/addons/addon-depends/librespot-depends/rustup.rs/package.mk index 4403f834b2..a3d8820fe3 100644 --- a/packages/addons/addon-depends/librespot-depends/rustup.rs/package.mk +++ b/packages/addons/addon-depends/librespot-depends/rustup.rs/package.mk @@ -2,8 +2,8 @@ # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) PKG_NAME="rustup.rs" -PKG_VERSION="1.20.2" -PKG_SHA256="28207ee4c2d66840ca903df152b23b916326a5d3eeb643a1de0f24a16afa4209" +PKG_VERSION="1.22.1" +PKG_SHA256="ad46cc624f318a9493aa62fc9612a450564fe20ba93c689e0ad856bff3c64c5b" PKG_LICENSE="MIT" PKG_SITE="https://www.rust-lang.org" PKG_URL="https://github.com/rust-lang-nursery/rustup.rs/archive/$PKG_VERSION.tar.gz" From a67adaac27939c4aa38ccf66f7f3ca11605d6bf3 Mon Sep 17 00:00:00 2001 From: awiouy Date: Mon, 13 Jul 2020 19:53:50 +0200 Subject: [PATCH 3/3] librespot: update to 9f3a02e --- .../addons/service/librespot/changelog.txt | 4 ++ packages/addons/service/librespot/package.mk | 8 +-- .../patches/librespot-01_notify_kodi.patch | 26 ++++---- .../patches/librespot-02_android.patch | 50 ++++++++++++++++ ...ot-02_enable_pulseaudio_device_names.patch | 59 ------------------- 5 files changed, 71 insertions(+), 76 deletions(-) create mode 100644 packages/addons/service/librespot/patches/librespot-02_android.patch delete mode 100644 packages/addons/service/librespot/patches/librespot-02_enable_pulseaudio_device_names.patch diff --git a/packages/addons/service/librespot/changelog.txt b/packages/addons/service/librespot/changelog.txt index b02e552493..0e6b05bb3d 100644 --- a/packages/addons/service/librespot/changelog.txt +++ b/packages/addons/service/librespot/changelog.txt @@ -1,3 +1,7 @@ +124 +- Update to 9f3a02e (2020-06-22) +- Fix switching playback with Android + 123 - Handle non ascii track information diff --git a/packages/addons/service/librespot/package.mk b/packages/addons/service/librespot/package.mk index 4c0ab5ce68..87d0b0f9fa 100644 --- a/packages/addons/service/librespot/package.mk +++ b/packages/addons/service/librespot/package.mk @@ -3,10 +3,10 @@ # Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv) PKG_NAME="librespot" -PKG_VERSION="66f8a98ad2f5bf35be4daecd788dad6f0d87fb7c" -PKG_SHA256="b027c983341aa53d940412d5624cfe91392958ea9836ba597289680a4430b253" -PKG_VERSION_DATE="2020-02-27" -PKG_REV="123" +PKG_VERSION="9f3a02ee8f62f8e178f714c3c63132388d90af64" +PKG_SHA256="5b2d3c0a250fbd171ea86303b213dafc035bf32b5c6fb2e7e98d61d9140168a9" +PKG_VERSION_DATE="2020-06-22" +PKG_REV="124" PKG_ARCH="any" PKG_LICENSE="MIT" PKG_SITE="https://github.com/librespot-org/librespot/" diff --git a/packages/addons/service/librespot/patches/librespot-01_notify_kodi.patch b/packages/addons/service/librespot/patches/librespot-01_notify_kodi.patch index fb6ad6740e..1e77848a7f 100644 --- a/packages/addons/service/librespot/patches/librespot-01_notify_kodi.patch +++ b/packages/addons/service/librespot/patches/librespot-01_notify_kodi.patch @@ -1,6 +1,6 @@ -commit 93ad8ce6f94e51bb14547ddf9e7a234c41adc266 +commit 10489ef0b9de4241eb8e007596f3d62616120545 Author: awiouy -Date: Tue Dec 3 23:21:35 2019 +0100 +Date: Fri May 29 07:40:19 2020 +0200 Notify Kodi @@ -22,30 +22,30 @@ index 1a5fcd2..c670977 100644 pub struct SpotifyId { pub id: u128, diff --git a/playback/src/config.rs b/playback/src/config.rs -index 0f71110..931167d 100644 +index 9d65042..6d098db 100644 --- a/playback/src/config.rs +++ b/playback/src/config.rs -@@ -30,6 +30,7 @@ pub struct PlayerConfig { - pub bitrate: Bitrate, +@@ -31,6 +31,7 @@ pub struct PlayerConfig { pub normalisation: bool, pub normalisation_pregain: f32, + pub gapless: bool, + pub notify_kodi: bool, } impl Default for PlayerConfig { -@@ -38,6 +39,7 @@ impl Default for PlayerConfig { - bitrate: Bitrate::default(), +@@ -40,6 +41,7 @@ impl Default for PlayerConfig { normalisation: false, normalisation_pregain: 0.0, + gapless: true, + notify_kodi: false, } } } diff --git a/playback/src/player.rs b/playback/src/player.rs -index ef7484c..22ecb2c 100644 +index 2dd8f3b..67b3b28 100644 --- a/playback/src/player.rs +++ b/playback/src/player.rs -@@ -1415,6 +1415,10 @@ impl PlayerInternal { +@@ -1442,6 +1442,10 @@ impl PlayerInternal { } } @@ -56,7 +56,7 @@ index ef7484c..22ecb2c 100644 fn send_event(&mut self, event: PlayerEvent) { let mut index = 0; while index < self.event_senders.len() { -@@ -1425,6 +1429,16 @@ impl PlayerInternal { +@@ -1452,6 +1456,16 @@ impl PlayerInternal { } } } @@ -74,7 +74,7 @@ index ef7484c..22ecb2c 100644 fn load_track( diff --git a/src/main.rs b/src/main.rs -index f749a52..5a9f75d 100644 +index 2efd62b..ecee2ff 100644 --- a/src/main.rs +++ b/src/main.rs @@ -171,6 +171,11 @@ fn setup(args: &[String]) -> Setup { @@ -89,7 +89,7 @@ index f749a52..5a9f75d 100644 .optflag( "", "linear-volume", -@@ -277,6 +282,8 @@ fn setup(args: &[String]) -> Setup { +@@ -282,6 +287,8 @@ fn setup(args: &[String]) -> Setup { ) }; @@ -98,7 +98,7 @@ index f749a52..5a9f75d 100644 let session_config = { let device_id = device_id(&name); -@@ -320,6 +327,7 @@ fn setup(args: &[String]) -> Setup { +@@ -325,6 +332,7 @@ fn setup(args: &[String]) -> Setup { .opt_str("normalisation-pregain") .map(|pregain| pregain.parse::().expect("Invalid pregain float value")) .unwrap_or(PlayerConfig::default().normalisation_pregain), diff --git a/packages/addons/service/librespot/patches/librespot-02_android.patch b/packages/addons/service/librespot/patches/librespot-02_android.patch new file mode 100644 index 0000000000..eb897d9a48 --- /dev/null +++ b/packages/addons/service/librespot/patches/librespot-02_android.patch @@ -0,0 +1,50 @@ +From 16b83b38c1b77b34c64ad3f567e5f43bb1dc5ef0 Mon Sep 17 00:00:00 2001 +From: Anthony Green +Date: Tue, 7 Jul 2020 16:23:20 +0100 +Subject: [PATCH 1/2] Issue #497 - Playing songs from android app + +Implement the fix suggested by @Johannesd3 +--- + connect/src/spirc.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/connect/src/spirc.rs b/connect/src/spirc.rs +index b4c657f7..88d377df 100644 +--- a/connect/src/spirc.rs ++++ b/connect/src/spirc.rs +@@ -790,7 +790,7 @@ impl SpircTask { + } + + MessageType::kMessageTypeNotify => { +- if self.device.get_is_active() && frame.get_device_state().get_is_active() { ++ if self.device.get_is_active() && frame.get_device_state().get_is_active() && self.device.get_became_active_at() <= frame.get_device_state().get_became_active_at() { + self.device.set_is_active(false); + self.state.set_status(PlayStatus::kPlayStatusStop); + self.player.stop(); + +From 9565e4392ab6ba8d39b7714395ce3b8a58048fb6 Mon Sep 17 00:00:00 2001 +From: Anthony Green +Date: Fri, 10 Jul 2020 21:17:01 +0100 +Subject: [PATCH 2/2] Fix formatting + +--- + connect/src/spirc.rs | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/connect/src/spirc.rs b/connect/src/spirc.rs +index 88d377df..0dd67093 100644 +--- a/connect/src/spirc.rs ++++ b/connect/src/spirc.rs +@@ -790,7 +790,11 @@ impl SpircTask { + } + + MessageType::kMessageTypeNotify => { +- if self.device.get_is_active() && frame.get_device_state().get_is_active() && self.device.get_became_active_at() <= frame.get_device_state().get_became_active_at() { ++ if self.device.get_is_active() ++ && frame.get_device_state().get_is_active() ++ && self.device.get_became_active_at() ++ <= frame.get_device_state().get_became_active_at() ++ { + self.device.set_is_active(false); + self.state.set_status(PlayStatus::kPlayStatusStop); + self.player.stop(); diff --git a/packages/addons/service/librespot/patches/librespot-02_enable_pulseaudio_device_names.patch b/packages/addons/service/librespot/patches/librespot-02_enable_pulseaudio_device_names.patch deleted file mode 100644 index 4e79567a91..0000000000 --- a/packages/addons/service/librespot/patches/librespot-02_enable_pulseaudio_device_names.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 389276e5d361da5f2a2116d11724c815ce4b6ec8 Mon Sep 17 00:00:00 2001 -From: Konstantin Seiler -Date: Wed, 11 Mar 2020 13:49:52 +1100 -Subject: [PATCH] Enable pulseaudio device names - ---- - playback/src/audio_backend/pulseaudio.rs | 12 +++++++----- - 1 file changed, 7 insertions(+), 5 deletions(-) - -diff --git a/playback/src/audio_backend/pulseaudio.rs b/playback/src/audio_backend/pulseaudio.rs -index e844b0d6..8a833d65 100644 ---- a/playback/src/audio_backend/pulseaudio.rs -+++ b/playback/src/audio_backend/pulseaudio.rs -@@ -12,6 +12,7 @@ pub struct PulseAudioSink { - ss: pa_sample_spec, - name: CString, - desc: CString, -+ device: Option, - } - - fn call_pulseaudio( -@@ -56,10 +57,6 @@ impl Open for PulseAudioSink { - fn open(device: Option) -> PulseAudioSink { - debug!("Using PulseAudio sink"); - -- if device.is_some() { -- panic!("pulseaudio sink does not support specifying a device name"); -- } -- - let ss = pa_sample_spec { - format: PA_SAMPLE_S16LE, - channels: 2, // stereo -@@ -74,6 +71,7 @@ impl Open for PulseAudioSink { - ss: ss, - name: name, - desc: description, -+ device: device.and_then(|s| CString::new(s).ok()), - } - } - } -@@ -81,13 +79,17 @@ impl Open for PulseAudioSink { - impl Sink for PulseAudioSink { - fn start(&mut self) -> io::Result<()> { - if self.s == null_mut() { -+ let device = match &self.device { -+ None => null(), -+ Some(device) => device.as_ptr(), -+ }; - self.s = call_pulseaudio( - |err| unsafe { - pa_simple_new( - null(), // Use the default server. - self.name.as_ptr(), // Our application's name. - PA_STREAM_PLAYBACK, -- null(), // Use the default device. -+ device, - self.desc.as_ptr(), // desc of our stream. - &self.ss, // Our sample format. - null(), // Use default channel map