Spotify Connect on RuneAudio

Raspberry Pi related support

Re: Spotify Connect on RuneAudio

Postby dynobot » 14 May 2019, 22:13

spotityd.conf

[global]
username = "blahblah" <-----your account name
password = "blahblahblah" <----your account pw
device = "default:CARD=DSD" <------hw:....can not be used
volume-control = "softvol"
device_name = "Bedroom" <----text only what ever name you want
bitrate = 320

Also even though you seem to be getting sound 'without' enabling the kernel for I2S it still should be enabled to get the intended function of a I2S card. Note: all HATS function in I2S mode to communicate vs USB.

Also when you started the service, since its running as root, you can't include the --user in the systemctl line, per instructions.

systemctl start spotifyd.service
systemctl enable spotifyd.service
User avatar
dynobot
 
Posts: 114
Joined: 19 May 2014, 15:04
Location: GA-USA

Re: Spotify Connect on RuneAudio

Postby Ema_82 » 14 May 2019, 23:24

dynobot wrote:spotityd.conf

[global]
username = "blahblah" <-----your account name
password = "blahblahblah" <----your account pw
device = "default:CARD=DSD" <------hw:....can not be used
volume-control = "softvol"
device_name = "Bedroom" <----text only what ever name you want
bitrate = 320

Also even though you seem to be getting sound 'without' enabling the kernel for I2S it still should be enabled to get the intended function of a I2S card. Note: all HATS function in I2S mode to communicate vs USB.

Also when you started the service, since its running as root, you can't include the --user in the systemctl line, per instructions.

systemctl start spotifyd.service
systemctl enable spotifyd.service


Obviously I used my username and password in the first two fields.
I fixed the device with "card 1" (as in indicate in aplay -l) and I see from the log that is detected correctly.

I enabled also the I2S kernel in the config.txt.

And yes, I know that I can't include the --user in the systemctl line.

After these changes I reboot runeaudio and started spotifyd: still the same error.
Then I stopped spotifyd and launched the command systemctl status spotifyd

Here's the log info:

Code: Select all
May 15 00:06:28 runeaudio spotifyd[895]: 00:06:28 [INFO] Using software volume controller.
May 15 00:06:28 runeaudio spotifyd[895]: 00:06:28 [ERROR] Caught panic with message: called `Result::unwrap()` on an `Err` value: Os { code: 98, kind: AddrInUse, message: "Address already in use" }
May 15 00:06:28 runeaudio systemd[1]: spotifyd.service: Main process exited, code=exited, status=101/n/a
May 15 00:06:28 runeaudio systemd[1]: spotifyd.service: Unit entered failed state.
May 15 00:06:28 runeaudio systemd[1]: spotifyd.service: Failed with result 'exit-code'.
May 15 00:06:30 runeaudio systemd[1]: Stopped A spotify playing daemon.
Ema_82
 
Posts: 11
Joined: 13 May 2019, 09:01

Re: Spotify Connect on RuneAudio

Postby dynobot » 14 May 2019, 23:32

aplay -l -and- aplay -L gives two different results. Spotifyd uses the output from aplay -L

Therefore the line should read something like default:CARD=something, as supposed to hw or card which is the output of aplay -l

Good luck
User avatar
dynobot
 
Posts: 114
Joined: 19 May 2014, 15:04
Location: GA-USA

Re: Spotify Connect on RuneAudio

Postby Ema_82 » 14 May 2019, 23:44

aplay -L shows the correct card with the following name: sysdefault:CARD=sndrpihifiberry

I copypasted the line in spotityd.conf and checked that is correctly detected.
No way, after the reboot I still get the same error :cry:
Ema_82
 
Posts: 11
Joined: 13 May 2019, 09:01

Re: Spotify Connect on RuneAudio

Postby tml3nr » 15 May 2019, 15:43

For me this spotityd.conf work fine on Rune 0.4, Boss Dac:

Code: Select all
[global]
username = xxx
password = xxx
backend = alsa
device = hw:0 # Given by `aplay -L`
mixer = Digital
volume-control = alsa # or alsa_linear, or softvol
#onevent = command_run_on_playback_event
device_name = RuneAudio
bitrate = 320
#cache_path = /tmp/spotifyd
volume-normalisation = false
#normalisation-pregain = -10
tml3nr
 
Posts: 56
Joined: 02 Apr 2016, 07:43

Re: Spotify Connect on RuneAudio

Postby Ema_82 » 15 May 2019, 16:15

I've already used that configuration without success.
I'm pretty convinced that the problem does not depend on the configuration file and I suspect (from what I've read around on similar problems, although not strictly related to runeaudio and spotifyd) that is something related to the listening port that spotifyd uses to connect to.
I'm quite ignorant on the subject, but from what I read, it could be that the service tries to connect to a port that is occupied by another running service. And if this is true, I now need to understand how to see if there are other active processes and how to possibly stop them.
Is it possible? What do you think?
Thanks
Ema_82
 
