Spotify Connect on RuneAudio

Raspberry Pi related support

Spotify Connect on RuneAudio

Postby tml3nr » 07 Apr 2018, 16:02

Tested on RPi2, RuneAudio 0.4-beta_20170229, Boss Dac. It works perfect!

From this thread:

spotify-connect-autostart-t3315.html

You need to extend partition first.

Code: Select all
curl -OL https://github.com/Fornoth/spotify-connect-web/releases/download/0.0.3-alpha/spotify-connect-web.sh


Code: Select all
nano /root/spotify-connect-web.sh


Remove all 'sudo '

Code: Select all
#!/bin/bash
set -e

DIR=~/spotify-connect-web-chroot

if [ "$1" == "install" ]; then
        mkdir -p $DIR
        cd $DIR
        curl -L https://github.com/Fornoth/spotify-connect-web/releases/download/0.0.3-alpha/spotify-connect-web_0.0.3-alpha_chroot.tar.gz | tar xz
else
        trap "umount $DIR/dev $DIR/proc" EXIT
        mount --bind /dev $DIR/dev
        mount -t proc proc $DIR/proc/
        cp /etc/resolv.conf $DIR/etc/
        chroot $DIR /bin/bash -c "cd /usr/src/app && python main.py $*"
fi


Code: Select all
chmod +x spotify-connect-web.sh


Code: Select all
/root/spotify-connect-web.sh install


Code: Select all
wget https://github.com/RafaPolit/moode-spotify-connect-web/raw/master/spotify_appkey.key

mv /root/spotify_appkey.key /root/spotify-connect-web-chroot/usr/src/app


Now test:

Code: Select all
/root/spotify-connect-web.sh --name RuneAudio --device 0 --mixer Digital --username abc --password xyz --bitrate 320


--device <value> --mixer <value> from alsamixer:

Image

If everything's OK. Now you can see RuneAudio Connect on your Spotify app!

Store this service file as /usr/lib/systemd/system/spotify-connect.service:

Code: Select all
nano /usr/lib/systemd/system/spotify-connect.service


Code: Select all
[Unit]
Description=Spotify Connect
After=network.target

[Service]
ExecStart=/usr/bin/sh /root/spotify-connect-web.sh --name RuneAudio --device 0 --mixer Digital --username abc --password xyz --bitrate 320
Restart=always
RestartSec=10
StartLimitInterval=30
StartLimitBurst=20

[Install]
WantedBy=multi-user.target


To test the service execute:

Code: Select all
systemctl start spotify-connect


If all works, you can enable the service (start on boot):

Code: Select all
systemctl enable spotify-connect


Adjust Spotify volume on app or web, also control volume on RuneAudio.

After successfully install v0.0.3. You can update to v0.0.4 by the same this way. If you install v0.0.4 first, it's not working.

More information:

https://github.com/Fornoth/spotify-connect-web/releases

Many thanks to RuneAudio team for a wonderful Audiophile OS.

Many thanks to @Fornoth, @hongdagx35, @Lazerharp, @Stert...

Image
Last edited by tml3nr on 05 Jun 2018, 04:24, edited 2 times in total.
tml3nr
 
Posts: 20
Joined: 02 Apr 2016, 07:43

Re: Spotify Connect on RuneAudio

Postby grofweg » 18 Apr 2018, 07:27

Thanks tml3nr for the write up.

I tried a few times to compile the new Librespot(-org) but failed everytime mostly because of dependencies. On debian/raspian based RPI's this is less painful ;)
This seems like a good alternative. I have v0.0.4 installed (following your guide) on an RPi 3: running good sofar!

Thanks,

Greetings,

Martin

