# Struggling to get Mopidy to play over Snapcast

**URL:** <https://discourse.mopidy.com/t/struggling-to-get-mopidy-to-play-over-snapcast/4949>\
**Category:** Help and support\
**Created:** [May 18, 2021, 3:42pm UTC](https://discourse.mopidy.com/t/struggling-to-get-mopidy-to-play-over-snapcast/4949 "2021-05-18T15:42:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheKaese](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/thekaese/32/2026_2.png) [@TheKaese](https://discourse.mopidy.com/u/TheKaese)\
**Post date:** [May 18, 2021, 3:42pm UTC](https://discourse.mopidy.com/t/struggling-to-get-mopidy-to-play-over-snapcast/4949/1 "2021-05-18T15:42:31Z")

</div>

Hi… I’m struggling to get anything to output from my Mopidy server to a snapclient. I’m receiving the error ‘Could not open file “tmp/snapfifo” for writing’ when attempting to play any track. I’ve attempted to manually create the file and change permissions to 777 to see if that would do anything, but I’m still getting the same error. Anyone have any ideas?

Config:

> $ sudo mopidyctl config  
> Running “/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf config” as user mopidy  
> [core]  
> cache\_dir = /var/cache/mopidy  
> config\_dir = /etc/mopidy  
> data\_dir = /var/lib/mopidy  
> max\_tracklist\_length = 10000  
> restore\_state = false
> 
> [logging]  
> verbosity = 0  
> format = %(levelname)-8s [%(threadName)s] %(name)s %(message)s  
> color = false  
> config\_file =
> 
> [audio]  
> mixer = software  
> mixer\_volume =  
> output = audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! wavenc ! filesink location=/tmp/snapfifo  
> buffer\_time =
> 
> [proxy]  
> scheme =  
> hostname =  
> port =  
> username =  
> password =
> 
> [iris]  
> enabled = true  
> country = NZ  
> locale = en\_NZ  
> spotify\_authorization\_url = `https://jamesbarnsley.co.nz/iris/auth_spotify.php`  
> lastfm\_authorization\_url = `https://jamesbarnsley.co.nz/iris/auth_lastfm.php`  
> genius\_authorization\_url = `https://jamesbarnsley.co.nz/iris/auth_genius.php`  
> data\_dir = $XDG\_DATA\_DIR/iris
> 
> [file]  
> enabled = true  
> media\_dirs =  
> $XDG\_MUSIC\_DIR|Music  
> ~/|Home  
> excluded\_file\_extensions =  
> .directory  
> .html  
> .jpeg  
> .jpg  
> .log  
> .nfo  
> .pdf  
> .png  
> .txt  
> .zip  
> show\_dotfiles = false  
> follow\_symlinks = false  
> metadata\_timeout = 1000
> 
> [http]  
> enabled = true  
> hostname = 0.0.0.0  
> port = 6680  
> zeroconf = Mopidy HTTP server on $hostname  
> allowed\_origins =  
> csrf\_protection = true  
> default\_app = mopidy
> 
> [m3u]  
> enabled = true  
> base\_dir =  
> default\_encoding = latin-1  
> default\_extension = .m3u8  
> playlists\_dir =
> 
> [softwaremixer]  
> enabled = true
> 
> [stream]  
> enabled = true  
> protocols =  
> http  
> https  
> mms  
> rtmp  
> rtmps  
> rtsp  
> metadata\_blacklist =  
> timeout = 5000
> 
> [spotify]  
> enabled = true  
> username = \*\*\*\*\*\*\*\*  
> password = \*\*\*\*\*\*\*\*  
> client\_id = \*\*\*\*\*\*\*\*\*  
> client\_secret = \*\*\*\*\*\*\*\*  
> bitrate = 320  
> volume\_normalization = true  
> private\_session = true  
> timeout = 10  
> allow\_cache = true  
> allow\_network = true  
> allow\_playlists = true  
> search\_album\_count = 20  
> search\_artist\_count = 10  
> search\_track\_count = 50  
> toplist\_countries =  
> US
> 
> [mpris]  
> enabled = true  
> bus\_type = session
> 
> [mpd]  
> enabled = true  
> hostname = ::  
> port = 6600  
> password =  
> max\_connections = 20  
> connection\_timeout = 60  
> zeroconf = Mopidy MPD server on $hostname  
> command\_blacklist =  
> listall  
> listallinfo  
> default\_playlist\_scheme = m3u
> 
> [alsamixer]  
> enabled = true  
> card = 0  
> control = Master  
> min\_volume = 0  
> max\_volume = 100  
> volume\_scale = cubic

Dependencies:

> $ sudo mopidyctl deps  
> Running “/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf deps” as user mopidy  
> Executable: /usr/bin/mopidy  
> Platform: Linux-5.4.0-73-generic-x86\_64-with-glibc2.29  
> Python: CPython 3.8.5 from /usr/lib/python3.8  
> Mopidy: 3.1.1 from /usr/lib/python3/dist-packages  
> Mopidy-ALSAMixer: 2.0.1 from /usr/lib/python3/dist-packages  
> Mopidy-Iris: 3.58.0 from /usr/local/lib/python3.8/dist-packages  
> setuptools: 45.2.0 from /usr/lib/python3/dist-packages  
> Mopidy: 3.1.1 from /usr/lib/python3/dist-packages  
> Pykka: 2.0.3 from /usr/lib/python3/dist-packages  
> Mopidy-Spotify: 4.1.0 from /usr/lib/python3/dist-packages  
> Mopidy-MPRIS: 3.0.3 from /usr/lib/python3/dist-packages  
> Mopidy-MPD: 3.1.0 from /usr/lib/python3/dist-packages  
> GStreamer: 1.16.2.0 from /usr/lib/python3/dist-packages/gi  
> Detailed information:  
> Python wrapper: python-gi 3.36.0  
> Relevant elements:  
> Found:  
> uridecodebin  
> souphttpsrc  
> appsrc  
> alsasink  
> osssink  
> oss4sink  
> pulsesink  
> id3demux  
> id3v2mux  
> lamemp3enc  
> mpegaudioparse  
> mpg123audiodec  
> vorbisdec  
> vorbisenc  
> vorbisparse  
> oggdemux  
> oggmux  
> oggparse  
> flacdec  
> flacparse  
> shout2send  
> Not found:  
> flump3dec  
> mad

Debug:

> May 18 15:29:31 mopidy systemd[1]: Starting Mopidy music server…  
> May 18 15:29:31 mopidy systemd[1]: Started Mopidy music server.  
> May 18 15:29:31 mopidy mopidy[1471]: INFO [MainThread] mopidy. **main** Starting Mopidy 3.1.1  
> May 18 15:29:31 mopidy mopidy[1471]: INFO [MainThread] mopidy.config Loading config from builtin defaults  
> May 18 15:29:31 mopidy mopidy[1471]: INFO [MainThread] mopidy.config Loading config from file:///usr/share/mopidy/conf.d/mopidy.conf  
> May 18 15:29:31 mopidy mopidy[1471]: INFO [MainThread] mopidy.config Loading config from file:///etc/mopidy/mopidy.conf  
> May 18 15:29:31 mopidy mopidy[1471]: INFO [MainThread] mopidy.config Loading config from command line options  
> May 18 15:29:32 mopidy mopidy[1471]: INFO [MainThread] mopidy. **main** Enabled extensions: iris, mpd, mpris, file, m3u, alsamixer, stream, softwaremixer, spotify, http  
> May 18 15:29:32 mopidy mopidy[1471]: INFO [MainThread] mopidy. **main** Disabled extensions: none  
> May 18 15:29:32 mopidy mopidy[1471]: INFO [MainThread] mopidy.commands Starting Mopidy mixer: SoftwareMixer  
> May 18 15:29:32 mopidy mopidy[1471]: INFO [MainThread] mopidy.commands Starting Mopidy audio  
> May 18 15:29:32 mopidy mopidy[1471]: INFO [MainThread] mopidy.commands Starting Mopidy backends: FileBackend, M3UBackend, StreamBackend, SpotifyBackend  
> May 18 15:29:32 mopidy mopidy[1471]: INFO [Audio-2] mopidy.audio.actor Audio output set to “audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! wavenc ! filesink location=/tmp/snapfifo”  
> May 18 15:29:32 mopidy mopidy[1471]: INFO [SpotifyEventLoop] mopidy\_spotify.backend Logged in to Spotify in online mode  
> May 18 15:29:33 mopidy mopidy[1471]: INFO [SpotifyBackend-6] mopidy\_spotify.web Logged into Spotify Web API as \*\*\*\*\*\*\*\*\*\*\*\*  
> May 18 15:29:34 mopidy mopidy[1471]: INFO [SpotifyBackend-6] mopidy\_spotify.playlists Refreshed 6 Spotify playlists  
> May 18 15:29:34 mopidy mopidy[1471]: INFO [SpotifyBackend-6] mopidy\_spotify.backend Spotify private session activated  
> May 18 15:29:34 mopidy mopidy[1471]: INFO [MainThread] mopidy.commands Starting Mopidy core  
> May 18 15:29:34 mopidy mopidy[1471]: INFO [MainThread] mopidy.commands Starting Mopidy frontends: IrisFrontend, HttpFrontend, MprisFrontend, MpdFrontend  
> May 18 15:29:34 mopidy mopidy[1471]: INFO [IrisFrontend-10] mopidy\_iris.core Starting Iris 3.58.0  
> May 18 15:29:34 mopidy mopidy[1471]: INFO [HttpFrontend-12] mopidy.http.actor HTTP server running at [::ffff:0.0.0.0]:6680  
> May 18 15:29:34 mopidy mopidy[1471]: WARNING [MprisFrontend-13] mopidy\_mpris.frontend MPRIS frontend setup failed (g-io-error-quark: Cannot autolaunch D-Bus without X11 $DISPLAY (0))  
> May 18 15:29:34 mopidy mopidy[1471]: INFO [MainThread] mopidy\_mpd.actor MPD server running at [::]:6600  
> May 18 15:29:34 mopidy mopidy[1471]: INFO [MainThread] mopidy.commands Starting GLib mainloop  
> May 18 15:29:35 mopidy snapserver[737]: ControlServer::NewConnection: 10.1.0.167  
> May 18 15:29:35 mopidy snapserver[737]: 2021-05-18 15-29-35 [Notice] (handleAccept) ControlServer::NewConnection: 10.1.0.167  
> May 18 15:29:54 mopidy mopidy[1471]: WARNING [Audio-2] mopidy.audio.actor Setting GStreamer state to GST\_STATE\_PLAYING failed  
> May 18 15:29:54 mopidy mopidy[1471]: ERROR [MainThread] mopidy.audio.gst GStreamer error: Could not open file “/tmp/snapfifo” for writing.  
> May 18 15:29:54 mopidy mopidy[1471]: WARNING [Core-9] mopidy.core.tracklist Track is not playable: spotify:track:3AUMiJI6rDcz3iQcTf3dH7

---

<div class="post-metadata">

**Author:** ![mangrove](https://avatars.discourse-cdn.com/v4/letter/m/ecd19e/32.png) [@mangrove](https://discourse.mopidy.com/u/mangrove)\
**Post date:** [July 18, 2021, 11:38am UTC](https://discourse.mopidy.com/t/struggling-to-get-mopidy-to-play-over-snapcast/4949/3 "2021-07-18T11:38:33Z")

</div>

Check that the /tmp/snapfifo is a fifo and not a file, and check the permissions. I have read that you can switch to some kind of tcp stream also but haven’t grokked that yet. 🙂 anyway, do this:

mkfifo /tmp/snapfifo  
chown mopidy:audio /tmp/snapfifo

…I think these are the standard values…

---

<div class="post-metadata">

**Author:** ![TheKaese](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/thekaese/32/2026_2.png) [@TheKaese](https://discourse.mopidy.com/u/TheKaese)\
**Post date:** [August 8, 2021, 11:49pm UTC](https://discourse.mopidy.com/t/struggling-to-get-mopidy-to-play-over-snapcast/4949/4 "2021-08-08T23:49:26Z")

</div>

This might be it! I’ll have to re set up my config this week and give it a go!

---

<div class="post-metadata">

**Author:** ![mangrove](https://avatars.discourse-cdn.com/v4/letter/m/ecd19e/32.png) [@mangrove](https://discourse.mopidy.com/u/mangrove)\
**Post date:** [August 9, 2021, 7:28am UTC](https://discourse.mopidy.com/t/struggling-to-get-mopidy-to-play-over-snapcast/4949/5 "2021-08-09T07:28:29Z")

</div>

I changed to TCP streaming but that gave unacceptable delays (and some audio artifacts) when playing/pausing, possibly due to some excessive buffering somewhere. I have solved this by going back to FIFO and modifying the startup scripts for both Mopidy and Snapserver to create the FIFO manually at service start. That worked.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/system/32/1_2.png) [@system](https://discourse.mopidy.com/u/system)\
**Post date:** [February 7, 2022, 7:29pm UTC](https://discourse.mopidy.com/t/struggling-to-get-mopidy-to-play-over-snapcast/4949/6 "2022-02-07T19:29:09Z")

</div>

Closed on February 7, 2022, 7:29pm UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
