repo-plugins icon indicating copy to clipboard operation
repo-plugins copied to clipboard

Ryujinx game provider addon

Open albfan opened this issue 4 years ago • 16 comments

Description

Game provider for the Ryujinx emulator

  • TODO:

    • Depends on a PR on Ryujinx to list available games https://github.com/Ryujinx/Ryujinx/pull/2131
    • Listen to ESC to end runned game
    • Setup Ryujinx path
    • Run on same screen as kodi (for multimonitor setup)
    • Use bmcplugin.setResolvedUrl isntead for subprocess, right now I get (file cannot be played with any known emulator)
  • Good to have:

    • Integration with "Add game"
    • Integration with gamepad controller (for joycons)

Checklist:

  • [x] My code follows the add-on rules and piracy stance of this project.
  • [x] I have read the CONTRIBUTING document
  • [x] Each add-on submission should be a single commit with using the following style: [plugin.video.foo] v1.0.0

Additional information :

  • Submitting your add-on to this specific branch makes it available to any Kodi version equal or higher than the branch name with the applicable Kodi dependencies limits.
  • add-on development wiki page.
  • Kodi pydocs provide information about the Python API
  • PEP8 codingstyle which is considered best practice but not mandatory.
  • This add-on repository has automated code guideline check which could help you improve your coding. You can find the results of these check at Codacy. You can create your own account as well to continuously monitor your python coding before submitting to repo.
  • Development questions can be asked in the add-on development section on the Kodi forum.
  • If you see no activity on your PR after a week (so at least one weekend has passed) then please go to the #kodi-dev freenode IRC channel to reach out to the team

albfan avatar Mar 24 '21 09:03 albfan

This seems to be an incomplete PR (with TODO's) on the master branch. Please only create complete PR's against the correct target branch: leia or matrix.

basrieter avatar Mar 28 '21 18:03 basrieter

@basrieter thanks. Main TODO is to get custom path for Ryujinx if needed (but Ryujinx should be found on path usually)

I try to set this as draft but looks I have no rights to do it.

Other TODOs are questions for kodi developers:

  • Can I run external emulator with kodi?
  • Can I get the kodi screen in a multimonitor display to start emulator on same screen?
  • Can I listen to escape or exit on Kodi to kill external app?

albfan avatar Mar 29 '21 08:03 albfan

I would suggest you do this in your own repository and create a pull request when it is complete. For your add-on development questions I would redirect you to the Kodi forums.

basrieter avatar Mar 29 '21 17:03 basrieter

Sure

albfan avatar Mar 29 '21 17:03 albfan

https://github.com/Ryujinx/Ryujinx/pull/2310 will help in running emulator headless. Still not sure about stopping it

albfan avatar Oct 11 '21 16:10 albfan

From this info: https://kodi.wiki/view/Releases matrix is the last release 19.09, so rebasing on top of that

albfan avatar Oct 12 '21 10:10 albfan

Refreshing TODO list. Will ask in forums as suggested by @basrieter

TODO: - Depends on a PR on Ryujinx to list available games Integration with kodi Ryujinx/Ryujinx#2131 - Listen to ESC to end runned game - Setup Ryujinx path with config - Run on same screen as kodi (for multimonitor setup) can be defined with config till then - Use bmcplugin.setResolvedUrl isntead for subprocess, right now I get (file cannot be played with any known emulator)

  • Good to have:
    • Integration with "Add game"
    • Integration with gamepad controller (for joycons)

albfan avatar Oct 12 '21 10:10 albfan

Questions posted on forum: https://forum.kodi.tv/showthread.php?tid=364906

albfan avatar Oct 12 '21 10:10 albfan

Please take a look at CI failures, https://github.com/xbmc/repo-plugins/pull/3510/checks?check_run_id=3918149094 The automated checks can figure out a few issues automatically :)

enen92 avatar Oct 17 '21 09:10 enen92

Waiting for the CI

Still pending.

  • How to warn user if settings are not setup? If emulator is not set I prefer something better than error (check log file)
  • I modify emulator to listen to joycon home button (guide button) to launch stop game dialog but I miss be able from kodi to listen to exit on HDMI remote TV control (like it does for a movie) @enen92 @basrieter any ideas? I suppose implement a game emulator addon instead of a program will make that possible

I try something like:

diff --git i/plugin.program.ryujinx/addon.xml w/plugin.program.ryujinx/addon.xml
index 032a45d0c..739335eda 100644
--- i/plugin.program.ryujinx/addon.xml
+++ w/plugin.program.ryujinx/addon.xml
@@ -10,6 +10,17 @@
     <extension point="xbmc.python.pluginsource" library="main.py">
         <provides>executable game</provides>
     </extension>
+    <extension point="kodi.gameclient"
+      library_android="game.moonlight.so"
+      library_linux="game.moonlight.so"
+      library_osx="game.moonlight.dylib"
+      library_windx="game.moonlight.dll"
+      library_wingl="game.moonlight.dll">
+      <platforms></platforms>
+      <extensions>nsp</extensions>
+      <supports_vfs>true</supports_vfs>
+      <supports_no_game>true</supports_no_game>
+    </extension>
     <extension point="xbmc.addon.metadata">
         <summary lang="en_GB">Ryujinx emulator on Kodi</summary>
         <description lang="en_GB">Ryujinx frontend for Kodi.</description>

But cannot run an nsp game that way (did I miss executable path?)

  • Can I ask kodi which monitor is it using in a multimonitor setup?

albfan avatar Oct 22 '21 16:10 albfan

@basrieter @enen92 I map home button of joycons to stop emulation, so if exit from remote tv cannot be used to stop emulation, that is mostly solved.

Wonder if it is possible to use joycons to interact with kodi, I see some documentation https://kodi.wiki/view/HOW-TO:Configure_controllers but not sure how to create a new game controller.

Is it detected by vendor:product?

albfan avatar Oct 23 '21 09:10 albfan

@albfan buttonmaps are out of the scope of python plugins. Never did it myself but I think you have to create a buttonmap for your joycon controller (see https://kodi.wiki/view/HOW-TO:Share_button_maps). There's no way to grab the button control from python plugins. You either map a key to a specific action (using the keymapper add-on) or you create a script instead of a plugin on which you design your own window and listen for actions on the window (https://codedocs.xyz/xbmc/xbmc/group__python__xbmcgui__window__cb.html#ga9ab0edbacfaba93c64c1f2ec6f335884).

enen92 avatar Oct 23 '21 10:10 enen92

To check if settings are filled you can check the value of the setting on the add-on entry point:

my_path = xbmcaddon.Addon().getSetting("myPathsettingId") if not my_path or not xbmcvfs.exists(xbmcvfs.translatePath(my_path): xbmcgui.Dialog.ok("my_addon", "setting not configured") xbmcaddon.Addon().openSettings()

enen92 avatar Oct 23 '21 10:10 enen92

Many thanks!

I will implement those details and fill the README with exact instructions (to install emulator) A fork until integration is merged on Ryujinx

albfan avatar Oct 23 '21 11:10 albfan

so this is dead right?

ezamelczyk avatar Jan 31 '24 17:01 ezamelczyk

No progress so far, yes.

albfan avatar Jan 31 '24 19:01 albfan