jaedb / Iris

Discover, explore and manage your music library across multiple sources with this beautiful web-based interface. Iris is a Mopidy frontend extension.
Apache License 2.0
1.14k stars 134 forks source link

Snapcast RPC fails to load in docker compose example #914

Open jasonmhite opened 1 year ago

jasonmhite commented 1 year ago

Iris version

HEAD

Operating system(s) affected

Browser(s) affected

What happened?

I set up the example docker compose files, including copying the various .example.conf files and making a snapcast.json, editing docker-compose.yml etc. I made no changes to the default example configuration files. Running docker compose up, snapcast complains it's unable to assign address/RPC error (see below). I tried fiddling with various settings with no luck. It's unclear if it's a bug/regression or a user error, lemme know how to help debug.

Logs

[+] Running 3/3
 ✔ Network iris_default         Created                                                                                                                                                                                                              0.1s 
 ✔ Container iris-snapserver-1  Created                                                                                                                                                                                                              0.2s 
 ✔ Container iris-mopidy-1      Created                                                                                                                                                                                                              0.2s 
Attaching to iris-mopidy-1, iris-snapserver-1
iris-snapserver-1  | 2023-08-03 19-14-01.559 [Info] (Snapserver) Version 0.27.0, revision 54a3d862
iris-snapserver-1  | 2023-08-03 19-14-01.560 [Info] (Snapserver) Adding stream: pipe:///tmp/snapfifo?name=Default&sampleformat=48000:16:2&controlscript=meta_mopidy.py
iris-snapserver-1  | 2023-08-03 19-14-01.560 [Notice] (init) Settings file: "/root/.config/snapserver/server.json"
iris-snapserver-1  | 2023-08-03 19-14-01.560 [Info] (Snapserver) Using HTTP host name: efd28bfa662c
iris-snapserver-1  | 2023-08-03 19-14-01.560 [Error] (Avahi) Failed to create client: Daemon not running
iris-snapserver-1  | 2023-08-03 19-14-01.560 [Info] (PcmStream) PcmStream: Default, sampleFormat: 48000:16:2
iris-snapserver-1  | 2023-08-03 19-14-01.560 [Info] (PipeStream) PipeStream mode: create
iris-snapserver-1  | 2023-08-03 19-14-01.560 [Info] (Server) Stream: {"fragment":"","host":"","path":"/tmp/snapfifo","query":{"chunk_ms":"20","codec":"flac","controlscript":"meta_mopidy.py","name":"Default","sampleformat":"48000:16:2"},"raw":"pipe:////tmp/snapfifo?chunk_ms=20&codec=flac&controlscript=meta_mopidy.py&name=Default&sampleformat=48000:16:2","scheme":"pipe"}
iris-snapserver-1  | 2023-08-03 19-14-01.560 [Info] (FlacEnc) Init - compression level: 2
iris-snapserver-1  | 2023-08-03 19-14-01.561 [Error] (PosixStream) Exception: end of file
iris-snapserver-1  | 2023-08-03 19-14-01.561 [Info] (ControlServer) Creating TCP acceptor for address: 0.0.0.0, port: 1705
iris-snapserver-1  | 2023-08-03 19-14-01.561 [Info] (ControlServer) Creating HTTP acceptor for address: 0.0.0.0, port: 1780
iris-snapserver-1  | 2023-08-03 19-14-01.561 [Info] (StreamServer) Creating stream acceptor for address: 0.0.0.0, port: 1704
iris-snapserver-1  | 2023-08-03 19-14-01.561 [Info] (Snapserver) Number of threads: 2, hw threads: 2
iris-snapserver-1  | 2023-08-03 19-14-01.624 [Info] (PcmStream) Stream: Default, message: 2023-08-03 19:14:01,623 meta_mopidy INFO: Started MopidyControl loop
iris-snapserver-1  | 2023-08-03 19-14-01.625 [Error] (PcmStream) Stream: Default, message: 2023-08-03 19:14:01,625 meta_mopidy ERROR: Snapcast RPC websocket error
iris-snapserver-1  | 2023-08-03 19-14-01.626 [Error] (PcmStream) Stream: Default, message: 2023-08-03 19:14:01,625 meta_mopidy ERROR: [Errno 99] Cannot assign requested address
iris-snapserver-1  | 2023-08-03 19-14-01.626 [Info] (PcmStream) Stream: Default, message: 2023-08-03 19:14:01,625 meta_mopidy INFO: Snapcast RPC websocket closed
iris-mopidy-1      | -- INSTALLING PIP PACKAGES Mopidy-YTMusic Mopidy-Tidal Mopidy-SoundCloud Mopidy-MusicBox-Webclient --
iris-mopidy-1      | Defaulting to user installation because normal site-packages is not writeable
iris-mopidy-1      | ERROR: Invalid requirement: 'Mopidy-YTMusic Mopidy-Tidal Mopidy-SoundCloud Mopidy-MusicBox-Webclient'
iris-mopidy-1      | 
iris-mopidy-1      | [notice] A new release of pip is available: 23.1.2 -> 23.2.1
iris-mopidy-1      | [notice] To update, run: python3 -m pip install --upgrade pip
iris-mopidy-1      | 
iris-snapserver-1  | 2023-08-03 19-14-02.627 [Error] (PcmStream) Stream: Default, message: 2023-08-03 19:14:02,627 meta_mopidy ERROR: Snapcast RPC websocket error
iris-snapserver-1  | 2023-08-03 19-14-02.627 [Error] (PcmStream) Stream: Default, message: 2023-08-03 19:14:02,627 meta_mopidy ERROR: [Errno 99] Cannot assign requested address
iris-snapserver-1  | 2023-08-03 19-14-02.627 [Info] (PcmStream) Stream: Default, message: 2023-08-03 19:14:02,627 meta_mopidy INFO: Snapcast RPC websocket closed
iris-mopidy-1      | INFO     2023-08-03 19:14:03,043 [7:MainThread] mopidy.__main__
iris-mopidy-1      |   Starting Mopidy 3.4.1
iris-mopidy-1      | INFO     2023-08-03 19:14:03,062 [7:MainThread] mopidy.config
iris-mopidy-1      |   Loading config from builtin defaults
iris-mopidy-1      | INFO     2023-08-03 19:14:03,063 [7:MainThread] mopidy.config
iris-mopidy-1      |   Loading config from file:///config/mopidy.conf
iris-mopidy-1      | INFO     2023-08-03 19:14:03,063 [7:MainThread] mopidy.config
iris-mopidy-1      |   Loading config from command line options
iris-mopidy-1      | INFO     2023-08-03 19:14:03,065 [7:MainThread] mopidy.internal.path
iris-mopidy-1      |   Creating dir file:///var/lib/mopidy/.cache/mopidy
iris-mopidy-1      | INFO     2023-08-03 19:14:03,172 [7:MainThread] mopidy.__main__
iris-mopidy-1      |   Enabled extensions: softwaremixer, youtube, musicbox_webclient, m3u, ytmusic, iris, mpd, file, stream, http
iris-mopidy-1      | INFO     2023-08-03 19:14:03,172 [7:MainThread] mopidy.__main__
iris-mopidy-1      |   Disabled extensions: spotify, local, soundcloud
iris-mopidy-1      | WARNING  2023-08-03 19:14:03,172 [7:MainThread] mopidy.__main__
iris-mopidy-1      |   Found local configuration errors. The extension has been automatically disabled:
iris-mopidy-1      | WARNING  2023-08-03 19:14:03,172 [7:MainThread] mopidy.__main__
iris-mopidy-1      |     local/media_dir must be set.
iris-mopidy-1      | WARNING  2023-08-03 19:14:03,172 [7:MainThread] mopidy.__main__
iris-mopidy-1      |   Found soundcloud configuration errors. The extension has been automatically disabled:
iris-mopidy-1      | WARNING  2023-08-03 19:14:03,172 [7:MainThread] mopidy.__main__
iris-mopidy-1      |     soundcloud/auth_token must be set.
iris-mopidy-1      | WARNING  2023-08-03 19:14:03,172 [7:MainThread] mopidy.__main__
iris-mopidy-1      |   Found spotify configuration errors. The extension has been automatically disabled:
iris-mopidy-1      | WARNING  2023-08-03 19:14:03,172 [7:MainThread] mopidy.__main__
iris-mopidy-1      |     spotify/username must be set.
iris-mopidy-1      | WARNING  2023-08-03 19:14:03,172 [7:MainThread] mopidy.__main__
iris-mopidy-1      |     spotify/password must be set.
iris-mopidy-1      | WARNING  2023-08-03 19:14:03,172 [7:MainThread] mopidy.__main__
iris-mopidy-1      |     spotify/client_id must be set.
iris-mopidy-1      | WARNING  2023-08-03 19:14:03,172 [7:MainThread] mopidy.__main__
iris-mopidy-1      |     spotify/client_secret must be set.
iris-mopidy-1      | WARNING  2023-08-03 19:14:03,172 [7:MainThread] mopidy.__main__
iris-mopidy-1      |   Please fix the extension configuration errors or disable the extensions to silence these messages.
iris-mopidy-1      | INFO     2023-08-03 19:14:03,232 [7:MainThread] mopidy.commands
iris-mopidy-1      |   Starting Mopidy mixer: SoftwareMixer
iris-mopidy-1      | INFO     2023-08-03 19:14:03,233 [7:MainThread] mopidy.commands
iris-mopidy-1      |   Starting Mopidy audio
iris-mopidy-1      | INFO     2023-08-03 19:14:03,234 [7:MainThread] mopidy.commands
iris-mopidy-1      |   Starting Mopidy backends: YTMusicBackend, YouTubeBackend, FileBackend, M3UBackend, StreamBackend
iris-mopidy-1      | INFO     2023-08-03 19:14:03,238 [7:Audio-2] mopidy.audio.actor
iris-mopidy-1      |   Audio output set to "audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! wavenc ! filesink location=/tmp/snapfifo"
iris-snapserver-1  | 2023-08-03 19-14-03.629 [Error] (PcmStream) Stream: Default, message: 2023-08-03 19:14:03,629 meta_mopidy ERROR: Snapcast RPC websocket error
iris-snapserver-1  | 2023-08-03 19-14-03.629 [Error] (PcmStream) Stream: Default, message: 2023-08-03 19:14:03,629 meta_mopidy ERROR: [Errno 99] Cannot assign requested address
iris-snapserver-1  | 2023-08-03 19-14-03.629 [Info] (PcmStream) Stream: Default, message: 2023-08-03 19:14:03,629 meta_mopidy INFO: Snapcast RPC websocket closed
iris-mopidy-1      | INFO     2023-08-03 19:14:03,964 [7:YouTubeBackend-5] mopidy_youtube
iris-mopidy-1      |   file caching not enabled
iris-mopidy-1      | 
iris-mopidy-1      | 
iris-mopidy-1      | INFO     2023-08-03 19:14:03,966 [7:YouTubeBackend-5] mopidy_youtube
iris-mopidy-1      |   using jAPI
iris-mopidy-1      | 
iris-mopidy-1      | 
iris-mopidy-1      | INFO     2023-08-03 19:14:03,971 [7:MainThread] mopidy.commands
iris-mopidy-1      |   Starting Mopidy core
iris-mopidy-1      | INFO     2023-08-03 19:14:03,974 [7:MainThread] mopidy.commands
iris-mopidy-1      |   Starting Mopidy frontends: YTMusicScrobbleFE, YouTubeAutoplayer, YouTubeCoreListener, MpdFrontend, IrisFrontend, HttpFrontend
iris-mopidy-1      | INFO     2023-08-03 19:14:03,975 [7:MainThread] mopidy_mpd.actor
iris-mopidy-1      |   MPD server running at [::ffff:0.0.0.0]:6600
iris-mopidy-1      | INFO     2023-08-03 19:14:03,976 [7:IrisFrontend-15] mopidy_iris.core
iris-mopidy-1      |   Starting Iris 3.67.0
iris-mopidy-1      | 
iris-mopidy-1      | 
iris-mopidy-1      | INFO     2023-08-03 19:14:03,976 [7:HttpFrontend-17] mopidy.http.actor
iris-mopidy-1      |   HTTP server running at [::ffff:0.0.0.0]:6680
iris-mopidy-1      | 
iris-mopidy-1      | 
iris-mopidy-1      | INFO     2023-08-03 19:14:03,976 [7:MainThread] mopidy.commands
iris-mopidy-1      |   Starting GLib mainloop
iris-mopidy-1      | 
iris-mopidy-1      | 
iris-mopidy-1      | INFO     2023-08-03 19:14:03,978 [7:HttpServer] mopidy.internal.path
iris-mopidy-1      |   Creating dir file:///var/lib/mopidy/.cache/mopidy/youtube
iris-mopidy-1      | INFO     2023-08-03 19:14:03,981 [7:HttpServer] mopidy.internal.path
iris-mopidy-1      |   Creating dir file:///var/lib/mopidy/http
iris-snapserver-1  | 2023-08-03 19-14-04.631 [Error] (PcmStream) Stream: Default, message: 2023-08-03 19:14:04,631 meta_mopidy ERROR: Snapcast RPC websocket error
iris-snapserver-1  | 2023-08-03 19-14-04.631 [Error] (PcmStream) Stream: Default, message: 2023-08-03 19:14:04,631 meta_mopidy ERROR: [Errno 99] Cannot assign requested address
iris-snapserver-1  | 2023-08-03 19-14-04.631 [Info] (PcmStream) Stream: Default, message: 2023-08-03 19:14:04,631 meta_mopidy INFO: Snapcast RPC websocket closed
iris-snapserver-1  | 2023-08-03 19-14-05.633 [Error] (PcmStream) Stream: Default, message: 2023-08-03 19:14:05,633 meta_mopidy ERROR: Snapcast RPC websocket error
iris-snapserver-1  | 2023-08-03 19-14-05.633 [Error] (PcmStream) Stream: Default, message: 2023-08-03 19:14:05,633 meta_mopidy ERROR: [Errno 99] Cannot assign requested address
iris-snapserver-1  | 2023-08-03 19-14-05.633 [Info] (PcmStream) Stream: Default, message: 2023-08-03 19:14:05,633 meta_mopidy INFO: Snapcast RPC websocket closed
...continues like this...
jaedb commented 1 year ago

