Kodi Community Forum
Beta Advanced Emulator Launcher - Multi-emulator frontend for Kodi - 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: Game Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=291)
+---- Thread: Beta Advanced Emulator Launcher - Multi-emulator frontend for Kodi (/showthread.php?tid=287826)



RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - berlinchair - 2017-08-30

Hi all
I've been trying to get this setup on a S905 box for a few days on and off, and have been having trouble trying to figure out how to get it set up to use retroarch as its default emulator. I can use retroarch to load various ROMs off various systems but have had no success in getting the basic setup of AEL to a point where I can use it.
I gather using Libreelec 8 that I should be setting up my launchers as "ROM launcher (emulator)" as LE8 doesn't yet have the retroplayer stuff incorporated, right?
Anyway, when I try to setup my launcher, it asks to point to the launcher file in the file system, and I can't for the life of me find where I can access the retroarch executable file to point the launcher at.
I am sure I am missing the point here somewhere, if anybody has experience with this sort of setup I'd be grateful of any help.
I should add this is on a Minix U1 box loaded with kszap's LE 8.0.2e build.
Sorry if this seems like an obvious question but I have tried finding answers and can't seem to find anything in this thread or elsewhere that helps me figure it out.
Thanks in advance

Edit - with even further looking around, I found the AEL-asset-library on wintermute's github - anyone have any idea if these xml files should work on a standard Retroarch setup on LibreElec? thx


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - Wintermute0110 - 2017-08-30

(2017-08-30, 10:03)berlinchair Wrote: Hi all
I've been trying to get this setup on a S905 box for a few days on and off, and have been having trouble trying to figure out how to get it set up to use retroarch as its default emulator. I can use retroarch to load various ROMs off various systems but have had no success in getting the basic setup of AEL to a point where I can use it.
I gather using Libreelec 8 that I should be setting up my launchers as "ROM launcher (emulator)" as LE8 doesn't yet have the retroplayer stuff incorporated, right?
Anyway, when I try to setup my launcher, it asks to point to the launcher file in the file system, and I can't for the life of me find where I can access the retroarch executable file to point the launcher at.
I am sure I am missing the point here somewhere, if anybody has experience with this sort of setup I'd be grateful of any help.
I should add this is on a Minix U1 box loaded with kszap's LE 8.0.2e build.
Sorry if this seems like an obvious question but I have tried finding answers and can't seem to find anything in this thread or elsewhere that helps me figure it out.
Thanks in advance

Edit - with even further looking around, I found the AEL-asset-library on wintermute's github - anyone have any idea if these xml files should work on a standard Retroarch setup on LibreElec? thx

OK, don't desperate. We're here to help Laugh

If you can use Retroarch I assume you have installed a Retroarch addon into Libreelect 8 like, for example, JoKeRzBoX. In order to configure a Retroarch launcher you will need these things:

Code:
Application -> path to Retroach executable
Core path -> path to a Retroarch core. You will need it for the Arguments.
ROM path -> path where you ROMs are. You have to create it in a writable directory.
Assets path -> path where you assets are. You have to create it in a writable directory.

Since you call Retroarch this way:

Code:
/home/kodi/bin/retroarch -L /home/kodi/libretro/ppsspp_libretro.so -f -v "$rom$"

In this example of a Sony PSP launcher the Application is /home/kodi/retroarch and the Arguments '/home/kodi/libretro/ppsspp_libretro.so -f -v "$rom$"'. You will need to investigate where the Retroarch Application and the Retroarch Cores are intalled in your system. This depends of the addon you use to install Retroarch on Libreelect.

Next, you will need to find a writable directory to create the ROM path and the Assets path. Both must be different for each launcher. To find a suitable directory check that out on a Libreelect forum or the documentation.

Note that the XML configuration files in the AEL asset library are currently for Linux, Windows and Android. Linux is the operating system with most XML configurations because is the OS I use for development of AEL and also the OS installed in my Kodi box. Recently, bite_your_idols has included XML configurations if you use his Gamestarted addon, but Gamestarter is only available for Raspberry Pi.

LE8 does not have Retroplayer, you will need an external emulator. Also, according to Garbear, Retroplayer in Kodi Leia won't be able to load core BIOSes. This means basically that any core that requires a BIOS cannot be used until Retroplayer is improved (presumably in Kodi M****, we are talking about Feb/Mar 2019 at current development pace).

To configure your launcher you can use AEL launcher setup wizard (context menu "Add new Launcher") or you can create an XML file with the launcher configuration and then impor it in AEL settings, I/O tab. I recommend the latter because you can always edit the XML, make your changes, and reimport again. It's quicker than use AEL's GUI.

Once you have some working XML configurations for Libreelect and Retroarch addon XXXX then you can add them to the AEL asset library so other people can benefit.

I guess this does not answer all you questions but I think it could be a good start.


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - berlinchair - 2017-08-30

Many thanks Wintermute for your detailed reply - glad you are here to help!!!
So I have been digging around via SSH into my LibreElec box, and figured out my problem was that when searching for the executable when trying to run the launcher setup, my box does not show the .kodi hidden directory hence I couldn't find the damn thing!!! So have sorted out where cores lives and where the executable is now.
So I have been fiddling with an xml file and loaded it, which then loads a category (in this case - Atari) in the root menu, then when clicking through this I find one entry - Atari 2600 (Retroarch). Clicking on this gives a message 'launching...' but doesn't seem to do anything.
Trying to figure out where the logs would be for this so I can see what it is actually doing......
Will get back to you when I have had a look!!


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - Wintermute0110 - 2017-08-30

(2017-08-30, 15:06)berlinchair Wrote: Many thanks Wintermute for your detailed reply - glad you are here to help!!!
So I have been digging around via SSH into my LibreElec box, and figured out my problem was that when searching for the executable when trying to run the launcher setup, my box does not show the .kodi hidden directory hence I couldn't find the damn thing!!! So have sorted out where cores lives and where the executable is now.
So I have been fiddling with an xml file and loaded it, which then loads a category (in this case - Atari) in the root menu, then when clicking through this I find one entry - Atari 2600 (Retroarch). Clicking on this gives a message 'launching...' but doesn't seem to do anything.
Trying to figure out where the logs would be for this so I can see what it is actually doing......
Will get back to you when I have had a look!!

There is a setting in Kodi settings like "Show hidden files/directories". Make sure is ON and you will see the .kodi directory in file browse dialogs.

If you have trouble then go to the launcher context menu, "View Launcher", "View last execution output". There you will see the messages Retroarch printed to the console. Normally you do not see this console because the console window is not open but AEL will record it for you. Also, remember that some Retroarch cores require a BIOS to run. I would recommend you start with some BIOSless systems like Mega Drive, Master System, NES and SNES.

Good luck!


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - berlinchair - 2017-08-31

OK, I'm now the proud owner of a working Master System emulator, loaded with a few hundred ROMs.
Interestingly, when loading any of the games I get a situation where the game screen comes up but whenever I press a button on the joypad it tries to return to LibreElec. Essentially can't use any input in the emulator as it tries to use that input for LibreElec. I had a look around the settings but couldn't figure out how to stop it doing this - something in the skin settings or elsewhere?


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - Wintermute0110 - 2017-08-31

(2017-08-31, 15:11)berlinchair Wrote: OK, I'm now the proud owner of a working Master System emulator, loaded with a few hundred ROMs.
Interestingly, when loading any of the games I get a situation where the game screen comes up but whenever I press a button on the joypad it tries to return to LibreElec. Essentially can't use any input in the emulator as it tries to use that input for LibreElec. I had a look around the settings but couldn't figure out how to stop it doing this - something in the skin settings or elsewhere?

It looks LibreELEC is running Kodi in standalone mode without a Window manager. Please do an experiment for me: Go to Kodi settings, System Settings, Display. Can you change the Display Mode from Full Screen to Windowed? If so, when Kodi is a window, can you see a window border and the minimize, maximize and close buttons? If so you are running Kodi within a Window Manager and AEL should work OK. If you don't see the window border and buttons then you are running Kodi in standalone mode and AEL won't work well.


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - mariano198596 - 2017-08-31

Hi, I'm trying to use AEL with rocketluncher when using pc games. It gives me an error when I try to run them using the argument -s "System Name" argument -r "% ROM%" and apparently the error is corrected by turning this option (turn "off" support for .lnk files) but it is of advance luncher and in AEL I do not find it, how it is configured?

pd: sorry for my bad English!


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - berlinchair - 2017-08-31

(2017-08-31, 16:32)Wintermute0110 Wrote: It looks LibreELEC is running Kodi in standalone mode without a Window manager. Please do an experiment for me: Go to Kodi settings, System Settings, Display. Can you change the Display Mode from Full Screen to Windowed? If so, when Kodi is a window, can you see a window border and the minimize, maximize and close buttons? If so you are running Kodi within a Window Manager and AEL should work OK. If you don't see the window border and buttons then you are running Kodi in standalone mode and AEL won't work well.

Unfortunately, nothing in Libreelec settings to change from full screen to windowed Confused
Ah well thanks for all the help, I may have to look for some other option as it seems with my current setup AEL is not going to be happy
Cheers


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - Wintermute0110 - 2017-09-01

