Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ryujinx game provider addon #3510

Draft
wants to merge 1 commit into
base: matrix
Choose a base branch
from
Draft

Ryujinx game provider addon #3510

wants to merge 1 commit into from

Conversation

albfan
Copy link

@albfan albfan commented Mar 24, 2021

Description

Game provider for the Ryujinx emulator

  • 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
    • 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:

  • My code follows the add-on rules and piracy stance of this project.
  • I have read the CONTRIBUTING document
  • 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

@basrieter basrieter added the Don't merge PR that should not be merged (yet) label Mar 28, 2021
@basrieter
Copy link
Contributor

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 basrieter self-requested a review March 28, 2021 18:36
@albfan albfan changed the base branch from master to matrix March 29, 2021 08:02
@albfan albfan marked this pull request as draft March 29, 2021 08:04
@albfan
Copy link
Author

albfan commented Mar 29, 2021

@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?

@basrieter
Copy link
Contributor

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.

@albfan
Copy link
Author

albfan commented Mar 29, 2021

Sure

@albfan albfan closed this Mar 29, 2021
@albfan
Copy link
Author

albfan commented Oct 11, 2021

Ryujinx/Ryujinx#2310 will help in running emulator headless. Still not sure about stopping it

@albfan
Copy link
Author

albfan commented Oct 12, 2021

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

@albfan albfan reopened this Oct 12, 2021
@albfan
Copy link
Author

albfan commented Oct 12, 2021

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
Copy link
Author

albfan commented Oct 12, 2021

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

Copy link
Contributor

@basrieter basrieter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You include a bunch of standard files from our repo. Please make sure you rebase before you do a PR.

.github/ISSUE_TEMPLATE/broken_addon.md Outdated Show resolved Hide resolved
.github/ISSUE_TEMPLATE/config.yml Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
PULL_REQUEST_TEMPLATE.md Outdated Show resolved Hide resolved
ISSUE_TEMPLATE.md Outdated Show resolved Hide resolved
.github/ISSUE_TEMPLATE/violating_addon.md Outdated Show resolved Hide resolved
Copy link
Member

@enen92 enen92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments. Thanks for the submission.
I am a big fan of your miraclecast work btw :)

plugin.ryujix/addon.xml Outdated Show resolved Hide resolved
plugin.ryujix/addon.xml Outdated Show resolved Hide resolved
plugin.ryujix/addon.xml Outdated Show resolved Hide resolved
plugin.ryujix/main.py Outdated Show resolved Hide resolved
plugin.ryujix/main.py Outdated Show resolved Hide resolved
plugin.ryujix/main.py Outdated Show resolved Hide resolved
@albfan albfan force-pushed the ryujinx branch 4 times, most recently from 72283bf to 1658b51 Compare October 17, 2021 09:38
@enen92
Copy link
Member

enen92 commented Oct 17, 2021

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 :)

@albfan
Copy link
Author

albfan commented Oct 22, 2021

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 albfan force-pushed the ryujinx branch 2 times, most recently from b015cf3 to dc6817c Compare October 22, 2021 22:51
@albfan
Copy link
Author

albfan commented Oct 23, 2021

@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?

@enen92
Copy link
Member

enen92 commented Oct 23, 2021

@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
Copy link
Member

enen92 commented Oct 23, 2021

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()

@albfan
Copy link
Author

albfan commented Oct 23, 2021

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

@ezamelczyk
Copy link

so this is dead right?

@albfan
Copy link
Author

albfan commented Jan 31, 2024

No progress so far, yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Don't merge PR that should not be merged (yet)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants