Kodi Community Forum
IARL - Deprecated - 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: IARL - Deprecated (/showthread.php?tid=231339)



RE: Internet Archive ROM Launcher - zachmorris - 2015-11-13

(2015-11-12, 23:16)hansolo77 Wrote: Maybe I'm missing a step. With GameEx, it doesn't just "work". You have to install emulators and configure them. I expected to have to do this too, but the wiki documentation makes it sound like it will work with Kodi AS IS, since it works with some built in core aspects of Kodi. If this is true, what else am I missing here? According to the log (Line 532), it looks like it is trying to find the emulator plugin and is failing.

Yep, you have two options:
1) Use a test build of Kodi that includes retroplayer (not part of the standard Kodi install yet). If you use this, then it should just launch the game directly in Kodi without any other settings needed to be updated. See this thread if you want to use a test build.
2) Use a standard install of Kodi + an install of Retroarch. If you use this method, then you'll also have to change the settings for the addon. Wiki goes through the steps here.


RE: Internet Archive ROM Launcher - hansolo77 - 2015-11-13

Figures I was missing something lol.

I will probably go with #2 since I have Kodi set up pretty much the way I want and don't want to have to re-do everything all over again.


RE: Internet Archive ROM Launcher - Scourge - 2015-11-13

Installing Retroplayer over an earlier install wont change your settings. The only drawback is that you are limited to Confluence for now.


RE: Internet Archive ROM Launcher - hansolo77 - 2015-11-13

I'm still trying to get RetroArch installed. I can't really find any support. I'm running on a Raspberry Pi 2. I think I found a support thread over at OpenELEC (the os I'm using on the Pi). There isn't really a guide there though. So I went through and installed it, but it doesn't run. If I ssh, I can manage to get it to launch something, but it doesn't look anything like the setup screens in the IARL setup wiki walkthrough. So I'm completely lost.


RE: Internet Archive ROM Launcher - zachmorris - 2015-11-13

(2015-11-13, 18:20)hansolo77 Wrote: I'm still trying to get RetroArch installed. I can't really find any support. I'm running on a Raspberry Pi 2. I think I found a support thread over at OpenELEC (the os I'm using on the Pi). There isn't really a guide there though. So I went through and installed it, but it doesn't run. If I ssh, I can manage to get it to launch something, but it doesn't look anything like the setup screens in the IARL setup wiki walkthrough. So I'm completely lost.

Yeah, installation for retroarch on OpenElec is tricky. The addon I've used for that is listed in the thread here. If that installed, you should be able to launch Retroarch from the program addons section in Kodi.
Next step then is to enable the helper scripts that IARL uses to launch games. RPi isn't powerful enough to run Kodi and Retroarch simultaneously, so the helper script will temporarily exit Kodi, launch the game, and then when Retroarch is exited, re-launch Kodi (same exact scripts that are in the OpenElec forums, I've included in the IARL addon). You just need to change the permissions on the script to allow it to run on your system (unfortunately I was unable to find a suitable way to make this happen automatically). Instructions for that are listed in the wiki here.


RE: Internet Archive ROM Launcher - onizuka - 2015-11-13

Stupid question: Is there an significant advantage to using Retroplayer vs external Retroarch?

Retroplayer while a serious WIP, makes things really feel integrated.


RE: Internet Archive ROM Launcher - hansolo77 - 2015-11-13

(2015-11-13, 20:33)zachmorris Wrote: Yeah, installation for retroarch on OpenElec is tricky. The addon I've used for that is listed in the thread here. If that installed, you should be able to launch Retroarch from the program addons section in Kodi.
Next step then is to enable the helper scripts that IARL uses to launch games. RPi isn't powerful enough to run Kodi and Retroarch simultaneously, so the helper script will temporarily exit Kodi, launch the game, and then when Retroarch is exited, re-launch Kodi (same exact scripts that are in the OpenElec forums, I've included in the IARL addon). You just need to change the permissions on the script to allow it to run on your system (unfortunately I was unable to find a suitable way to make this happen automatically). Instructions for that are listed in the wiki here.

