Giter VIP home page Giter VIP logo

raspotify's Introduction

Raspotify is a Debian package and associated repository for Debian Stable ( Currently Debian 11 "Bullseye" ) and other Debian Stable based/compatible OS's ( your mileage may vary ) which thinly wraps a fork of the awesome librespot library by Paul Lietar and others up as a systemd daemon.

Raspotify is intended to be used in a headless enviroment. For desktop OS's spotifyd offers similar functionality and is a better choice. If you're looking for a turnkey audio solution for Raspberry Pi's with Spotify Connect support we recommend moOde™ audio player.

Librespot, and therefore Raspotify, requires a premium account.

Installation

There are various "guides" floating around online. Most if not all of them are outdated and/or present incorrect information. Don't follow them.

sudo apt-get -y install curl && curl -sL https://dtcooper.github.io/raspotify/install.sh | sh

Or you can just download the latest .deb package and install it manually from here:

Configuration

The wiki is full of useful information. The Basic Setup Guide is a good place to start.

Bug Reports, Questions and Feature Requests

Please read the Troubleshooting Guide, the Basic Setup Guide, and search though open and closed issues and discussions before opening an issue or asking a question.

Disclaimer

Per librespot's disclaimer, using librespot — the underlying library behind raspotify — to connect to Spotify's API "is probably forbidden by them." We've not received word about that, however use at your own risk.

Raspotify and librespot are intended for personal private use. Please DO NOT use Raspotify or librespot in any sort of commercial and/or public presentation. Doing so is a flagrant violation of Spotify's terms of service and could potentially lead to them blocking all Raspotify and librespot users.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Special thanks to Paul Lietar, librespot org and its many contributors for librespot, which Raspotify packages (a slightly modded version of). Without librespot, Raspotify would simply not exist.

📻 "And Now, For Something Completely Different!" 🎙️

Raspotify's author David Cooper has abandoned being a software engineer to pursue a career as a radio personality. If you find Raspotify useful, you can support him by checking out his radio work here or give him a follow on Twitter.

On a related note, @JasonLG1979 has become the de-facto maintainer of the project. So an additional thank you to him as well.

If you'd like to buy Jason a Red Bull you can ❤️ Sponsor Him.

Final Note

...and remember kids, have fun!

raspotify's People

Contributors

branttaylor avatar burningkarl avatar ceesvanegmond avatar chandlercv avatar dennis14e avatar devinnorgarb avatar dtcooper avatar e4c6 avatar febs avatar haukepribnow avatar jasonlg1979 avatar lumaxis avatar mherkender avatar pimvh avatar reinoudk avatar skywinder avatar stevewolter avatar troon avatar weskerfoot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

raspotify's Issues

Metadata and controlling like Web API

Hi,

i would like to ask if it's possible to read out some metadata like e.g. the artist, song name or the art cover to display them on a HTML website. At the same time, the website should be able to play, stop, resume and skip forward and back.

So in fact the functions the Spotify Web API is able to do. Or do i have to use the Web API to archive these points?

Thanks in advance!

I can't edit raspotify settings

Hello,

i followed your instructions on how to edit the raspotify settings, so I did that.
when I want to save I get this message: "Error writing raspotify: Permission denied"
I enter this command: pi@raspberrypi:/etc/default $ ls -lha
I see this:
-rw-r--r-- 1 502 dialout 946 Jul 27 22:10 raspotify
all other files have root root

how can I fix this?

regards,

Ralph

New enums

Crashes due to new enums (12 and 13) for file formats.
Librespot has implemented them already.

How to make it work on ODROID C2

Hello, is there a way to make it work on an ODROID C2 device? The curl install line returns "Raspotify installer only runs on a Raspberry Pi".
Thank you

[Feature Request] Adjust sound volume via HDMI-CEC

Hi there!

Is it somehow possible to implement an option to adjust the Spotify sound volume over HDMI-CEC?
I am using an AV-receiver and the Raspberry Pi over HDMI is very quiet compared to other inputs.

The receiver-integrated Spotify connection works like that: The volume bar within the Spotify app is relative so there is no total silent and no max volume. If you want it louder, it sets the receiver's volume higher. Unfortunately it is exposed to the internet so I prefer Raspotify over that integrated thing.

Maybe there is a possibility to do a similar thing?

USB Soundcard

Hey mate,

can't get it working with my usb soundcard. Did like exactly like mentioned in the readme with
"`--device hw:0,1".
Even tried "output = alsasink device=hw:1,0". But no success. Whatever I do, the Music Plays through the hdmi out ...
Got mopidy running too. And there it works fine and like expected: Sound Comes through the 3.5mm jack of the usb soundcard.
Any tip would be awesome.

Shuffle not working on Spotify Connect

The shuffle function doesn't work when connected to the raspberry pi (raspotify). It is possible to click the shuffle icon in the client, but it doesn't do anything. The queue stays un-shuffled, and when it goes to the next song it isn't shuffled.

Version: 0.9.1~librespot.20171005T125424Z.8971d3a

Not Discoverable on local wifi - Pi 3

Hi,
Im using a rasperry pi 3.
Unfortunately the pi is not discoverable on my local wifi right out of the box by any device.

I can only discover it once I modify the config file and add my username and password to it.
This however means that everybody else on my network cannot use raspotify.

Thanks,
Simon

Logs:

Nov 11 14:28:15 Sipi systemd[546]: Time has been changed
Nov 11 14:28:15 Sipi systemd[1]: Time has been changed
Nov 11 14:28:15 Sipi systemd[1]: apt-daily.timer: Adding 9h 58min 48.041173s random time.
Nov 11 14:28:15 Sipi systemd[1]: apt-daily-upgrade.timer: Adding 56min 23.982175s random time.
Nov 11 14:29:35 Sipi librespot[856]: INFO:librespot::player: Loading track "Fried Hockey Boogie"
Nov 11 14:29:35 Sipi librespot[856]: INFO:librespot::player: Track "Fried Hockey Boogie" loaded
Nov 11 14:33:47 Sipi librespot[856]: INFO:librespot::player: Loading track "On The Road Again"
Nov 11 14:33:48 Sipi librespot[856]: INFO:librespot::player: Track "On The Road Again" loaded
Nov 11 14:37:14 Sipi librespot[856]: INFO:librespot::player: Loading track "Same All Over"
Nov 11 14:37:15 Sipi librespot[856]: INFO:librespot::player: Track "Same All Over" loaded
Nov 11 14:40:26 Sipi systemd[1]: Started Session c3 of user pi.
Nov 11 14:40:43 Sipi systemd[1]: Started Session c4 of user pi.
Nov 11 14:42:52 Sipi systemd[1]: Starting Cleanup of Temporary Directories...
Nov 11 14:42:52 Sipi systemd[1]: Started Cleanup of Temporary Directories.
Nov 11 14:44:30 Sipi systemd[1]: proc-sys-fs-binfmt_misc.automount: Got automount request for /proc/sys/fs/binfmt_misc, triggered by 939 (find)
Nov 11 14:44:30 Sipi systemd[1]: Mounting Arbitrary Executable File Formats File System...
Nov 11 14:44:30 Sipi systemd[1]: Mounted Arbitrary Executable File Formats File System.
Nov 11 14:52:06 Sipi systemd[1]: Stopping Raspotify...
Nov 11 14:52:06 Sipi systemd[1]: Stopped Raspotify.
Nov 11 14:52:06 Sipi systemd[1]: Starting Raspotify...
Nov 11 14:52:06 Sipi systemd[1]: Started Raspotify.
Nov 11 14:52:06 Sipi librespot[1059]: INFO:librespot: librespot 8971d3a (2017-10-05). Built on 2017-10-05. Build ID: POyxPQVg
Nov 11 14:54:22 Sipi systemd[1]: Stopping Raspotify...
Nov 11 14:54:22 Sipi systemd[1]: Stopped Raspotify.
Nov 11 14:54:47 Sipi systemd[1]: Reloading.
Nov 11 14:54:47 Sipi systemd[1]: Reloading.
Nov 11 14:54:50 Sipi dbus[376]: [system] Activating via systemd: service name='org.freedesktop.PackageKit' unit='packagekit.service'
Nov 11 14:54:50 Sipi systemd[1]: Starting PackageKit Daemon...
Nov 11 14:54:50 Sipi PackageKit: daemon start
Nov 11 14:54:50 Sipi dbus[376]: [system] Successfully activated service 'org.freedesktop.PackageKit'
Nov 11 14:54:50 Sipi systemd[1]: Started PackageKit Daemon.
Nov 11 14:56:18 Sipi systemd[1]: Reloading.
Nov 11 14:56:19 Sipi systemd[1]: Reloading.
Nov 11 14:56:20 Sipi systemd[1]: Starting Raspotify...
Nov 11 14:56:20 Sipi systemd[1]: Started Raspotify.
Nov 11 14:56:20 Sipi librespot[1559]: INFO:librespot: librespot 8971d3a (2017-10-05). Built on 2017-10-05. Build ID: POyxPQVg
Nov 11 14:57:46 Sipi systemd[1]: Stopping Raspotify...
Nov 11 14:57:46 Sipi systemd[1]: Stopped Raspotify.
Nov 11 14:57:46 Sipi systemd[1]: Starting Raspotify...
Nov 11 14:57:46 Sipi systemd[1]: Started Raspotify.
Nov 11 14:57:46 Sipi librespot[1588]: INFO:librespot: librespot 8971d3a (2017-10-05). Built on 2017-10-05. Build ID: POyxPQVg
Nov 11 15:00:01 Sipi systemd[1]: Stopping Raspotify...
Nov 11 15:00:01 Sipi systemd[1]: Stopped Raspotify.
Nov 11 15:00:01 Sipi systemd[1]: Starting Raspotify...
Nov 11 15:00:01 Sipi systemd[1]: Started Raspotify.
Nov 11 15:00:01 Sipi librespot[1625]: INFO:librespot: librespot 8971d3a (2017-10-05). Built on 2017-10-05. Build ID: POyxPQVg
Nov 11 15:05:46 Sipi systemd[1]: Stopping Raspotify...
Nov 11 15:05:46 Sipi systemd[1]: Stopped Raspotify.
Nov 11 15:05:46 Sipi systemd[1]: Starting Raspotify...
Nov 11 15:05:46 Sipi systemd[1]: Started Raspotify.
Nov 11 15:05:46 Sipi librespot[1675]: INFO:librespot: librespot 8971d3a (2017-10-05). Built on 2017-10-05. Build ID: POyxPQVg

