Could "Spotifyd" be available into DietPi software ?

I know that Raspotify is already available in DietPi … But it is using librespot that is not supported anymore meaning that Raspotify could stop working at anytime depending on new Spotify released.

Spotifyd beeing based ont the Official Spotify connect protocol, it would be nice to have it installed within dietPi just like raspotify is.

seems to install clean, just can’t seem to get sound out of it though

Finally got the spotifyd.conf fill configured right on one Dac, which includes use of the volume control.

It seems its not a one size fits all situation though as the same settings won’t work on another Dac. I’m guessing the file is too specific to work across the board…just a guess. Anyway I have about 5 different interfaces to play with, I’ll try to get them all to work and see if I can come up with a generic solution.

Okay I think I got it.

Installing just download the zip, unzip it to /usr/bin, run it with ./, make a service, enable the service to run on boot, create and update the .conf file. Everything required for the files are at the github site.

According to the Spotifyd github this is the stock spotifyd.conf file contents when can be adjusted to meet users needs.


[global]
username = USER
password = PASS
#use-keyring = true
backend = alsa
device = alsa_audio_device # Given by aplay -L
mixer = PCM
volume-control = alsa # or alsa_linear, or softvol
#onevent = command_run_on_playback_event
device_name = name_in_spotify_connect # Cannot contain spaces
bitrate = 96|160|320
cache_path = cache_directory
volume-normalisation = true
normalisation-pregain = -10

From the Github page:
__

Every field is optional; Spotifyd can even run without a configuration file. Options can also be placed in a [spotifyd] section which takes priority over the [global] section. This is useful when you run applications related to Spotifyd which shares some, but not all, options with Spotifyd.

Because I normally have more than one client running I used [spotifyd] instead of [global]. And these are the basic settings that seem to work across all of the USB interfaces I have, which include the Amanero and the XMOS. Be aware that no spaces are allowed in device name.

[spotifyd]
username = “your_account_name”
password = “your_password”
device = alsa_audio_device # Given by aplay -L
volume-control = “softvol”
device_name = “your_client_name”
bitrate = 320

Very clean install on the RPi, nothing major. The github includes directions for making it a service etc.

Good luck and have fun!

:sunglasses:

Update

Amanero USB interfaces seem to be difficult to control the volume. Its not completely stable, sometimes it works sometimes not. Kinda figures because alsamixer does not show any volume controls.

But it worked for a while so I don’t know what gives.

Results

Spotifyd seems to be totally fine with all USB chips I have except Amanero. This also includes HATS like the DigiOne and DigiOne SIg. Volume control etc works fine, every time without a hitch. Installed from scratch multiple times, results very consistent.

Install process:

  1. download and unzip file.
  2. place file in /usr/bin
  3. create config file in ~/.config/spotifyd/
  4. create service in /etc/systemd/system/
  5. start and enable the service

Parameters for spotifyd.conf
[spotifyd]
username = “your_account_name”
password = “your_password”
device = alsa_audio_device # Given by aplay -L
volume-control = “softvol”
device_name = “your_client_name”
bitrate = 320

Note: [global] call and other parameters exist to try.

Edward
Many thanks for testing. Is it possible to have Spotifyd using the audio device that is configured with ALSA, or, generally using ALSA? I remember this being an issue with Raspotify (or was it Spotify Connect Web?) already, that ALSA is bypassed, thus equalizer and sound card selection being bypassed and also the audio device then being blocked for other output and all such.

So if possible we would like all audio sources using ALSA, so you can configure the audio device + equalizer in one central place.

HI MichaIng,

Thats a good question.

Thats exactly the case, it bypasses ALSA but ‘is’ able to control the volume on everything [I’ ve tried] except the Amanero USB device.

To remedy this I found that if I use this in the spotifyd.conf file it will control the volume of everything, even the Amanero USB device. However it does stream at 48Hz not 44.1…working on sample rate next.

must be set for ‘global’ and ‘Digital’ for mixer device, otherwise it will by bypass ALSA.

[global]
username = “your_account_name”
password = “your_password”
device = alsa_audio_device # example sysdefault:CARD=Amanero
mixer = “Digital”
volume-control = “softvol”
device_name = “your_client_name”
bitrate = 320


Rebooted a few times, Amanero continues to work, flashed a new SD and did the whole install over from scratch and everything is good. I need to go back and see if the ‘digital’ setting works for everything ie XMOS, Allo Digi etc. If it does then this could be a generic file setting.


Continued testing-
Just for kicks I changed my settlings back to [what didnt work] ie [spotifyd] and nothing for mixer. The Amanero volume controls still worked..

So something fishy is going on here, I wouldn't run with my proposed solution just yet. I need to break it ie make it not work then fix it so it works before I would be confident.

Edward Thanks for your post, it convinced me to install spotifyd on my Sparky USBridge
and it seems to work flawleessly.

Is it possible to set the volume at 50% of it max level on at the beginning of the very first song to be played ?have

Is the a way to visualize the artist cover as well ? (Nothing about this to be found on spotifyd GitHub

Facel
As far as I know spotifyd is just a endpoint for the spotify app. I don’t think it can do anything else but stream from the app.

Glad to know it worked out for you. For me its only at 100% for the initial connection, after that it stays at what ever volume I adjust it too for any music I listen too after that.

I have exactly the same behaviour as yours regarding the volume level.

I would simply have preferred to set the volume at 50% for the initial connection (instead of 100%)

Facel

This might be a way around it.

Go into alsamixer and adjust the level to your desired output. The volume ‘should’ decrease. After that you should be maxed at 50%.

This worked for me in one instance

Strange, now even the Amanero USB interface works. I guess its rare to be pissed that something works but in this case I don’t want it to work. I want it to either be broke so I can fix it or at the very least allow me to break it so I can fix it.

Now I run a very spartan spotifyd.conf file

[spotifyd]
username = “blahblah”
password = “blahblahblah”
device = “default:CARD=DSD”
volume-control = “softvol”
device_name = “Bedroom”
bitrate = 320

The only difference in procedure is I powered the RPi off and once powered on I connected by my primary Spotify device ie my phone. Volume control worked, the only thing I can do is kill the output by commenting out the device line, other than that volume control always works.

Tested on Amanero and XMOS…HATS never had a problem.

I’ll keep testing and if something pops up or I catch that elusive Gremlin I’ll let you know.

Okay I tested it three more times, all on boards that 100% did not work before ie Amanero USB.

After install, starting and enabling the service I used my primary Spotify device [my phone] to connect to Spotifyd. Each time it worked without a hitch.

Note: These were all fresh brand new OS and Spotifyd installs on three different micro SD cards using three different Rpi’s, all using WiFi.

I’m pretty sure its sovled but I still would like to have someone verify.

:sunglasses:

I’m new to dietpi and I love it so mutch.

I like to try spotifyd too, because raspotify and “Spotify Connect Web” are not running very stable.


I tried to install it manually but I can’t get sound out it with my Allo digione soundcard.


A simple integration in optimised software would be very great!! :stuck_out_tongue:


Greetings!