# Mopidy.audio.gst GStreamer error: Could not open audio device for playback

**URL:** <https://discourse.mopidy.com/t/mopidy-audio-gst-gstreamer-error-could-not-open-audio-device-for-playback/4581>\
**Category:** Help and support\
**Created:** [December 21, 2020, 8:46pm UTC](https://discourse.mopidy.com/t/mopidy-audio-gst-gstreamer-error-could-not-open-audio-device-for-playback/4581 "2020-12-21T20:46:07Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![reversedr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/reversedr/32/1748_2.png) [@reversedr](https://discourse.mopidy.com/u/reversedr)\
**Post date:** [December 21, 2020, 8:46pm UTC](https://discourse.mopidy.com/t/mopidy-audio-gst-gstreamer-error-could-not-open-audio-device-for-playback/4581/1 "2020-12-21T20:46:07Z")

</div>

Hello

Need help, cannot play anything.

I got these error on log

dez 21 19:09:34 cubietruck mopidy[10363]: WARNING [Audio-2] mopidy.audio.actor Setting GStreamer state to GST\_STATE\_PLAYING failed  
dez 21 19:09:34 cubietruck mopidy[10363]: ERROR [MainThread] mopidy.audio.gst GStreamer error: Could not open audio device for playback.  
dez 21 19:09:34 cubietruck mopidy[10363]: WARNING [Core-18] mopidy.core.tracklist Track is not playable: local:track:8%20Mile%20Soundtrack/03%20-%20Eminem%20-%208%20Mile%20-%208%20Mile.mp3

Thank you

---

<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:** [December 21, 2020, 9:19pm UTC](https://discourse.mopidy.com/t/mopidy-audio-gst-gstreamer-error-could-not-open-audio-device-for-playback/4581/2 "2020-12-21T21:19:27Z")

</div>

Likely related to running the service as user mopidy which doesn’t have access to the sound device but there’s not enough info given. See [https://docs.mopidy.com/en/latest/troubleshooting/](https://docs.mopidy.com/en/latest/troubleshooting/)

---

<div class="post-metadata">

**Author:** ![reversedr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/reversedr/32/1748_2.png) [@reversedr](https://discourse.mopidy.com/u/reversedr)\
**Post date:** [December 21, 2020, 9:44pm UTC](https://discourse.mopidy.com/t/mopidy-audio-gst-gstreamer-error-could-not-open-audio-device-for-playback/4581/3 "2020-12-21T21:44:36Z")

</div>

here is the output:

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 = alsasink device=hw:1,0  
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.1.96  
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

[youtube]  
enabled = true  
youtube\_api\_key =  
threads\_max = 16  
search\_results = 15  
playlist\_max\_videos = 20  
api\_enabled = false  
autoplay\_enabled = false  
strict\_autoplay = false  
max\_autoplay\_length = 600  
max\_degrees\_of\_separation = 3

[musicbox\_webclient]  
enabled = true  
musicbox = false  
websocket\_host =  
websocket\_port =  
on\_track\_click = PLAY\_ALL

[mixcloud]  
enabled = true  
users = FactionMix

[alarmclock]  
enabled = false ; Extension disabled by user config.

[tunein]  
enabled = true  
timeout = 5000  
filter =

[spotify]  
enabled = true  
username = 1xna49ls11o07j7101hbtrus5  
password = \*\*\*\*\*\*\*\*  
client\_id = efd0a200-04ac-4305-aca1-8bc84bde4f5f  
client\_secret = \*\*\*\*\*\*\*\*  
bitrate = 160  
volume\_normalization = true  
private\_session = false  
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 =

[soundcloud]  
enabled = true  
explore\_songs = 50  
auth\_token = \*\*\*\*\*\*\*\*

[podcast]  
enabled = true  
browse\_root = Podcasts.opml  
browse\_order = desc  
lookup\_order = asc  
cache\_size = 64  
cache\_ttl = 86400  
timeout = 10

[podcast-itunes]  
enabled = true  
base\_url = [http://itunes.apple.com/](http://itunes.apple.com/)  
country = US  
explicit =  
charts = audioPodcasts  
charts\_limit = 20  
search\_limit = 20  
timeout = 10  
retries = 3

[mpris]  
enabled = true  
bus\_type = session

[mpd]  
enabled = true  
hostname = 192.168.1.96  
port = 6600  
password =  
max\_connections = 20  
connection\_timeout = 60  
zeroconf = Mopidy MPD server on $hostname  
command\_blacklist =  
listall  
listallinfo  
default\_playlist\_scheme = m3u

[local]  
enabled = true  
media\_dir = /mnt/5tb/Music  
scan\_timeout = 1000  
scan\_flush\_threshold = 100  
scan\_follow\_symlinks = false  
included\_file\_extensions =  
excluded\_file\_extensions =  
.cue  
.directory  
.html  
.jpeg  
.jpg  
.log  
.nfo  
.pdf  
.png  
.txt  
.zip  
directories =  
Albums local:directory?type=album  
Artists local:directory?type=artist  
Composers local:directory?type=artist&role=composer  
Genres local:directory?type=genre  
Performers local:directory?type=artist&role=performer  
Release Years local:directory?type=date&format=%25Y  
Tracks local:directory?type=track  
Last Week’s Updates local:directory?max-age=604800  
Last Month’s Updates local:directory?max-age=2592000  
timeout = 10  
use\_artist\_sortname = false  
album\_art\_files =  
\*.jpg  
\*.jpeg  
\*.png

[dleyna]  
enabled = true  
upnp\_browse\_limit = 500  
upnp\_lookup\_limit = 20  
upnp\_search\_limit = 100  
dbus\_start\_session = dbus-daemon --fork --session --print-address=1 --print-pid=1

[beets]  
enabled = true  
hostname = 127.0.0.1  
port = 8337

[alsamixer]  
enabled = true  
card = 1  
control = Master  
min\_volume = 0  
max\_volume = 100  
volume\_scale = cubic

---

<div class="post-metadata">

**Author:** ![reversedr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/reversedr/32/1748_2.png) [@reversedr](https://discourse.mopidy.com/u/reversedr)\
**Post date:** [December 21, 2020, 9:45pm UTC](https://discourse.mopidy.com/t/mopidy-audio-gst-gstreamer-error-could-not-open-audio-device-for-playback/4581/4 "2020-12-21T21:45:51Z")

</div>

deps output:

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.8.16-sunxi-armv7l-with-debian-10.6  
Python: CPython 3.7.3 from /usr/lib/python3.7  
Mopidy: 3.0.2 from /usr/local/lib/python3.7/dist-packages  
tornado: 6.0.4 from /usr/local/lib/python3.7/dist-packages  
requests: 2.24.0 from /usr/local/lib/python3.7/dist-packages  
urllib3: 1.25.10 from /usr/local/lib/python3.7/dist-packages  
certifi: 2020.6.20 from /usr/local/lib/python3.7/dist-packages  
idna: 2.10 from /usr/local/lib/python3.7/dist-packages  
chardet: 3.0.4 from /usr/local/lib/python3.7/dist-packages  
setuptools: 50.3.0 from /usr/local/lib/python3.7/dist-packages  
Pykka: 2.0.2 from /usr/local/lib/python3.7/dist-packages  
Mopidy-SoundCloud: 3.0.0 from /usr/lib/python3/dist-packages  
Mopidy-Podcast-iTunes: 3.0.0 from /usr/lib/python3/dist-packages  
Mopidy-MusicBox-Webclient: 3.1.0 from /usr/local/lib/python3.7/dist-packages  
Mopidy: 3.0.2 from /usr/local/lib/python3.7/dist-packages  
setuptools: 50.3.0 from /usr/local/lib/python3.7/dist-packages  
Pykka: 2.0.2 from /usr/local/lib/python3.7/dist-packages  
Mopidy-AlarmClock: 0.1.9 from /usr/local/lib/python3.7/dist-packages  
setuptools: 50.3.0 from /usr/local/lib/python3.7/dist-packages  
Mopidy: 3.0.2 from /usr/local/lib/python3.7/dist-packages  
Pykka: 2.0.2 from /usr/local/lib/python3.7/dist-packages  
monotonic: 1.5 from /usr/local/lib/python3.7/dist-packages  
Mopidy-Spotify: 4.0.1 from /usr/lib/python3/dist-packages  
Mopidy-Mixcloud: 3.1.4 from /usr/local/lib/python3.7/dist-packages  
setuptools: 50.3.0 from /usr/local/lib/python3.7/dist-packages  
Mopidy: 3.0.2 from /usr/local/lib/python3.7/dist-packages  
Pykka: 2.0.2 from /usr/local/lib/python3.7/dist-packages  
Mopidy-ALSAMixer: 2.0.0 from /usr/lib/python3/dist-packages  
Mopidy-MPRIS: 3.0.1 from /usr/lib/python3/dist-packages  
Mopidy-Local: 3.1.1 from /usr/lib/python3/dist-packages  
Mopidy-YouTube: 3.1 from /usr/local/lib/python3.7/dist-packages  
cachetools: 3.1.0 from /usr/lib/python3/dist-packages  
setuptools: 50.3.0 from /usr/local/lib/python3.7/dist-packages  
youtube-dl: 2020.9.20 from /usr/local/lib/python3.7/dist-packages  
beautifulsoup4: 4.9.2 from /usr/local/lib/python3.7/dist-packages  
soupsieve: 2.0.1 from /usr/local/lib/python3.7/dist-packages  
requests: 2.24.0 from /usr/local/lib/python3.7/dist-packages  
urllib3: 1.25.10 from /usr/local/lib/python3.7/dist-packages  
certifi: 2020.6.20 from /usr/local/lib/python3.7/dist-packages  
idna: 2.10 from /usr/local/lib/python3.7/dist-packages  
chardet: 3.0.4 from /usr/local/lib/python3.7/dist-packages  
Mopidy: 3.0.2 from /usr/local/lib/python3.7/dist-packages  
Pykka: 2.0.2 from /usr/local/lib/python3.7/dist-packages  
Mopidy-MPD: 3.0.0 from /usr/lib/python3/dist-packages  
Mopidy-dLeyna: 2.0.0 from /usr/lib/python3/dist-packages  
Mopidy-Beets: 4.0.0 from /usr/lib/python3/dist-packages  
Mopidy-Podcast: 3.0.0 from /usr/lib/python3/dist-packages  
Mopidy-TuneIn: 1.0.0 from /usr/lib/python3/dist-packages  
GStreamer: 1.14.4.0 from /usr/lib/python3/dist-packages/gi  
Detailed information:  
Python wrapper: python-gi 3.30.4  
Relevant elements:  
Found:  
uridecodebin  
souphttpsrc  
appsrc  
alsasink  
osssink  
oss4sink  
id3demux  
id3v2mux  
lamemp3enc  
mpegaudioparse  
mpg123audiodec  
vorbisdec  
vorbisenc  
vorbisparse  
oggdemux  
oggmux  
oggparse  
flacdec  
flacparse  
shout2send  
Not found:  
pulsesink  
flump3dec  
mad

---

<div class="post-metadata">

**Author:** ![reversedr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/reversedr/32/1748_2.png) [@reversedr](https://discourse.mopidy.com/u/reversedr)\
**Post date:** [December 21, 2020, 9:52pm UTC](https://discourse.mopidy.com/t/mopidy-audio-gst-gstreamer-error-could-not-open-audio-device-for-playback/4581/5 "2020-12-21T21:52:01Z")

</div>

> [@kingosticks](#):
>
> Likely related to running the service as user mopidy which doesn’t have access to the sound device

How can i check that ?

Thank You

---

<div class="post-metadata">

**Author:** ![reversedr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/reversedr/32/1748_2.png) [@reversedr](https://discourse.mopidy.com/u/reversedr)\
**Post date:** [December 22, 2020, 10:22am UTC](https://discourse.mopidy.com/t/mopidy-audio-gst-gstreamer-error-could-not-open-audio-device-for-playback/4581/6 "2020-12-22T10:22:34Z")

</div>

Also got these “Failed to attach 2290”

dez 22 10:11:34 cubietruck systemd[1]: Started Mopidy music server.  
dez 22 10:11:34 cubietruck systemd[2290]: Failed to attach 2290 to compat systemd cgroup /system.slice/mopidy.service: No such file or directory

---

<div class="post-metadata">

**Author:** ![sapristi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/sapristi/32/1364_2.png) [@sapristi](https://discourse.mopidy.com/u/sapristi)\
**Post date:** [December 22, 2020, 11:20am UTC](https://discourse.mopidy.com/t/mopidy-audio-gst-gstreamer-error-could-not-open-audio-device-for-playback/4581/7 "2020-12-22T11:20:31Z")

</div>

Make sure the `mopidy` user belongs to the `audio` group ?

---

<div class="post-metadata">

**Author:** ![reversedr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/reversedr/32/1748_2.png) [@reversedr](https://discourse.mopidy.com/u/reversedr)\
**Post date:** [December 22, 2020, 12:06pm UTC](https://discourse.mopidy.com/t/mopidy-audio-gst-gstreamer-error-could-not-open-audio-device-for-playback/4581/8 "2020-12-22T12:06:44Z")

</div>

there is no mopidy user

reversedr@cubietruck:~$ users  
reversedr reversedr

---

<div class="post-metadata">

**Author:** ![reversedr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/reversedr/32/1748_2.png) [@reversedr](https://discourse.mopidy.com/u/reversedr)\
**Post date:** [December 22, 2020, 12:08pm UTC](https://discourse.mopidy.com/t/mopidy-audio-gst-gstreamer-error-could-not-open-audio-device-for-playback/4581/9 "2020-12-22T12:08:13Z")

</div>

reversedr@cubietruck:~$ groups  
reversedr tty disk dialout sudo audio video plugdev games users systemd-journal input netdev ssh bluetooth

groups mopidy  
mopidy : audio video

---

<div class="post-metadata">

**Author:** ![sapristi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/sapristi/32/1364_2.png) [@sapristi](https://discourse.mopidy.com/u/sapristi)\
**Post date:** [December 22, 2020, 4:23pm UTC](https://discourse.mopidy.com/t/mopidy-audio-gst-gstreamer-error-could-not-open-audio-device-for-playback/4581/11 "2020-12-22T16:23:54Z")

</div>

The `users` command only gives you the users with a currently open session (or something like that).  
Since you are running mopidy as a service, and the service seems up, I guess there indeed is a mopidy user.

To check which user the service is running as, you could run `cat /lib/systemd/system/mopidy.service` (if the file does not exist, you could get the service file using `systemctl status mopidy`).

Also, does the `mopidy` have access to the file you are trying to read ?

---

<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:** [December 22, 2020, 4:49pm UTC](https://discourse.mopidy.com/t/mopidy-audio-gst-gstreamer-error-could-not-open-audio-device-for-playback/4581/12 "2020-12-22T16:49:43Z")

</div>

> [@reversedr](#):
>
> How can i check that ?

I don’t know. That’s specific to your hardware and your operating system.

---

<div class="post-metadata">

**Author:** ![reversedr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/reversedr/32/1748_2.png) [@reversedr](https://discourse.mopidy.com/u/reversedr)\
**Post date:** [December 22, 2020, 5:10pm UTC](https://discourse.mopidy.com/t/mopidy-audio-gst-gstreamer-error-could-not-open-audio-device-for-playback/4581/13 "2020-12-22T17:10:14Z")

</div>

Here is the output of “cat /lib/systemd/system/mopidy.service”

reversedr@cubietruck:~$ cat /lib/systemd/system/mopidy.service  
[Unit]  
Description=Mopidy music server  
After=avahi-daemon.service  
After=dbus.service  
After=network.target  
After=nss-lookup.target  
After=pulseaudio.service  
After=remote-fs.target  
After=sound.target

[Service]  
User=mopidy  
PermissionsStartOnly=true  
ExecStartPre=/bin/mkdir -p /var/cache/mopidy  
ExecStartPre=/bin/chown mopidy:audio /var/cache/mopidy  
ExecStart=/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf

[Install]  
WantedBy=multi-user.target

---

<div class="post-metadata">

**Author:** ![reversedr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/reversedr/32/1748_2.png) [@reversedr](https://discourse.mopidy.com/u/reversedr)\
**Post date:** [December 22, 2020, 5:11pm UTC](https://discourse.mopidy.com/t/mopidy-audio-gst-gstreamer-error-could-not-open-audio-device-for-playback/4581/14 "2020-12-22T17:11:13Z")

</div>

Cubietruck with Armbian 20.08.17 Buster with Linux 5.8.16-sunxi

---

<div class="post-metadata">

**Author:** ![reversedr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/reversedr/32/1748_2.png) [@reversedr](https://discourse.mopidy.com/u/reversedr)\
**Post date:** [December 22, 2020, 5:17pm UTC](https://discourse.mopidy.com/t/mopidy-audio-gst-gstreamer-error-could-not-open-audio-device-for-playback/4581/15 "2020-12-22T17:17:02Z")

</div>

> [@sapristi](#):
>
> Also, does the `mopidy` have access to the file you are trying to read ?

What file is that?

And Yes there is a user “mopidy” on the following groups:  
reversedr@cubietruck:~$ sudo groups mopidy  
mopidy : audio video

---

<div class="post-metadata">

**Author:** ![sapristi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/sapristi/32/1364_2.png) [@sapristi](https://discourse.mopidy.com/u/sapristi)\
**Post date:** [December 22, 2020, 6:08pm UTC](https://discourse.mopidy.com/t/mopidy-audio-gst-gstreamer-error-could-not-open-audio-device-for-playback/4581/16 "2020-12-22T18:08:17Z")

</div>

> [@reversedr](#):
>
> What file is that?

8%20Mile%20Soundtrack/03%20-%20Eminem%20-%208%20Mile%20-%208%20Mile.mp3

Since mopidy is ran with user `mopidy`, the music files have to be readable by that user.

But anyway this line:

> [@reversedr](#):
>
> dez 21 19:09:34 cubietruck mopidy[10363]: ERROR [MainThread] mopidy.audio.gst GStreamer error: Could not open audio device for playback.

suggests there’s indeed a problem with gstreamer opening the sound card. Have you tried playing something outside of mopidy ? Also is there any reason you have this line : `output = alsasink device=hw:1,0` in the audio configuration ? Have you tried other values as described here: [Configuration — Mopidy 3.4.2 documentation](https://docs.mopidy.com/en/latest/config/#confval-audio-output)

---

<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:** [December 22, 2020, 8:04pm UTC](https://discourse.mopidy.com/t/mopidy-audio-gst-gstreamer-error-could-not-open-audio-device-for-playback/4581/17 "2020-12-22T20:04:35Z")

</div>

Are you using pulseaudio?

---

<div class="post-metadata">

**Author:** ![reversedr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/reversedr/32/1748_2.png) [@reversedr](https://discourse.mopidy.com/u/reversedr)\
**Post date:** [December 23, 2020, 12:26am UTC](https://discourse.mopidy.com/t/mopidy-audio-gst-gstreamer-error-could-not-open-audio-device-for-playback/4581/18 "2020-12-23T00:26:47Z")

</div>

> [@sapristi](#):
>
> Also is there any reason you have this line : `output = alsasink device=hw:1,0` in the audio configuration ?

You are right! somehow the **card 1:** doesn´t exist anymore! ?

i changed output = alsasink device=hw: **2** ,0 and now its working!

sudo aplay -l  
\*\*\*\* List of PLAYBACK Hardware Devices \*\*\*\*  
card 0: sun4icodec [sun4i-codec], device 0: CDC PCM Codec-0 [CDC PCM Codec-0]  
Subdevices: 1/1  
Subdevice #0: subdevice #0  
card 2: SPDIF [On-board SPDIF], device 0: spdif-dit-hifi dit-hifi-0 [spdif-dit-hifi dit-hifi-0]  
Subdevices: 1/1  
Subdevice #0: subdevice #0

Thanks all of you for your help 😃

---

<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:** [June 23, 2021, 12:26pm UTC](https://discourse.mopidy.com/t/mopidy-audio-gst-gstreamer-error-could-not-open-audio-device-for-playback/4581/19 "2021-06-23T12:26:51Z")

</div>

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