Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running Spotifyd headless on RaspberryPi #504

Closed
johnalanwoods opened this issue Feb 8, 2020 · 4 comments
Closed

Running Spotifyd headless on RaspberryPi #504

johnalanwoods opened this issue Feb 8, 2020 · 4 comments
Labels
bug A functionality or parts of a program that do not work as intended

Comments

@johnalanwoods
Copy link
Contributor

Description
When running the latest release of Spotifyd headless (without desktop env) on RpiB, I get this error on launch: D-Bus error: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11

To Reproduce
Run latest release on RpiB

Expected behavior
Launch without issue

Logs
Config:

[global]
username = xxx
password = yyy
backend = alsa
device = alsa_audio_device
mixer = PCM
volume-control = softvol
#onevent = command_run_on_playback_event
device_name = SpotiPi
bitrate = 320
cache_path = /home/pi/.spotifycache
volume-normalisation = true
@johnalanwoods johnalanwoods added the bug A functionality or parts of a program that do not work as intended label Feb 8, 2020
@johnalanwoods
Copy link
Contributor Author

johnalanwoods commented Feb 8, 2020

@sirwindfield - does Spotifyd work without a desktop environment on the raspberry pi? (sorry to bother you)

@mainrs
Copy link
Member

mainrs commented Feb 9, 2020

It should work yes, but MPRIS will not work without a user dbus session. Someone posted a workaround here though: #244 (comment)

@johnalanwoods
Copy link
Contributor Author

johnalanwoods commented Feb 9, 2020

@sirwindfield thanks for the help!

I got further, i.e. the app now starts! :)

However seeing this error and no sound is coming out of the Pi (running Rasbian)...

ALSA lib control.c:1375:(snd_ctl_open_noupdate) Using alsa sink
Invalid CTL alsa_audio_device
Couldn't read volume from alsa device with name "alsa_audio_device".
ALSA lib control.c:1375:(snd_ctl_open_noupdate) Invalid CTL alsa_audio_device
Couldn't set volume: Error("snd_mixer_attach", Sys(ENOENT))

ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM alsa_audio_device
Alsa error PCM open ALSA function 'snd_pcm_open' failed with error 'ENOENT: No such file or directory'
Could not start audio: Alsa error: PCM open failed

Any ideas?

FWIW I can play test mp3s, and I see ALSA on the pi:

pi@blueberrypi:~/spotifyd $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 7/7
  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
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 IEC958/HDMI [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: ALSA [bcm2835 ALSA], device 2: bcm2835 IEC958/HDMI1 [bcm2835 IEC958/HDMI1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

I see a mixer too:

pi@blueberrypi:~/spotifyd $ amixer
Simple mixer control 'PCM',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback -10239 - 400
  Mono: Playback -2000 [77%] [-20.00dB] [on]

@johnalanwoods
Copy link
Contributor Author

Cracked it!

@sirwindfield - working perfectly now!

just needed to set the device = default, which is the ALSA device name on the Pi.

This is too cool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A functionality or parts of a program that do not work as intended
Projects
None yet
Development

No branches or pull requests

2 participants