# Issue with GStreamer, music not playing, strange error message

**URL:** <https://discourse.mopidy.com/t/issue-with-gstreamer-music-not-playing-strange-error-message/324>\
**Category:** Misc\
**Created:** [November 14, 2014, 7:00pm UTC](https://discourse.mopidy.com/t/issue-with-gstreamer-music-not-playing-strange-error-message/324 "2014-11-14T19:00:14Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![lumihei](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@lumihei](https://discourse.mopidy.com/u/lumihei)\
**Post date:** [November 14, 2014, 7:00pm UTC](https://discourse.mopidy.com/t/issue-with-gstreamer-music-not-playing-strange-error-message/324/1 "2014-11-14T19:00:15Z")

</div>

Hi,

I am trying to set up a Mopidy Raspberry Pi B v2 with HifiBerry DAC and Touchscreen (Adafruit).  
So far, I already had almost everything working individually, but nothing at the same time. With support from “9and3r” I got his excellent Mopidy-Touchscreen extension running - so this is now perfect. Before, also my Hifiberry worked like a charm - but now not any longer.

What I had to do amongst other things to get the Touchscreen extension running was to run Mopidy as root. I am not sure whether the calls to GStreamer from Mopidy are also run as root - I could well imagine part of the issue might arise from that.

I constantly get the following error now when I try to start a song (from webclient or touchscreen, same issue):

```
2014-11-14 19:36:31,751 ERROR [2478:MainThread] mopidy.audio.actor: GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure. Debug message: gstplaysink.c(1899): gen_audio_chain (): /GstPlayBin2:playbin20/GstPlaySink:playsink0

```

I tried to see whether I can get GStreamer under the console working - both the following commands play a pretty annoying beep through my Hifiberry, so seems working:

```
gst-launch-0.10 audiotestsrc ! audioresample ! autoaudiosink
gst-launch-0.10 audiotestsrc ! audioresample ! alsasink

```

Also mplayer plays perfectly from the console, no issues with that.

When I call gst-launch from the console without commands, I get an error though - not sure this might be an issue:

```
root@musikkiste:~# gst-launch-0.10
ERROR: pipeline could not be constructed: empty pipeline not allowed.

```

System is a Raspbian 2014-09-09 pure, with the rpi-firmware updated through:

```
REPO_URI=https://github.com/notro/rpi-firmware rpi-update

```

I would really appreciate your support - I have no further idea what I could try to get this up and running.  
Thanks for pointing me into probable right directions!

lumihei

* * *

```
> Mopidy Deps output:
root@musikkiste:~# mopidy deps
Platform: Linux-3.12.25+-armv6l-with-debian-7.6
Python: CPython 2.7.3 from /usr/lib/python2.7
Mopidy: 0.19.4 from /usr/lib/python2.7/dist-packages
  Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
  tornado>=2.3: 2.3 from /usr/lib/python2.7/dist-packages
Mopidy-Touchscreen: 0.2.1 from /usr/local/lib/python2.7/dist-packages/Mopidy_Touchscreen-0.2.1-py2.7.egg
  setuptools: 0.6c11 from /usr/lib/python2.7/dist-packages
  Mopidy>=0.18: 0.19.4 from /usr/lib/python2.7/dist-packages
    Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
    tornado>=2.3: 2.3 from /usr/lib/python2.7/dist-packages
  Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
  pygame: 1.9.1release from /usr/lib/python2.7/dist-packages
Mopidy-MusicBox-Webclient: 1.0.3 from /usr/local/lib/python2.7/dist-packages
  setuptools: 0.6c11 from /usr/lib/python2.7/dist-packages
  Mopidy>=0.19: 0.19.4 from /usr/lib/python2.7/dist-packages
    Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
    tornado>=2.3: 2.3 from /usr/lib/python2.7/dist-packages
Mopidy-Dirble: 0.1.1 from /usr/local/lib/python2.7/dist-packages
  setuptools: 0.6c11 from /usr/lib/python2.7/dist-packages
  Mopidy>=0.18: 0.19.4 from /usr/lib/python2.7/dist-packages
    Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
    tornado>=2.3: 2.3 from /usr/lib/python2.7/dist-packages
  Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
  pycountry: 0.14.1 from /usr/lib/python2.7/dist-packages
Mopidy-Youtube: 1.0.1 from /usr/local/lib/python2.7/dist-packages
  setuptools: 0.6c11 from /usr/lib/python2.7/dist-packages
  requests>=2.2.1: 2.4.3 from /usr/local/lib/python2.7/dist-packages
  pafy>=0.3.35: 0.3.64 from /usr/local/lib/python2.7/dist-packages
  Mopidy>=0.18: 0.19.4 from /usr/lib/python2.7/dist-packages
    Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
    tornado>=2.3: 2.3 from /usr/lib/python2.7/dist-packages
  Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
Mopidy-Spotify: 1.2.0 from /usr/local/lib/python2.7/dist-packages
  setuptools: 0.6c11 from /usr/lib/python2.7/dist-packages
  Mopidy>=0.18: 0.19.4 from /usr/lib/python2.7/dist-packages
    Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
    tornado>=2.3: 2.3 from /usr/lib/python2.7/dist-packages
  Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
  pyspotify>=1.9,<1.999: 1.11 from /usr/lib/pymodules/python2.7
GStreamer: 0.10.36.0 from /usr/lib/python2.7/dist-packages/gst-0.10/gst
  Detailed information:
    Python wrapper: gst-python 0.10.22.0
    Relevant elements:
      Found:
        uridecodebin
        souphttpsrc
        appsrc
        alsasink
        osssink
        oss4sink
        id3demux
        id3v2mux
        lame
        mad
        mp3parse
        vorbisdec
        vorbisenc
        vorbisparse
        oggdemux
        oggmux
        oggparse
        flacdec
        flacparse
        shout2send
      Not found:
        pulsesink
        flump3dec
```

---

<div class="post-metadata">

**Author:** ![lumihei](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@lumihei](https://discourse.mopidy.com/u/lumihei)\
**Post date:** [November 14, 2014, 8:14pm UTC](https://discourse.mopidy.com/t/issue-with-gstreamer-music-not-playing-strange-error-message/324/2 "2014-11-14T20:14:04Z")

</div>

PS - sounded similar to this issue – but I checked and I am not trying to run multiple instances or sounds at the same time.

> <https://github.com/mopidy/mopidy/issues/889>
>
> I'm trying to use mopidy with alsa and dmix, in order to have mopidy and shairport share a single sound card.
> My...

---

<div class="post-metadata">

**Author:** ![lumihei](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@lumihei](https://discourse.mopidy.com/u/lumihei)\
**Post date:** [November 14, 2014, 8:15pm UTC](https://discourse.mopidy.com/t/issue-with-gstreamer-music-not-playing-strange-error-message/324/3 "2014-11-14T20:15:31Z")

</div>

PPS.: Issue also sounded a bit like the following, but adding user root to group “music” did not fix my problem.

> [@Playback issue on Raspberry Pi](https://discourse.mopidy.com/t/playback-issue-on-raspberry-pi/151/5):
>
> Using alsasink gave me an annoying continuous beep, and the following output: $ gst-launch-0.10 audiotestsrc ! audioresample ! alsasink Setting pipeline to PAUSED … Pipeline is PREROLLING … Pipeline is PREROLLED … Setting pipeline to PLAYING … New clock: GstAudioSinkClock ^CCaught interrupt – handling interrupt. Interrupt: Stopping pipeline … (gst-launch-0.10:7173): GLib-CRITICAL \*\*: Source ID 17 was not found when attempting to remove it Execution ended after 12273261733 ns. Setti…

---

<div class="post-metadata">

**Author:** ![lumihei](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@lumihei](https://discourse.mopidy.com/u/lumihei)\
**Post date:** [November 16, 2014, 9:43am UTC](https://discourse.mopidy.com/t/issue-with-gstreamer-music-not-playing-strange-error-message/324/4 "2014-11-16T09:43:38Z")

</div>

PPPS.: tried running it again as user “mopidy”, part of group “audio” - still having the same error messages.  
Therefore can’t be related to user “root” running mopidy I believe.

Any ideas?  
Before I start reinstalling it yet again, it would be great to have some other ideas I could try out - yet mine are gone…

---

<div class="post-metadata">

**Author:** ![adamcik](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/adamcik/32/5_2.png) [@adamcik](https://discourse.mopidy.com/u/adamcik)\
**Post date:** [November 16, 2014, 10:12am UTC](https://discourse.mopidy.com/t/issue-with-gstreamer-music-not-playing-strange-error-message/324/5 "2014-11-16T10:12:36Z")

</div>

[https://docs.mopidy.com/en/develop/troubleshooting/#debugging-gstreamer](https://docs.mopidy.com/en/develop/troubleshooting/#debugging-gstreamer) might help, without those low level GStreaner logs there isn’t much anyone can do but guess.

---

<div class="post-metadata">

**Author:** ![lumihei](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@lumihei](https://discourse.mopidy.com/u/lumihei)\
**Post date:** [November 16, 2014, 11:26pm UTC](https://discourse.mopidy.com/t/issue-with-gstreamer-music-not-playing-strange-error-message/324/6 "2014-11-16T23:26:05Z")

</div>

Hi adamcik,

thanks for your support! I did try to get some further debug logs and copied them here. To be honest I don’t know how to read this log - overwhelms me with information.  
I realized some of it is German - not sure if it’s due to locale settings.

BTW - I tried it several times and can reproduce the error, even with a separate fresh Raspbian install by installing or de-installing the extension “Mopidy-Touchscreen”. @9and3r: Might be in correlation with “Mopidy-Musicbox-Webclient” since you seem to use Moped and apparently do not have the issue - or with a newer version of Raspbian - or with the modules I use for HifiBerry (DAC)

Just from reading the log this seems interesting to me - as if I had another resourdce exclusively using the device.

```
alsa pcm_hw.c:1293:snd_pcm_hw_open:e[00m alsalib error: open '/dev/snd/pcmC0D0p' failed (-16): Das GerÃ¤t oder die Ressource ist belegt
0:00:44.863231773 e[332m 3277e[00m 0xe0ac60 e[33;01mWARN e[00m e[00m alsa gstalsasink.c:689:gst_alsasink_open:<alsasink0>e[00m error: Audio-GerÃ¤t konnte nicht zur Wiedergabe geÃ¶ffnet werden. Es wird durch eine andere Anwendung verwendet.
0:00:44.863507768 e[332m 3277e[00m 0xe0ac60 e[33;01mWARN e[00m e[00m alsa gstalsasink.c:689:gst_alsasink_open:<alsasink0>e[00m error: Device 'default' is busy

```

Here the complete log until I killed the mopidy process:

[Logfile from GStreamer according to the link of @adamcik](http://pastebin.com/qAx2Xnhv)

---

<div class="post-metadata">

**Author:** ![lumihei](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@lumihei](https://discourse.mopidy.com/u/lumihei)\
**Post date:** [November 19, 2014, 12:49pm UTC](https://discourse.mopidy.com/t/issue-with-gstreamer-music-not-playing-strange-error-message/324/7 "2014-11-19T12:49:11Z")

</div>

Managed to get it translated into English - had initially set the locales into German.

Here the Logfile - portion I believe is relevant:

```
pygst gstbuffer.override:69:_wrap_gst_buffer_new:^[[00m pyo:0x2e0c050 pyr:1 minio:0xae42b090 minir:1
             alsa pcm_hw.c:1293:snd_pcm_hw_open:^[[00m alsalib error: open '/dev/snd/pcmC0D0p' failed (-16): Device or resource busy
             alsa gstalsasink.c:689:gst_alsasink_open:<alsasink0>^[[00m error: Could not open audio device for playback. Device is being used by another application.
             alsa gstalsasink.c:689:gst_alsasink_open:<alsasink0>^[[00m error: Device 'default' is busy
31;47m GST_ERROR_SYSTEM gstelement.c:1964:gst_element_message_full:<alsasink0>^[[00m posting message: Could not open audio device for playback. Device is being used by another application.
31;47m GST_ERROR_SYSTEM gstelement.c:1987:gst_element_message_full:<alsasink0>^[[00m posted error message: Could not open audio device for playback. Device is being used by another application.
31m GST_STATES gstelement.c:2768:gst_element_change_state:<alsasink0>^[[00m have FAILURE change_state return
            pygst gstbuffer.override:50:_wrap_gst_buffer_new:^[[00m self:0x2db5ec0
            pygst gstbuffer.override:69:_wrap_gst_buffer_new:^[[00m pyo:0x2db5ec0 pyr:1 minio:0xae42b0f8 minir:1
31m GST_STATES gstelement.c:2335:gst_element_abort_state:<alsasink0>^[[00m aborting state from NULL to READY
31m GST_STATES gstbin.c:2542:gst_bin_change_state_func:<bin0>^[[00m child 'alsasink0' failed to go to state 2(READY)
31m GST_STATES gstelement.c:2768:gst_element_change_state:<bin0>^[[00m have FAILURE change_state return
31m GST_STATES gstelement.c:2460:gst_element_continue_state:<alsasink0>^[[00m completed state change to NULL
31m GST_STATES gstbin.c:2526:gst_bin_change_state_func:<bin0>^[[00m child 'alsasink0' changed state to 1(NULL) successfully
31m GST_STATES gstelement.c:2460:gst_element_continue_state:<bin0>^[[00m completed state change to NULL
         playsink gstplaysink.c:1899:gen_audio_chain:<playsink0>^[[00m error: Configured audiosink bin0 is not working.
31;47m GST_ERROR_SYSTEM gstelement.c:1964:gst_element_message_full:<playsink0>^[[00m posting message: Configured audiosink bin0 is not working.
31;47m GST_ERROR_SYSTEM gstelement.c:1987:gst_element_message_full:<playsink0>^[[00m posted error message: Configured audiosink bin0 is not working.

```

Apart from that, I tried to set the alsa sound config file (/etc/asound.conf) to nonblock - mode. That however still does not fix the issue:

```
pcm.!default {
        type hw
        card 0
        nonblock TRUE
    }
    ctl.!default {
        type hw
        card 0
        nonblock TRUE....
    }
```

---

<div class="post-metadata">

**Author:** ![lumihei](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@lumihei](https://discourse.mopidy.com/u/lumihei)\
**Post date:** [November 22, 2014, 8:30am UTC](https://discourse.mopidy.com/t/issue-with-gstreamer-music-not-playing-strange-error-message/324/8 "2014-11-22T08:30:23Z")

</div>

Closed / solved for now.  
Thanks, 9and3r!

> [@Anyone use the Mopidy Touchscreen Front end?](https://discourse.mopidy.com/t/anyone-use-the-mopidy-touchscreen-front-end/327/18):
>
> 9and3r - I love you man! Solved the riddle again for me. Days of work and trying around - finally done. added SDL\_variables in your plugin, same place as the others: os.environ["SDL\_AUDIODRIVER"] = "disk" os.environ["SDL\_PATH\_DSP"] = "/dev/null" Everything working - made my day.

---

<div class="post-metadata">

**Author:** ![adamcik](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/adamcik/32/5_2.png) [@adamcik](https://discourse.mopidy.com/u/adamcik)\
**Post date:** [November 22, 2014, 9:02am UTC](https://discourse.mopidy.com/t/issue-with-gstreamer-music-not-playing-strange-error-message/324/9 "2014-11-22T09:02:37Z")

</div>

Looks like the problem was that SDL/PyGame was also grabbing the audio device, and with the asound config you were using it wasn’t possible for multiple processes to open it at the same time. As shown by the `Audio-GerÃ¤t konnte nicht zur Wiedergabe geÃ¶ffnet werden. Es wird durch eine andere Anwendung verwendet.`

(Just adding this so anyone else that runs into something similar has a bit more of an explanation)