(2017-08-31, 21:15)mariano198596 Wrote: Hi, I'm trying to use AEL with rocketluncher when using pc games. It gives me an error when I try to run them using the argument -s "System Name" argument -r "% ROM%" and apparently the error is corrected by turning this option (turn "off" support for .lnk files) but it is of advance luncher and in AEL I do not find it, how it is configured?

pd: sorry for my bad English!

Can you post a debug log when you launch rocket launcher?


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - Wintermute0110 - 2017-09-01

(2017-08-31, 23:08)berlinchair Wrote:
(2017-08-31, 16:32)Wintermute0110 Wrote: It looks LibreELEC is running Kodi in standalone mode without a Window manager. Please do an experiment for me: Go to Kodi settings, System Settings, Display. Can you change the Display Mode from Full Screen to Windowed? If so, when Kodi is a window, can you see a window border and the minimize, maximize and close buttons? If so you are running Kodi within a Window Manager and AEL should work OK. If you don't see the window border and buttons then you are running Kodi in standalone mode and AEL won't work well.

Unfortunately, nothing in Libreelec settings to change from full screen to windowed Confused
Ah well thanks for all the help, I may have to look for some other option as it seems with my current setup AEL is not going to be happy
Cheers

Do not desperate. In Linux there is always a solution, no matter how easy (or difficult). I have been doing some research. LibreELEC runs Kodi in standalone mode using a systemd service named kodi. Also, LibreELEC applies a C++ patch to Kodi core to prevent setting Kodi into a window. This makes sense: Kodi is running in standalone mode without a window manager so turning it into a window will be detrimental.

OK, so your solution is to use a wrapper shell script that turns Kodi off before launching the application, launchs the app, and then turns Kodi ON again. This will have the advantage that Kodi will not run on the background so you will have more CPU time to run the emulator (this is especially important for emulators like Dolphin or Mupen). I have made this wrapper script example looking at the wrapper script from Gamesterter addon:

Code:
#!/bin/sh
#
# Wrapper script to run Retroarch in LibreELEC
#
RETROARCH_EXECUTABLE="/change/this/retroarch"
LIBRETRO_CORES_DIR="/change/this/libretro/"

# --- Stop KODI ---
echo "Stopping Kodi service ..."
systemctl stop kodi

# --- Run retroarch ---
echo "Running Retroarch ..."
$RETROARCH_EXECUTABLE -L $LIBRETRO_CORES_DIR/$1_libretro.so -f -v "$2"

# --- Start KODI ---
echo "Starting Kodi service ..."
systemctl start kodi

Save this code in a file named "run_retroarch.sh". Remember this wrapper script must have executable permissions (chmod 755 run_retroarch.sh). Then, to use it in AEL:

Code:
Application: '/directory/run_retroarch.sh'
Arguments: 'core_name "$rom$"'

core_name does not include _libretro.so. For example, picodrive_libretro.so becomes picodrive. If you want to launch applications other than Retroarch you will need to create wrapper scripts on the same fashion.

Good luck!


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - mariano198596 - 2017-09-01

(2017-09-01, 12:30)Wintermute0110 Wrote:
(2017-08-31, 21:15)mariano198596 Wrote: Hi, I'm trying to use AEL with rocketluncher when using pc games. It gives me an error when I try to run them using the argument -s "System Name" argument -r "% ROM%" and apparently the error is corrected by turning this option (turn "off" support for .lnk files) but it is of advance luncher and in AEL I do not find it, how it is configured?

pd: sorry for my bad English!

Can you post a debug log when you launch rocket launcher?



Thanks for answering, Now I can not upload the log I am at work, if I in the options of luncher sack the option of the extension and I put ln instead of lnk the game runs correctly with rocketluncher per I can not add new rom

This probe in advance luncher and when I remove that option (turn "off" support for .lnk files) and it works correctly


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - Wintermute0110 - 2017-09-01

(2017-09-01, 14:32)mariano198596 Wrote:
(2017-09-01, 12:30)Wintermute0110 Wrote:
(2017-08-31, 21:15)mariano198596 Wrote: Hi, I'm trying to use AEL with rocketluncher when using pc games. It gives me an error when I try to run them using the argument -s "System Name" argument -r "% ROM%" and apparently the error is corrected by turning this option (turn "off" support for .lnk files) but it is of advance luncher and in AEL I do not find it, how it is configured?

pd: sorry for my bad English!

Can you post a debug log when you launch rocket launcher?

Thanks for answering, Now I can not upload the log I am at work, if I in the options of luncher sack the option of the extension and I put ln instead of lnk the game runs correctly with rocketluncher per I can not add new rom

This probe in advance luncher and when I remove that option (turn "off" support for .lnk files) and it works correctly