Code: Select all
root@runeaudio(rw):~# systemctl status spotify-connect
● spotify-connect.service - Spotify Connect
   Loaded: loaded (/usr/lib/systemd/system/spotify-connect.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2018-04-18 08:22:27 CEST; 1min 55s ago
 Main PID: 1265 (sh)
    Tasks: 4 (limit: 512)
   CGroup: /system.slice/spotify-connect.service
           ├─1265 /usr/bin/sh /root/spotify-connect-web.sh --name RuneSpot --playback_device sysdefault:CARD=DAC --username xxx --password xxx --bitrate 320
           └─1270 python main.py --name RuneSpot --playback_device sysdefault:CARD=DAC --username xxx --password xxx --bitrate 320

Apr 18 08:22:27 runeaudio systemd[1]: Started Spotify Connect.
grofweg
 
Posts: 18
Joined: 30 Sep 2017, 11:37

Re: Spotify Connect on RuneAudio

Postby grofweg » 18 Apr 2018, 18:50

Unfortunately, after a full day of listening things didn't turn out that good. More than once the music stopped completely. A reboot was required to get things going again.

Anyone else having similar issues?

Sent from my Redmi 3S using Tapatalk
grofweg
 
Posts: 18
Joined: 30 Sep 2017, 11:37

Re: Spotify Connect on RuneAudio

Postby tml3nr » 19 Apr 2018, 01:13

grofweg wrote:Unfortunately, after a full day of listening things didn't turn out that good. More than once the music stopped completely. A reboot was required to get things going again.

Anyone else having similar issues?

Sent from my Redmi 3S using Tapatalk

There are currently 3 versions of spotify-connect-web can work on RuneAudio:

Code: Select all
1.

http://spotify-connect-web.s3-website.eu-central-1.amazonaws.com/spotify-connect-web.tar


Code: Select all
2.

https://github.com/Fornoth/spotify-connect-web/releases/download/0.0.3-alpha/spotify-connect-web_0.0.3-alpha_chroot.tar.gz


Code: Select all
3.

https://github.com/Fornoth/spotify-connect-web/releases/download/0.0.4-alpha/spotify-connect-web_0.0.4-alpha_chroot.tar.gz


For me the first one works perfectly:

Code: Select all
curl -O http://spotify-connect-web.s3-website.eu-central-1.amazonaws.com/spotify-connect-web.sh


Code: Select all
nano /root/spotify-connect-web.sh


Remove all 'sudo '

Code: Select all
#!/bin/bash
set -e
DIR=~/spotify-connect-web-chroot
if [ "$1" == "install" ]; then
  mkdir -p $DIR
  cd $DIR
  curl http://spotify-connect-web.s3-website.eu-central-1.amazonaws.com/spotify-connect-web.tar.gz | tar xz
else
  trap "umount $DIR/dev $DIR/proc" EXIT
  mount --bind /dev $DIR/dev
  mount -t proc proc $DIR/proc/
  cp /etc/resolv.conf $DIR/etc/
  chroot $DIR /bin/bash -c "cd /usr/src/app && python main.py $*"
fi


Code: Select all
chmod +x spotify-connect-web.sh


Code: Select all
./spotify-connect-web.sh install


Download spotify_appkey.key and console_callbacks.py from:

https://github.com/RafaPolit/moode-spot ... appkey.key

https://github.com/JozoVilcek/spotify-c ... llbacks.py

Copy file spotify_appkey.key to /root/spotify-connect-web-chroot/usr/src/app

Copy overwrite file console_callbacks.py to /root/spotify-connect-web-chroot/usr/src/app

Run test:

Code: Select all
/root/spotify-connect-web.sh --name RuneAudio --device 0 --mixer Digital --username abc --password xyz --bitrate 320


Code: Select all
nano /usr/lib/systemd/system/spotify-connect.service


Code: Select all
[Unit]
Description=Spotify Connect
After=network.target
[Service]
ExecStart=/usr/bin/sh /root/spotify-connect-web.sh --name RuneAudio --device 0 --mixer Digital --username abc --password xyz --bitrate 320
Restart=always
RestartSec=10
StartLimitInterval=30
StartLimitBurst=20
[Install]
WantedBy=multi-user.target


Code: Select all
systemctl enable spotify-connect


PS: Edit console_callbacks.py to more accurately volume control from Spotify app to RuneAudio (If your DAC has hardware volume):

Code: Select all
nano /root/spotify-connect-web-chroot/usr/src/app/console_callbacks.py


Edit:

Code: Select all
mixer.setvolume(int(volume / 655.35))


to:

Code: Select all
mixer.setvolume(int(50 + (volume / 655.35) / 2 ))



Many thanks to maumi for this tip (Volume fix):

https://github.com/Fornoth/spotify-conn ... /issues/11
Last edited by tml3nr on 19 Apr 2018, 12:16, edited 1 time in total.
tml3nr
 
Posts: 20
Joined: 02 Apr 2016, 07:43

Re: Spotify Connect on RuneAudio

Postby grofweg » 19 Apr 2018, 09:41

Thanks, I'll try the first 1 as well.
Let's see if that one is more stable.

Sent from my Redmi 3S using Tapatalk
grofweg
 
Posts: 18
Joined: 30 Sep 2017, 11:37

Re: Spotify Connect on RuneAudio

Postby tml3nr » 19 Apr 2018, 11:41

grofweg wrote:Thanks, I'll try the first 1 as well.
Let's see if that one is more stable.

Sent from my Redmi 3S using Tapatalk

I installed the first one and run 24/7 has been 2 weeks. Everything OK.

Code: Select all
root@runeaudio(rw):~# systemctl status spotify-connect
● spotify-connect.service - Spotify Connect
   Loaded: loaded (/usr/lib/systemd/system/spotify-connect.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2018-04-19 18:23:17 ICT; 2s ago
 Main PID: 14030 (sh)
    Tasks: 3 (limit: 512)
   CGroup: /system.slice/spotify-connect.service
           ├─14030 /usr/bin/sh /root/spotify-connect-web.sh --name RuneAudio --device 0 --mixer Digital --username abc --password xyz --bitrate 320
           ├─14035 /bin/bash -c cd /usr/src/app && python main.py --name RuneAudio --device 0 --mixer Digital --username abc --password xyz --bitrate
           └─14036 python main.py --name RuneAudio --device 0 --mixer Digital --username abc --password xyz --bitrate 320

Apr 19 18:23:17 runeaudio systemd[1]: Started Spotify Connect.
tml3nr
 
Posts: 20
Joined: 02 Apr 2016, 07:43

Re: Spotify Connect on RuneAudio

Postby grofweg » 20 Apr 2018, 17:17

Unfortunately this doesn't work either. Same problems.

Never mind it was worth the try. May be this weekend I'll try again with h an RP2.
grofweg
 
Posts: 18
Joined: 30 Sep 2017, 11:37

Re: Spotify Connect on RuneAudio

Postby tml3nr » 21 Apr 2018, 07:28

Thank you very much for your test. Maybe it would be better on RPi2. All 3 versions of spotify-connect-web work fine on my test with RPi2.

i have both RPi2 & RPi3. But i prefer RPi2 because it's low noise, sound more cleaner.
tml3nr
 
Posts: 20
Joined: 02 Apr 2016, 07:43

Re: Spotify Connect on RuneAudio

Postby kaczor189 » 26 May 2018, 18:35

Hello,
I've got a problem with step: ./spotify-connect-web.sh install. Putty claims there is no space left on divice, while I have a 16GB card !
kaczor189
 
Posts: 7
Joined: 27 Oct 2016, 08:03

Re: Spotify Connect on RuneAudio

Postby tml3nr » 27 May 2018, 01:46

kaczor189 wrote:Hello,
I've got a problem with step: ./spotify-connect-web.sh install. Putty claims there is no space left on divice, while I have a 16GB card !

You need to extend partition first!
tml3nr
 
Posts: 20
Joined: 02 Apr 2016, 07:43

support RuneAudio Donate with PayPal

Next

Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 1 guest