Posts: 11
Joined: 13 May 2019, 09:01

Re: Spotify Connect on RuneAudio

Postby Ema_82 » 15 May 2019, 21:06

Solved! Finally! ... With a rather drastic but effective remedy: I killed all the active processes with
Code: Select all
 killall -u root
and restarted the Raspberry. Once relaunched spotifyd, it started correctly!

Thanks to janui, dynobot and tml3nr for trying to help me and excuse me for flooding the topic :P
Ema_82
 
Posts: 11
Joined: 13 May 2019, 09:01

Re: Spotify Connect on RuneAudio

Postby tml3nr » 19 May 2019, 06:12

Use onevent parameter to enhance the sound quality for spotifyd. Automatically start and stop mpd (and other service etc) when play and stop Spotify Connect.

Code: Select all
root@runeaudio(rw):~# spotifyd --help
Usage: spotifyd [options]

Options:
  -c, --config CONFIG Path to a config file.
  -u, --username USERNAME
  Spotify user name.
  -p, --password PASSWORD
  Spotify password.
  --device DEVICE Audio device, given by aplay -L.
  --mixer DEVICE  Audio mixer
  --bitrate DEVICE
  Any of 96, 160, and 320.
  --pid PID-FILE  Path to PID file.
  --device_name DEVICE
  Name of this Spotify device.
  --backend BACKEND
  Audio backend.
  --cache_path PATH
  Path to cache location.
  --volume-normalisation
  Apply volume normalisation per track.
  --normalisation-pregain PREGAIN
  dB of pregain for volume normalisation
  --onevent COMMAND
  Run a command on events. Environment variables
  PLAYER_EVENT, TRACK_ID,OLD_TRACK_ID are passed to the
  command.
  --volume-control CONTROLLER
  Possible values are alsa, alsa_linear, and softvol.
  -v, --verbose  Add debug information to log.
  --no-daemon  Don't detach from console.
  --backends  List available audio backends.
  -h, --help  Print this help text.


Create spotifyd_even.sh. Set chmod 755:

nano /home/root/spotifyd_event.sh

#!/bin/bash

case "$PLAYER_EVENT" in

start)
# Stop mpd
systemctl stop mpd
exit
;;

stop)
# Start mpd
systemctl start mpd
exit
;;
esac
exit 0


Edit spotifyd.service:

Code: Select all
ExecStart=/usr/bin/spotifyd --no-daemon --onevent /home/root/spotifyd_event.sh


Done!!!

PS: We may need to restart the related scripts to re-set the service settings.
tml3nr
 
Posts: 56
Joined: 02 Apr 2016, 07:43

Re: Spotify Connect on RuneAudio

Postby rtfq » 22 Apr 2020, 23:19

Hi,
I am completely new to rune audio, but it appears to do what I have been looking for in an audio server and, if I could get spotify to work it would be perfect. I have been running raspbian with separate software for doing all the functions (local playback, internet radio, spotify (using raspotify) etc.). I have been trying to setup spotifyd on rune but keep on getting this error when trying to run spotifyd:

Code: Select all
login as: root
root@192.168.1.90's password:
===============  RuneOS distribution  ===============
  ____                      _             _ _
 |  _ \ _   _ _ __   ___   / \  _   _  __| (_) ___
 | |_) | | | | '_ \ / _ \ / _ \| | | |/ _` | |/ _ \
 |  _ <| |_| | | | |  __// ___ \ |_| | (_| | | (_) |
 |_| \_\\__,_|_| |_|\___/_/   \_\__,_|\__,_|_|\___/

================  www.runeaudio.com  ================
RuneOs: 0.3-beta
RuneUI: 1.3-beta
Hw-env: RaspberryPi 2


Last login: Wed Apr 22 23:51:56 2020 from 192.168.1.66
[root@runeaudio ~]# spotifyd --no-daemon
Loading config from "/root/.config/spotifyd/spotifyd.conf"
No proxy specified
Using software volume controller.
Caught panic with message: called `Result::unwrap()` on an `Err` value: Os { code: 98, kind: AddrInUse, message: "Address already in use" }
[root@runeaudio ~]#


This is the same issue someone was getting previously, however a
Code: Select all
killall -u root

and a reboot did not solve it like previous.
My config and service files are identical to above too. This is quite frustrating now!

Anyone got any ideas?
Thanks in advance, people seem quite helpful on here from what I've seen so far.
rtfq
 
Posts: 1
Joined: 22 Apr 2020, 23:06

Re: Spotify Connect on RuneAudio

Postby AndyF » 02 May 2020, 21:56

Hi rtfq,

I think you should give rern's version a try: https://www.runeaudio.com/forum/runeaudio-r-e3-t7014.html

regards, Andy
AndyF
 
Posts: 151
Joined: 02 Aug 2015, 07:36
Location: Germany - Bavaria

support RuneAudio Donate with PayPal

PreviousNext

Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 2 guests