# Mopidy-Touchscreen

**URL:** <https://discourse.mopidy.com/t/mopidy-touchscreen/1499>\
**Category:** Misc\
**Created:** [February 5, 2017, 6:55pm UTC](https://discourse.mopidy.com/t/mopidy-touchscreen/1499 "2017-02-05T18:55:43Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![dcarrco](https://avatars.discourse-cdn.com/v4/letter/d/e5b9ba/32.png) [@dcarrco](https://discourse.mopidy.com/u/dcarrco)\
**Post date:** [February 5, 2017, 6:55pm UTC](https://discourse.mopidy.com/t/mopidy-touchscreen/1499/1 "2017-02-05T18:55:44Z")

</div>

mopidy looks pretty cool. i have used MPD quite a bit and now im trying to get my new raspberry pi 3 with adafruit 2.8" capacitive touch screen working. it has taken me a few days to get things figured out, to get mopidy running and grabbing my local tracks, to get the spotify extension working. i used adafruits easy install image so the touchscreen works and not only do i see console output but the touchscreen test program shows touch inputs working. Mopidy-Touchscreen installed fine and it says its running when i run mopidy (sudo mopidy). i have added root to the audio group and spotify and my local files play fine. unfortunately i dont quite understand how and where i can access the actual touchscreen interface. my pi just shows the INFO lines from mopidy that its running and the extensions are loaded. am i missing something?

---

<div class="post-metadata">

**Author:** ![dcarrco](https://avatars.discourse-cdn.com/v4/letter/d/e5b9ba/32.png) [@dcarrco](https://discourse.mopidy.com/u/dcarrco)\
**Post date:** [February 6, 2017, 7:44pm UTC](https://discourse.mopidy.com/t/mopidy-touchscreen/1499/2 "2017-02-06T19:44:27Z")

</div>

ok. i figured it out. i didnt have the lines needed in the mopidy.conf file:

```
sdl_fbdev = /dev/fb1
sdl_mousdrv = TSLIB
sdl_mousedev = /dev/input/touchscreen

```

once i did that, presto change-o… it worked! i was having problems with the mouse pointer being stuck in the upper left corner. the touchscreen would work, it only registered a click in the upper left corner though. so i followed thse instructions to use the old SDL library [https://learn.adafruit.com/adafruit-2-8-pitft-capacitive-touch/pitft-pygame-tips](https://learn.adafruit.com/adafruit-2-8-pitft-capacitive-touch/pitft-pygame-tips) and that fixed the remaining problems. the only issue i still have is no album art for my local files although it is pulling art for the spotify songs. any ideas? anyone?

---

<div class="post-metadata">

**Author:** ![dcarrco](https://avatars.discourse-cdn.com/v4/letter/d/e5b9ba/32.png) [@dcarrco](https://discourse.mopidy.com/u/dcarrco)\
**Post date:** [February 6, 2017, 8:53pm UTC](https://discourse.mopidy.com/t/mopidy-touchscreen/1499/3 "2017-02-06T20:53:43Z")

</div>

this is what i am getting on my Now Playing screen even after i installed Mopidy-Local-Images (it is playing music right now)

 ![](https://canada1.discourse-cdn.com/flex036/uploads/mopidy/original/1X/8ffda6d64d421fdc704314efecf611656169c1b2.jpg)

---

<div class="post-metadata">

**Author:** ![9and3r](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/9and3r/32/1513_2.png) [@9and3r](https://discourse.mopidy.com/u/9and3r)\
**Post date:** [February 6, 2017, 10:08pm UTC](https://discourse.mopidy.com/t/mopidy-touchscreen/1499/4 "2017-02-06T22:08:55Z")

</div>

That screen should show some controls on the top (Volume, pause…). Probably an error happened and because of that nothing is being shown on that screen. I only use Spotify and I made and tested the code to work with it, so probably some adjustments will need to be made to work with Mopidy-Local-Images.

You can run mopidy using the next commad:  
`sudo mopidy > log.txt 2>&1`  
This will save the output to log.txt. Check for errors on the file or post it here so I can check what is going wrong.

---

<div class="post-metadata">

**Author:** ![dcarrco](https://avatars.discourse-cdn.com/v4/letter/d/e5b9ba/32.png) [@dcarrco](https://discourse.mopidy.com/u/dcarrco)\
**Post date:** [February 6, 2017, 10:18pm UTC](https://discourse.mopidy.com/t/mopidy-touchscreen/1499/5 "2017-02-06T22:18:23Z")

</div>

@9and3r thanks for taking a look and thanks for writing that cool touchscreen plugin. heres the log. i started mopidy, selected local files, selected a file and then pressed the NowPlaying tab and it was red with no title.

INFO Starting Mopidy 2.1.0  
INFO Loading config from builtin defaults  
INFO Loading config from /root/.config/mopidy/mopidy.conf  
INFO Loading config from command line options  
INFO Enabled extensions: spotify, touchscreen, http, file, stream, m3u, mpd, softwaremixer, moped, musicbox\_webclient, local  
INFO Disabled extensions: none  
INFO Starting Mopidy mixer: SoftwareMixer  
INFO Mixer volume set to 80  
INFO Starting Mopidy audio  
INFO Starting Mopidy backends: StreamBackend, M3UBackend, FileBackend, LocalBackend, SpotifyBackend  
INFO Audio output set to "autoaudiosink"  
INFO Loaded 5505 local tracks using json  
INFO Starting Mopidy core  
INFO Logged in to Spotify in offline mode  
INFO Logged in to Spotify in online mode  
INFO Starting Mopidy frontends: TouchScreen, MpdFrontend, HttpFrontend  
ERROR Frontend (MpdFrontend) initialization error: MPD server startup failed: [Errno 98] Address already in use  
INFO HTTP server running at [::ffff:0.0.0.0]:6680  
INFO Starting GLib mainloop  
WARNING GStreamer warning: gst-stream-error-quark: No volume control found (3)  
WARNING GStreamer warning: gst-stream-error-quark: No volume control found (3)  
Traceback (most recent call last):  
File “/usr/local/lib/python2.7/dist-packages/mopidy\_touchscreen/touch\_screen.py”, line 106, in track\_playback\_started  
self.screen\_manager.track\_started(tl\_track)  
File “/usr/local/lib/python2.7/dist-packages/mopidy\_touchscreen/screen\_manager.py”, line 178, in track\_started  
self.screens[main\_screen\_index].track\_started(track.track)  
File “/usr/local/lib/python2.7/dist-packages/mopidy\_touchscreen/screens/main\_screen.py”, line 120, in track\_started  
track.length / 1000))  
TypeError: unsupported operand type(s) for /: ‘NoneType’ and 'int’  
Traceback (most recent call last):  
File “/usr/local/lib/python2.7/dist-packages/mopidy\_touchscreen/touch\_screen.py”, line 106, in track\_playback\_started  
self.screen\_manager.track\_started(tl\_track)  
File “/usr/local/lib/python2.7/dist-packages/mopidy\_touchscreen/screen\_manager.py”, line 178, in track\_started  
self.screens[main\_screen\_index].track\_started(track.track)  
File “/usr/local/lib/python2.7/dist-packages/mopidy\_touchscreen/screens/main\_screen.py”, line 120, in track\_started  
track.length / 1000))  
TypeError: unsupported operand type(s) for /: ‘NoneType’ and 'int’  
Traceback (most recent call last):  
File “/usr/local/lib/python2.7/dist-packages/mopidy\_touchscreen/touch\_screen.py”, line 106, in track\_playback\_started  
self.screen\_manager.track\_started(tl\_track)  
File “/usr/local/lib/python2.7/dist-packages/mopidy\_touchscreen/screen\_manager.py”, line 178, in track\_started  
self.screens[main\_screen\_index].track\_started(track.track)  
File “/usr/local/lib/python2.7/dist-packages/mopidy\_touchscreen/screens/main\_screen.py”, line 120, in track\_started  
track.length / 1000))  
TypeError: unsupported operand type(s) for /: ‘NoneType’ and 'int’  
Traceback (most recent call last):  
File “/usr/local/lib/python2.7/dist-packages/mopidy\_touchscreen/touch\_screen.py”, line 106, in track\_playback\_started  
self.screen\_manager.track\_started(tl\_track)  
File “/usr/local/lib/python2.7/dist-packages/mopidy\_touchscreen/screen\_manager.py”, line 178, in track\_started  
self.screens[main\_screen\_index].track\_started(track.track)  
File “/usr/local/lib/python2.7/dist-packages/mopidy\_touchscreen/screens/main\_screen.py”, line 120, in track\_started  
track.length / 1000))  
TypeError: unsupported operand type(s) for /: ‘NoneType’ and 'int’  
Traceback (most recent call last):  
File “/usr/local/lib/python2.7/dist-packages/mopidy\_touchscreen/touch\_screen.py”, line 106, in track\_playback\_started  
self.screen\_manager.track\_started(tl\_track)  
File “/usr/local/lib/python2.7/dist-packages/mopidy\_touchscreen/screen\_manager.py”, line 178, in track\_started  
self.screens[main\_screen\_index].track\_started(track.track)  
File “/usr/local/lib/python2.7/dist-packages/mopidy\_touchscreen/screens/main\_screen.py”, line 120, in track\_started  
track.length / 1000))  
TypeError: unsupported operand type(s) for /: ‘NoneType’ and 'int’  
INFO GLib mainloop got SIGTERM. Exiting…  
INFO Stopping Mopidy frontends  
INFO Stopping Mopidy core  
INFO Stopping Mopidy backends  
INFO Stopping Mopidy audio  
INFO Stopping Mopidy mixer  
pi@rpi3:~ $

---

<div class="post-metadata">

**Author:** ![9and3r](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/9and3r/32/1513_2.png) [@9and3r](https://discourse.mopidy.com/u/9and3r)\
**Post date:** [February 6, 2017, 10:39pm UTC](https://discourse.mopidy.com/t/mopidy-touchscreen/1499/6 "2017-02-06T22:39:42Z")

</div>

The problem is that the song has no defined duration and because of that mopidy-touchscreen crashes as it expects to get the duration. This error should be already fixed on the development version.  
Install mopidy-touchscreen from [github](https://github.com/9and3r/mopidy-touchscreen) (develop branch) and it should work.

---

<div class="post-metadata">

**Author:** ![dcarrco](https://avatars.discourse-cdn.com/v4/letter/d/e5b9ba/32.png) [@dcarrco](https://discourse.mopidy.com/u/dcarrco)\
**Post date:** [February 6, 2017, 10:57pm UTC](https://discourse.mopidy.com/t/mopidy-touchscreen/1499/7 "2017-02-06T22:57:51Z")

</div>

thank you. i installed with pip install mopidy-touchscreen. how do i install the development version? download the git and copy the script files over the old ones?

---

<div class="post-metadata">

**Author:** ![dcarrco](https://avatars.discourse-cdn.com/v4/letter/d/e5b9ba/32.png) [@dcarrco](https://discourse.mopidy.com/u/dcarrco)\
**Post date:** [February 6, 2017, 11:24pm UTC](https://discourse.mopidy.com/t/mopidy-touchscreen/1499/8 "2017-02-06T23:24:02Z")

</div>

i installed it by running the [setup.py](http://setup.py) in the git package. i am still getting the same error

INFO Starting Mopidy 2.1.0  
INFO Loading config from builtin defaults  
INFO Loading config from /root/.config/mopidy/mopidy.conf  
INFO Loading config from command line options  
INFO Enabled extensions: spotify, touchscreen, http, moped, stream, m3u, mpd, softwaremixer, file, musicbox\_webclient, local  
INFO Disabled extensions: none  
INFO Starting Mopidy mixer: SoftwareMixer  
INFO Mixer volume set to 80  
INFO Starting Mopidy audio  
INFO Starting Mopidy backends: StreamBackend, M3UBackend, FileBackend, LocalBackend, SpotifyBackend  
INFO Audio output set to "autoaudiosink"  
INFO Loaded 5505 local tracks using json  
INFO Starting Mopidy core  
INFO Logged in to Spotify in offline mode  
INFO Logged in to Spotify in online mode  
INFO Starting Mopidy frontends: TouchScreen, MpdFrontend, HttpFrontend  
ERROR Frontend (MpdFrontend) initialization error: MPD server startup failed: [Errno 98] Address already in use  
INFO Starting GLib mainloop  
INFO HTTP server running at [::ffff:0.0.0.0]:6680  
WARNING GStreamer warning: gst-stream-error-quark: No volume control found (3)  
Traceback (most recent call last):  
File “/usr/local/lib/python2.7/dist-packages/Mopidy\_Touchscreen-1.0.0-py2.7.egg/mopidy\_touchscreen/touch\_screen.py”, line 106, in track\_playback\_started  
self.screen\_manager.track\_started(tl\_track)  
File “/usr/local/lib/python2.7/dist-packages/Mopidy\_Touchscreen-1.0.0-py2.7.egg/mopidy\_touchscreen/screen\_manager.py”, line 178, in track\_started  
self.screens[main\_screen\_index].track\_started(track.track)  
File “/usr/local/lib/python2.7/dist-packages/Mopidy\_Touchscreen-1.0.0-py2.7.egg/mopidy\_touchscreen/screens/main\_screen.py”, line 120, in track\_started  
track.length / 1000))  
TypeError: unsupported operand type(s) for /: ‘NoneType’ and 'int’  
INFO GLib mainloop got SIGTERM. Exiting…  
INFO Stopping Mopidy frontends  
INFO Stopping Mopidy core  
INFO Stopping Mopidy backends  
INFO Stopping Mopidy audio  
INFO Stopping Mopidy mixer

---

<div class="post-metadata">

**Author:** ![dcarrco](https://avatars.discourse-cdn.com/v4/letter/d/e5b9ba/32.png) [@dcarrco](https://discourse.mopidy.com/u/dcarrco)\
**Post date:** [February 7, 2017, 1:54am UTC](https://discourse.mopidy.com/t/mopidy-touchscreen/1499/9 "2017-02-07T01:54:36Z")

</div>

EDIT: sorry. i made a mistake and it was the old version i was installing. once i figured out to download the DEVELOP zip and install that one, the error went away. i am still working on getting local images to work from my MP3 files, does your module require the Mopidy-Local-Images to pull images? where does it get the artwork?

---

<div class="post-metadata">

**Author:** ![dcarrco](https://avatars.discourse-cdn.com/v4/letter/d/e5b9ba/32.png) [@dcarrco](https://discourse.mopidy.com/u/dcarrco)\
**Post date:** [February 8, 2017, 7:35pm UTC](https://discourse.mopidy.com/t/mopidy-touchscreen/1499/10 "2017-02-08T19:35:03Z")

</div>

@9and3r hey i have figured something out. if i play local media through a playlist that i created with mpd/mpc:

mpc clear  
mpc -w update  
mpc listall | mpc add  
mpc save allmusic

and then through mopidy i select the playlsit, Mopidy-Touchscreen has the title of the song but says Unknown Artist and Unknown Title and has no playing time. if i play the SAME song through the local media tab, it has playing time and artist and album. i am still NOT seeing album art from local files so my question above is still relevant.

as far as i can tell, the playlist is the only way to play ALL my local music on random. so this is what is holding me back from actually using Mopidy and Mopidy-Spotify and Mopidy-Touchscreen as my main system. any ideas?

---

<div class="post-metadata">

**Author:** ![andrew-james-heard](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/andrew-james-heard/32/806_2.png) [@andrew-james-heard](https://discourse.mopidy.com/u/andrew-james-heard)\
**Post date:** [December 24, 2017, 5:42am UTC](https://discourse.mopidy.com/t/mopidy-touchscreen/1499/11 "2017-12-24T05:42:28Z")

</div>

@9and3r - is Mopidy-Touchscreen working with Raspberry Pi Stretch?  
pip install Mopidy-Touchscreen outputs the following error:

Collecting Mopidy-Touchscreen  
Downloading [https://www.piwheels.hostedpi.com/simple/mopidy-touchscreen/Mopidy\_Touchscreen-1.0.0-py2.py3-none-any.whl](https://www.piwheels.hostedpi.com/simple/mopidy-touchscreen/Mopidy_Touchscreen-1.0.0-py2.py3-none-any.whl)  
Collecting Mopidy\>=1.0 (from Mopidy-Touchscreen)  
Downloading Mopidy-2.1.0-py2.py3-none-any.whl (210kB)  
100% |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 215kB 142kB/s  
Collecting setuptools (from Mopidy-Touchscreen)  
Exception:  
Traceback (most recent call last):  
File “/usr/lib/python2.7/dist-packages/pip/basecommand.py”, line 215, in main  
status = self.run(options, args)  
File “/usr/lib/python2.7/dist-packages/pip/commands/install.py”, line 353, in run  
wb.build(autobuilding=True)  
File “/usr/lib/python2.7/dist-packages/pip/wheel.py”, line 749, in build  
self.requirement\_set.prepare\_files(self.finder)  
File “/usr/lib/python2.7/dist-packages/pip/req/req\_set.py”, line 380, in prepare\_files  
ignore\_dependencies=self.ignore\_dependencies))  
File “/usr/lib/python2.7/dist-packages/pip/req/req\_set.py”, line 554, in \_prepare\_file  
require\_hashes  
File “/usr/lib/python2.7/dist-packages/pip/req/req\_install.py”, line 278, in populate\_link  
self.link = finder.find\_requirement(self, upgrade)  
File “/usr/lib/python2.7/dist-packages/pip/index.py”, line 465, in find\_requirement  
all\_candidates = self.find\_all\_candidates([req.name](http://req.name))  
File “/usr/lib/python2.7/dist-packages/pip/index.py”, line 423, in find\_all\_candidates  
for page in self.\_get\_pages(url\_locations, project\_name):  
File “/usr/lib/python2.7/dist-packages/pip/index.py”, line 568, in \_get\_pages  
page = self.\_get\_page(location)  
File “/usr/lib/python2.7/dist-packages/pip/index.py”, line 683, in \_get\_page  
return HTMLPage.get\_page(link, session=self.session)  
File “/usr/lib/python2.7/dist-packages/pip/index.py”, line 792, in get\_page  
"Cache-Control": “max-age=600”,  
File “/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py”, line 501, in get  
return self.request(‘GET’, url, \*\*kwargs)  
File “/usr/lib/python2.7/dist-packages/pip/download.py”, line 386, in request  
return super(PipSession, self).request(method, url, \*args, \*\*kwargs)  
File “/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py”, line 488, in request  
resp = self.send(prep, \*\*send\_kwargs)  
File “/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py”, line 609, in send  
r = adapter.send(request, \*\*kwargs)  
File “/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py”, line 47, in send  
resp = super(CacheControlAdapter, self).send(request, \*\*kw)  
File “/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py”, line 423, in send  
timeout=timeout  
File “/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py”, line 643, in urlopen  
\_stacktrace=sys.exc\_info()[2])  
File “/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/retry.py”, line 315, in increment  
total -= 1  
TypeError: unsupported operand type(s) for -=: ‘Retry’ and ‘int’
