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

[BUG] Avahi error: Setting up dns-sd failed: I/O error: No such file or directory (os error 2) #103

Open
kapuett opened this issue Jan 1, 2025 · 9 comments
Labels
bug Something isn't working

Comments

@kapuett
Copy link

kapuett commented Jan 1, 2025

Describe the bug
Using latest:

giof71/librespot                        latest     4b770b306618   10 hours ago    143MB

I am getting

Running in user mode ...
[2025-01-01T15:37:05Z INFO  librespot] librespot 0.6.0 383a6f6 (Built on 2024-12-24, Build ID: u3wY0FhS, Profile: release)
[2025-01-01T15:37:05Z INFO  librespot_playback::mixer::softmixer] Mixing with softvol and volume control: Log(60.0)
[2025-01-01T15:37:05Z INFO  librespot_playback::convert] Converting with ditherer: tpdf
[2025-01-01T15:37:05Z INFO  librespot_playback::audio_backend::pulseaudio] Using PulseAudioSink with format: S16
[2025-01-01T15:37:05Z ERROR librespot_discovery] Avahi error: Setting up dns-sd failed: I/O error: No such file or directory (os error 2)
[2025-01-01T15:37:05Z ERROR librespot] Discovery stopped unexpectedly

which is not the case with image up to

giof71/librespot                        latest     272aa19eea88   2 weeks ago     140MB
Running in user mode ...
[2025-01-01T15:39:24Z INFO  librespot] librespot 0.5.0 84d28e8 (Built on 2024-10-17, Build ID: oT8q3ZHD, Profile: release)
[2025-01-01T15:39:24Z WARN  libmdns] Failed to register IPv6 receiver: Os { code: 19, kind: Uncategorized, message: "No such device" }
[2025-01-01T15:39:24Z INFO  librespot_playback::mixer::softmixer] Mixing with softvol and volume control: Log(60.0)
[2025-01-01T15:39:24Z INFO  librespot_playback::convert] Converting with ditherer: tpdf
[2025-01-01T15:39:24Z INFO  librespot_playback::audio_backend::pulseaudio] Using PulseAudioSink with format: S16

To Reproduce
Steps to reproduce the behavior:
Pull latest image, restart container.

Expected behavior
No avahi error

Docker run command
Using compose, see below

Docker-compose.yaml file

services:
  librespot:
    image: giof71/librespot:latest
    container_name: librespot
    network_mode: host
    environment:
      - BACKEND=pulseaudio
      - DEVICE_TYPE=avr
      - BITRATE=320
      - INITIAL_VOLUME=100
      - DEVICE_NAME=dummy
    restart: always
    volumes:
      - /run/user/1000/pulse:/run/user/1000/pulse

Screenshots
None

Operating system(please complete the following information):

❯ docker --version
Docker version 27.4.1, build b9d17ea
❯ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Additional context
None

@kapuett kapuett added the bug Something isn't working label Jan 1, 2025
@GioF71
Copy link
Owner

GioF71 commented Jan 1, 2025

Hello, this is happening to me as well. It must be due to some changes in librespot, I have to investigate.
In the meantime, image tagged as giof71/librespot:bookworm-2024-11-17 should work and still accessible using that tag.

@GioF71
Copy link
Owner

GioF71 commented Jan 2, 2025

The issue is with discovery. Should you run the container with DISABLE_DISCOVERY=y and with credentials (see here for how to add credentials), the app works as intended.
However it should also work in discovery mode. From my tests using --zeroconf-backend with anything different from avahi (default), I get errors. Maybe the application is built with some features disabled.

@kapuett
Copy link
Author

kapuett commented Jan 2, 2025

Wasn't entirely sure whether this is the right place to open an issue or if librespot would have been better suited. More or less only wanted to make you aware that latest has this issue.

@GioF71
Copy link
Owner

GioF71 commented Jan 2, 2025

Hello, thank you. I had not noticed yet. I checked the last raspotify release notes and I was too optimistic thinking that there wouldn't be any impact. Furthermore, it's more the underlying software that changes, that's the reason why I build the latest image every day. So there is a risk anyway, but if I didn't do that, I would have to just trigger releases for no change in the docker image definition just to keep up with the changes in raspotify/librespot.

I am about to try raspotify without docker and see if I get the same issue

@GioF71
Copy link
Owner

GioF71 commented Jan 2, 2025

Raspotify on its own works perfectly.
Looking here and considering that raspotify is built with with-avahi, maybe using libmdns or dns-sd could help, but those options are not available in the raspotify build.
In the past I tried building with cargo but had issues with the armhf platform and github actions. I'd prefer to not drop yet, that is why I am using raspotify since encountering those issues.

@GioF71
Copy link
Owner

GioF71 commented Jan 2, 2025

This issue might be related

@GioF71
Copy link
Owner

GioF71 commented Jan 2, 2025

I got it working by compiling with libmdns support:

librespot  | ADDITIONAL_ARGUMENTS=[--zeroconf-backend libmdns]
librespot  | Command Line: [/usr/bin/librespot --backend pulseaudio --bitrate 320 --initial-volume 100 --device-type avr --zeroconf-backend libmdns]
librespot  | Running in user mode ...
librespot  | [2025-01-02T11:53:21Z INFO  librespot] librespot 0.6.0 383a6f6 (Built on 2025-01-02, Build ID: EsKuvT3G, Profile: release)
librespot  | [2025-01-02T11:53:21Z INFO  librespot_playback::mixer::softmixer] Mixing with softvol and volume control: Log(60.0)
librespot  | [2025-01-02T11:53:21Z INFO  librespot_playback::convert] Converting with ditherer: tpdf
librespot  | [2025-01-02T11:53:21Z INFO  librespot_playback::audio_backend::pulseaudio] Using PulseAudioSink with format: S16
librespot  | [2025-01-02T11:53:48Z INFO  librespot_core::session] Connecting to AP "ap-gew4.spotify.com:4070"
librespot  | [2025-01-02T11:53:48Z INFO  librespot_core::session] Authenticated as 'xxxxx' !
librespot  | [2025-01-02T11:53:48Z INFO  librespot_core::session] Country: "IT"
librespot  | [2025-01-02T11:53:48Z INFO  librespot_core::spclient] Resolved "gew4-spclient.spotify.com:443" as spclient access point
librespot  | [2025-01-02T11:53:48Z INFO  librespot_playback::player] Loading <Alejandro> with Spotify URI <spotify:track:2gZeJkD03utaqEkKxiBdub>
librespot  | [2025-01-02T11:53:49Z INFO  librespot_connect::spirc] Resolved 50 tracks from <"spotify:playlist:37i9dQZF1DX9mjcFz1zTh3">
librespot  | [2025-01-02T11:53:49Z INFO  librespot_playback::player] <Alejandro> (522479 ms) loaded

Though I need to verify if the image can be built on all platforms. This test is on my amd64 desktop.

@GioF71
Copy link
Owner

GioF71 commented Jan 2, 2025

Would you like to try this image: giof71/librespot:feature-cargo-retry-b02-bookworm
It's available for amd64 and arm64. I could not build for arm/v7. I will probably end up doing the builds on my computer.
You need to add the variable:

ADDITIONAL_ARGUMENTS=--zeroconf-backend libmdns

Let me know if this works for you

@GioF71
Copy link
Owner

GioF71 commented Jan 3, 2025

Hello, the upcoming builds should restore functionality. The workflow is running right now and should take another 30-35 minutes.
Let me know if this works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants