Open source client of Spotify Connect closed library developed in Java
I decided to make a Java version because i needed the player to run without any privileged or any additional installation.
This version is working with Raspberry Pi 2 with the hard float version of the spotify's library
There is a version to run in Raspberry Pi 1 here, but it only works in a soft float system (you will have to install Raspbian armel or emulate with chroot, docker, etc...). This version will only be updated after a while the main version.
It's possible that it will be run other devices if you use the right version of spotify's library.
If you managed to run on others devices, or need help to, let me know.
- Download Java, link here
- Get apropriate version of spotify lib, you can find all versions on this github, to run in Raspberry Pi 2 is this one
- Get your spotify key, here, download the binary version
- Get SCPlayer jar, here
- Put all on the same folder
- Run using the command /path/to/java -jar SCPlayer.jar
- From a browser access: http://IP:4000 and login with your login clicking on the right top conner
Java options -D<option>=<value>
- player.name - Set the player name, will appears on all your connect devices (Default will be SCPlayer)
- username - Set username
- password - Set password
- remember.me - Save your credentials for the next start (true/false), defaults to true
- standalone - Runs without the web version (true/false)
- debug - Set debug level - 0 > WARN, 1 > INFO, 2 > DEBUG, 3 > TRACE
- app.key - Path to your spotify_appkey.key
- list.mixers - List the available mixers for use
- mixer - Set the mixer, you can use either the name or index provided by list.mixers
- bitrate - Set the bitrate (90/160/320)
- zeroconf.provider - Zeroconf authentication provider (library/opensource), defaults to opensource
- zeroconf.service - Zeroconf authentication service (avahi/jmdns), defaults to avahi, if not found uses JmDNS (May not work on Windows clients)
Example: ./jdk1.8.0_60/bin/java -Dplayer.name=Kitchen -Dmixer=0 -Dapp.key=/home/pi/spotify_appkey.key -jar SCPlayer.jar
Details here
If you are running on Openelec like I am, you have to run this command to enable alsa drivers
from ssh type echo snd_bcm2835 >> /storage/.config/modules-load.d/audio.conf
after version 6 you may also have to add dtparam=audio=on
to config.txt
and reboot
If you are running on OSMC you have to run this command to enable alsa drivers
for older versions from ssh type sudo modprobe snd_bcm2835
, no need to reboot
for newer versions add this line dtparam=audio=on
to /boot/config.txt
Using this code to connect to Spotify's API is probably forbidden by them, and might result in your application key getting banned. Use at you own risk