Page 1 of 6

Spotify Connect on RuneAudio

PostPosted: 07 Apr 2018, 16:02
by tml3nr
METHOD 1: Spotify Connect web by Fornoth

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

METHOD 2: Spotifyd by Simon Persson

Many thanks to dynobot!

spotify-connect-on-runeaudio-t6315-20.html#p27695

Re: Spotify Connect on RuneAudio

PostPosted: 18 Apr 2018, 07:27
by grofweg
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.

Re: Spotify Connect on RuneAudio

PostPosted: 18 Apr 2018, 18:50
by grofweg
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

Re: Spotify Connect on RuneAudio

PostPosted: 19 Apr 2018, 01:13
by tml3nr
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

Re: Spotify Connect on RuneAudio

PostPosted: 19 Apr 2018, 09:41
by grofweg
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

Re: Spotify Connect on RuneAudio

PostPosted: 19 Apr 2018, 11:41
by tml3nr
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.

Re: Spotify Connect on RuneAudio

PostPosted: 20 Apr 2018, 17:17
by grofweg
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.

Re: Spotify Connect on RuneAudio

PostPosted: 21 Apr 2018, 07:28
by tml3nr
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.

Re: Spotify Connect on RuneAudio

PostPosted: 26 May 2018, 18:35
by kaczor189
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 !

Re: Spotify Connect on RuneAudio

PostPosted: 27 May 2018, 01:46
by tml3nr
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!