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

Install on Raspberry Pi Zero W2 #1051

Closed
matejliska opened this issue Feb 5, 2022 · 5 comments
Closed

Install on Raspberry Pi Zero W2 #1051

matejliska opened this issue Feb 5, 2022 · 5 comments
Labels
bug A functionality or parts of a program that do not work as intended

Comments

@matejliska
Copy link

My first bug report, be patient w me pls

I was following this instruction on: https://spotifyd.github.io/spotifyd/installation/Raspberry-Pi.html

And after> wget https://github.com/Spotifyd/spotifyd/releases/download/v0.3.3/spotifyd-linux-armv6-slim.tar.gz
untar it with> tar -xvzf spotifyd-linux-armv6-slim.tar.gz
and run with> ./spotifyd --no-daemon

terminal Write me this error:

/------------------------------------------------------------------------------/
pi@raspberrypi:~ $ ./spotifyd --no-daemon
Loading config from "/home/pi/.config/spotifyd/spotifyd.conf"
Error:
0: could not load the config file
1: invalid TOML value, did you mean to use a quoted string? at line 5 column 10

Location:
src/config.rs:478

note:
the config format should be valid TOML
we recently changed the config format, see #765

Backtrace omitted.
Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
pi@raspberrypi:~ $

I will ask for advice with this problem, as soon as possible. Thnx a lot.

Versions

  • OS: Raspbian
  • HW: RP3A0 - Quad-core 64-bit Arm Cortex A53 CPU
  • Spotifyd: 0.3.3
@matejliska matejliska added the bug A functionality or parts of a program that do not work as intended label Feb 5, 2022
@eladyn
Copy link
Member

eladyn commented Feb 5, 2022

Hi and welcome!

As the error message indicates, spotifyd has trouble parsing the config file. I assume that you copied it from the installation instructions that you linked to.

The copied file is not valid in its documented form as you need to change some values:

  • device needs to be a quoted string with the alsa device name. Alternatively, you can just leave it out.
  • bitrate needs to be either 96 or 160 or 320.
  • Change the other values to suit your needs.

The following file should get past the errors (make sure that you replace USER and PASS with your values):

[global]
username = "USER"
password = "PASS"
backend = "alsa"
mixer = "PCM"
volume-controller = "alsa" # or alsa_linear, or softvol
device_name = "my_spotifyd"
bitrate = 320
volume-normalisation = true
normalisation-pregain = -10

Maybe this helps to get your installation working! If you have any further questions, feel free to ask! 😃

Edit: see also this issue

@matejliska
Copy link
Author

Thanx a lot, yes i found there some mistakes

But my spotifyd crashed after i connected to device and press play button (on PC for example).
Here is my error code:

ALSA lib pcm_hw.c:1829:(_snd_pcm_hw_open) Invalid value for card
Alsa error PCM open ALSA function 'snd_pcm_open' failed with error 'ENODEV: No such device'
Could not start audio: Alsa error: PCM open failed
ALSA lib pcm_hw.c:1829:(_snd_pcm_hw_open) Invalid value for card
Alsa error PCM open ALSA function 'snd_pcm_open' failed with error 'ENODEV: No such device'
Could not start audio: Alsa error: PCM open failed
Caught panic with message: called `Option::unwrap()` on a `None` value

For audio output im using i2s with DAC, (not connected now, waiting for delivery),
and here is my aplay -l and -L informations:

**** List of PLAYBACK Hardware Devices ****
card 0: sndrpihifiberry [snd_rpi_hifiberry_dac], device 0: HifiBerry DAC HiFi pcm5102a-hifi-0 [HifiBerry DAC HiFi pcm5102a-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

pi@raspberrypi:~ $ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
lavrate
    Rate Converter Plugin Using Libav/FFmpeg Library
samplerate
    Rate Converter Plugin Using Samplerate Library
speexrate
    Rate Converter Plugin Using Speex Resampler
jack
    JACK Audio Connection Kit
oss
    Open Sound System
pulse
    PulseAudio Sound Server
upmix
    Plugin for channel upmix (4,6,8)
vdownmix
    Plugin for channel downmix (stereo) with a simple spacialization
speakerbonnet
dmixer
softvol
default
plugequal
equal
hw:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0
    Direct hardware device without any conversions
plughw:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0
    Hardware device with all software conversions
sysdefault:CARD=sndrpihifiberry
    snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0
    Default Audio Device
dmix:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0
    Direct sample mixing device
usbstream:CARD=sndrpihifiberry
    snd_rpi_hifiberry_dac
    USB Stream Output

so i dont know if i must wait for my dac and configure spotifyd after wires are already connected or, if is possible configure this without DAC.

Thanks a lot for your advices! And have a nice day :).

@eladyn
Copy link
Member

eladyn commented Mar 30, 2022

Great to hear that.

I don't know how useful this will be without speakers, but you should be able to try any of those names that aplay -L prints out as the device = "..." parameter and see if one of them works (or at least doesn't make spotifyd crash). Using null should be fine in all cases, although you won't hear any sound of course.

If that doesn't work, could you paste your spotifyd.conf (with the sensitive information removed)?

@waldeckmatheus
Copy link

waldeckmatheus commented Apr 20, 2022

Hello,

Here i'm using this following configuration, in summary, may it serves for you:

File spotifyd.conf: /home/pi/.config/spotifyd/spotifyd.conf
Modified from: https://spotifyd.github.io/spotifyd/config/File.html

[global]
username = "email@email"
password = "password123"
use_keyring = true
use_mpris = true
device = "sysdefault"  
control = "sysdefault"  
on_song_change_hook = "echo 1234"
device_name = "device-test-spotify"
bitrate = 160
cache_path = "/tmp/"
no_audio_cache = true
initial_volume = "90"
volume_normalisation = true
normalisation_pregain = -10
autoplay = true
zeroconf_port = 9991
device_type = "speaker"

If you need to compile, may check: #1053 (comment)

@eladyn
Copy link
Member

eladyn commented Mar 9, 2023

I'm going to close this for now. If you've got any further questions, you can either join the matrix channel or comment here again and I'll reopen. :)

@eladyn eladyn closed this as completed Mar 9, 2023
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

3 participants