I've tried lots of different ways to make this work. "Out of the Box" doesn't seem possible. Everything I look at shows there is a lot of configuring I still need to do, like change paths, move over BIOS files, etc. I've tried doing all that, but I just can't seem to get it to work. I'm even at a "Just get RetroArch working first" point, with a copy of my own ROM for testing. I just can't seem to get it to launch, or have it even bring up the program when directly launching in SSH. I don't mind it not working simultaneously.. in fact I prefer it that way. More power to the emulator. The permissions part is no problem.. simple chmod or whatever and that does it. I'm really getting hung up on that very first step.. after installing you say to launch RetroArch and verify you get all the updates. Well, it doesn't launch. If I manually start it in SSH, the screen doesn't even have an UPDATE option. So I'm way lost lol.


RE: Internet Archive ROM Launcher - Scourge - 2015-11-14

(2015-11-13, 21:05)onizuka Wrote: Stupid question: Is there an significant advantage to using Retroplayer vs external Retroarch?

Retroplayer while a serious WIP, makes things really feel integrated.

The obvious response is: RetroArch has more working cores, while RetroPlayer is a Wip with some quirks. OTOH, if you are patient enough to wait (or contribute) for other cores to become available for RetroPlayer, it is obviously the way forward because of the user-friendly implementation. Smile


RE: Internet Archive ROM Launcher - hansolo77 - 2015-11-14

Going to work on this more tomorrow when I'm not half asleep, but I finally got RetroArch to play a game I put onto the SD card. The latest custom version of RetroArch I'm using enables you to specify a config file to use for the ROM when launching. This is helpful because my controller's button mappings were all wrong when I loaded up a game. A quick run through of the input mappings and I got it the way it should be. Saved it, and I'm good. Next time I launch the emulator, I can tell it to load that custom config, and the buttons will be correct.

This brings up a troubling question. How will IARL be able to handle this. Moreover, CAN it? Not all consoles are the same. Heck, every Nintendo console ever released has a new controller to work with it. This inevitably would require remapping buttons for every emulator. If IARL can't be configured to run a specific emulator's config, that severely limits it's potential to only work with one config, which will probably not have the mappings you need.

Anyway, I'm off to bed then work tomorrow. I should be off around 8:00pm and then off all day Sunday to work on this some more. Hope to hear back!


RE: Internet Archive ROM Launcher - hansolo77 - 2015-11-14

Good morning! I had a go at this just now before leaving for work... I think you can make it work, but it needs something extra. When you bring up the context menu for a console, you have options to to change the launcher, etc. I'm playing with Sega Genesis right now, since it's the console I'm most familiar with. When you choose the launcher, it gives you the list of available cores and obviously for me I'd want to pick the picodrive one. But this looks like it's a pre-defined setup. There's no way to actually change the command line. Would it be possible to have another option in the list called maybe "Custom" where you can actually just input your own command line? For instance, to make Picodrive work with the custom controller config, my command would be:
Code:
retroarch.start picodrive picodrive_libretro.cfg /storage/roms/"rom name"
So I would assume you would replace "rom name" with %rom% or whatever (and point the path to the right location). Would this be doable? I think rather than building a brand new custom menu to select it from a list, the ability to add a CUSTOM would work best. Of course, you'd want to have that save to a new file for each console.

Thanks for an awesome addon. I just hope to make it work for me on the RPi2! See ya after work lol.


RE: Internet Archive ROM Launcher - zachmorris - 2015-11-14

