RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - berlinchair - 2017-09-02
Code: 3773518752 ERROR: AEL INFO : _command_run_rom() Launching ROM in Launcher ...
16:28:04.964 T:3773518752 ERROR: AEL VERB : fs_load_ROMs_JSON() Dir special://profile/addon_data/plugin.program.advanced.emulator.launcher/db_ROMs
16:28:04.964 T:3773518752 ERROR: AEL VERB : fs_load_ROMs_JSON() JSON roms_Emulators_run_retroarch_08cd3a.json
16:28:04.965 T:3773518752 ERROR: AEL INFO : _command_run_rom() Using Launcher standard arguments
16:28:04.965 T:3773518752 ERROR: AEL INFO : _command_run_rom() Sigle ROM detected (no multidisc)
16:28:04.965 T:3773518752 ERROR: AEL INFO : _command_run_rom() ROMFileName OP "/var/media/usb/roms/atari2600/Burgtime.bin"
16:28:04.965 T:3773518752 ERROR: AEL INFO : _command_run_rom() ROMFileName P "/var/media/usb/roms/atari2600/Burgtime.bin"
16:28:04.965 T:3773518752 ERROR: AEL INFO : _command_run_rom() categoryID 1ae0aa83a0374a5e86543f54dfc847f6
16:28:04.965 T:3773518752 ERROR: AEL INFO : _command_run_rom() launcherID 08cd3aac56177ddd4c15917287a3530d
16:28:04.965 T:3773518752 ERROR: AEL INFO : _command_run_rom() romID 151b97aa10c34b0a94692aa50d1ecf50
16:28:04.965 T:3773518752 ERROR: AEL INFO : _command_run_rom() romfile "/var/media/usb/roms/atari2600/Burgtime.bin"
16:28:04.965 T:3773518752 ERROR: AEL INFO : _command_run_rom() rompath "/var/media/usb/roms/atari2600"
16:28:04.965 T:3773518752 ERROR: AEL INFO : _command_run_rom() rombase "Burgtime.bin"
16:28:04.965 T:3773518752 ERROR: AEL INFO : _command_run_rom() rombasenoext "Burgtime"
16:28:04.965 T:3773518752 ERROR: AEL INFO : _command_run_rom() romtitle "Burgtime"
16:28:04.966 T:3773518752 ERROR: AEL INFO : _command_run_rom() application "/storage/.kodi/addons/emulator.tools.retroarch/bin/run_retroarch.sh"
16:28:04.966 T:3773518752 ERROR: AEL INFO : _command_run_rom() apppath "/storage/.kodi/addons/emulator.tools.retroarch/bin"
16:28:04.966 T:3773518752 ERROR: AEL INFO : _command_run_rom() romext "bin|BIN"
16:28:04.966 T:3773518752 ERROR: AEL INFO : _command_run_rom() Escaping ROMFileName ' and "
16:28:04.966 T:3773518752 ERROR: AEL INFO : _command_run_rom() raw arguments "stella "$rom$""
16:28:04.966 T:3773518752 ERROR: AEL INFO : _command_run_rom() final arguments "stella "/var/media/usb/roms/atari2600/Burgtime.bin""
16:28:04.966 T:3773518752 ERROR: AEL VERB : fs_load_Collection_ROMs_JSON() special://profile/addon_data/plugin.program.advanced.emulator.launcher/history.json
16:28:04.971 T:3773518752 ERROR: AEL VERB : fs_write_Collection_ROMs_JSON() File special://profile/addon_data/plugin.program.advanced.emulator.launcher/history.json
16:28:05.027 T:3773518752 ERROR: AEL VERB : fs_load_Favourites_JSON() File special://profile/addon_data/plugin.program.advanced.emulator.launcher/most_played.json
16:28:05.029 T:3773518752 ERROR: AEL INFO : fs_write_Favourites_JSON() File special://profile/addon_data/plugin.program.advanced.emulator.launcher/most_played.json
16:28:05.052 T:3773518752 ERROR: AEL INFO : _command_run_rom() Launcher is not Kodi Retroplayer.
16:28:05.052 T:3773518752 ERROR: AEL VERB : _run_before_execution() media_state_action is "Stop" (0)
16:28:05.052 T:3773518752 ERROR: AEL VERB : _run_before_execution() DO NOT suspend Kodi audio engine
16:28:05.052 T:3773518752 ERROR: AEL VERB : _run_before_execution() Toggling Kodi fullscreen
16:28:05.052 T:3773518752 ERROR: AEL VERB : _run_before_execution() Pausing 100 ms
16:28:05.214 T:3773518752 ERROR: AEL ERROR: SingleInstance::__exit__() Unhandled excepcion in protected code
16:28:05.240 T:3773518752 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<--
16:28:08.616 T:3773518752 ERROR: AEL VERB : fs_load_catfile() Loading special://profile/addon_data/plugin.program.advanced.emulator.launcher/categories.xml
Ok so have created the .sh file as per your instructions, and this is the log that I get with errors as above. From my limited knowledge of the above, it looks like it is throwing script errors? Thanks for your analysis
RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - berlinchair - 2017-09-02
Here is the run_retroarch.sh just to check I haven't stuffed anything up there
Code: #!/bin/sh
#
# Wrapper script to run Retroarch in LibreELEC
#
RETROARCH_EXECUTABLE="/storage/.kodi/addons/emulator.tools.retroarch/bin/retroarch"
LIBRETRO_CORES_DIR="/storage/.kodi/addons/emulator.tools.retroarch/lib/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
RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - Wintermute0110 - 2017-09-02
@berlinchair The error is "OSError: [Errno 2] No such file or directory". AEL cannot launch the file "/storage/.kodi/addons/emulator.tools.retroarch/bin/run_retroarch.sh" because it cannot be found. Please recheck the launcher application with the launcher context menu. The launcher context menu, "View", "View launcher information" shows the raw database entry of the launcher and it's very useful for debug. Also, check that the file has correct permissions.
If you keep having trouble then I will think of another solution.
RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - yevaman44 - 2017-09-03
(2017-08-29, 07:57)Wintermute0110 Wrote: (2017-08-28, 20:39)ibanana Wrote: Hello,
How can I remove the "[Browse Offline Scrapper]" Icon from the Category list?
It's been fixed in Github but ... the development version now is unstable. You will need to upgrade the databases with "Check/upgrade all databases ..." and this is irreversible. If you want to roll back to 0.9.6 you will need to make a backup of PLUGIN_DATA_DIR first.
Hi,
Is there a way to remove it without the new alpha build ? Can you tell me in the xml or code where I can manualy remove it ?
Bye!
RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - Wintermute0110 - 2017-09-03
(2017-09-03, 14:34)yevaman44 Wrote: Hi,
Is there a way to remove it without the new alpha build ? Can you tell me in the xml or code where I can manualy remove it ?
Bye!
Comment out this line of code by placing a # at the beginning.
RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - yevaman44 - 2017-09-03
(2017-09-03, 15:07)Wintermute0110 Wrote: (2017-09-03, 14:34)yevaman44 Wrote: Hi,
Is there a way to remove it without the new alpha build ? Can you tell me in the xml or code where I can manualy remove it ?
Bye!
Comment out this line of code by placing a # at the beginning.
Very Helpful As usual ! Thx man
RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - Wintermute0110 - 2017-09-07
(2017-08-04, 02:55)zachmorris Wrote: (2017-07-31, 01:30)yevaman44 Wrote: Hello,
When I use AEL in Kodi Krypton, the game is launched and I can play but Kodi remains active: my movements with the Gamepad, in game, act on the menu of Kodi !!!
Others games are launched, or movies...
I think thats an issue you can only get around currently by disabling joystick control in Kodi settings. I wanted to attempt to stop the same thing in my addon somehow but wasn't able to find a solution yet.
See here and here.
Zach,
I've doing some research on this. Apparently, the setting "input.enablejoystick" does not exist in Krypton anymore. I think there is no way the joystick can be disabled in Krypton programmatically.
RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - berlinchair - 2017-09-08
That sounds like the issue that I was having with mine.
I have tried a few things to get that .sh file to execute (which stops kodi prior to launching the emulator), but to no avail......... sh just for some reason complains that it can't find the file, no matter which directory I put it in
RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - Wintermute0110 - 2017-09-08
(2017-09-08, 04:42)berlinchair Wrote: That sounds like the issue that I was having with mine.
I have tried a few things to get that .sh file to execute (which stops kodi prior to launching the emulator), but to no avail......... sh just for some reason complains that it can't find the file, no matter which directory I put it in
Hi berlinchair,
Some other guy in the Gamestarter addon thread also is having issues when launching shell scripts in Linux. Since I added the new launching mechanism based on the subprocess module in 0.9.6 I haven't tested launching of shell scripts. In my setup I always launch Retroarch and MAME which are ELF executables (the equivalent to Windows EXEs, in a way of speaking). Tonight I will have a look at this matter.
Also, if you like the technicalities, have a look here regarding the shell argument. Currently, AEL always sets shell = False but maybe for shell scripts in Linux this must be true. If so, I will create a per-launcher setting to enable this flag if I find it must be true for shell launchers.
RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - sagrath - 2017-09-08
Hi @Wintermute0110 !
I wanna to suggest a thing that I think is simple.
Let's say that I have itens in AEL:
Emulators (Category)
Arcades (Launcher)
Pc Games (Launcher)
So, In AEL configurations, we have to appoint some folders: Backups, Categories, Collections, Favorites and Launchers.
I wanna to suggest, if I have a [name of launcher]-fanart.jpg and [name of launcher]-poster.jpg inside Launchers Folder, AEL will display automatically to my desired launcher eg. Arcades. In My case will be arcades-fanart.jpg and arcades-poster.jpg. The same way is to Category: A file [name of category]-fanart.jpg and [name of category]-poster.jpg inside Categories folder wil set automatically to categories that we made.
If we have some collections, these [name of collections]-fanart/poster.jpg will be inside Collections folder.
To stand alone launchers, you can put a extra folder on these configurarions named Stand Alone or use the Launchers folder (an extra folder is most to keep things organized).
NFO's files with meta-data can be placed on the same folders of arts, named [name of launcher].nfo or [name of category].nfo. These way, we keep a bunch of images and nfo's placed on related folders, and save a LOT of work just to assign them to launchers and categories.
cheers!
RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - Wintermute0110 - 2017-09-09
(2017-09-08, 19:39)sagrath Wrote: Hi @Wintermute0110 !
I wanna to suggest a thing that I think is simple.
Let's say that I have itens in AEL:
Emulators (Category)
Arcades (Launcher)
Pc Games (Launcher)
So, In AEL configurations, we have to appoint some folders: Backups, Categories, Collections, Favorites and Launchers.
I wanna to suggest, if I have a [name of launcher]-fanart.jpg and [name of launcher]-poster.jpg inside Launchers Folder, AEL will display automatically to my desired launcher eg. Arcades. In My case will be arcades-fanart.jpg and arcades-poster.jpg. The same way is to Category: A file [name of category]-fanart.jpg and [name of category]-poster.jpg inside Categories folder wil set automatically to categories that we made.
If we have some collections, these [name of collections]-fanart/poster.jpg will be inside Collections folder.
To stand alone launchers, you can put a extra folder on these configurarions named Stand Alone or use the Launchers folder (an extra folder is most to keep things organized).
NFO's files with meta-data can be placed on the same folders of arts, named [name of launcher].nfo or [name of category].nfo. These way, we keep a bunch of images and nfo's placed on related folders, and save a LOT of work just to assign them to launchers and categories.
cheers!
That is exactly what has been implemented for 0.9.7! This is a commented canonical example of a launcher that imports both metadata and artwork. Also, AEL guarantees that exporting and XML configuration and importing it again perfectly restores your setup. It took a lot of time to refurbish the AEL Asset Library and the work is still in progress.
RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - Wintermute0110 - 2017-09-09
(2017-09-08, 10:38)Wintermute0110 Wrote: (2017-09-08, 04:42)berlinchair Wrote: That sounds like the issue that I was having with mine.
I have tried a few things to get that .sh file to execute (which stops kodi prior to launching the emulator), but to no avail......... sh just for some reason complains that it can't find the file, no matter which directory I put it in
Hi berlinchair,
Some other guy in the Gamestarter addon thread also is having issues when launching shell scripts in Linux. Since I added the new launching mechanism based on the subprocess module in 0.9.6 I haven't tested launching of shell scripts. In my setup I always launch Retroarch and MAME which are ELF executables (the equivalent to Windows EXEs, in a way of speaking). Tonight I will have a look at this matter.
Also, if you like the technicalities, have a look here regarding the shell argument. Currently, AEL always sets shell = False but maybe for shell scripts in Linux this must be true. If so, I will create a per-launcher setting to enable this flag if I find it must be true for shell launchers.
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
# Script arguments: core_name "$rom$" $categoryID$ $launcherID$ $romID$
#
RETROARCH="/home/kodi/bin/retroarch"
LIBRETRO_PATH="/home/kodi/bin/libretro/"
LOG_FILE="/home/kodi/bin/run_retroarch.log"
LOG_RETROARCH="/home/kodi/bin/retroarch.log"
kodi_rpc()
{
METHOD="$1"
json_str="{\"jsonrpc\":\"2.0\",\"id\":\"1\",\"method\":\"$METHOD\"}\""
curl -H "Content-type: application/json" -d "$json_str" http://localhost:8080/jsonrpc
}
kodi_rpc_params()
{
METHOD="$1"
PARAMS="$2"
json_str="{\"jsonrpc\":\"2.0\",\"id\":\"1\",\"method\":\"$METHOD\",$PARAMS}\""
curl -H "Content-type: application/json" -d "$json_str" http://localhost:8080/jsonrpc
}
# --- Print some information ---
echo "Retroarch core \"$1\"" > $LOG_FILE
echo "ROM filename \"$2\"" >> $LOG_FILE
echo "Category ID \"$3\"" >> $LOG_FILE
echo "Launcher ID \"$4\"" >> $LOG_FILE
echo "ROM ID \"$5\"" >> $LOG_FILE
echo "PID \"$$\"" >> $LOG_FILE
echo "Parent PID \"$PPID\"" >> $LOG_FILE
# --- Check if libretro core exists ---
core_file="$LIBRETRO_PATH/$1_libretro.so"
if [ ! -f "$core_file" ]; then
PARAMS="\"params\":{\"title\" : \"run_retroarch error\", \"message\":\"Core file not found\"}"
kodi_rpc_params "GUI.ShowNotification" "$PARAMS"
exit 1
fi
echo "Core \"$core_file\" found." >> $LOG_FILE
# --- Check if retroarch executable exists ---
if [ ! -f "$RETROARCH" ]; then
PARAMS="\"params\":{\"title\" : \"run_retroarch error\", \"message\":\"Retroarch exectuable not found\"}"
kodi_rpc_params "GUI.ShowNotification" "$PARAMS"
exit 1
fi
echo "Retroarch executable \"$RETROARCH\" found." >> $LOG_FILE
# --- In LibreELEC use this ---
# echo "Shutting down Kodi (LibreELEC) ..." >> $LOG_FILE
# systemctl stop kodi
# --- In Kodibuntu kill the Kodi process after shutdown ---
echo "Shutting down Kodi (Linux) ..." >> $LOG_FILE
kodi_rpc "Application.Quit"
sleep 2
killall -9 kodi
killall -9 kodi.bin
echo "Running Retroarch ..." >> $LOG_FILE
$RETROARCH -L $core_file -v "$2" > $LOG_RETROARCH 2>&1
# --- In LibreELEC use this ---
# echo "Starting Kodi (LibreELEC) ..." >> $LOG_FILE
# systemctl start kodi
# --- In Kodibuntu use this ---
echo "Starting Kodi (Linux) ..." >> $LOG_FILE
/usr/bin/kodi &
sleep 2
# --- Tell Kodi to open AEL in the correct Launcher ---
echo "Starting AEL Launcher ..." >> $LOG_FILE
ael_id="\"addonid\":\"plugin.program.advanced.emulator.launcher\""
ael_pars="\"params\":{\"com\":\"SHOW_ROMS\",\"catID\":\"$3\",\"launID\":\"$4\"}"
PARAMS="\"params\":{$ael_id,$ael_pars}"
kodi_rpc_params "Addons.ExecuteAddon" "$PARAMS"
An a launcher example of how to use it:
Code: <?xml version="1.0" encoding="utf-8" standalone="yes"?>
<advanced_emulator_launcher_configuration>
<launcher>
<name>GameCube (Retroarch wrapper)</name>
<category>Nintendo</category>
<year>2001</year>
<genre>Sixth generation console</genre>
<developer>Nintendo</developer>
<rating></rating>
<plot>The GameCube is a home video game console released by Nintendo in Japan on September 14, 2001; in North America on November 18, 2001; in Europe on May 3, 2002; and in Australia on May 17, 2002. The sixth-generation console is the successor to the Nintendo 64 and competed with Sony Computer Entertainment's PlayStation 2 and Microsoft's Xbox. The GameCube is the first Nintendo console to use optical discs as its primary storage medium. The discs are similar to the miniDVD format; as a result of their smaller size and the console's small disc compartment, the system was not designed to play standard DVDs or audio CDs. The console supports online gaming for a small number of titles via the broadband or modem adapter and connects to the Game Boy Advance via the link cable, allowing players to access exclusive in-game features using the handheld as a second screen and controller.</plot>
<platform>Nintendo GameCube</platform>
<application>/home/kodi/bin/retroarch</application>
<args>dolphin "$rom$" $categoryID$ $launcherID$ $romID$</args>
<ROM_path>/home/kodi/AEL-ROMs/nintendo-gamecube/</ROM_path>
<ROM_ext>iso|gcm</ROM_ext>
<ROM_asset_path>/home/kodi/AEL-assets/nintendo-gamecube</ROM_asset_path>
<Asset_Prefix>GameCube</Asset_Prefix>
</launcher>
</advanced_emulator_launcher_configuration>
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: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - sagrath - 2017-09-09
(2017-09-09, 10:54)Wintermute0110 Wrote: That is exactly what has been implemented for 0.9.7! This is a commented canonical example of a launcher that imports both metadata and artwork. Also, AEL guarantees that exporting and XML configuration and importing it again perfectly restores your setup. It took a lot of time to refurbish the AEL Asset Library and the work is still in progress.
That's AMAZING!!! Waiting for this release!!!
Thanks for the amazing work!!
RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - crono141 - 2017-09-11
So, somewhat concurrently I've been working on a wrapper script that will interface with an existing install of RetroPie on Raspberry Pi. I just got it working this evening after about a week of trial and error (coding noob here). For those not in the know, retropie launches all of its emulators through an included script called runcommand. Runcommand is huge and complicated, and I don't hardly understand it, but what I do understand is the syntax on runcommand to launch specific emulators. It goes something like this
Code: runcommand.sh 0 _SYS_ nes "%rom%"
where 0 is a video mode
_SYS_ is a switch (_PORT_ or _SYS_)
nes is the name of the system
rom is the full path of the romfile to be loaded.
You can't use AEL, or any other Kodi rom launcher on RPi in RetroPie because RetroPie runs everything without a desktop environment. Kodi, as well as Retroarch display by writing directly to the Pi framebuffer. This makes AEL unusable because, even though the emulator runs, Kodi is still running on top and the emulator does not display. So we must kill Kodi first. Wintermute was kind enough to help me out through the process of creating these scripts.
The first script is the launcher wrapper. It takes the same arguments as runcommand, only it does a few things before the runcommand script is called. It looks like this.
Code: #!/bin/bash
videomode=$1
sysport=$2
system=$3
rom=$4
filename="/home/pi/.kodi/userdata/kodi.launch"
touch $filename
launchID=$(tail --lines=30 /home/pi/.kodi/temp/kodi.log | grep launcherID | grep -v grep | awk '{print $9}')
catID=$(tail --lines=30 /home/pi/.kodi/temp/kodi.log | grep categoryID | grep -v grep | awk '{print $9}')
romID=$(tail --lines=30 /home/pi/.kodi/temp/kodi.log | grep romID | grep -v grep | awk '{print $9}')
ps -ef | grep kodi_v | grep -v grep | awk '{print $2}' | xargs kill
echo -e "$catID" > $filename
echo -e "$launchID" >> $filename
echo -e "$romID" >> $filename
/opt/retropie/supplementary/runcommand/runcommand.sh $videomode $sysport $system "${rom}"
wait
/opt/retropie/supplementary/runcommand/runcommand.sh 0 _PORT_ kodi
I've placed this in my home folder. What this script does is create a file (mine is in the .kodi/userdata folder), and then reads the launcherID, categoryID, and romID from the kodi.log file and writes them into the kodi.launch file. It then hard kills anything kodi related (retropie's kodi runs as kodi_v7.bin, at least on my installation). The script then invokes RetroPie's runcommand script with all the arguments that it expects. Once the emulator closes, it reopens Kodi through its runcommand switch.
Script #2 is an autoexec.py file, which must go in your .kodi/userdata folder. This script is automatically executed by Kodi at launch.
Code: #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import os
import xbmc
import datetime
filename='/home/pi/.kodi/userdata/kodi.launch'
logname='/home/pi/autoexec.log'
def log(message):
f=open(logname,"a+")
now=datetime.datetime.now()
now=unicode(now.replace(microsecond=0))
f.write(now + ": " + message + "\r\n")
f.close()
try:
if os.path.isfile(filename):
log("Loading AEL Addon")
with open(filename) as file:
IDs=file.readlines()
IDs=[x.strip() for x in IDs]
catID=IDs[0]
launchID=IDs[1]
romID=IDs[2]
xbmc.executebuiltin("ActivateWindow(1,plugin://plugin.program.advanced.emulator.launcher/?com=SHOW_ROMS&catID=" + catID + "&launID=" + launchID + ")")
try:
os.remove(filename)
log("Removed kodi.launch file")
except:
log("Failed to remove kodi.launch")
else:
log("Loading Kodi Main Window")
except Exception as e:
log(str(e))
The filename variable must match the file name and location created by the wrapper script. I then have a separate log file because I couldn't for the life of me get any of my log entries to print to kodi.log. I'm sure I was just doing something wrong, but I was more interested in getting this to work than figuring that out, so I wrote my own logging function.
First thing the script actually does is check for the existence of the kodi.launch file (which contains the IDs of the category et al from the rom we just launched). If that file doesn't exist, it skips the rest of the file and proceeds with loading Kodi normally. If the file DOES exist, it reads the IDs from the file, and uses them to launch Kodi back to the exact same screen you were on when you left it before.
It took a lot of trial and error, but I finally have this working satisfactorily. Only thing I forgot to do was ad the romID into the activatewindow function to get you literally back to where you started. Unfortunately, this line will probably need to be updated when Wintermute releases his next version, since he's updating the internal URLs of AEL.
Speaking of the next version, Wintermute, I noticed that Kodi eats a LOT of cpu time when AEL is running. My Pi (which is passively cooled) pushes temps of 70C just sitting on an AEL romlist. Perhaps if you can pin it down you could have CPU utilization be reduced.
Thanks everyone.
RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - berlinchair - 2017-09-11
(2017-09-09, 11:02)Wintermute0110 Wrote: 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.
That all looks very interesting, I will have to give that a go when I get some time to sit and tinker with my box.
Have been playing around with an Emulationstation build which seems to get around some of these problems but it would be nice to have it all integrated within Kodi as per your setup.
Will advise how I get on!
|