doc:appunti:software:kodi_addon
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
doc:appunti:software:kodi_addon [2023/05/26 16:07] – [Cannot execute a graphical external program] niccolo | doc:appunti:software:kodi_addon [2023/05/26 17:05] (current) – [How to start an external program from Kodi] niccolo | ||
---|---|---|---|
Line 276: | Line 276: | ||
===== Cannot execute a graphical external program ===== | ===== Cannot execute a graphical external program ===== | ||
- | After many hours of trying and failing, it turned out that **it is not possibile to start an external program** from Kodi and use the **graphic display**; at least it is not possible | + | After many hours of trying and failing, it turned out that **it is not possibile to start an external program** from Kodi and use the **graphic display**; at least it is not possible if Kodi is **running without a full windowing system** (e.g. X11). |
- | FIXME | + | When Kodi is installed on the **Raspberry Pi** using the **RaspiOS** operating system (based on Debian GNU/Linux 11 Bullseye), the program is started by the binary program **%%kodi.bin%%** using the argument **%%--standalone%%**. |
- | | + | **kodi-standalone** on the Raspberry Pi uses the GBM (Generic Buffer Management) windowing system to draw its graphics via the Mesa (an open source implementation of the OpenGL API). Other platforms supported by kodi-standalone are X11 and Wayland. You can see the following line into the **kodi.log**: |
+ | < | ||
+ | INFO < | ||
+ | </ | ||
+ | |||
+ | GBM/KMS only supports one "DRM master" | ||
+ | |||
+ | You can verify if it is possibile to lanuch a simple graphical program like **kmscube** (from the homonymous Debian package). Just execute the command: | ||
+ | |||
+ | <code bash> | ||
+ | # / | ||
+ | kmscube -D / | ||
+ | </ | ||
+ | |||
+ | If Kodi is not running the kmscube runs nicely, but if Kodi is running (you can launch the program using '' | ||
+ | |||
+ | < | ||
+ | failed to set mode: Permission denied | ||
+ | </ | ||
+ | |||
+ | If you use '' | ||
+ | |||
+ | < | ||
+ | ioctl(3, DRM_IOCTL_MODE_SETCRTC, | ||
+ | </ | ||
+ | |||
+ | ==== How to start an external program from Kodi ==== | ||
+ | |||
+ | I tried (but failed) to start a Python graphical program from Kodi. Because there is not an X11 windowing system, I tried **Pygame** with the drivers **directfb**, | ||
+ | |||
+ | To execute an external program from my add-on video plugin, I used the following two methods. The first one just starts an external Python script when the code is executed: | ||
+ | |||
+ | <code python> | ||
+ | # This works only for a Python script. | ||
+ | # Notice " | ||
+ | xbmc.executescript(' | ||
+ | </ | ||
+ | |||
+ | This second method will add a context menu item to the add-on '' | ||
+ | |||
+ | <code python> | ||
+ | # Add a context menu item to the add-on xbmcgui.ListItem object. | ||
+ | # This works only for a Python script. | ||
+ | li.addContextMenuItems([(' | ||
+ | </ | ||
+ | |||
+ | A third method should be the following, but I did not tried it: | ||
+ | |||
+ | <code python> | ||
+ | xbmc.executebuiltin(' | ||
+ | </ | ||
+ | |||
+ | Other non-tested code to execute plugins or scripts: | ||
+ | |||
+ | <code python> | ||
+ | xbmc.executebuiltin(' | ||
+ | xbmc.executebuiltin(' | ||
+ | xbmc.executebuiltin(' | ||
+ | </ | ||
+ | |||
+ | * **[[https:// | ||
+ | * **[[https:// | ||
+ | * **[[https:// | ||
+ | * **[[https:// | ||
+ | * **[[https:// | ||
+ | * **[[https:// | ||
+ | * **[[https:// | ||
+ | * **[[https:// | ||
===== Web References ===== | ===== Web References ===== |
doc/appunti/software/kodi_addon.1685110045.txt.gz · Last modified: 2023/05/26 16:07 by niccolo