Raspotify doesn't work properly with usb audio without Pulseaudio

My USB DAC doesn't work properly unless I use the "--plug hw:1,0" option ("--device hw:1,0), otherwise I'd get the following error:

ALSA lib pcm.c:7918:(snd_pcm_set_params) Sample format not available for PLAYBACK: Invalid argument thread '<unnamed>' panicked at 'called Option::unwrap()on aNonevalue', /checkout/src/libcore/option.rs:329 note: Run withRUST_BACKTRACE=1for a backtrace. thread 'main' panicked at 'calledResult::unwrap()on anErr value: "SendError(..)"', /checkout/src/libcore/result.rs:859

The USB DAC is set as the default audio output and works with any other program, just not with raspotify/librespot by default. Just now I discovered that simply by installing pulseaudio this issue disappears. The backend used by librespot is still ALSA, but I don't have to do "plughw" or anything of the sort. Perhaps this can be added to the README for other people facing this issue.

Access is Denied?

Hi! When I try to play a song over Spotify Connect, I get the following error:

ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Access denied
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', /checkout/src/libcore/option.rs:335
note: Run with `RUST_BACKTRACE=1` for a backtrace.

I've tried adding user raspotify to the audio group, but that didn't do anything. Any ideas?

volume drops randomly

hi there,

I started using this application a litte while ago on a headless raspberry pi, and it worked perfectly till today. The volume keeps dropping randomly and I can't find the problem. I looked for the .log file but couldn't find it. Which makes it impossible to include in this issue.

I hope to see some response and thanks in advance for looking into it.

Playback via external DAC

Hi all,

I am unable to play sound through external dac (Denon DA-300USB)
PreviouslyI was using fornoth solution for spotify connect and I was passing -Dplughw:DA300USB parameter for configuration. This does not work here.

I also tried --device hw:1, which does not help.

Device output:


 0 [ALSA           ]: bcm2835 - bcm2835 ALSA
                      bcm2835 ALSA
 1 [DA300USB       ]: USB-Audio - DA-300USB
                      D & M Holdings Inc. DA-300USB at usb-3f980000.usb-1.2, high speed
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: DA300USB [DA-300USB], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Could you please help me? Thanks a lot!

Raspbian with HiFiBerry - ALSA equalizer not working

I have Raspberry Pi 2 with installed Raspbian Lite from HiFiBerry download page. It has been modified to automatically detect and configure of the HiFiBerry DAC+ Pro board. I installed Raspotify and it works great: spotify connect and sound, and then i installed ALSA equalizer from this manual https://www.hifiberry.com/build/documentation/guide-adding-equalization-using-alsaeq/

But editing equalizer to manual setting not working, sound not changes.
I tested it, play file by command: aplay /path/to/file.wav
and i hear changes, edited in equalizer.

Maybe it's the problem with setting in Raspotify?

Does not work because of 'called `Option::unwrap()` on a `None` value'

When I try to play a song, the following appears on journalctl:

librespot[5059]: thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', /checkout/src/libcore/option.rs:335:20
librespot[5059]: stack backtrace:
librespot[5059]:    0: <unknown>
librespot[5059]:    1: <unknown>
librespot[5059]:    2: <unknown>
librespot[5059]:    3: <unknown>
librespot[5059]:    4: <unknown>
librespot[5059]:    5: <unknown>
librespot[5059]:    6: <unknown>
librespot[5059]:    7: <unknown>
librespot[5059]:    8: <unknown>
librespot[5059]:    9: <unknown>
librespot[5059]:   10: <unknown>
librespot[5059]:   11: <unknown>
librespot[5059]:   12: <unknown>
librespot[5059]:   13: <unknown>
librespot[5059]:   14: <unknown>
librespot[5059]:   15: <unknown>
librespot[5059]:   16: <unknown>

(Debug enabled)
And no sound is comming from the device.
Also tried different device settings, but nothing helped.

Can anyone help?

Additonal Question: When I have a raspberry 3, hifiberry RAC+ and the audio from the raspi disabled, how to find the correct device?

help with editing raspotify options file

Trying to get the output to go to my USB interface.

In the Raspotify file, do I need to remove the '#' characters? Add a device designator?

Trying to figure out exactly what I need to do in editing this file to steer the audio to USB.

Thoughts?

Raspotify shows on pizero w but says is not available on windows and android but plays on iOS.

I am building a wireless Spotify connect speaker system with a Raspberry Pi Zero W, Pimoroni PHAT -DAC with Raspotify in a headless configuration. For a few days, the install worked perfectly whether connecting from a Win 10 computer, Amazon Fire tablet and various iOS devices like multiple generation iPhones and iPods. As of yesterday, while testing the podcast section on Spotify the wireless connect speaker would not play at first and then started to connect but within a couple of minutes stopped. Since then, the device with Raspotify can be seen greyed out on the device panel with the statement that Raspotify cannot connect right now on this device. If I switch to an iOS device it connects fine and plays the same content. I have tried resetting the device, my wifi network and even reinstalling the Spotify app on my computer nothing works.
The only way I got it to connect again is by removing the Raspotify package from the device and re-installing. On the Pi-Zero-W speaker, once again the streaming music plays now but I cannot play the podcast section. Any suggestions?

Raspbian install issue

During installation on Raspbian, I have this issue :
N: Skipping acquire of configured file 'non-free/binary-armhf/Packages' as repository 'http://repository.spotify.com stable InRelease' doesn't support architecture 'armhf'

So the installation ends, I can see raspotify (raspberry) in my device list on all my devices, but can't connect to it..

Volume fade in / fade out

There is no volume fade in / out when press play/pause on the track.
It would be great to see this options in raspotify.

Sound volume

Is there any way to adjust the default sound volume? Whenever I start a song the volume is set to max.

Spotify only playing back from HDMI

Hello there,I just went through the easy installation and setup of raspotify, no problems at all. I have my Raspberry Pi 3 connected to a TV via HDMI and the analog audio output connected to a hifi-system. The RPi runs OSMC and I tried all the audio settings that include the analog output (analog only and analog+hdmi). In the config of raspotify I used the command --device hw:0 to send audio to the analog output.

No matter what I choose, Spotify only sends sound to the hdmi out. That means I'd have to keep on the TV (which is wired to the hifi-system as well). Did I miss an option where I can specify the output of Raspotify?

Thanks a lot!

Install error: Raspotify installer only runs on a Raspberry Pi

Tried installing using the curl -sL.... command on a Raspberry Pi 2B that has OSMC installed.

Got the error that: Raspotify installer only runs on a Raspberry Pi

Have tried both the easy and the hard/manual install options but get errors on both of them.

Any thoughts?

Login Spotify. Can't see the device

Just installed Raspotify and it is awesome! Thank you for your hard work. :)

I wonder why i can only play songs on ra'spotify localy (over LAN/WLAN).

I've deleted the "#" before "OPTIONS and gave my username and pass like this:
OPTIONS="--username <1161875533> --password <********>"

Log says : Authenticated as "1161875533"
but i cant see the new device on my list...
maybe im doing smth. wrong?
greets Adam
my raspotify status:

● raspotify.service - Raspotify
Loaded: loaded (/lib/systemd/system/raspotify.service; enabled)
Active: active (running) since Wed 2017-07-05 08:58:21 UTC; 47s ago
Process: 19680 ExecStartPre=/bin/chown raspotify:raspotify /var/cache/raspotify (code=exited, status=0/SUCCESS)
Process: 19677 ExecStartPre=/bin/mkdir -p 0755 /var/cache/raspotify (code=exited, status=0/SUCCESS)
Main PID: 19683 (librespot)
CGroup: /system.slice/raspotify.service
└─19683 /usr/bin/librespot --name Wohnzimmer --backend alsa --cache /var/cache/raspotify --bitrate 160 --userna...

Jul 05 08:58:21 RASPBERRYPI systemd[1]: Started Raspotify.
Jul 05 08:58:21 RASPBERRYPI librespot[19683]: INFO:librespot: librespot 2259188 (2017-06-14). Built on 2017-06-14.
Jul 05 08:58:21 RASPBERRYPI librespot[19683]: WARN:mdns::fsm: error sending packet Error { repr: Os { code: 99, messa..." } }
Jul 05 08:58:21 RASPBERRYPI librespot[19683]: INFO:librespot::session: Connecting to AP "lon3-accesspoint-a8.ap.spoti...4070"
Jul 05 08:58:21 RASPBERRYPI librespot[19683]: INFO:librespot::session: Authenticated as "1161875533" !
Jul 05 08:58:21 RASPBERRYPI librespot[19683]: INFO:librespot::session: Country: "DE"
Jul 05 08:58:21 RASPBERRYPI librespot[19683]: INFO:librespot::audio_backend::alsa: Using alsa sink

Can not connect

Hello!

I can see "raspotify (raspberry pi)" under "Devices Available" but doesn´t connect, using Android.

Thanks for your help

Audio out via USB DAC

Hello, I have the following problem:
I connected my active speakers via USB to my Pi 3. They are set as default and work perfectly in browser etc. and when I start librespot in the shell with this command:

librespot --name raspberry --bitrate 320 --backend alsa --device hw:1

so I thougt when I change the /etc/default/raspotify to this it would have the same effect:

...
OPTIONS="--name raspberry --bitrate 320 --backend alsa --device hw:1"
...

Unfortunately this doesn't work, do you have any hints for me?

Thank you very much! :-)

Greets

Tracks auto repeating despite repeat being turned off

So I've been using Raspotify for a few days and so far it's been working great, with one minor issue:

The playback behaves as if the repeat setting is turned on, despite it actually being turned off. So if I'm listening to an album and the last song finishes, the first track of that album follows immediately after. Turning the repeat mode on and off doesn't change anything.

Additionally, the repeat-track mode seems to be missing completely.

Install error on RPi3 running OSMC (Debian)

I tried your .sh automated install and the manual method. I am not a Linux expert at all, but this is what happened:

Automated (last part):

  lsb
The following NEW packages will be installed:
  apt-transport-https lsb-release
0 upgraded, 2 newly installed, 0 to remove and 1 not upgraded.
Need to get 162 kB of archives.
After this operation, 269 kB of additional disk space will be used.
Get:1 http://ftp.debian.org/debian/ jessie/main apt-transport-https armhf 1.0.9.8.4 [135 kB]
Get:2 http://ftp.debian.org/debian/ jessie/main lsb-release all 4.1+Debian13+nmu1 [26.5 kB]
Fetched 162 kB in 0s (1,460 kB/s)
Selecting previously unselected package apt-transport-https.
(Reading database ... 32153 files and directories currently installed.)
Preparing to unpack .../apt-transport-https_1.0.9.8.4_armhf.deb ...
Unpacking apt-transport-https (1.0.9.8.4) ...
Selecting previously unselected package lsb-release.
Preparing to unpack .../lsb-release_4.1+Debian13+nmu1_all.deb ...
Unpacking lsb-release (4.1+Debian13+nmu1) ...
Setting up apt-transport-https (1.0.9.8.4) ...
Setting up lsb-release (4.1+Debian13+nmu1) ...
Raspotify installer only runs on a Raspberry Pi

Manual:

Reading package lists... Done
Building dependency tree
Reading state information... Done
apt-transport-https is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
osmc@ChilleTV:~$ curl -sSL https://dtcooper.github.io/raspotify/key.asc | sudo apt-key add -v -
gpg: pub  4096R/7953A455 2017-06-15  David Cooper <[email protected]>
OK
osmc@ChilleTV:~$ echo 'deb https://dtcooper.github.io/raspotify jessie main' | sudo tee /etc/apt/sources.list.d/raspotify.list
deb https://dtcooper.github.io/raspotify jessie main
osmc@ChilleTV:~$ sudo apt-get -y install raspotify
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package raspotify

I guess some checks are done to verify it is indeed a Raspbery Pi, somehow RPIs running OSMC (https://osmc.tv/) are not recognised properly?

Piping this to another app

Hi guys,

Just wondering if you could help me, how can I run this as a named pipe to output it to forked-daapd. Im using it as an Airplay Server for Spotify.

Use USB DAC with Raspotify?

Hi!

Thank you for a nice project! :-)

Can a universal USB DAC be used instead of the internal DAC that outputs the analog signal through the 3.5 mm audio jack on the Raspberry Pi 3? I do not want to use the internal DAC or a HiFi Berry.
If so, do I have to change/add anything in the /etc/default/raspotify config file to get this to work?
I have not tried this yet since I want to know that it will work before I buy a USB DAC. :-)

Can this be used to cast to another spotify client/chromecast etc?

Really cool project! When reading the docs, it sounds like this implementation is built to use as a reciever to a speaker only. I'm looking for something that I can pair with my home-integration-system that can initiate a casting to a wireless speaker. This functionality exist in spotify already, but I don't want to be dependent on a cellphone with an app.

Shows Up; But No Sound

I ran the install and everything is showing up in Spotify Connect but there's no sound going through. I have the pi set up as a Roon Bridge and it works fine for that.

Metadata

Hi,

How could I read out metadata from raspotify ? (artist name etc)
I'd like display them on a hd44780

thanks

Custom backend

Even if add in /etc/default/raspotify to change --backend and --device raspotify still use alsa as backend.

Any tip where I can change that?

I would like to add those argues:

--backend pipe --device /home/pi/srv/music/spotify --cache /tmp > /dev/null 2>&1

librespot's pleitar has quit, maybe change fork?

The original dev of librespot, plietar, has announced that due to personal circumstances (a new job or something) he's no longer able to work on librespot, and he actively stops maintaining it (including handling issues and reviewing pull requests).
Maybe we should start considering taking librespot from an alternative active fork? Looking at the network graph then michaelherger's fork seemed pretty active up until a month ago.

Streaming with no sound

Sooo. I've installed raspotify and it works like a charm.... but only for first 5 songs. After that I can still stream on spotify connect (my spotify says the song is playing) but I can't hear anything... When I restart I can again listen to something like 5 songs... Any ideas?

password crypto

would it be possible to encrypt the spotify password so people shouldersurfing or people finding a way into your raspberry can't easily just see your password in plaintext?

low priority but useful

USB audio output not working

hey everyone,

I can't get raspotify to work with my USB audio interface. The interface is recognized just fine and can play other audio sources, it's just raspotify that doesn't work. when i run

sudo systemctl status raspotify

I get

Nov 11 16:34:41 raspberrypi librespot[598]: INFO:librespot: librespot 8971d3a (2017-10-05). Built on 2017-10-05. Build ID: POyxPQVg Nov 11 16:35:15 raspberrypi librespot[598]: INFO:librespot_core::session: Connecting to AP "gew1-accesspoint-b-mvpz.ap.spotify.com:4070" Nov 11 16:35:16 raspberrypi librespot[598]: INFO:librespot_core::session: Authenticated as "camilo_rojo" ! Nov 11 16:35:16 raspberrypi librespot[598]: INFO:librespot::audio_backend::alsa: Using alsa sink Nov 11 16:35:16 raspberrypi librespot[598]: INFO:librespot_core::session: Country: "DE" Nov 11 16:35:16 raspberrypi librespot[598]: INFO:librespot::player: Loading track "Computer Liebe - 2009 Remastered Version" Nov 11 16:35:17 raspberrypi librespot[598]: INFO:librespot::player: Track "Computer Liebe - 2009 Remastered Version" loaded Nov 11 16:35:17 raspberrypi librespot[598]: ALSA lib pcm.c:8382:(snd_pcm_set_params) Sample format not available for PLAYBACK: Invalid argument Nov 11 16:35:17 raspberrypi librespot[598]: thread '<unnamed>' panicked at 'called Option::unwrap()on aNonevalue', /checkout/src/libcore/option.rs Nov 11 16:35:17 raspberrypi librespot[598]: note: Run withRUST_BACKTRACE=1 for a backtrace.

here is what my settings look like

`# /etc/default/raspotify -- Arguments for librespot

Device name on Spotify Connect

DEVICE_NAME="M-AUDIO"
OPTIONS="--device hw:1,0"

Bitrate, one of 96 (low quality), 160 (default quality), or 320 (high quality)

#BITRATE="160"

Additional command line arguments for librespot can be set below.

See librespot -h for more info.

To make your device visible on Spotify Connect across the Internet add your

username and password which can be set via "Set device password", on your

account settings, use --username and --password.

To choose a different output device (ie a USB audio dongle or HDMI audio out),

use --device with something like --device hw:0,1. Your mileage may vary.

#OPTIONS="--device hw:1,0"
`

also, in case it helps, if i run aplay -l I get:

**** List of PLAYBACK Hardware Devices **** card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA] Subdevices: 8/8 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1 Subdevice #2: subdevice #2 Subdevice #3: subdevice #3 Subdevice #4: subdevice #4 Subdevice #5: subdevice #5 Subdevice #6: subdevice #6 Subdevice #7: subdevice #7 card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: M2X2 [M-Track 2X2], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0

The error output says that the sample format is not available for playback, what should i change then?
Thanks a lot in advance!