This seems to be isolated to the controlscript element of your Snapserver configuration.

This error basically means that snapcast is unable to connect to your mopidy instance in order to control it (this is the purpose of the controlscript argument).

Have you changed the network_mode: host setting in your docker-compose.yml file? This will bind containers to the host network, meaning that snapserver can access mopidy via localhost (which is the expected configuration). Can you please paste your full docker-compose.yml file?

jasonmhite commented 1 year ago

I haven't changed the network_mode in my docker compose file, I only took the included example and modified the mount paths for the volumes. I'll see if I can dig into it more based on what you said.

jasonmhite commented 1 year ago

Changing network_mode to host seems to reduce the connection error messages but snapcast still shows as disconnected in Iris.

version: "3"
services:
  snapserver:
    image: jaedb/snapserver
    network_mode: host
    ports:
      - 1704:1704
      - 1705:1705
      - 1780:1780
    volumes:
      - /tmp/snapserver:/tmp
      - ./docker/snapserver/snapserver.conf:/etc/snapserver.conf
      - ./docker/snapserver/snapserver.json:/root/.config/snapserver/server.json
  mopidy:
    image: jaedb/iris
    environment:
      - PIP_PACKAGES=Mopidy-YTMusic Mopidy-Tidal Mopidy-SoundCloud Mopidy-MusicBox-Webclient
    build:
      context: .
    depends_on:
      - snapserver
    ports:
      - 6600:6600
      - 6680:6680
    volumes:
      - ./docker/mopidy/iris:/var/lib/mopidy/iris # Iris-specific storage
      - ./docker/mopidy/m3u:/var/lib/mopidy/m3u # To persist local playlists
      - ./docker/mopidy/mopidy.conf:/config/mopidy.conf
      - /tmp/snapserver:/tmp
      - ./music:/var/lib/mopidy/media