Still I do not understand how you configure your setup. My current understanding is that you set your launcher as:

Code:
Application -> 'd:\path\to\rocketlauncher.exe'
Arguments   -> '-s "System Name" -r "$rom$"'

In that launcher, your "ROMs" are LNK files? If so, out of curiosity, why do you need Rocketlauncher? Why you don't use just AEL to launch the LNK files?


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - mariano198596 - 2017-09-01

(2017-09-01, 15:04)Wintermute0110 Wrote:
(2017-09-01, 14:32)mariano198596 Wrote:
(2017-09-01, 12:30)Wintermute0110 Wrote: Can you post a debug log when you launch rocket launcher?

Thanks for answering, Now I can not upload the log I am at work, if I in the options of luncher sack the option of the extension and I put ln instead of lnk the game runs correctly with rocketluncher per I can not add new rom

This probe in advance luncher and when I remove that option (turn "off" support for .lnk files) and it works correctly

Still I do not understand how you configure your setup. My current understanding is that you set your launcher as:

Code:
Application -> 'd:\path\to\rocketlauncher.exe'
Arguments   -> '-s "System Name" -r "$rom$"'

In that launcher, your "ROMs" are LNK files? If so, out of curiosity, why do you need Rocketlauncher? Why you don't use just AEL to launch the LNK files?


If that is how I say it, I have it configured that way.
When configuring it with rocketluncher between that I run the game and the game appears the load custom screen without seeing if the window is opened or anything and it is type console is a matter of taste nothing more sorry for the inconvenience only I think it looks better Blush


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - Wintermute0110 - 2017-09-01

(2017-09-01, 16:25)mariano198596 Wrote: If that is how I say it, I have it configured that way.
When configuring it with rocketluncher between that I run the game and the game appears the load custom screen without seeing if the window is opened or anything and it is type console is a matter of taste nothing more sorry for the inconvenience only I think it looks better Blush

OK, I see. I have been checking old good Advanced Launcher code and now I remember there was a Launcher option "Shortcuts (.lnk) support". Instead of a Launcher option like AL I will add a global option like "Disable LNK $rom$ launching". This option is likely to be used only by people who use RocketLauncher and if you use RocketLauncher to launch LNK files then you use for all LNK launchers or for no one.

It's going to take some time, this is a low-priority feature. In the mean time, if you want to use AEL do not use RocketLauncher. You can create an additional LNK launcher and point the ROM path to the directory where you have your LNK "ROMs". It's perfectly OK to have 2 or more launchers pointing to the same ROM directory.


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - berlinchair - 2017-09-02

(2017-09-01, 12:43)Wintermute0110 Wrote: Do not desperate. In Linux there is always a solution, no matter how easy (or difficult). I have been doing some research. LibreELEC runs Kodi in standalone mode using a systemd service named kodi. Also, LibreELEC applies a C++ patch to Kodi core to prevent setting Kodi into a window. This makes sense: Kodi is running in standalone mode without a window manager so turning it into a window will be detrimental.

OK, so your solution is to use a wrapper shell script that turns Kodi off before launching the application, launchs the app, and then turns Kodi ON again. This will have the advantage that Kodi will not run on the background so you will have more CPU time to run the emulator (this is especially important for emulators like Dolphin or Mupen). I have made this wrapper script example looking at the wrapper script from Gamesterter addon:

Code:
#!/bin/sh
#
# Wrapper script to run Retroarch in LibreELEC
#
RETROARCH_EXECUTABLE="/change/this/retroarch"
LIBRETRO_CORES_DIR="/change/this/libretro/"

# --- Stop KODI ---
echo "Stopping Kodi service ..."
systemctl stop kodi

# --- Run retroarch ---
echo "Running Retroarch ..."
$RETROARCH_EXECUTABLE -L $LIBRETRO_CORES_DIR/$1_libretro.so -f -v "$2"

# --- Start KODI ---
echo "Starting Kodi service ..."
systemctl start kodi

Save this code in a file named "run_retroarch.sh". Remember this wrapper script must have executable permissions (chmod 755 run_retroarch.sh). Then, to use it in AEL:

Code:
Application: '/directory/run_retroarch.sh'
Arguments: 'core_name "$rom$"'

core_name does not include _libretro.so. For example, picodrive_libretro.so becomes picodrive. If you want to launch applications other than Retroarch you will need to create wrapper scripts on the same fashion.

Good luck!

Wintermute, you are da man!!!!! One can never despair when there is such dedicated and knowledgable developers such as yourself.

This looks fantastic, I will look at trying this out some time over the weekend.

Thanks again for all your help with this, I shall report back with results either way.