9and3r / mopidy-touchscreen Goto Github PK
View Code? Open in Web Editor NEWExtension for displaying track info and controlling Mopidy from a touch screen using PyGame/SDL
License: Apache License 2.0
Extension for displaying track info and controlling Mopidy from a touch screen using PyGame/SDL
License: Apache License 2.0
Using last Pi MusicBox version (0.6.0), after installing mopidy-touchscreen (via 'pip install Mopidy-Touchscreen') disables web interface so I can't control mopidy via http.
Hi folks,
im running touchscreen on Arch Linux 4.0.7-v7+ on a Raspberry Pi 2 rev. B together with a Spotpear 3.5" display.
Everything works fine except the cursor, it bounces around all the time as soon as the touchscreen is touched, even though the finger is not moved. The given positions seem not to correlate to the touched position in any way.
sdl_fbdev = /dev/fb1
sdl_mousdrv = TSLIB
sdl_mousedev = /dev/input/event0
sdl_audiodriver = none
sdl_path_dsp = /dev/null
Any other ideas? I'm thankful for every hint!
Cheer
Claude
An error is being thrown when I play an internet radio station via the tunein plugin or a url. I think it's because there's no track length for the stream.
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'
Mopidy-Touchscreen is using the internal function mopidy.utils.process.exit_process()
in two places:
As this method is internal and not supposed to be used by Mopidy extensions, I recommend using other means for stopping Mopidy, similar to your methods for shutting down the device with os.system()
.
If mopidy/mopidy#1173 is merged, Mopidy-Touchscreen will break with Mopidy 1.1.
OK, so I have a flip clock screensaver on the pi. I love it. But unfortunately when Fullscreen is enabled in Mopidy-Touchscreen it won't activate. Mopidy-Touchscreen overdraws it. Xscreensaver runs behind it.
When Fullscreen is disabled the screensaver works but every time I reboot the pi or turn it off I need to run Maximus and resize the window to give it the Fullscreen look.
Are there any solutions to this?
Hello,
I have a raspberry with a touchscreen.
When i put the cursor option at false, I can't click on all screen.
Just the first and the last is be triggered.
Thanks for your work.
If you set mopidy to run as root, you will get a warning in mopidy saying
"you are using the SDL disk writer audio driver", and the file sdlaudio.raw
is created in /var/log/mopidy.
root have to be added to the audio group for mopidy to work properly.
sudo usermod -a -G audio root
this is on raspbian.
Please,
In my Raspberry as Mopidy-Touchscreen not enter in fullscreen mode.
He stays in one small part of the display and my the touchscreen don't work perfecty.
I'm using eGalax and display 7" with touchscreen.
I configured [touchscreen] variables in the mopidy.conf and the resolution I put value 800x480 (what is the real display size) and the fullscreen variable with "True".
Thanks!
I configured and tested my raspberry pi to use the following BCM ports for following button presses:
Up = 5
Down = 27
Left = 21
Right = 20
ENTER = 23
all the buttons are tested and working fine.
but the menu on the display always goes right only.
I added some debug info to gpio_inpput_manager.py and I found out following:
pushing left button triggers the left function
pushing right button triggers right function
pushing down button triggers right function
pushing up button triggers up function
pushing enter button triggers right function
for the 2 in bold above, there is a issue with what gets triggered.
but in any case, the menu does not do what the function stated eather.
can you help me?
I'm running mopidy 2.2.1 with the mopidy-touchscreen version 1.0.0
running on python 2.7
I runnning with a 3.5 inch TFT from kedei.
It not able to show the mopidy-touchscreen when i start my pi 3.
But there is no problem if i run it from menu.
I tested put both .config/mopidy/mopidy.conf and also put at /etc/mopidy/mopidy.conf
no luck.
also try Change DAEMON_USER=mopidy to DAEMON_USER=root.
also no luck.
https://www.raspberrypi.org/forums/viewtopic.php?f=44&t=124961
Please help. or give some guide where I should search for.
Hi, running this ons macOS sierra (10.12.40) i get the following error after starting mopidy:
WARNING: You are using the SDL disk writer audio driver!
Writing to file [sdlaudio.raw].
INFO Starting GLib mainloop2017-03-31 15:05:48.875 Python[19365:10354745] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'nextEventMatchingMask should only be called from the Main Thread!'
Trying to use on Raspian with the latest Mopidy and your package. Even with the proper touchscreen settings for the shield, I get:
2015-11-17 08:50:59,574 ERROR [17135:MainThread] mopidy.commands: Frontend (TouchScreen) initialization error: Error on display init:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/mopidy_touchscreen/touch_screen.py", line 72, in get_display_surface
self.screen = pygame.display.set_mode(size, pygame.FULLSCREEN)
error: Unable to open a console terminal
Mopidy 1.0 release is right around the corner. We've changed some of the Core API to prepare for future changes, like gapless playback.
It looks like Mopidy-Touchscreen use core.playback.change_track()
at https://github.com/9and3r/mopidy-touchscreen/blob/master/mopidy_touchscreen/tracklist.py#L35, which is no longer public. I didn't make a pull request as I'm not sure exactly how the extension works and what's the best replacement. One suggestion is simply to use core.playback.play(self.tracks[post])
instead.
When you fix this, please make sure to update the extension's dependency to Mopidy in setup.py
to Mopidy >= 1.0
.
Been scratching my head for two days and ca't get rid of this:
Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/mopidy_touchscreen/screen_manager.py", line 69, in init_manager self.base_size, self, self.fonts), File "/usr/local/lib/python2.7/dist-packages/mopidy_touchscreen/screens/playlist_screen.py", line 18, in __init__ self.playlists_loaded() File "/usr/local/lib/python2.7/dist-packages/mopidy_touchscreen/screens/playlist_screen.py", line 34, in playlists_loaded self.list_view.set_list(self.playlists_strings) File "/usr/local/lib/python2.7/dist-packages/mopidy_touchscreen/graphic_utils/list_view.py", line 49, in set_list self.load_new_item_position(0) File "/usr/local/lib/python2.7/dist-packages/mopidy_touchscreen/graphic_utils/list_view.py", line 69, in load_new_item_position self.pos[1] + self.base_size * z), (width, -1)) File "/usr/local/lib/python2.7/dist-packages/mopidy_touchscreen/graphic_utils/screen_objects.py", line 234, in __init__ background=background, scroll_no_fit=scroll_no_fit) File "/usr/local/lib/python2.7/dist-packages/mopidy_touchscreen/graphic_utils/screen_objects.py", line 95, in __init__ self.box = self.font.render(text, True, self.color) UnicodeError: A Unicode character above '\uFFFF' was found; not supported ERROR Got un-handled exception from TouchScreen Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/mopidy/commands.py", line 237, in _actor_error_handling yield File "/usr/lib/python2.7/dist-packages/mopidy/commands.py", line 411, in start_frontends frontend_class.start(config=config, core=core) File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 94, in start obj = cls(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/mopidy_touchscreen/touch_screen.py", line 50, in __init__ self.resolution_factor) File "/usr/local/lib/python2.7/dist-packages/mopidy_touchscreen/screen_manager.py", line 48, in __init__ self.init_manager(size) File "/usr/local/lib/python2.7/dist-packages/mopidy_touchscreen/screen_manager.py", line 128, in init_manager self.options_changed() File "/usr/local/lib/python2.7/dist-packages/mopidy_touchscreen/screen_manager.py", line 231, in options_changed self.screens[menu_index].options_changed() TypeError: 'NoneType' object has no attribute '__getitem__'
it launches mopidy afterwards, but it's just a black window. Tried setting the user to root in /lib/systemd/system/mopidy.service and the daemon to root in /etc/init.d/mopidy to no avail. I also changed the env var to sdl_audiodriver = none and still can't use it. Any help would be much appreciated.
I got it working :) but touch curser dosnt follow touch - so calibration is bad.
How do I calibrate so touch actualy works ?
has anyone got a solution how to use this extension on musicbox and a pimoroni HyperPixel touchscreen?
Why isn't this being maintained? Is there another version or a de facto one everyone uses and I'm woefully unaware of?
Hi,
I would like to share how I got mopidy to run as a service without root privileges.
First the prerequisites:
Further, I assume you have your touch screen running and bound to /dev/fb1
and your touch input linked to /dev/input/touchscreen
. The first is achieved by adding a line like dtoverlay="your device"
to /boot/config.txt
where "your device"
is chosen from this list and possibly augmented with appropriate parameter settings. For the latter your might have to add another dtoverlay
-line to your /boot/config.txt
, depending on your touch input device. For my device this is not necessary as the touch driver is included in the display driver.
Finally you must link your touch input to /dev/input/touchscreen
and calibrate it as described here. You may omit the creation of the files for setting the environment variables and run sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_calibrate
instead.
You may also send boot log to the touch screen by adding this to the end of the one and only line in /boot/cmdline.txt
: fbcon=map:10
.
What follows now is the actual solution to letting run mopidy as a service without root privileges. I had to try many different approaches and I hope I recall everything that finally led to success correctly. If you encounter a problem in recreating this, give me a shout, maybe I missed something important.
usermod -a -G video mopidy
, usermod -a -G tty mopidy
, usermod -a -G input mopidy
.sudo rm /etc/systemd/system/getty.target.wants/[email protected]
/lib/systemd/system/mopidy.service
in the [Service]
section: StandardInput=tty-fail
StandardOutput=tty
TTYPath=/dev/tty1
/etc/mopidy/mopidy.conf
to your needs. And of course install Mopidy-Touchscreen and configure it as wellsudo systemctl enable mopidy
and sudo reboot
it should run the touch UI on your TFT after startup.Have fun and many thanks to the developers of this great little application.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.