# Trying to install mopidy on sailfishos

**URL:** <https://discourse.mopidy.com/t/trying-to-install-mopidy-on-sailfishos/2083>\
**Category:** Misc\
**Created:** [December 3, 2017, 10:23am UTC](https://discourse.mopidy.com/t/trying-to-install-mopidy-on-sailfishos/2083 "2017-12-03T10:23:54Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![wdehoog](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/wdehoog/32/780_2.png) [@wdehoog](https://discourse.mopidy.com/u/wdehoog)\
**Post date:** [December 3, 2017, 10:23am UTC](https://discourse.mopidy.com/t/trying-to-install-mopidy-on-sailfishos/2083/1 "2017-12-03T10:23:54Z")

</div>

Hi,

I am trying to install mopidy on my sailfish phone (oneplus one using a community port).  
I did (as root):  
pip install -U mopidy  
pip install -U gi  
pip install -U Mopidy-MusicBox-Webclient

Also had to install pygobject2 and build python-gst myself. Now mopidy starts, musicbox works, I can browse the list from the somafm extension but when I try to play a stream I get a stack trace:

File “/usr/lib/python2.7/site-packages/mopidy/audio/scan.py”, line 84, in \_setup\_pipeline  
src = Gst.Element.make\_from\_uri(Gst.URIType.SRC, uri)  
TypeError: make\_from\_uri() takes exactly 3 arguments (2 given)

Can anybody point me in a direction to solve this?

---

<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 3, 2017, 11:19am UTC](https://discourse.mopidy.com/t/trying-to-install-mopidy-on-sailfishos/2083/2 "2017-12-03T11:19:38Z")

</div>

If memory serves that’s when the pygst bindings are missing. I think I created a github issue about trying to better detect that error case but I can’t find it right now. If you can find it you may get some hints about where the files are expected to be.

---

<div class="post-metadata">

**Author:** ![wdehoog](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/wdehoog/32/780_2.png) [@wdehoog](https://discourse.mopidy.com/u/wdehoog)\
**Post date:** [December 3, 2017, 12:29pm UTC](https://discourse.mopidy.com/t/trying-to-install-mopidy-on-sailfishos/2083/3 "2017-12-03T12:29:38Z")

</div>

Thanks for your response. I cannot find what you mean. Besides how can those bindings be missing when the trace shows Gst is there only the function is expected to be called differently. But I have to confess I know nothing of python.

---

<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 3, 2017, 2:11pm UTC](https://discourse.mopidy.com/t/trying-to-install-mopidy-on-sailfishos/2083/4 "2017-12-03T14:11:22Z")

</div>

> <https://github.com/mopidy/mopidy/issues/1579>

---

<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 3, 2017, 2:15pm UTC](https://discourse.mopidy.com/t/trying-to-install-mopidy-on-sailfishos/2083/5 "2017-12-03T14:15:18Z")

</div>

I’m not saying it is that, but some gstreamer stuff is missing. Maybe the required elements are compile options and you didn’t specify them? I’m really just guessing.

Edit. Actually it take that back. I’m pretty sure it’s exactly what I said. The 3rd argument is optional, the overrides let you omit that argument when calling from python. Your install is broken.

---

<div class="post-metadata">

**Author:** ![wdehoog](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/wdehoog/32/780_2.png) [@wdehoog](https://discourse.mopidy.com/u/wdehoog)\
**Post date:** [December 3, 2017, 4:01pm UTC](https://discourse.mopidy.com/t/trying-to-install-mopidy-on-sailfishos/2083/6 "2017-12-03T16:01:39Z")

</div>

Yes I am pretty sure the installation is broken. Not mopidy.

I followed your guess and now I suspect the pygobject2 package for sailfishos is for gstreamer-0.10 even though gstreamer-1.0 is used for the rest. Will try to build a newer version.

---

<div class="post-metadata">

**Author:** ![wdehoog](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/wdehoog/32/780_2.png) [@wdehoog](https://discourse.mopidy.com/u/wdehoog)\
**Post date:** [December 3, 2017, 5:04pm UTC](https://discourse.mopidy.com/t/trying-to-install-mopidy-on-sailfishos/2083/7 "2017-12-03T17:04:39Z")

</div>

Newer version of pygobject (3.10.2 -\> 3.15.91) makes mopidy work better.  
Also needed to enable pulseaudio (#configure-pulseaudio).  
Now I have to find out why I still do not get any sound.

---

<div class="post-metadata">

**Author:** ![wdehoog](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/wdehoog/32/780_2.png) [@wdehoog](https://discourse.mopidy.com/u/wdehoog)\
**Post date:** [December 3, 2017, 10:27pm UTC](https://discourse.mopidy.com/t/trying-to-install-mopidy-on-sailfishos/2083/8 "2017-12-03T22:27:06Z")

</div>

mopidy sink was muted.

---

<div class="post-metadata">

**Author:** ![G33kex](https://avatars.discourse-cdn.com/v4/letter/g/bbce88/32.png) [@G33kex](https://discourse.mopidy.com/u/G33kex)\
**Post date:** [February 23, 2018, 10:00am UTC](https://discourse.mopidy.com/t/trying-to-install-mopidy-on-sailfishos/2083/9 "2018-02-23T10:00:55Z")

</div>

Hey ! How did you install pygobject 3.15.91 on sailfish ? I tried to compile it but it does’t find autoconf-archive. I tried to compile autoconf-archive but it fails with " rule to make target `ax_prog_date.texi', needed by`autoconf-archive.info’" (I tried both tar and git version, tar version doesn’t even do anything (Nothing to do for target all-am)

---

<div class="post-metadata">

**Author:** ![wdehoog](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/wdehoog/32/780_2.png) [@wdehoog](https://discourse.mopidy.com/u/wdehoog)\
**Post date:** [February 23, 2018, 10:55am UTC](https://discourse.mopidy.com/t/trying-to-install-mopidy-on-sailfishos/2083/10 "2018-02-23T10:55:09Z")

</div>

I have built it on OBS. See: [https://api.merproject.org/package/show/home:wdehoog/pygobject2](https://api.merproject.org/package/show/home:wdehoog/pygobject2)

Sorry but I do not remember much of what I did then to get things working.

---

<div class="post-metadata">

**Author:** ![G33kex](https://avatars.discourse-cdn.com/v4/letter/g/bbce88/32.png) [@G33kex](https://discourse.mopidy.com/u/G33kex)\
**Post date:** [February 23, 2018, 11:32am UTC](https://discourse.mopidy.com/t/trying-to-install-mopidy-on-sailfishos/2083/11 "2018-02-23T11:32:11Z")

</div>

Wow that worked ! Thank you very much, there even was a pre compiled RPM  
That’s much easier that building it from scratch… I’m always having trouble building packages for Sailfish OS, I didn’t know about the OBS, can you access it directly from a package manager? I’ve tried osc but it seems I would need an account from the Mer Bugzilla, which is closed to new members…

Mopidy is such a great music server, I use ncmpcpp as my main music player on desktops, which I will be able to do on sailfish as well now !

---

<div class="post-metadata">

**Author:** ![G33kex](https://avatars.discourse-cdn.com/v4/letter/g/bbce88/32.png) [@G33kex](https://discourse.mopidy.com/u/G33kex)\
**Post date:** [February 23, 2018, 1:40pm UTC](https://discourse.mopidy.com/t/trying-to-install-mopidy-on-sailfishos/2083/12 "2018-02-23T13:40:28Z")

</div>

Do you remember how you got the audio working with pulseaudio ? I set `output = pulsesink client-name=mopidy` in `[audio]` in `mopidy.conf` but it doesn’t seem to work.

---

<div class="post-metadata">

**Author:** ![wdehoog](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/wdehoog/32/780_2.png) [@wdehoog](https://discourse.mopidy.com/u/wdehoog)\
**Post date:** [February 23, 2018, 2:09pm UTC](https://discourse.mopidy.com/t/trying-to-install-mopidy-on-sailfishos/2083/13 "2018-02-23T14:09:59Z")

</div>

for an OBS account mail the guy mentioned on the bugzilla page or ask on irc #mer, #sailfishos or #sailfishos-porters

---

<div class="post-metadata">

**Author:** ![wdehoog](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/wdehoog/32/780_2.png) [@wdehoog](https://discourse.mopidy.com/u/wdehoog)\
**Post date:** [February 23, 2018, 2:14pm UTC](https://discourse.mopidy.com/t/trying-to-install-mopidy-on-sailfishos/2083/14 "2018-02-23T14:14:23Z")

</div>

I found some notes. I did:

mkdir mopidy/playlists

created /etc/pulse/xpolicy.conf.d/mopidy.conf with  
[stream]  
exe = mopidy  
group = player

and uncommented load-module module-native-protocol-tcp and added auth-ip-acl=127.0.0.1  
to the /etc/pulse/xxx.pa file  
xxx differs by phone. mine was arm\_msm8974\_oneplus-bacon.pa

use ‘pacmd list-sink-inputs’ to see what sink-inputs are active  
use ‘pacmd set-sink-input-mute 8 false’ to unmute one

hope this helps.

---

<div class="post-metadata">

**Author:** ![G33kex](https://avatars.discourse-cdn.com/v4/letter/g/bbce88/32.png) [@G33kex](https://discourse.mopidy.com/u/G33kex)\
**Post date:** [February 23, 2018, 2:49pm UTC](https://discourse.mopidy.com/t/trying-to-install-mopidy-on-sailfishos/2083/15 "2018-02-23T14:49:24Z")

</div>

It works ! Thank you ! I missed the xpolicy file. My pa file was default.pa on Sailfish X and mopidy ended up using Sink 40. Also, mopidy needs to be launched as regular user, not as root or with service file, otherwise it fails with permission error (cannot launch neither mpd or http), if anybody sees this thread and faces the same issue.

---

<div class="post-metadata">

**Author:** ![G33kex](https://avatars.discourse-cdn.com/v4/letter/g/bbce88/32.png) [@G33kex](https://discourse.mopidy.com/u/G33kex)\
**Post date:** [February 23, 2018, 3:21pm UTC](https://discourse.mopidy.com/t/trying-to-install-mopidy-on-sailfishos/2083/16 "2018-02-23T15:21:20Z")

</div>

However, the sink assigned to mopidy seems to be chosen randomly each time I change song, which is quite annoying. I’ll read pulseaudio’s doc to see if I can fix the sink for mopidy. For now I use a dirty workaround : `r i in {1..30}; do echo $i;pacmd set-sink-input-mute $i false; done`

---

<div class="post-metadata">

**Author:** ![wdehoog](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/wdehoog/32/780_2.png) [@wdehoog](https://discourse.mopidy.com/u/wdehoog)\
**Post date:** [February 23, 2018, 7:47pm UTC](https://discourse.mopidy.com/t/trying-to-install-mopidy-on-sailfishos/2083/17 "2018-02-23T19:47:23Z")

</div>

It should be possible to start mopidy using a service file in /etc/systemd/user/ . Maybe something similar to [https://github.com/kimmoli/gesture-daemon/blob/master/config/gestured.service](https://github.com/kimmoli/gesture-daemon/blob/master/config/gestured.service).

This random input-sinks of mopidy are terrible. cutespot from openrepos also does that but it’s version from harbour does not so there is a solution but I have no idea what or how.
