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

Mistakingly trying to play locally... #176

Open
forbesmyester opened this issue Feb 9, 2023 · 5 comments
Open

Mistakingly trying to play locally... #176

forbesmyester opened this issue Feb 9, 2023 · 5 comments

Comments

@forbesmyester
Copy link

Squeezelite tried to play locally, for a Docker hosted server with mounted /music directory (thus could not open the file)

[19:15:11.525726] stream_file:528 opening local file: /music/music_unchecked/__________.mp3
[19:15:11.525772] stream_file:538 can't open file: /music/music_unchecked/__________.mp3
[19:15:11.547400] decode_thread:100 decode complete

Docker config (Ansible):

- name: Container
  community.docker.docker_container:
    name: cnt-logitechmediaserver
    image: "lmscommunity/logitechmediaserver:8.3.1"
    cpus: 0.75
    networks_cli_compatible: yes
    labels:
      com.centurylinklabs.watchtower.enable: "true"
    env:
      HTTP_PORT: '{{ logitechmediaserver.http_port }}'
    volumes:
      - "{{ logitechmediaserver.system_mounts.config }}/config:/config:rw"
      - "{{ logitechmediaserver.system_mounts.playlist }}/music:/playlist:rw"
      - "{{ logitechmediaserver.music_mounts.music }}:/music/music:ro"
      - "{{ logitechmediaserver.music_mounts.music_listened }}:/music/music_listened:ro"
      - "{{ logitechmediaserver.music_mounts.music_unchecked }}:/music/music_unchecked:ro"
      - "/etc/localtime:/etc/localtime:ro"
      - "/etc/timezone:/etc/timezone:ro"
    published_ports:
      - "{{ logitechmediaserver.http_port }}:{{ logitechmediaserver.http_port }}/tcp"
      - "9090:9090/tcp"
      - "3483:3483/tcp"
      - "3483:3483/udp"
    state: started
    healthcheck:
      interval: 30s
      retries: 1
      start_period: 300s
      test: ["CMD", "curl", "--fail", "http://localhost:9000/"]
      timeout: 30s
    restart_policy: unless-stopped
  tags: [docker_logitechmediaserver]
@forbesmyester
Copy link
Author

Is there a way to skip this if?

if (ip == LOCAL_PLAYER_IP && port == LOCAL_PLAYER_PORT) {

@ralph-irving
Copy link
Owner

Do you have the localplayer plugin installed in LMS? It's needed to support reading the files directly.

To skip that line you could use IP address of the ethernet adapter in the squeezelite settings instead of the lo interface.

@forbesmyester
Copy link
Author

forbesmyester commented Feb 10, 2023

Hi Ralph,

Thanks for your response.

I did have localplayer installed, but given that LMS was running in a docker container (I don't think) it had access to the soundcard / pulseaudio etc.

I tried using the -s flag but it didn't seem to have any effect and the stream_file:538 can't open errors still occurred (which is not what I was expecting).

I wonder if having had localplayer installed (during, but then previously) caused the issue?

@jpmenil
Copy link

jpmenil commented Feb 13, 2023

@forbesmyester when running squeezelite inside a docker container,
you'll need:
chmod -R a+rw /dev/snd/
or start your container, mapping your local audio group:

-u nobody:$(getent group audio | awk -F: '{print $3}')

https://github.com/jpmenil/squeezelite/blob/master/README.md?plain=1#L10-L14

@forbesmyester
Copy link
Author

@jpmenil good tip, and worth knowing, but as /dev is a virtual filesystem there'd (likely) be work to make those changes persist etc... Was really just trying to pull the music over the overlay / virtual network, which seems like an easier option.

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

3 participants