# Gstreamer error

**URL:** https://discourse.mopidy.com/t/gstreamer-error/2481
**Category:** Misc
**Created:** [May 8, 2018, 10:18pm UTC](https://discourse.mopidy.com/t/gstreamer-error/2481 "2018-05-08T22:18:56Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![vash3d](https://avatars.discourse-cdn.com/v4/letter/v/b782af/32.png) [@vash3d](https://discourse.mopidy.com/u/vash3d)
#### Post date: [May 8, 2018, 10:18pm UTC](https://discourse.mopidy.com/t/gstreamer-error/2481/1 "2018-05-08T22:18:56Z")

</div>

Hi all,  
I’m trying to setup mopidy and Snapcast to use them in combination with home assistant tts service, but I can’t get this to work.

If I let mopidy create the snapfifo file, when I use the tts service I can hear the voice repeated in an infinite loop.  
Indeed I read in other posts that should be Snapcast to create the snapfifo file.  
But if I let Snapcast create the file I can’t here nothing from mopidy and I got this error

`GStreamer error: gst-resource-error-quark: Error while seeking in file "/tmp/snapfifo". (11)`

Instead if I manually create the file with `mkfifo /tmp/snapfifo` I get this error

```auto
Mar 24 14:13:31 hassbian mopidy[17603]: ERROR GStreamer error: gst-resource-error-quark: Could not open file "/tmp/snapfifo" for writing. (6)
Mar 24 14:13:31 hassbian mopidy[17603]: WARNING Setting GStreamer state to GST_STATE_PLAYING failed
Mar 24 14:13:31 hassbian mopidy[17603]: WARNING Track is not playable: http://192.168.1.152:8123/api/tts_proxy/f0fa9097a41d357ca711da49ab4f935720e67a52_it_-_google.mp3

```

I’ve this in my Snapcast configuration now

```auto
SNAPSERVER_OPTS="-d -s airplay:///usr/bin/shairport-sync?name=Airplay&devicename=Multiroom&port=5000] -s pipe:///tmp/snapfifo?name=Mopidy&sampleformat=48000:16:2&codec=flac&mode=read"

```

the airplay part works flawlessly.

Any advice is really appreciated,  
thanks

---

<div class="post-metadata">

### Author: ![Steve\_Lambert](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/steve_lambert/32/1149_2.png) [@Steve\_Lambert](https://discourse.mopidy.com/u/Steve_Lambert)
#### Post date: [May 9, 2018, 5:56am UTC](https://discourse.mopidy.com/t/gstreamer-error/2481/2 "2018-05-09T05:56:22Z")

</div>

What do you mean by the ‘Home Assistant tts service’?  
I use same setup, HA+Mopidy+Snapcast and if I type text in the tts section of the MPD tile on the overview page, it comes out of all speakers, I don’t use it very often and as far as I can remember I’ve only done it when mopidy isn’t playing.

---

<div class="post-metadata">

### Author: ![Xalip](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/xalip/32/1532_2.png) [@Xalip](https://discourse.mopidy.com/u/Xalip)
#### Post date: [April 20, 2020, 7:23pm UTC](https://discourse.mopidy.com/t/gstreamer-error/2481/3 "2020-04-20T19:23:18Z")

</div>

Sorry for reopening the thread. But did you ever solved this issue?

I’m having a pretty similiar issue:

Pi4 with buster running a snapcast server and mopidy.

That’s my mopidy.conf:

```
# For further information about options in this file see:

# https://docs.mopidy.com/

#

# The initial commented out values reflect the defaults as of:

# Mopidy 3.0.2

# Mopidy-File 3.0.2

# Mopidy-HTTP 3.0.2

# Mopidy-M3U 3.0.2

# Mopidy-SoftwareMixer 3.0.2

# Mopidy-Stream 3.0.2

#

# Available options and defaults might have changed since then,

# run `mopidy config` to see the current effective config and

# `mopidy --version` to check the current version.

[core]

#cache_dir = $XDG_CACHE_DIR/mopidy

#config_dir = $XDG_CONFIG_DIR/mopidy

#data_dir = $XDG_DATA_DIR/mopidy

#max_tracklist_length = 10000

#restore_state = false

[local]

data_dir = /var/lib/mopidy/local

media_dir = /var/lib/mopidy/media

[logging]

#verbosity = 0

#format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n %(message)s

#color = true

#config_file =

[audio]

#mixer = software

#mixer_volume =

# output = alsasink

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 =

[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 = 192.168.0.2

port = 6680

#zeroconf = Mopidy HTTP server on $hostname

#allowed_origins =

#csrf_protection = true

#default_app = mopidy

[m3u]

#enabled = true

#base_dir = $XDG_MUSIC_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

```

I would like to pipe the output of mopidy to snapcast using this line:  
[audio]

```
#mixer = software

#mixer_volume =

# output = alsasink

output = audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! wavenc ! filesink location=/tmp/snapfifo

#buffer_time =

```

Sadly the mopidy log shows errors in writing to the file:

 ![Screenshot 2020-04-20 at 21.19.42](https://canada1.discourse-cdn.com/flex036/uploads/mopidy/original/2X/3/312cec9c82d2adddb918b5b2c0301f356201fe35.jpeg)

Does anyone know how to solve this issue?

I’m running Mopidy \> 3

Here’s the documentation of snapcast concerning piping output from mopidy to snapserver: [https://github.com/badaix/snapcast/blob/master/doc/player\_setup.md#mopidy](https://github.com/badaix/snapcast/blob/master/doc/player_setup.md#mopidy)

Thanks in advance.

---

<div class="post-metadata">

### Author: ![Xalip](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/xalip/32/1532_2.png) [@Xalip](https://discourse.mopidy.com/u/Xalip)
#### Post date: [April 22, 2020, 4:29pm UTC](https://discourse.mopidy.com/t/gstreamer-error/2481/4 "2020-04-22T16:29:55Z")

</div>

No one who might know how to solve this? I’m kind of desprate

---

<div class="post-metadata">

### Author: ![kingosticks](https://avatars.discourse-cdn.com/v4/letter/k/858c86/32.png) [@kingosticks](https://discourse.mopidy.com/u/kingosticks)
#### Post date: [April 22, 2020, 5:20pm UTC](https://discourse.mopidy.com/t/gstreamer-error/2481/5 "2020-04-22T17:20:35Z")

</div>

I don’t use snapcast. But did you also change the sysctl setting as it suggests?

---

<div class="post-metadata">

### Author: ![Steve\_Lambert](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/steve_lambert/32/1149_2.png) [@Steve\_Lambert](https://discourse.mopidy.com/u/Steve_Lambert)
#### Post date: [April 22, 2020, 7:25pm UTC](https://discourse.mopidy.com/t/gstreamer-error/2481/6 "2020-04-22T19:25:38Z")

</div>

Are you trying to use the tts service? or just set up snapcast?

---

<div class="post-metadata">

### Author: ![Xalip](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/xalip/32/1532_2.png) [@Xalip](https://discourse.mopidy.com/u/Xalip)
#### Post date: [April 23, 2020, 6:37am UTC](https://discourse.mopidy.com/t/gstreamer-error/2481/7 "2020-04-23T06:37:29Z")

</div>

I would like to stream all output from mopidy to snapserver.

---

<div class="post-metadata">

### Author: ![Steve\_Lambert](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/steve_lambert/32/1149_2.png) [@Steve\_Lambert](https://discourse.mopidy.com/u/Steve_Lambert)
#### Post date: [April 23, 2020, 12:45pm UTC](https://discourse.mopidy.com/t/gstreamer-error/2481/8 "2020-04-23T12:45:32Z")

</div>

Assuming then that you are not using HASS or trying to use it’s tts service and that you just have mopidy and snapcast installed on a your pi, can you play any music without using snapcast - ie just on the basic install of mopidy?

---

<div class="post-metadata">

### Author: ![Xalip](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/xalip/32/1532_2.png) [@Xalip](https://discourse.mopidy.com/u/Xalip)
#### Post date: [April 23, 2020, 5:59pm UTC](https://discourse.mopidy.com/t/gstreamer-error/2481/9 "2020-04-23T17:59:43Z")

</div>

Hey,

I’ve started a fresh install today. Removed all pieces of mopidy 2.3.1 and made a fresh install of mopidy 3.2. Rhasspy and HA are running on the same machine as well.

As long as I leave the audio section to:

```
[audio]
output = alsasink
#output = audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! wavenc ! filesink location=/tmp/snapfifo

```

Everything is working just fine.  
Flipping the upper lines with each other brings still an error.  
I thought maybe the local file is causing some trouble so I configured mopidy-spotify, but still the same. The error is not much different than before.  
That’s the error:

```
● mopidy.service - Mopidy music server
   Loaded: loaded (/lib/systemd/system/mopidy.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2020-04-23 19:53:54 CEST; 36s ago
  Process: 27351 ExecStartPre=/bin/mkdir -p /var/cache/mopidy (code=exited, status=0/SUCCESS)
  Process: 27352 ExecStartPre=/bin/chown mopidy:audio /var/cache/mopidy (code=exited, status=0/SUCCESS)
 Main PID: 27353 (mopidy)
    Tasks: 17 (limit: 4915)
   Memory: 69.7M
   CGroup: /system.slice/mopidy.service
           └─27353 /usr/bin/python3 /usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf

Apr 23 19:53:57 raspberrypi mopidy[27353]: INFO [SpotifyBackend-3] mopidy_spotify.web Logged into Spotify Web API as maulik21
Apr 23 19:54:20 raspberrypi mopidy[27353]: INFO [SpotifyBackend-3] mopidy_spotify.playlists Refreshed 85 Spotify playlists
Apr 23 19:54:20 raspberrypi mopidy[27353]: INFO [MainThread] mopidy.commands Starting Mopidy core
Apr 23 19:54:20 raspberrypi mopidy[27353]: INFO [MainThread] mopidy.commands Starting Mopidy frontends: IrisFrontend, HttpFrontend
Apr 23 19:54:20 raspberrypi mopidy[27353]: INFO [IrisFrontend-10] mopidy_iris.core Starting Iris 3.47.0
Apr 23 19:54:20 raspberrypi mopidy[27353]: INFO [HttpFrontend-12] mopidy.http.actor HTTP server running at [::]:6680
Apr 23 19:54:20 raspberrypi mopidy[27353]: INFO [MainThread] mopidy.commands Starting GLib mainloop
Apr 23 19:54:23 raspberrypi mopidy[27353]: WARNING [Audio-2] mopidy.audio.actor Setting GStreamer state to GST_STATE_PLAYING failed
Apr 23 19:54:23 raspberrypi mopidy[27353]: WARNING [Core-9] mopidy.core.tracklist Track is not playable: spotify:track:5pKCDm2fw4k6D6C5Rk646C
Apr 23 19:54:23 raspberrypi mopidy[27353]: ERROR [MainThread] mopidy.audio.gst GStreamer error: Could not open file "/tmp/snapfifo" for writing.

```

Shall I enable better debugging? Any hint on how to solve this?

Thanks for the help.

---

<div class="post-metadata">

### Author: ![Steve\_Lambert](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/steve_lambert/32/1149_2.png) [@Steve\_Lambert](https://discourse.mopidy.com/u/Steve_Lambert)
#### Post date: [April 23, 2020, 7:07pm UTC](https://discourse.mopidy.com/t/gstreamer-error/2481/10 "2020-04-23T19:07:12Z")

</div>

did you follow @kingosticks suggestion above?

---

<div class="post-metadata">

### Author: ![Steve\_Lambert](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/steve_lambert/32/1149_2.png) [@Steve\_Lambert](https://discourse.mopidy.com/u/Steve_Lambert)
#### Post date: [April 23, 2020, 7:40pm UTC](https://discourse.mopidy.com/t/gstreamer-error/2481/11 "2020-04-23T19:40:40Z")

</div>

I haven’t used Rhasspy and have stopped using HA but either of those could maybe interfering with the snapserver.  
My only suggestion would be to start over again, maybe on a fresh card if you have one, get mopidy and snapserver running then build on from there, I have a feeling that’s what I had to do when I set it up. But it was a couple of years ago and the memory is fading now 🙂  
I’m afraid I haven’t really got the time until the weekend to look into it and try and offer any more assistance.

---

<div class="post-metadata">

### Author: ![Xalip](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/xalip/32/1532_2.png) [@Xalip](https://discourse.mopidy.com/u/Xalip)
#### Post date: [April 24, 2020, 6:25am UTC](https://discourse.mopidy.com/t/gstreamer-error/2481/12 "2020-04-24T06:25:20Z")

</div>

> [@Steve\_Lambert](#):
>
> did you follow @kingosticks suggestion above?

Yes I’ve set the sysctl setting as the documenation says.

> [@Steve\_Lambert](#):
>
> I haven’t used Rhasspy and have stopped using HA but either of those could maybe interfering with the snapserver.  
> My only suggestion would be to start over again, maybe on a fresh card if you have one, get mopidy and snapserver running then build on from there, I have a feeling that’s what I had to do when I set it up. But it was a couple of years ago and the memory is fading now 🙂  
> I’m afraid I haven’t really got the time until the weekend to look into it and try and offer any more assistance.

Maybe I’ll try that some time. Atm I don’t have a second sd card. Basically I could try this on my ubuntu machine.

In case you have any idea on the weekend I’m happy to try it.

Thanks so far.

EDIT: I forgot to say that Rhassyp as well as HA are running in docker containers. So I don’t think they are interferring with snapcast or mopidy.

---

<div class="post-metadata">

### Author: ![bachschmidmedia](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/bachschmidmedia/32/2239_2.png) [@bachschmidmedia](https://discourse.mopidy.com/u/bachschmidmedia)
#### Post date: [April 27, 2022, 10:15am UTC](https://discourse.mopidy.com/t/gstreamer-error/2481/13 "2022-04-27T10:15:49Z")

</div>

I had the same problem after updating my Pi4 to buster!

I fixed it by changing the ownership of the /tmp/snapfifo file from “snapserver:snapserver” to the “mopidy”-user:

`sudo chown -R mopidy /tmp/snapfifo`

And restart the mopdiy-service as usual  
`sudo systemctl restart mopidy.service`

This fixed it for me!

BTW here is my audio output entry (im using icecast, snapcast-server and client and mopidy [with iris])

```auto
output = tee name=t ! queue ! audioresample ! queue ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! wavenc ! filesink location=/tmp/snapfifo

```

Btw. you can run this command in a second terminal for debugging. This was a big help for me:

```auto
sudo journalctl -u mopidy

```

---

<div class="post-metadata">

### Author: ![Sungod3000](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/sungod3000/32/2306_2.png) [@Sungod3000](https://discourse.mopidy.com/u/Sungod3000)
#### Post date: [November 2, 2022, 12:23am UTC](https://discourse.mopidy.com/t/gstreamer-error/2481/14 "2022-11-02T00:23:44Z")

</div>

> [@bachschmidmedia](#):
>
> sudo systemctl restart mopidy.service

omg! i have been trying to get this working for 5 weeks and your chown command fixed it, so i can hear music from all the clients for the first time. thanks!