(2015-11-14, 17:52)hansolo77 Wrote: Good morning! I had a go at this just now before leaving for work... I think you can make it work, but it needs something extra. When you bring up the context menu for a console, you have options to to change the launcher, etc. I'm playing with Sega Genesis right now, since it's the console I'm most familiar with. When you choose the launcher, it gives you the list of available cores and obviously for me I'd want to pick the picodrive one. But this looks like it's a pre-defined setup. There's no way to actually change the command line. Would it be possible to have another option in the list called maybe "Custom" where you can actually just input your own command line? For instance, to make Picodrive work with the custom controller config, my command would be:
Code:
retroarch.start picodrive picodrive_libretro.cfg /storage/roms/"rom name"
So I would assume you would replace "rom name" with %rom% or whatever (and point the path to the right location). Would this be doable? I think rather than building a brand new custom menu to select it from a list, the ability to add a CUSTOM would work best. Of course, you'd want to have that save to a new file for each console.

Thanks for an awesome addon. I just hope to make it work for me on the RPi2! See ya after work lol.

Yeah, that can be done. Like you said, the addon comes with pre-defined launch commands, but you can add your own.
See the wiki here. You'll need to edit the xml file "external_command_database.xml" and just paste the command you listed above in with the title you want. Then when you choose your launcher, your command with the title you list should show up and you can select it. All the addon does in this case is write that command line to the xml for use with all games in the list.
Keep in mind though that the path to "retroarch.start" and probably the config file needs to be defined explicitly with the path included. I'll take a look, I haven't actually set this up on RPi for external launching but it should work without a problem. If you've got a list of commands that look like they'd be useful for everyone please let me know and I'll include them in the addon directly.

I also like the idea of having an option for the user just to input whatever command they like, I'll add that to my list of things to do. For now though, you'll have to edit the xml manually. Let me know if you get this working and you have some helpful info to add to the wiki for RPi.


RE: Internet Archive ROM Launcher - hansolo77 - 2015-11-15

Cool, I'll check into it and work on it some more. FYI - the build I'm using just has a re-configured start script, to allow loading of those custom configs. If you're interested in trying it out on your system, here is the link to the forum post with all the details:

http://openelec.tv/forum/128-addons/72972-retroarch-addon-arm-rpi?start=450#150421

Essentially, the BULK of RetroArch is in the first link, where he included a whole bunch of working cores that are specifically compiled for use with the Pi's, and have all been tested (not by me yet) to be working. Just put it somewhere your Pi can access via "Install from Zip" and run that. In my tests, I didn't use the 2nd link. It looks like that is just a re-configured retroarch.cfg for use with a PS3 controller, which I don't have, so I didn't bother. The 3rd link I'm also not using at present. I've played a little with shaders on my PC, but really didn't like much of any of them. I don't like to see all the extra little tweaks people do OUTSIDE the ROM.. I'm a purest so a straight output was good enough for me. The 4th link though is the key. He re-wrote the retoarch.start script to run a check for the addition of a cfg file to load with the core. In my first test attempts, I didn't realize this was NECESSARY. I was trying to launch the ROM directly without adding in a cfg in the command line. All I would get were errors about the "whatever ROM path".cfg wasn't found. It wasn't until I created a dummy "test.cfg" file and included that in my command line that I was finally able to get it to load. The final bits of that post just provided you with examples of what the command line would be, and an example of his .cfg he created for that specific core. In his case, he's using a shader, and then the default retroarch.cfg is taking over for the controls. In my case, I just created a new .cfg from within the running core and saved it. The new save file was essentially "corename_libretro.cfg", where "corename" is whatever core you're loading.

Once I work out the re-programming of your .xml for Sega Genesis, I will go through the same process for all the other cores and update your xml as necessary. Something else that came to mind, is perhaps requesting you provide a way to filter out unwanted consoles from the list. For instance, say in the future I have a friend over and I'm showing him the addon. He decides to go into Nintendo 64 and tries to load it up. Well surpise! N64 doesn't exactly work very well with Pi2, so I never bothered setting it up. He didn't know that, and since the console is listed, it should work right? Well my request would be some way to have an "Enabled/Disable" check box or switch in the addon's configuration so we can disable the ones we don't want to see. You can still scrape and add them on your backend though because even though (in my example) N64 won't work for me on the Pi, it does work sufficiently on my PC, and there are PC users out there.