[+] Running 3/0
 ✔ Container iris-snapserver-1                                           Created                                                                                                                                                                     0.0s 
 ! snapserver Published ports are discarded when using host network mode                                                                                                                                                                             0.0s 
 ✔ Container iris-mopidy-1                                               Created                                                                                                                                                                     0.0s 
Attaching to iris-mopidy-1, iris-snapserver-1
iris-snapserver-1  | 2023-08-21 16-12-06.530 [Info] (Snapserver) Version 0.27.0, revision 54a3d862
iris-snapserver-1  | 2023-08-21 16-12-06.530 [Info] (Snapserver) Adding stream: pipe:///tmp/snapfifo?name=Default&sampleformat=48000:16:2&controlscript=meta_mopidy.py
iris-snapserver-1  | 2023-08-21 16-12-06.530 [Notice] (init) Settings file: "/root/.config/snapserver/server.json"
iris-snapserver-1  | 2023-08-21 16-12-06.531 [Info] (Snapserver) Using HTTP host name: containerbot
iris-snapserver-1  | 2023-08-21 16-12-06.531 [Error] (Avahi) Failed to create client: Daemon not running
iris-snapserver-1  | 2023-08-21 16-12-06.531 [Info] (PcmStream) PcmStream: Default, sampleFormat: 48000:16:2
iris-snapserver-1  | 2023-08-21 16-12-06.531 [Info] (PipeStream) PipeStream mode: create
iris-snapserver-1  | 2023-08-21 16-12-06.531 [Info] (Server) Stream: {"fragment":"","host":"","path":"/tmp/snapfifo","query":{"chunk_ms":"20","codec":"flac","controlscript":"meta_mopidy.py","name":"Default","sampleformat":"48000:16:2"},"raw":"pipe:////tmp/snapfifo?chunk_ms=20&codec=flac&controlscript=meta_mopidy.py&name=Default&sampleformat=48000:16:2","scheme":"pipe"}
iris-snapserver-1  | 2023-08-21 16-12-06.531 [Info] (FlacEnc) Init - compression level: 2
iris-snapserver-1  | 2023-08-21 16-12-06.532 [Error] (PosixStream) Exception: end of file
iris-snapserver-1  | 2023-08-21 16-12-06.532 [Info] (ControlServer) Creating TCP acceptor for address: 0.0.0.0, port: 1705
iris-snapserver-1  | 2023-08-21 16-12-06.532 [Info] (ControlServer) Creating HTTP acceptor for address: 0.0.0.0, port: 1780
iris-snapserver-1  | 2023-08-21 16-12-06.532 [Info] (StreamServer) Creating stream acceptor for address: 0.0.0.0, port: 1704
iris-snapserver-1  | 2023-08-21 16-12-06.532 [Info] (Snapserver) Number of threads: 4, hw threads: 4
iris-snapserver-1  | 2023-08-21 16-12-06.628 [Info] (PcmStream) Stream: Default, message: 2023-08-21 16:12:06,628 meta_mopidy INFO: Started MopidyControl loop
iris-mopidy-1      | -- INSTALLING PIP PACKAGES Mopidy-YTMusic Mopidy-Tidal Mopidy-SoundCloud Mopidy-MusicBox-Webclient --
iris-mopidy-1      | Defaulting to user installation because normal site-packages is not writeable
iris-mopidy-1      | ERROR: Invalid requirement: 'Mopidy-YTMusic Mopidy-Tidal Mopidy-SoundCloud Mopidy-MusicBox-Webclient'
iris-snapserver-1  | 2023-08-21 16-12-07.137 [Error] (PcmStream) Stream: Default, message: 2023-08-21 16:12:07,136 meta_mopidy ERROR: Snapcast RPC websocket error
iris-snapserver-1  | 2023-08-21 16-12-07.137 [Error] (PcmStream) Stream: Default, message: 2023-08-21 16:12:07,137 meta_mopidy ERROR: [Errno 104] Connection reset by peer
iris-snapserver-1  | 2023-08-21 16-12-07.137 [Info] (PcmStream) Stream: Default, message: 2023-08-21 16:12:07,137 meta_mopidy INFO: Snapcast RPC websocket closed
iris-mopidy-1      | 
iris-mopidy-1      | [notice] A new release of pip is available: 23.1.2 -> 23.2.1
iris-mopidy-1      | [notice] To update, run: python3 -m pip install --upgrade pip
iris-mopidy-1      | 
iris-mopidy-1      | INFO     2023-08-21 16:12:08,099 [7:MainThread] mopidy.__main__
iris-mopidy-1      |   Starting Mopidy 3.4.1
iris-mopidy-1      | INFO     2023-08-21 16:12:08,121 [7:MainThread] mopidy.config
iris-mopidy-1      |   Loading config from builtin defaults
iris-mopidy-1      | INFO     2023-08-21 16:12:08,122 [7:MainThread] mopidy.config
iris-mopidy-1      |   Loading config from file:///config/mopidy.conf
iris-mopidy-1      | INFO     2023-08-21 16:12:08,122 [7:MainThread] mopidy.config
iris-mopidy-1      |   Loading config from command line options
iris-mopidy-1      | INFO     2023-08-21 16:12:08,124 [7:MainThread] mopidy.internal.path
iris-mopidy-1      |   Creating dir file:///var/lib/mopidy/.cache/mopidy
iris-snapserver-1  | 2023-08-21 16-12-08.139 [Error] (PcmStream) Stream: Default, message: 2023-08-21 16:12:08,139 meta_mopidy ERROR: Snapcast RPC websocket error
iris-snapserver-1  | 2023-08-21 16-12-08.139 [Error] (PcmStream) Stream: Default, message: 2023-08-21 16:12:08,139 meta_mopidy ERROR: [Errno 104] Connection reset by peer
iris-snapserver-1  | 2023-08-21 16-12-08.139 [Info] (PcmStream) Stream: Default, message: 2023-08-21 16:12:08,139 meta_mopidy INFO: Snapcast RPC websocket closed
iris-mopidy-1      | INFO     2023-08-21 16:12:08,245 [7:MainThread] mopidy.__main__
iris-mopidy-1      |   Enabled extensions: mpd, http, file, m3u, ytmusic, iris, softwaremixer, youtube, musicbox_webclient, stream
iris-mopidy-1      | INFO     2023-08-21 16:12:08,245 [7:MainThread] mopidy.__main__
iris-mopidy-1      |   Disabled extensions: local, soundcloud, spotify
iris-mopidy-1      | WARNING  2023-08-21 16:12:08,245 [7:MainThread] mopidy.__main__
iris-mopidy-1      |   Found local configuration errors. The extension has been automatically disabled:
iris-mopidy-1      | WARNING  2023-08-21 16:12:08,245 [7:MainThread] mopidy.__main__
iris-mopidy-1      |     local/media_dir must be set.
iris-mopidy-1      | WARNING  2023-08-21 16:12:08,245 [7:MainThread] mopidy.__main__
iris-mopidy-1      |   Found soundcloud configuration errors. The extension has been automatically disabled:
iris-mopidy-1      | WARNING  2023-08-21 16:12:08,245 [7:MainThread] mopidy.__main__
iris-mopidy-1      |     soundcloud/auth_token must be set.
iris-mopidy-1      | WARNING  2023-08-21 16:12:08,245 [7:MainThread] mopidy.__main__
iris-mopidy-1      |   Found spotify configuration errors. The extension has been automatically disabled:
iris-mopidy-1      | WARNING  2023-08-21 16:12:08,245 [7:MainThread] mopidy.__main__
iris-mopidy-1      |     spotify/username must be set.
iris-mopidy-1      | WARNING  2023-08-21 16:12:08,245 [7:MainThread] mopidy.__main__
iris-mopidy-1      |     spotify/password must be set.
iris-mopidy-1      | WARNING  2023-08-21 16:12:08,245 [7:MainThread] mopidy.__main__
iris-mopidy-1      |     spotify/client_id must be set.
iris-mopidy-1      | WARNING  2023-08-21 16:12:08,245 [7:MainThread] mopidy.__main__
iris-mopidy-1      |     spotify/client_secret must be set.
iris-mopidy-1      | WARNING  2023-08-21 16:12:08,245 [7:MainThread] mopidy.__main__
iris-mopidy-1      |   Please fix the extension configuration errors or disable the extensions to silence these messages.
iris-mopidy-1      | INFO     2023-08-21 16:12:08,323 [7:MainThread] mopidy.commands
iris-mopidy-1      |   Starting Mopidy mixer: SoftwareMixer
iris-mopidy-1      | INFO     2023-08-21 16:12:08,323 [7:MainThread] mopidy.commands
iris-mopidy-1      |   Starting Mopidy audio
iris-mopidy-1      | INFO     2023-08-21 16:12:08,324 [7:MainThread] mopidy.commands
iris-mopidy-1      |   Starting Mopidy backends: YTMusicBackend, YouTubeBackend, FileBackend, M3UBackend, StreamBackend
iris-mopidy-1      | 
iris-mopidy-1      | 
iris-mopidy-1      | INFO     2023-08-21 16:12:08,328 [7:Audio-2] mopidy.audio.actor
iris-mopidy-1      |   Audio output set to "audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! wavenc ! filesink location=/tmp/snapfifo"
iris-mopidy-1      | INFO     2023-08-21 16:12:08,862 [7:YouTubeBackend-5] mopidy_youtube
iris-mopidy-1      |   file caching not enabled
iris-mopidy-1      | INFO     2023-08-21 16:12:08,864 [7:YouTubeBackend-5] mopidy_youtube
iris-mopidy-1      |   using jAPI
iris-mopidy-1      | 
iris-mopidy-1      | 
iris-mopidy-1      | INFO     2023-08-21 16:12:08,871 [7:MainThread] mopidy.commands
iris-mopidy-1      |   Starting Mopidy core
iris-mopidy-1      | INFO     2023-08-21 16:12:08,873 [7:MainThread] mopidy.commands
iris-mopidy-1      |   Starting Mopidy frontends: YTMusicScrobbleFE, YouTubeAutoplayer, YouTubeCoreListener, MpdFrontend, IrisFrontend, HttpFrontend
iris-mopidy-1      | INFO     2023-08-21 16:12:08,874 [7:MainThread] mopidy_mpd.actor
iris-mopidy-1      |   MPD server running at [::ffff:0.0.0.0]:6600
iris-mopidy-1      | INFO     2023-08-21 16:12:08,875 [7:IrisFrontend-15] mopidy_iris.core
iris-mopidy-1      |   Starting Iris 3.67.0
iris-mopidy-1      | 
iris-mopidy-1      | 
iris-mopidy-1      | INFO     2023-08-21 16:12:08,875 [7:HttpFrontend-17] mopidy.http.actor
iris-mopidy-1      |   HTTP server running at [::ffff:0.0.0.0]:6680
iris-mopidy-1      | 
iris-mopidy-1      | 
iris-mopidy-1      | INFO     2023-08-21 16:12:08,876 [7:MainThread] mopidy.commands
iris-mopidy-1      |   Starting GLib mainloop
iris-mopidy-1      | 
iris-mopidy-1      | 
iris-mopidy-1      | INFO     2023-08-21 16:12:08,878 [7:HttpServer] mopidy.internal.path
iris-mopidy-1      |   Creating dir file:///var/lib/mopidy/.cache/mopidy/youtube
iris-mopidy-1      | INFO     2023-08-21 16:12:08,880 [7:HttpServer] mopidy.internal.path
iris-mopidy-1      |   Creating dir file:///var/lib/mopidy/http
iris-snapserver-1  | 2023-08-21 16-12-09.150 [Info] (PcmStream) Stream: Default, message: 2023-08-21 16:12:09,150 meta_mopidy INFO: Snapcast RPC websocket opened
iris-snapserver-1  | 2023-08-21 16-12-09.150 [Info] (Script) Sending request: {"id":1,"jsonrpc":"2.0","method":"Plugin.Stream.Player.GetProperties"}
iris-snapserver-1  | 2023-08-21 16-12-09.152 [Info] (PcmStream) Stream: Default, message: 2023-08-21 16:12:09,152 meta_mopidy INFO: New properties: {'playbackStatus': 'stopped', 'shuffle': False, 'volume': 100, 'position': 0.0, 'loopStatus': 'none', 'canGoNext': True, 'canGoPrevious': True, 'canPlay': True, 'canPause': True, 'canSeek': False, 'canControl': True}
iris-snapserver-1  | 2023-08-21 16-12-09.152 [Info] (Script) Response: {"id":1,"jsonrpc":"2.0","result":{"canControl":true,"canGoNext":true,"canGoPrevious":true,"canPause":true,"canPlay":true,"canSeek":false,"loopStatus":"none","playbackStatus":"stopped","position":0.0,"shuffle":false,"volume":100}}, id: 1
iris-snapserver-1  | 2023-08-21 16-12-09.152 [Info] (PcmStream) Response for Plugin.Stream.Player.GetProperties: {"id":1,"jsonrpc":"2.0","result":{"canControl":true,"canGoNext":true,"canGoPrevious":true,"canPause":true,"canPlay":true,"canSeek":false,"loopStatus":"none","playbackStatus":"stopped","position":0.0,"shuffle":false,"volume":100}}
iris-mopidy-1      | INFO     2023-08-21 16:12:10,112 [7:Thread-4] mopidy_ytmusic
iris-mopidy-1      |   YTMusic loaded 10 auto playlists sections
iris-mopidy-1      | INFO     2023-08-21 16:12:10,113 [7:Thread-4] mopidy_ytmusic
iris-mopidy-1      |   YTMusic Auto Playlists refreshed in 1.25s

image

scotthraban commented 10 months ago

localhost in the snapserver container isn't going to work to get to the mopidy container, so you have to add a controlscriptparams option to set the host in meta_mopidy.py to the stream definition in the snapserver.conf, which in the example docker compose would be mopidy (the name of the service is used as the hostname):

stream = pipe:///tmp/snapfifo?name=Mopidy&sampleformat=48000:16:2&controlscript=meta_mopidy.py&controlscriptparams=--mopidy-host=mopidy