OSMC device disconnects randomly

hi,

I have experienced random disconnections (after few songs). Music stop playing. When I look at Spotify Android app I can see that OSMC device is connected.

I have to disconnect from the OSMC device and connect once again. After doing this the volume is reset to 100% and playback is ok.

So it seems issue with connection between Spotify Connect devices.

Any idea? :)

Kind Regards!
A.S.

Stops playing after x songs

Hey!
So let me start by saying this the most convenient solution to use spotify connect on an rpi, thank you!!

The issue I've run into, is that it stops playing after x tracks. So it will finish playing the track, and then stop until I service raspotify restart . Here's what I get for service raspotify status :

   Loaded: loaded (/lib/systemd/system/raspotify.service; enabled)
   Active: active (running) since Wed 2017-06-28 11:05:01 UTC; 20min ago
  Process: 1670 ExecStartPre=/bin/chown raspotify:raspotify /var/cache/raspotify (code=exited, status=0/SUCCESS)
  Process: 1667 ExecStartPre=/bin/mkdir -p 0755 /var/cache/raspotify (code=exited, status=0/SUCCESS)
 Main PID: 1673 (librespot)
   CGroup: /system.slice/raspotify.service
           ├─1673 /usr/bin/librespot --name raspotify (raspberrypi) --backend alsa --cache /var/cache/raspotify --bitrate 160
           └─1686 /usr/bin/pulseaudio --start --log-target=syslog

Jun 28 11:05:10 raspberrypi librespot[1673]: INFO:librespot::player: Track "A Jealous Heart Never Rests" loaded
Jun 28 11:05:11 raspberrypi pulseaudio[1686]: [pulseaudio] server-lookup.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Jun 28 11:05:11 raspberrypi pulseaudio[1686]: [pulseaudio] main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Jun 28 11:05:11 raspberrypi pulseaudio[1686]: [pulseaudio] bluez4-util.c: org.bluez.Manager.GetProperties() failed: org.freedesktop.DBus.Error.UnknownMethod: Method "GetProperties" with signature "" on interface "org.bluez.Manager" doesn't exist
Jun 28 11:06:31 raspberrypi librespot[1673]: INFO:librespot::player: Loading track "Playing with Fire"
Jun 28 11:06:32 raspberrypi librespot[1673]: INFO:librespot::player: Track "Playing with Fire" loaded
Jun 28 11:06:35 raspberrypi librespot[1673]: INFO:librespot::player: Loading track "Friday Fish Fry - Maribou State & Pedestrian Remix - Radio Edit"
Jun 28 11:06:35 raspberrypi librespot[1673]: INFO:librespot::player: Track "Friday Fish Fry - Maribou State & Pedestrian Remix - Radio Edit" loaded
Jun 28 11:10:46 raspberrypi librespot[1673]: INFO:librespot::player: Loading track "Waves"
Jun 28 11:10:46 raspberrypi librespot[1673]: INFO:librespot::player: Track "Waves" loaded

Building a more generic Debian librespot package

would it maybe be possible to further enhance your scripts to e.g. build packages (and upstream the scripts) so that librespot could be packaged for the regular Debian universe repositories?

--onstart parameter

I've made a shell script, that turns on my receiver over CEC and want to have that script running with the --onstart parameter from librespot.

I changed the line of etc/default/raspotify to

OPTIONS="--onstart cd ../../ && sh home/pi/start.sh"

But if i start raspotify with this configuration it doesn't work and i can't even connect to my device.
What am I doing wrong?

Not working on Orange PI

It's very similar board, working too on Rasbian

Maybe you can check what is wrong.

./librespot -n a
INFO:librespot: librespot ddfc28f (2017-08-04). Built on 2017-08-07. Build ID: N5RcEuis
thread 'main' panicked at 'called Result::unwrap() on an Err value: Error { repr: Os { code: 92, message: "Protocol not available" } }', /checkout/src/libcore/result.rs:860
stack backtrace:
0:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13: __libc_start_main

strace:

