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

Using pipe backend #20

Open
jagjordi opened this issue Sep 21, 2024 · 1 comment
Open

Using pipe backend #20

jagjordi opened this issue Sep 21, 2024 · 1 comment

Comments

@jagjordi
Copy link

Hello,
I am trying to use the pipe backend.
First I tried adding --backend pipe to the docker command but got the error Error parsing command line options: Option 'backend' given more than once.
Then I saw that in the entrypoint script the backend is set based on the OUTPUT env variable, which in the Dockerfile is empty.
I tried passing it to the docker command as follows.

docker run --rm \
    --name "spot" \
    --env "MOD_MDNS_NAME=Super Name For Your Spotify Connect Endpoint" \
    --env "OUTPUT=pipe" \
    --env "DEVICE=/tmp/spotify" \
    --volume /tmp \
    --group-add audio \
    --device /dev/snd \
    --net host \
    --cap-drop ALL \
    --read-only \
    docker.io/dubodubonduponey/spotify

But still I couldn't get it to work, when librespot boots it tryes to use ALSA card. See logs

ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5703:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM default
[2024-09-21T23:16:56Z ERROR librespot_playback::player] Audio Sink Error Connection Refused: <AlsaSink> Device default May be Invalid, Busy, or Already in Use, ALSA function 'snd_pcm_open' failed with error 'ENOENT: No such file or directory'

Am I doing something wrong?
Thank you!

@marco79cgn
Copy link

marco79cgn commented Jan 21, 2025

You have to use both --device /path/to/fifo and --backend pipe parameters, but not via --env. What I did is mounting the fifo (named spotpipe) from the docker host (/home/pi/music) into the container (/mnt/music) as volume.

Try this:

docker run -d --rm \
    --name "spot" \
    --env "NAME=Super Name For Your Spotify Connect Endpoint" \
    --volume /tmp \
    --volume /home/pi/music:/mnt/music \
    --group-add audio \
    --backend pipe \
    --device /mnt/music/spotpipe \
    --net host \
    --cap-drop ALL \
    --read-only \
    docker.io/dubodubonduponey/spotify

At the end I switched to this fork and got it running with this docker-compose.yml:

services:
  librespot:
    image: giof71/librespot:latest
    network_mode: host
    environment:
      - BACKEND=pipe
      - DEVICE=/mnt/music/spotpipe
      - BITRATE=320
      - INITIAL_VOLUME=100
      - DEVICE_NAME=SpotiPi
    volumes:
      - /home/pi/music:/mnt/music

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants