I’m trying to get a small Adafruit 1.5" 128x128 OLED to run as a second display (to show playback details, channel tuned in PVR etc.). I’ve got it running in Raspbian with a stock Pi Foundation kernel (which includes fbtft support) but the OSMC kernel doesn’t seem to include fbtft support? Is there a simple way I can add this?
Yes - current stock Raspbian “2018-06-27-raspbian-stretch” includes it.
A “sudo modprobe fbtft_device name=pioled” works fine with no additional code added. I think there was a change to the way Linux handled video output that meant the fbtft approach was unlikely to be a long-term solution so it was moved to staging?
However it’s still very useful - and because so many portable game solutions use little TFT/OLED screens driven by SPI using fbtft (and fbcpy) I guess the Raspbian team continue to include it?
Sam - it works thanks and the pioled can be enabled with fbtft support at boot.
Unfortunately the add-on I want to use GitHub - vitalogy/script.kodisplay is proving tricky - it requires SDL and pygame. Have got about 98% of the way there but it fails. There is a fault installing pygame but it completes.
13:00:20.580 T:1687155456 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'pygame.error'>
Error Contents: Unable to open a console terminal
Traceback (most recent call last):
File "/home/osmc/.kodi/addons/script.kodisplay/kodisplay.py", line 202, in <module>
File "/home/osmc/.kodi/addons/script.kodisplay/kodisplay.py", line 101, in __init__
error: Unable to open a console terminal
-->End of Python script error report<--
13:00:20.585 T:1925474816 DEBUG: ------ Window Init (DialogNotification.xml) ------
13:00:20.677 T:1687155456 INFO: Python script stopped
It runs fine in stock raspbian - but I’ve hit the limit of my abilities…
Suspect I’ll have to use a second Pi and KodiDisplayInfo to remotely connect instead.
(The aim is to have a neat small OLED or TFT screen that shows Kodi status separate to the main video output. Tuned Live TV channel, File playing etc. Kodisplay is much neater and better implemented than Kodi Display Info, but the latter runs over http whereas the former needs to run on the same box I think)
I wonder if stopping Kodi (sudo systemctl stop mediacenter) lets you start PyGame on the screen from the command line.
I would also check permissions on /dev/fb1. chown osmc:osmc on /dev/fb1 might be all that’s needed for this to work; but it’s unclear if PyGame is trying to open /dev/fb1 (presumably your fbtft display) or trying to open /dev/fb0.
If you run ls -l on /dev/fb0 and /dev/fb1 respectively, there will probably be different permissions.
Do let me know if this is the case. We probably want to adjust our udev rules to handle this properly.
osmc@osmc:~$ python modified_012_text.py
Traceback (most recent call last):
File "modified_012_text.py", line 86, in <module>
File "modified_012_text.py", line 41, in flytext
screen = pygame.display.set_mode((320,240))
pygame.error: Unable to open a console terminal
Ah - stderr isn’t being captured with your command line options - I did something different to capture stderr rather than stdout
FB_OpenKeyboard in SDL_fbevents is called unconditionally during
Framebuffer video initialization. You can see there that most of
the logic to find a keyboard device is guarded by a check that
geteuid() == 0. (I.e. that the user is root.) The only fallback for
when not root is to try to open /dev/tty. If it fails to find a
keyboard device it can use it aborts. I hope that helps back up what
has been gleaned from the strace and maybe gives some clues.