Thanks again for the reply! Looking forward to keeping you up to date with what I find!


EDIT - Found the xml file. Scrolled down to the OpenELEC "OS" and found the picodrive command. I changed it to this. Would this be correct?
Code:
    <launcher name="RetroArch Pico Drive (Sega 32X/CD)" os="OpenElec">
        <launcher_command>/storage/.kodi/addons/emulator.tools.retroarch/bin/retroarch.start picodrive /storage/.kodi/userdata/addon_data/emulator.tools.retroarch/config/picodrive_libretro.cfg "%ROM_PATH%"</launcher_command>


EDIT 2 - Ok, that didn't work. Since I was able to run "retroarch.start" without giving it the explicit path in SSH like you suggested, I decided to take all that out. Now my command is
Code:
    <launcher name="RetroArch Pico Drive (Sega 32X/CD)" os="OpenElec">
        <launcher_command>retroarch.start picodrive picodrive_libretro.cfg "%ROM_PATH%"</launcher_command>
Running that caused Kodi to black out, but nothing else happens. I checked the log, and it looks like it is running the script correctly:
Code:
23:10:15 281.608337 T:1637065792  NOTICE: Downloading Selected ROM
23:10:15 281.609253 T:1637065792  NOTICE: http://archive.org/download/No-Intro-Collection_2015-03-03/Sega%20-%20Mega%20Drive%20-%20Genesis.zip/Sega%20-%20Mega%20Drive%20-%20Genesis%2FAero%20the%20Acro-Bat%20%28USA%29.zip
23:10:15 281.609467 T:1637065792  NOTICE: /storage/.kodi/userdata/addon_data/plugin.program.iarl/temp_iarl/Aero the Acro-Bat (USA).zip
23:10:17 283.411804 T:1637065792  NOTICE: Unzipping /storage/.kodi/userdata/addon_data/plugin.program.iarl/temp_iarl/Aero the Acro-Bat (USA).zip
23:10:17 283.499969 T:1637065792  NOTICE: Unzip Successful
23:10:17 283.502960 T:1637065792  NOTICE: External Command: retroarch.start picodrive picodrive_libretro.cfg "/storage/.kodi/userdata/addon_data/plugin.program.iarl/temp_iarl/Aero the Acro-Bat (USA).md"
23:10:17 284.200500 T:1968037888  NOTICE: Storing total System Uptime
23:10:17 284.201172 T:1968037888  NOTICE: Saving settings
23:10:17 284.326782 T:1968037888  NOTICE: stop all
It doesn't seem to actually launch the game. It just sits there. So I did a reboot, and in SSH just ran the "External Command" directly. It loaded up the game fine. So somewhere between IARL launching it's command, and RetroArch trying to take over Kodi there is a problem. RetroArch disables Kodi on launch. Does IARL disable Kodi when it launches the External Command as well? Maybe that is where the hang up is, because RetroArch then tries to do it too, and get's hung up. I don't know how to get any kind of logs from what RetroArch is doing once Kodi isn't running. Darn! So close!


EDIT 3 - Last one for tonight, I'm sleepy!
Ok, so as an "experiment", I went into the retroarch.start file and # commented out the 2 lines dealing with shutting down and restarting Kodi. I then tried to launch another game from IARL. It kinda worked! Essentially I could hear the game in the background, but Kodi was still very much in the foreground. So I definitely think the problem I was having is with the Kodi shut down part. By commenting out the shutdown in the retoarch.start file, I essentially left it to IARL to handle it, and well... it didn't. I did find in your /bin that you have an applaunch.sh and an applaunch_OE.sh. I assume the "oe" is for "OpenELEC?" If I go in there I can see you have already setup some method of closing Kodi, but it looks like they're all # commented out as well. It says to uncomment them and comment the other part, but I'm not sure how far to go / what parts to comment out. Should I take out the rest of the file? Or just the part leading up to "done;"? I don't want to mess it up. I suppose I can do a trial & error run. But I'm too tired to mess with it more tonight! Maybe you'll know what I need to do by the time I wake up tomorrow? Smile TTYL!


RE: Internet Archive ROM Launcher - hansolo77 - 2015-11-15

I tried some more things today, but can't really get anywhere. I tried commenting out all of IARL's "stop kodi" commands completely, and have just RetroArch's stop run. That didn't work. I also tried editing RetroArch's start script to include a sleep, in case maybe it was getting stuck trying to launch before Kodi was completely shut down. That also didn't work. I wish I knew more about Linux so I could watch a log as it's all happening. Right now, all I can see is Kodi's functions up to the point where IARL launches the command, then "something" initiates the shutdown. I don't know what happens after that because nothing is being logged. I don't know if IARL is initiating the shutdown, or if RetroArch is. But in either case, if I comment out RetroArch's shutdown, I get audio from the game and if I wait long enough the video overlays in a 50% transparency on top of Kodi. If I try to do anything to navigate though, Kodi takes over again at 100% (I think what's happening here is the screensaver "Dim" is cutting down Kodi's transparency and RetroArch then becomes visible, and when I move something the "Dim" screensaver disengages and Kodi becomes fully visible again). Regardless of that, it looks like IARL's attempts to shutdown Kodi aren't working, and RetroArch's doesn't work unless launched directly from SSH. I tried replacing RetroArch's shutdown command "systemctl stop kodi" inside the applaunch_OE.sh so that it would use that instead, but it didn't make any difference either. I'm really coming at this from a complete newb point of view though. I don't know anything about Linux and programming outside of old school 80's BASIC. But by looking at the scripts, it should be fairly straight forward. It's just not working. There's probably something else going on that I just can't see without having a log OUTSIDE of Kodi. Any ideas?


EDIT - New finding.. I renamed your /bin/applaunch_OE.sh to "-applaunch_OE.sh", effectively cutting it completely off from anything that would be calling it. Wouldn't you know? I get the exact same thing happening (screen goes black, nothing starts). So to me, this is just further evidence that IARL is ignoring your preset script for launching in OpenELEC. However... this may be because I'm using the modified xml. Just thought of that. Still, worth noting.


EDIT 2 - Yeah I'm just getting frustrated now. I added an echo line in each script file I could find that indicated some form of shutdown procedure. Essentially saying "(name of file) IS SHUTTING DOWN KODI!" so I could look for that specific echo in the logs. None of them displayed it! I tried it in applaunch, romlaunch, oe/non-oe, retroarch... I just can't figure this out. My thought was, if I can get that line to show up in Kodi's logs, then I know EXACTLY which file I need to edit and replace with the shutdown commands that the modified retroarch.start file is using. But, of course, since NONE of them showed that line, I have nothing left to try. I'm completely out of ideas on my end. I need a new solution or idea from you zachmorris to go farther. I really want to make this work, it would be the ultimate final key to my super Kodi setup. Let me know if you got something else you want to try. Until then, I'm going to work on other stuff (like catching up on my TV and reading!)

Just a reminder.. here's where I'm at:

