| 1 | === Spotify === |
| 2 | ==== Skill ==== |
| 3 | Install the regular Spotify skill from the skill marketplace (or get it from [https://github.com/forslund/spotify-skill]) |
| 4 | ==== raspotify ==== |
| 5 | To have a local spotify device on the Mark II install raspotify |
| 6 | * sudo apt-get install raspotify |
| 7 | ==== make raspotify use pulseaudio ==== |
| 8 | raspotify can not use pulseaudio by default as it does not have a pulseaudio audio device module. To make it work with pulseaudio it has to be run as a user service and not a system service. |
| 9 | See [https://github.com/dtcooper/raspotify/issues/78] for details. |
| 10 | Disable the system service: |
| 11 | * sudo systemctl disable raspotify |
| 12 | Create a user service file: |
| 13 | * nano ~/.config/systemd/user/myraspotify.service |
| 14 | {{{ |
| 15 | [Unit] |
| 16 | Description=myraspotify |
| 17 | After=network.target |
| 18 | |
| 19 | [Service] |
| 20 | Restart=always |
| 21 | RestartSec=10 |
| 22 | PermissionsStartOnly=true |
| 23 | Environment="DEVICE_NAME=raspotify (%H)" |
| 24 | Environment="BITRATE=160" |
| 25 | Environment="CACHE_ARGS=--disable-audio-cache" |
| 26 | Environment="VOLUME_ARGS=--enable-volume-normalisation --linear-volume --initial-volume=100" |
| 27 | Environment="BACKEND_ARGS=--backend alsa" |
| 28 | EnvironmentFile=-/etc/default/raspotify |
| 29 | ExecStart=/usr/bin/librespot --name ${DEVICE_NAME} $BACKEND_ARGS --bitrate ${BITRATE} $CACHE_ARGS $VOLUME_ARGS $OPTIONS |
| 30 | |
| 31 | [Install] |
| 32 | WantedBy=default.target |
| 33 | }}} |
| 34 | Enable and start service: |
| 35 | * systemctl --user daemon-reload |
| 36 | * systemctl --user enable myraspotify |
| 37 | * systemctl --user start myraspotify |