Release Gamestarter: Retrogaming add-ons for LibreELEC (RPi/Generic). - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27) +---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151) +---- Thread: Release Gamestarter: Retrogaming add-ons for LibreELEC (RPi/Generic). (/showthread.php?tid=323835) |
RE: Gamestarter: Retrogaming add-ons for LibreELEC (RPi/Generic). - crono141 - 2017-09-04 How is the progress on 0.9.7? Is this release imminent or a few weeks away? Also, if @Wintermute0110 could chime in on the plugin URL info, I'd be very grateful. I'm new to Kodi scripting and available documentation on this specifically is pretty thin. Thanks again everyone. RE: Gamestarter: Retrogaming add-ons for LibreELEC (RPi/Generic). - Wintermute0110 - 2017-09-04 (2017-09-04, 16:41)crono141 Wrote: How is the progress on 0.9.7? Is this release imminent or a few weeks away? Definitely not imminent. I've done a lot of progress but still there is a mayor feature to implement and a lot of polishing to be done (there were changes in the database format to accommodate new features and that always causes some disruptions in the code). You can see the progress in the changelog. (2017-09-04, 16:41)crono141 Wrote: Also, if @Wintermute0110 could chime in on the plugin URL info, I'd be very grateful. I'm new to Kodi scripting and available documentation on this specifically is pretty thin. AEL URLs are not documented yet and still are changing because I discover bugs or things that can be improved.. You can see some examples of the widgets in Estuary AEL MOD in this commit that use some of the URLs. RE: Gamestarter: Retrogaming add-ons for LibreELEC (RPi/Generic). - crono141 - 2017-09-04 (2017-09-04, 17:32)Wintermute0110 Wrote: AEL URLs are not documented yet and still are changing because I discover bugs or things that can be improved.. You can see some examples of the widgets in Estuary AEL MOD in this commit that use some of the URLs. Thanks. Is there a way to get the currently active URL programatically? My plan is to get the current URL at rom launch (so I'll need to make further modifications to the addon.sh script) and write that to my AEL.launch file. Then in my autoexec.py script we'll read from that file the last internal URL, and pass that to the activewindow function to bring us right back to where we were when we launched retroarch. This way, you can change your internal URLs as much as necessary and it won't effect the return script I'm writing. RE: Gamestarter: Retrogaming add-ons for LibreELEC (RPi/Generic). - Wintermute0110 - 2017-09-05 (2017-09-04, 17:44)crono141 Wrote:(2017-09-04, 17:32)Wintermute0110 Wrote: AEL URLs are not documented yet and still are changing because I discover bugs or things that can be improved.. You can see some examples of the widgets in Estuary AEL MOD in this commit that use some of the URLs. I believe ricardo85x has already done a script that does what you want. Have a look at this post. Note that you don't need to modify AEL's Python code anymore, AEL now supports the argument keywords $categoryID$, $launcherID$ and $romID$. Also, I may publish a wrapper launcher script soon in AEL's thread that restores Kodi when the launched application finished myself, based on ricardo85x work and tested by myself. I have discovered that in my setup (Intel NUC + Kodibuntu + Kodi Krypton) Kodi eats a lots of CPU time and the NUC fan is working all the time and I want to shut down Kodi, then launch Retroarch, then restore Kodi. RE: Gamestarter: Retrogaming add-ons for LibreELEC (RPi/Generic). - bite_your_idols - 2017-09-05 (2017-09-05, 09:51)Wintermute0110 Wrote: I believe ricardo85x has already done a script that does what you want. Have a look at this post. Note that you don't need to modify AEL's Python code anymore, AEL now supports the argument keywords $categoryID$, $launcherID$ and $romID$. interesting... I think the magic is in this line: Code: kodi-send --host=127.0.0.1 --port=9777 --action="ActivateWindow(1,plugin://plugin.program.advanced.emulator.launcher/?catID=$categoryID&com=SHOW_ROMS&launID=$launcherID)" I will make some tests... RE: Gamestarter: Retrogaming add-ons for LibreELEC (RPi/Generic). - crono141 - 2017-09-05 (2017-09-05, 10:03)bite_your_idols Wrote:(2017-09-05, 09:51)Wintermute0110 Wrote: I believe ricardo85x has already done a script that does what you want. Have a look at this post. Note that you don't need to modify AEL's Python code anymore, AEL now supports the argument keywords $categoryID$, $launcherID$ and $romID$. I'm not sure I understand how he gets the current categoryID, launcherID, or romID from his script. I'm decent at python scripting, but absolutely awful at bash scripting. RE: Gamestarter: Retrogaming add-ons for LibreELEC (RPi/Generic). - Wintermute0110 - 2017-09-06 (2017-09-05, 14:28)crono141 Wrote:(2017-09-05, 10:03)bite_your_idols Wrote:(2017-09-05, 09:51)Wintermute0110 Wrote: I believe ricardo85x has already done a script that does what you want. Have a look at this post. Note that you don't need to modify AEL's Python code anymore, AEL now supports the argument keywords $categoryID$, $launcherID$ and $romID$. Bash scripting is much easier than Python programming, although Bash syntax is sometimes horrible. Suppose your wrapper script is called run_retroarch.sh. Then (I'm using standard Linux paths, adapt for the distribution of the Pi): Code: Application -> /home/kodi/bin/run_retroarch.sh IDs are MD5 hashes or strings with no spaces and ASCII-only characters, so the quotes "" are not necessary. Regarding the URLs... best thing you can do now it to look at AEL's source code. However, last couple of days I've thinking about the current URL model in AEL. As you know, AEL started of a fork of Advanced Launcher and so it has inherited some of his flaws (also some AL's good things ). For example, the URL to display ROMs in a launcher: Code: plugin://plugin.program.advanced.emulator.launcher/?com=SHOW_ROMS&catID=$categoryID&launID=$launcherID I have realised that the the categoryID is redundant: because all launcher IDs are unique, the categoryID can be easily determined with the launcherID if necessary. Another issue is that now AEL has many different commands. For example: Code: SHOW_ADDON_ROOT -> Renders the addon root window This made sense during development: a new idea came to my mind and then implemented it with a new function. However, now that I started to do some skinning myself (Estuary AEL MOD) then I realised how URLs are used in plugins and discovered that from the skinner point of view is easier to have the less URL commands as possible and introduce the complexity into AEL. For example, it is not neccesary to have two commands SHOW_ROMS and SHOW_VLAUNCHER_ROMS. Instead, a unique command SHOW_ROMS and depending of the launcherID AELs renders ROMs in a launcher, ROMs in Favourites, ROMs in a Virtual Launcher, etc. Yet another issue is that currently I don't know how to preselect an item (ROM) in a ListItem. That is, when returning to Kodi you will return to the Launcher but the ROM you launched will not be selected. I will investigate this and talk with Kodi Core developers about the implementation. RE: Gamestarter: Retrogaming add-ons for LibreELEC (RPi/Generic). - crono141 - 2017-09-07 OK, now I'm having another problem After letting my Pi sit and AEL scan my mame folder (of 56000 files) for 4 days straight (because even though the UI froze up, the log file was still showing activity), I finally had to kill it an reboot. Now though, nothing launches. Here's the relevant portion. 20:01:31.122 T:1373971360 ERROR: AEL INFO : _command_run_rom() Launching ROM in Launcher ... 20:01:31.350 T:1373971360 ERROR: AEL INFO : _command_run_rom() Using Launcher standard arguments 20:01:31.351 T:1373971360 ERROR: AEL INFO : _command_run_rom() Sigle ROM detected (no multidisc) 20:01:31.351 T:1373971360 ERROR: AEL INFO : _command_run_rom() ROMFileName OP "/storage/emulators/roms/Nintendo Game Boy Advance/Roms/Advance Wars (USA) (Rev 1).gba" 20:01:31.351 T:1373971360 ERROR: AEL INFO : _command_run_rom() ROMFileName P "/storage/emulators/roms/Nintendo Game Boy Advance/Roms/Advance Wars (USA) (Rev 1).gba" 20:01:31.352 T:1373971360 ERROR: AEL INFO : _command_run_rom() categoryID 2b494a422afb2474f89a7b693328fe92 20:01:31.352 T:1373971360 ERROR: AEL INFO : _command_run_rom() launcherID c2b7de4d1f1ffc9e7eb09866d79a156e 20:01:31.352 T:1373971360 ERROR: AEL INFO : _command_run_rom() romID 18927807bbbae1f0518ad982e17821b9 20:01:31.353 T:1373971360 ERROR: AEL INFO : _command_run_rom() romfile "/storage/emulators/roms/Nintendo Game Boy Advance/Roms/Advance Wars (USA) (Rev 1).gba" 20:01:31.353 T:1373971360 ERROR: AEL INFO : _command_run_rom() rompath "/storage/emulators/roms/Nintendo Game Boy Advance/Roms" 20:01:31.353 T:1373971360 ERROR: AEL INFO : _command_run_rom() rombase "Advance Wars (USA) (Rev 1).gba" 20:01:31.353 T:1373971360 ERROR: AEL INFO : _command_run_rom() rombasenoext "Advance Wars (USA) (Rev 1)" 20:01:31.353 T:1373971360 ERROR: AEL INFO : _command_run_rom() romtitle "Advance Wars (USA) (Rev 1)" 20:01:31.353 T:1373971360 ERROR: AEL INFO : _command_run_rom() application "/storage/.kodi/addons/game.retroarch/addon.sh" 20:01:31.353 T:1373971360 ERROR: AEL INFO : _command_run_rom() apppath "/storage/.kodi/addons/game.retroarch" 20:01:31.354 T:1373971360 ERROR: AEL INFO : _command_run_rom() romext "gba|zip" 20:01:31.665 T:1373971360 ERROR: AEL INFO : _command_run_rom() raw arguments "mgba "%rom%"" 20:01:31.665 T:1373971360 ERROR: AEL INFO : _command_run_rom() final arguments "mgba "/storage/emulators/roms/Nintendo Game Boy Advance/Roms/Advance Wars (USA) (Rev 1).gba"" 20:01:32.283 T:1373971360 ERROR: AEL INFO : fs_write_Favourites_JSON() File special://profile/addon_data/plugin.program.advanced.emulator.launcher/most_played.json 20:01:32.600 T:1373971360 ERROR: AEL INFO : _command_run_rom() Launcher is not Kodi Retroplayer. 20:01:33.435 T:1373971360 ERROR: AEL ERROR: SingleInstance::__exit__() Unhandled excepcion in protected code 20:01:33.741 T:1373971360 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<-- - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS! Error Type: <type 'exceptions.OSError'> Error Contents: [Errno 2] No such file or directory Traceback (most recent call last): File "/storage/.kodi/addons/plugin.program.advanced.emulator.launcher/addon.py", line 39, in <module> main.Main().run_plugin() File "/storage/.kodi/addons/plugin.program.advanced.emulator.launcher/resources/main.py", line 248, in run_plugin with SingleInstance(): self.run_protected(args) File "/storage/.kodi/addons/plugin.program.advanced.emulator.launcher/resources/main.py", line 339, in run_protected self._command_run_rom(args['catID'][0], args['launID'][0], args['romID'][0]) File "/storage/.kodi/addons/plugin.program.advanced.emulator.launcher/resources/main.py", line 6743, in _command_run_rom self._run_process(application.getPath(), arguments, apppath, romext) File "/storage/.kodi/addons/plugin.program.advanced.emulator.launcher/resources/main.py", line 6845, in _run_process retcode = subprocess.call(exec_list, stdout = f, stderr = subprocess.STDOUT) File "/usr/lib/python2.7/subprocess.py", line 168, in call File "/usr/lib/python2.7/subprocess.py", line 390, in __init__ File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child OSError: [Errno 2] No such file or directory -->End of Python script error report<-- I've verified that the requested core exists. I know there used to be a symlink in the cores folder though that would truncate the "_libretro.so" portion of the command, but I don't see it anymore and I don't know how to recreate it. Chances are I downloaded the full Lakka cores, found out they didn't work, and then purged the whole directory, killing the symlink in the process. And I can't figure out how to recreate it either. LibreELEC:~/.kodi/userdata/addon_data/game.retroarch/cores # ls -l total 9450 -rw-r--r-- 1 root root 2068216 Sep 6 19:59 desmume_libretro.so -rw-r--r-- 1 root root 56900 Sep 6 19:59 emux_gb_libretro.so -rw-r--r-- 1 root root 331704 Sep 6 19:59 fceumm_libretro.so -rw-r--r-- 1 root root 157680 Sep 6 19:59 gambatte_libretro.so -rw-r--r-- 1 root root 2686204 Sep 6 20:00 genesis_plus_gx_libretro.so -rw-r--r-- 1 root root 532492 Sep 6 20:00 mednafen_pce_fast_libretro.so -rw-r--r-- 1 root root 567408 Sep 1 15:19 mgba_libretro.so -rw-r--r-- 1 root root 527488 Sep 6 20:00 pcsx_rearmed_libretro.so -rw-r--r-- 1 root root 1219020 Sep 6 20:00 snes9x2010_libretro.so -rw-r--r-- 1 root root 1431776 Sep 6 19:59 stella_libretro.so -rw-r--r-- 1 root root 91924 Sep 6 19:59 tgbdual_libretro.so Also, I can no longer launch retroarch from the plugin menu. The splash screen shows but the RA interface never appears. The retroarch executable never launches (as shown by a ps -ef | grep retro). However, from SSH I can manually kill kodi and launch the retroarch-RPi executable in the addon folder, and the app launches. Below appears to be the only relevant log entries for this problem. 20:07:57.928 T:1352135584 NOTICE: LoadJpeg: unable to load /storage/.kodi/addons/game.retroarch/fanart.jpg 20:07:58.013 T:1778381728 ERROR: EXCEPTION: XBMC is not playing any file 20:08:03.184 T:1778381728 ERROR: Previous line repeats 51 times. 20:08:03.184 T:1778381728 NOTICE: PLEX.kodimonitor -> No current File, cancel OnPlayBackStart... I've tried updating the plugin, but that doesn't solve the problem. RE: Gamestarter: Retrogaming add-ons for LibreELEC (RPi/Generic). - crono141 - 2017-09-07 Nevermind. I've given up on the project, and I figured out a way to get Advanced Emulator Launcher (AEL) to work with retropie's runcommand.sh. It was quite easy, actually. In AEL, you call this script: #!/bin/bash videomode=$1 sysport=$2 system=$3 rom=$4 kodi-send --host=127.0.0.1 --port=9777 --action='Quit' /opt/retropie/supplementary/runcommand/runcommand.sh $videomode $sysport $system "${rom}" /home/pi/RetroPie/roms/ports/Kodi.sh You need kodi-send and its dependencies installed for this to work. Then in AEL, instead of invoking runcommand.sh, you envoke the above script with the exact same command line parameters as runcommand, only this one quits kodi first before executing the runcommand emulator. I still need to setup the AEL url script, and the then Kodi autoexec.py script to bring you back to AEL once the emulator is done launching. Thanks anyway for all the support in this thread. RE: Gamestarter: Retrogaming add-ons for LibreELEC (RPi/Generic). - Wintermute0110 - 2017-09-07 (2017-09-07, 02:24)crono141 Wrote: OK, now I'm having another problem MAME has about 30,000 machines, including parents and clones. Where do you get 56000 files? Also, AEL can deal with no problems with such a big launcher but you need appropriate settings. Did you use offline or online metadata scraper? Did you use online scraper for artwork? If you use the offline scraper and search for local images scanning 30000 MAME ROMs should take less than 30 minutes. In the ROM scanner most of the time is consumed searching for artwork. Searching for metadata in the offline scraper is already optimised even for big databases like MAME. I'm working in a way of accelerating the scanning speed of artwork for 0.9.7 by using a caches of directory listings. So, to summarise, if you have a full MAME collection I recommend the following settings/procedures: 1) Always use the offline metadata scraper. 2) In "Metadata scan policy" chose "Scrapers". 3) "Ignore Scrapped Titles (use ROM filenames instead)" must be OFF for MAME ROMs. 4) In "Asset scan policy" choose "Local Images" 5) Download all the available MAME artwork from Pleasuredome (about 56 GB including manuals and Software Lists artwork) or Progretto SNAPs. Scraping MAME artwork is very inefficient. Downloading the artwork pack is much more quicker and convenient! Also, you can try Advanced MAME Launcher which is designed specifically for MAME and supports both MAME Machines and Software Lists ROMs (over 100,000 ROMs in total). However, TTBOMK, nobody has used AML so far in the Pi and there could be out of memory problems. If you wish to give AML a try and have any issues please tell me here or in the AML and I will think of a solution. (2017-09-07, 02:24)crono141 Wrote: Here's the relevant portion. AEL gets an OSError from Python subprocess module. Can you enable the debug log in AEL so I can see the whole argument list passed onto subprocess.exec()? RE: Gamestarter: Retrogaming add-ons for LibreELEC (RPi/Generic). - Wintermute0110 - 2017-09-08 @crono141 I realised there could be an issue with launching shell files on Linux. Have a look at this post on AEL's thread for more info. This weekend I will have a look at it. RE: Gamestarter: Retrogaming add-ons for LibreELEC (RPi/Generic). - Wintermute0110 - 2017-09-09 This is a copy of a post in AEL's thread that may be also of interest here. -------------------------------------------- Yesterday I tried to use a wrapper script in Linux (Kodibuntu) and it works well with 0.9.7-alpah. It should work also with 0.9.6 because the Linux launching code is exactly the same. This is the wrapper script: Code: #!/bin/sh An a launcher example of how to use it: Code: <?xml version="1.0" encoding="utf-8" standalone="yes"?> The wrapper script must be place in /home/kodi/bin/run_retroarch.sh and permissions must be 755. Also, for LibreELECT some modifications are required which are commented in the script code. The script checks if Retroarch executable and the core exist. If they don't exist, a warning notification shows up in Kodi. The wrapper script requires the curl command to be installed to use Kodi JSON RPC interface. There are currently a couple of (minor) problems: 1) Kodi cannot be stopped because AEL uses a blocking launcher. I have to kill the process. 2) When Kodi is restarted is complains that the remote interface cannot be inisialised. This could be a side effect of having to use the kill command with Kodi. I'm investigating how to solve those problems. RE: Gamestarter: Retrogaming add-ons for LibreELEC (RPi/Generic). - Wintermute0110 - 2017-09-09 I have created a new version of the script. I have been doing some tests and if the launcher process is non-blocking Kodi can be stopped using the JSON RPC interface. Tomorrow I will add a per-launcher setting to AEL to make processes non-blocking. This is the new version of the script: Code: #!/bin/sh RE: Gamestarter: Retrogaming add-ons for LibreELEC (RPi/Generic). - bite_your_idols - 2017-09-10 Thanks for your work @Wintermute0110 I will try to apply some of those lines to my addon lauccher script. It is a very useful option to get back to AEL when closing emulators instead coming back to kodis home page. RE: Gamestarter: Retrogaming add-ons for LibreELEC (RPi/Generic). - Wintermute0110 - 2017-09-10 @bite_your_idols Your are welcomed. Today I coded some features in 0.9.7-alpha: 1) I have added the non-blocking launcher option and it seems to work well. Note that you don't need that in LibreELEC. 2) I have solved the bug of Kodi complaining "Cannot initialise the remote interface". Now, I close the child (launched) process file descriptors for blocking (default) and non-blocking launchers. Technicalities: the problem was that by default a child process inherits all open file descriptors of the parent process. Some of the file descriptors are open sockets. When Kodi was restarted by the child process (the wrapper scripts) the socket of the web interface was already in use by the wrapper script itself! Now, all file descriptors are closed so when Kodi is restarted the socket is not in use anymore. 3) kodi-send can only send Kodi Actions. In order to do more sofisticated stuff like show notifications the JSON RPC interface must be used. The JSON RPC interface needs the command curl to be installed. It is a pretty basic command and I'm sure LibreELEC must have it but please check (connect via ssh and type curl). 4) If you can test the script and confirm that it works that would be great. A couple of days ago I thought maybe there was a problem launching shell files but now I tested it works OK with Linux Kodibuntu. However, nobody has confirmed it works OK in LibreELEC. 5) If you get crashes in 0.9.7-alpha and use No-Intro/Redump DATs try to refresh the audit. "Edit Launcher", "Audit ROMs/Launcher view modes", "Update NoIntro audit" |