AS IS - Doesn't Work
Edit "external_command_database.xml" to include specific rom launcher for modified start script - Black Screen Only
Launch via SSH IARL's complete new external command - Completely Works
Edit "retroarch.start" script to comment out it's Kodi ShutDown routine (to rely on IARL's shutdowns) - Black Screen, Audio, Screensaver Dims to show running EMU
Endless testing of various scripts to change their shutodwn routines (to match retroarch's shutdowns) - No Success


RE: Internet Archive ROM Launcher - zachmorris - 2015-11-16

OK, I gave this a try. The setup for the RPi Retroarch addon is not the same as the setup for the x86 version of the addon which i think is where my confusion came in.

Here's what I did to get external launching to work on my RPi2.
1) Install the retroarch addon referenced in the OpenElec thread here. Note that one of the users looks like they'll be releasing a new version of the addon with Retroarch 1.2.2 in it which is better since it can self update when needed.
2) I created a new helper script, called it
Code:
romlaunch_OE_RPi2.sh
and put it in my addons bin folder at:
/storage/.kodi/addons/plugin.program.iarl/resources/bin/
Script is here
3) chmod a+x /storage/.kodi/addons/plugin.program.iarl/resources/bin/* so the script is executable
4) Edit my addons external_command_database.xml, findall and replace
Code:
romlaunch_OE.sh
with
Code:
romlaunch_OE_RPi2.sh
5) In the addon, then select your archive of interest and then bring up the context menu and select external launching, and then change the external launch command to your core of interest.
Should launch the game now with the updated helper script.

Note that in my new helper script I didn't include seperate configs per core (not sure why thats needed? Your controller can be setup in retroarch.cfg to work with all cores.) At any rate, if you want to use seperate configs per core, then in the romlaunch_OE_RPi2.sh helper script file, you need to uncomment the line:
Code:
#$BASE_DIR/bin/retroarch -c $RETROARCH_CONFIG_FILE -L $BASE_DIR/lib/libretro/$1_libretro.so --appendconfig $RETROARCH_CONFIG_DIR/"$2"  "$3"
and then comment out the line:
Code:
$BASE_DIR/bin/retroarch -c $RETROARCH_CONFIG_FILE -L $BASE_DIR/lib/libretro/$1_libretro.so "$2"

Then, in the external_command_database.xml, you need to edit the commands so that the arguments match above ($1=core name, $2=config filename, $3=ROM Path), so it would be something like the following (Nestopia for example):
Code:
<launcher name="RetroArch Nestopia (NES)" os="OpenElec">
        <launcher_command>%ADDON_DIR%/resources/bin/romlaunch_OE_RPi2.sh nestopia "MY_NESTOPIA_CONFIG.cfg" "%ROM_PATH%"</launcher_command>
    </launcher>

Phew! Not the most ideal permanent solution by any means. I'll see if I can come up with a better built in solution and include it in the next update of the addon (hopefully to work with the updated version of the addon they're going to put out).


RE: Internet Archive ROM Launcher - hansolo77 - 2015-11-16

Hey I'm just glad to be working side-by-side with you on this.

You said you installed the retroarch (step 1) from the OpenELEC forum. Just to be absolutely clear we're on the exact same page... you're referring to the one that was quoted, where the user "Nasp" had built the setup with the extra cores?

I will try this after dinner. Also.. there are 2 reasons I'm using the separate config type setup. #1 - The changes made to retroarch.start required it (like I said, I don't know how to read all that code to make it not be necessary) and #2 - The default controller config that would be used in retroarch.cfg wouldn't necessarily work for all consoles; this is especially true when you setup a controller with shoulder buttons. Like say you have them configured to be START and SELECT/OPTION for all consoles, but then in SNES or GBA consoles, those shoulder buttons are used on the actual controller. So you can't configure retroarch.cfg to have a universal mapping of LB=Start and RB=Select now. I suppose if you have a controller with more buttons, this isn't a problem. But for me it is. THIS is my controller. I specifically bought it because it has 6 action buttons, just like the Sega Genesis, TG16, and N64 controllers have. It only has 1 shoulder button per side though, and the RED button is supposed to be a "SHIFT" key to give you more buttons (SHIFT+1, SHIFT+2, etc) but I never even got the Windows software to work right with it, let alone some Linux version!.


This forum uses Lukasz Tkacz MyBB addons.