write(2, "INFO:librespot: librespot ddfc28"..., 87INFO:librespot: librespot ddfc28f (2017-08-04). Built on 2017-08-07. Build ID: N5RcEuis) = 87
write(2, "\n", 1
) = 1
socketpair(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0, [6, 8]) = 0
getrandom(0xbefe5717, 0, GRND_NONBLOCK) = -1 ENOSYS (Function not implemented)
open("/dev/urandom", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 9
ioctl(9, FIOCLEX) = 0
read(9, "\36\266\200U\315\242\2\365", 8) = 8
read(9, "\345\323\f\255\232\22\317{", 8) = 8
close(9) = 0
rt_sigaction(SIGINT, {0xb6a4aaf0, [], SA_RESTORER|SA_RESTART|SA_SIGINFO|SA_NOCLDSTOP, 0xb6866271}, {SIG_DFL, [], 0}, 8) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 6, {EPOLLIN|EPOLLOUT|EPOLLRDHUP|EPOLLET, {u32=2, u64=2}}) = 0
getrandom(0xbefe889f, 0, 0) = -1 ENOSYS (Function not implemented)
open("/dev/urandom", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 9
ioctl(9, FIOCLEX) = 0
read(9, ".\244\322D@q\200W}c5\355\242\365G\5\261\216!\336\217fx==\355\4x\267\375c!"..., 1024) = 1024
close(9) = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 9
ioctl(9, FIOCLEX) = 0
setsockopt(9, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(9, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
listen(9, 1024) = 0
fcntl64(9, F_GETFL) = 0x2 (flags O_RDWR)
fcntl64(9, F_SETFL, O_RDWR|O_NONBLOCK) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 9, {EPOLLIN|EPOLLOUT|EPOLLRDHUP|EPOLLET, {u32=4, u64=4}}) = 0
getsockname(9, {sa_family=AF_INET, sin_port=htons(60312), sin_addr=inet_addr("0.0.0.0")}, [16]) = 0
uname({sysname="Linux", nodename="orangepi2", ...}) = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 10
ioctl(10, FIOCLEX) = 0
setsockopt(10, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(10, SOL_SOCKET, SO_REUSEPORT, [1], 4) = -1 ENOPROTOOPT (Protocol not available)
close(10) = 0
socket(PF_INET6, SOCK_DGRAM, IPPROTO_IP) = 10
ioctl(10, FIOCLEX) = 0
setsockopt(10, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(10, SOL_SOCKET, SO_REUSEPORT, [1], 4) = -1 ENOPROTOOPT (Protocol not available)
close(10) = 0
close(9) = 0
write(2, "thread '", 8thread ') = 8
write(2, "main", 4main) = 4
write(2, "' panicked at '", 15' panicked at ') = 15
write(2, "called Result::unwrap() on an "..., 111called Result::unwrap() on an Err value: Error { repr: Os { code: 92, message: "Protocol not available" } }) = 111
write(2, "', ", 3', ) = 3
write(2, "/checkout/src/libcore/result.rs", 31/checkout/src/libcore/result.rs) = 31

maybe you have some knowledge what is wrong ?

How can this work?

I thought it was no longer possible to obtain a Spotify key, required to use libspotify. I never properly saved my key so now I don't have Spotify Connect on my raspberry anymore :(

Your solution seems so simple, does it rely on the new (beta) web API from Spotify?

Keeps crashing

Hi guys,

raspotify keeps crashing, anyone seen this before? Running from a Pi Zero W

pi@AirServer:~ $ sudo systemctl status raspotify -l
● raspotify.service - Raspotify
   Loaded: loaded (/lib/systemd/system/raspotify.service; enabled)
   Active: activating (auto-restart) (Result: exit-code) since Thu 2017-09-14 13:28:04 AEST; 6s ago
  Process: 2952 ExecStart=/usr/bin/librespot --name ${DEVICE_NAME} --bitrate ${BITRATE} $CACHE_ARGS $OPTIONS (code=exited, status=101)
  Process: 2949 ExecStartPre=/bin/chown raspotify:raspotify /var/cache/raspotify (code=exited, status=0/SUCCESS)
  Process: 2946 ExecStartPre=/bin/mkdir -p 0755 /var/cache/raspotify (code=exited, status=0/SUCCESS)
 Main PID: 2952 (code=exited, status=101)

Sep 14 13:28:04 AirServer librespot[2952]: note: Run with `RUST_BACKTRACE=1` for a backtrace.
Sep 14 13:28:04 AirServer systemd[1]: raspotify.service: main process exited, code=exited, status=101/n/a
Sep 14 13:28:04 AirServer systemd[1]: Unit raspotify.service entered failed state.

Spotify not found with android version of Spotify

I just created a clean installation of Raspbian with the raspotify package. The raspberry is immediatly found with Spotify on my Windows desktop and works perfectly. Unfortunately it is not found by Spotify on an Android Smartphone. I tried two phones, both connected to the same network, which gave the same result.

Only just after I start playing a song from my desktop, it pop ups on my phone. I have no issues with other Spotify Connect enabled audio players.

Any idea?

Raspotify volume

When i start a song in spotify app and choose my app to stream the song it always start at 100% volume.
Is there anyway to change this?
Mabey start att 10% volume.

Right now im sending the sound through hdmi to my reciever but will soon install a digiamp+.
Will this change anythin?
Best Regards
WRSKalle

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.