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 - ricardo85x - 2016-11-10

Someone did try it on retropie(raspbian)?

I managed to run a rom but kodi process is in front of it:

Image

process:

Code:
pi        1956 26.3  2.1  89992 16520 tty1     SNl+ 00:57   5:36 /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-picodrive/picodrive_libretro.so --config /opt/retropie/configs/megadrive/retroarch.cfg /media/usb0/TORRENTS/No-Intro/Sega - Mega Drive - Genesis/zip/6-Pak (USA).md --appendconfig /dev/shm/retroarch.cfg

launcher xml tags:

Code:
<application>/home/pi/run_retroarch.sh</application>
  <args>megadrive &quot;%rom%&quot;</args>

run_retroarch.sh script I made(only for sega genesis)

Code:
#/bin/sh

retro=/opt/retropie/emulators/retroarch/bin/retroarch
basecore=/opt/retropie/libretrocores/
baseconfig=/opt/retropie/configs/

core_megadrive=lr-picodrive/picodrive_libretro.so

rom=$2
emulator=$1

if [ "$emulator" = "megadrive" ];
then
  echo $retro -L $basecore$core_megadrive --config $baseconfig$emulator/retroarch.cfg \"$rom\" --appendconfig /dev/shm/retroarch.cfg  > /home/pi/retro.run
  chmod +x /home/pi/retro.run
  /home/pi/retro.run

fi


I did kill all the kodi processes but I still got this problem


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - Wintermute0110 - 2016-11-11

(2016-11-08, 15:27)firewater Wrote: I'm still trying RetroArch to work, even with the command that you gave (not sure what's wrong, I'll keep trying myself), but, I tried with a Nintendo DS emulator, and it works there! So I can see now that it's something with RA (I previously thought my whole setup was screwed and that it wasn't launching not because of the command, but because of some corrupted file).

You may try to create a BAT or CMD file with the commands to run one ROM. Also, you add the -v parameter, so Retroarch will be verbose and print on the console any error that may happen. That could help you in tracking whtat's going on.

(2016-11-08, 15:27)firewater Wrote: About the assets, I understand that it's the standard and that it's fine that way for 99.9% of users, but having it in the folder of each game is a choice in organization that feels more coherent to me. Never understood how it came to be that the separate assets thing is the standard. On literature managers (Calibre), audio managers (foobar2000), and video managers (Kodi), assets like poster.png, cover.png, .nfo files, or metadata.opf, are stored inside the folder that holds the actual content. This makes sense to me - that's the whole package. Having two directories (Games / Assets) is like a policeman having one closet for hats, and another for the rest of his uniform. I see that it's practical in that it's what has been used so far, but as someone who's very keen on organization, and keeping standards for all my media, it would be awesome to have the option, even though I recognize that people are much more concerned with how files are presented on the screen (so for example they'd have something disjointed like "01 - song__artist_ALBUMv0.mp3" for the file, but have the song properly tagged on the metadata). Hopefully you could implement it in the future if it's not too complicated, if not, I understand.

Maybe I will think in the future adding the option to store artwork like that. Now, as you have seen on the changelog, there are still plenty of things to do. Coding that asset scheme will require significant changes in the code...

(2016-11-08, 15:27)firewater Wrote: Since I've touched this topic, I'd like to ask - I like to keep the same standards for all my content: films are "Movie.format", audio is "Audio.format", and so on, but with games is often something like "ddonpach.zip". Since AEL knows that ddonpach is DoDonPachi, is there any way it could rename all these files like that?

That's something that cannot be done. MAME is very picky about the ROM names, and will refuse to run games and machines if ROMs have not the correct name. That's the reason why you need to use a front-end like AEL. I understand your points about how to store media. However, ROMs and emulation are different, older than media (emulation revolution started around 1995 where the MP3/DIVX revolution started around the 2000's) and have their own traditions, like DAT files, etc.


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - Wintermute0110 - 2016-11-11

@ricardo85x Looks like a graphic driver issue... Retroarch supports many different graphic drivers outputs (X, Opengl, SDL, etc.). Maybe you can play with the command line until you find something that works for you.

Also, there are some threads and subforums specific for Raspi users. Maybe they will be able to help you there better.


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - firewater - 2016-11-11

(2016-11-09, 14:36)foleyjo Wrote: Firewater - I found that some cores in retroarch didn't load zipped roms from an external launcher. They worked fine in Retroarch but when using AEL to launch them Retroarch crashed.
This didn't happen with all cores but I think it did with one of the Snes or Nes ones I tried.
You could try using a different core or unzipping the files and seeing if they will launch

This might be it! I haven't had much time to test after I last posted, but this does make sense. Thanks.

(2016-11-11, 05:22)Wintermute0110 Wrote: Maybe I will think in the future adding the option to store artwork like that. Now, as you have seen on the changelog, there are still plenty of things to do. Coding that asset scheme will require significant changes in the code...

I understand.

(2016-11-11, 05:22)Wintermute0110 Wrote: That's something that cannot be done. MAME is very picky about the ROM names, and will refuse to run games and machines if ROMs have not the correct name. That's the reason why you need to use a front-end like AEL. I understand your points about how to store media. However, ROMs and emulation are different, older than media (emulation revolution started around 1995 where the MP3/DIVX revolution started around the 2000's) and have their own traditions, like DAT files, etc.

!!!! So if I rename ddpch.zip to dodonpachi.zip, it won't run? Damn... still will leave it there as part of my wishlist for the systems that can handle it (maybe you can implement it in 2020? haha)


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - myghalloween - 2016-11-11

Hi Wintermute,
So, at this day, always no solution for nplayer field ?

Sorry, but I don't understant how it's possible with RCB, and AEL not...

However, you're doing good work


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - ricardo85x - 2016-11-12

Hi

Are the a way to pass the category_id and the launcher_id as argument to open a rom?

like:

Code:
<args> %category_id% %launcher_id%  %rom% </args>


Thanks


EDITED

I just checked the source code and the only arguments I can use is:
rombasename
rompath
romtitle
apppath
rom

I could edit the code and add new options but I would like something more generic so other users could use too...

EDITED2

@Wintermute0110
In main.py I add this 3 new lines for category,laucher,and rom_id.

Code:
# ~~~~ Argument substitution ~~~~~
        arguments = arguments.replace('%rom%',         romfile).replace('%ROM%',             romfile)
        arguments = arguments.replace('%rombasename%', rombasename).replace('%ROMBASENAME%', rombasename)
        arguments = arguments.replace('%apppath%',     apppath).replace('%APPPATH%',         apppath)
        arguments = arguments.replace('%rompath%',     rompath).replace('%ROMPATH%',         rompath)
        arguments = arguments.replace('%romtitle%',    rom['m_name']).replace('%ROMTITLE%',  rom['m_name'])

        # new arguments:
        arguments = arguments.replace('%categoryID%',    categoryID).replace('%CATEGORYID%',  categoryID)
        arguments = arguments.replace('%launcherID%',    launcherID).replace('%LAUNCHERID%',  launcherID)
        arguments = arguments.replace('%romID%',    romID).replace('%ROMID%',  romID)

Do you think you could add this in the official plugin?

Thanks


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - J7AYU - 2016-11-12

Is there a way to setup PC Games as an emulator rather than standalone titles, basically modern PC games. I have a ahk that converts all my game shortcuts to .bat and i would like to mass import these. Rather than going through them one by one.

Its ok I managed to do it by using explorer.exe rather than cmd.exe.


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - Rufoo - 2016-11-13

Thought I'd share another shot of the skin that is being worked on and some of the visual possibilities AEL enables. Some of you may find the design familiar as it is an overhaul of one of the more well liked designs from my older project, SexyCirrus.

Image

Image


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - firewater - 2016-11-13

WOW!!! Stellar work, can't wait to try that out.

By the way, I came here to ask - I was wondering if AEL can handle cases like this: I believe most of us sort things out by 'system' rather than emulator, and in those terms, most arcade games are played with MAME, but then there's games like Mario Kart Arcade GP, which can only be emulated with Dolphin. Can AEL handle having both under 'Arcade'?


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - foleyjo - 2016-11-14

(2016-11-13, 14:12)Rufoo Wrote: Thought I'd share another shot of the skin that is being worked on and some of the visual possibilities AEL enables. Some of you may find the design familiar as it is an overhaul of one of the more well liked designs from my older project, SexyCirrus.

Image

Image

Looks great. Can't wait to play around with it. Does it play the video files too?(It's hard to tell with static screenshots)

Not sure if this is Skin or AEL specific but would it be possible to play music files for each game in different formats including SID(C64 music file)
I currently use gamebase64 for my c64 games as i like how it plays the sid files when I view a game in the list. It's got a very dated look though.


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - Rufoo - 2016-11-14

(2016-11-14, 00:18)foleyjo Wrote: Looks great. Can't wait to play around with it. Does it play the video files too?(It's hard to tell with static screenshots)

Not sure if this is Skin or AEL specific but would it be possible to play music files for each game in different formats including SID(C64 music file)
I currently use gamebase64 for my c64 games as i like how it plays the sid files when I view a game in the list. It's got a very dated look though.

Thanks, bud. Yes, automatic trailer playback will be included. Smile

As for your question regarding music playback, I am unaware of how that would be handled. I don't know / think Kodi natively supports chiptune formats.

I would assume you'd need an addon of some sort that can process those kind of formats. AEL itself has no capacity to but it can be spoofed by having audio as mp4 and assigning it as a trailer


Found a way to make it work on raspbian/retroPie - ricardo85x - 2016-11-14

GUIDE TO WORK on Raspbian/RetroPie(not tested on RetroPie, but should work)

I am using RaspBian and I do install retroPie on it to get retroarch running

Follow the steps:

1 - Install retroPie on raspbian(or use retroPie distro)

2 - Install this packages with apt-get

Code:
sudo apt-get install at
sudo apt-get install kodi-eventclients-xbmc-send

3 - Edit the main.py from advanced launcher
Code:
/home/pi/.kodi/addons/plugin.program.advanced.emulator.launcher/resources/main.py

add this:

Code:
arguments = arguments.replace('%categoryID%',    categoryID).replace('%CATEGORYID%',  categoryID)
arguments = arguments.replace('%launcherID%',    launcherID).replace('%lAUNCHERID%',  launcherID)
arguments = arguments.replace('%romID%',    romID).replace('%ROMID%',  romID)

after this:

Code:
arguments = arguments.replace('%romtitle%',    rom['m_name']).replace('%ROMTITLE%',  rom['m_name'])

4 - create a script on some directory ex:
Code:
/home/pi/adv_bian.sh

adv_bian.sh content:

Code:
#/bin/sh

log_file=/home/pi/advanced_launcher_script.log

rom=$2
emulator=$1
categoryID=$3
launcherID=$4
romID=$5


retro=/opt/retropie/emulators/retroarch/bin/retroarch
basecore=/opt/retropie/libretrocores/
baseconfig=/opt/retropie/configs/


# you need at command
# check for at command
if ! [ -x "$(command -v at)" ]; then
  echo 'Please install "at" with "sudo apt-get install at"' >> $log_file
  exit 1;
fi


# you need kodi-send installed
if ! [ -x "$(command -v kodi-send)" ]; then
  echo 'Please install "kodi-send" with "sudo apt-get install kodi-eventclients-xbmc-send"' >> $log_file
  exit 1;
fi


# configure each core here
if [ "$emulator" = "megadrive" ];
then
    core_emu=lr-picodrive/picodrive_libretro.so
elif [ "$emulator" = "snes" ];
then
    core_emu=lr-snes9x-next/snes9x2010_libretro.so
fi


retroconfig=$baseconfig$emulator/retroarch.cfg
core=$basecore$core_emu

# any unique name ( file must not exist )
helper_script=/home/pi/retro

if [ -f "$retroconfig" ] || [ -f "$core" ] ; then
    
    # send command to quit Kodi
    kodi-send --host=127.0.0.1 --port=9777 --action="Quit()"

cat <<EOT > $helper_script.run
    while pgrep "kodi" > /dev/null
    do
      echo "kodi is still running " >> $log_file
      sleep 2
    done
    sleep 1
    echo I will run retroarch now >>  $log_file
EOT

    echo $retro -L $core --config $retroconfig \"$rom\" --appendconfig /dev/shm/retroarch.cfg \&  >> $helper_script.run
    echo "$helper_script.running $categoryID $launcherID $romID | at now" >> $helper_script.run


cat <<EOT > $helper_script.running

echo cat $categoryID, launcher $launcherID, rom $romID >> $log_file

while pgrep "retroarch" > /dev/null
do
  echo "retroarch is running "  >> $log_file
  sleep 2
done

at -f /usr/bin/kodi now
sleep 5

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

EOT

    chmod +x $helper_script.run
    chmod +x $helper_script.running
    at -f $helper_script.run now

else
    echo $retroconfig or $core not found >> $log_file
fi

Note In this script I just configure megadrive and snes, you need to add the configuration for the other cores.
example with FBA:

Code:
if [ "$emulator" = "megadrive" ];
then
    core_emu=lr-picodrive/picodrive_libretro.so
elif [ "$emulator" = "snes" ];
then
    core_emu=lr-snes9x-next/snes9x2010_libretro.so
elif [ "$emulator" = "fba" ];
then
    core_emu=lr-fba-next/fbalpha_libretro.so
fi

5 - Now on Advanced Launcher's categories.xml file

5.1 configure the application tag like that:

Code:
<application>/home/pi/adv_bian.sh</application>

5.2 configure args tag like that:

Code:
<args>megadrive &quot;%rom%&quot; %categoryID% %launcherID% %romID% </args>

And you are done!

When You launch a rom it will Close Kodi and launch the rom

and when you close the rom, it will reopen Kodi in the same Category ex(mega drive) you leave it

ps: sorry for my english.

edited

@Wintermute0110
The only thing I could not do is set focus.
Do you know how can I use the 'ActivateWindowAndFocus' or Control.SetFocus to focus on a rom with romID?
the documentation for ActivateWindowAndFocus and Control.SetFocus is here:
http://kodi.wiki/view/list_of_built-in_functions


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - Wintermute0110 - 2016-11-14

(2016-11-11, 17:18)myghalloween Wrote: Hi Wintermute,
So, at this day, always no solution for nplayer field ?

Sorry, but I don't understant how it's possible with RCB, and AEL not...

However, you're doing good work

Hi. Of course it is possible to add nplayers to AEL. The question is whether is does make sense or not. I am still in the process of making the offline scrapers as you can see here. If I can find a reliable source of nplayers metadata for the offline scraper covering most systems I will add it.


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - Wintermute0110 - 2016-11-14

@ricardo85x Thanks a lot for your patch and your excellent tutorial. You may also put the tutorial in this thread, which is specific for people using a Raspi.

I will add %categoryID%, %launcherID% and %romID% variable substitution for launcher arguments to AEL ASAP.

(2016-11-14, 05:14)ricardo85x Wrote: The only thing I could not do is set focus.
Do you know how can I use the 'ActivateWindowAndFocus' or Control.SetFocus to focus on a rom with romID?
the documentation for ActivateWindowAndFocus and Control.SetFocus is here:
http://kodi.wiki/view/list_of_built-in_functions

I am not an expert in Kodi API. Please ask your question in the Development / Addons subforum.


RE: Advanced Emulator Launcher - Multi-emulator frontend for Kodi - Wintermute0110 - 2016-11-14

(2016-11-13, 22:54)firewater Wrote: WOW!!! Stellar work, can't wait to try that out.

By the way, I came here to ask - I was wondering if AEL can handle cases like this: I believe most of us sort things out by 'system' rather than emulator, and in those terms, most arcade games are played with MAME, but then there's games like Mario Kart Arcade GP, which can only be emulated with Dolphin. Can AEL handle having both under 'Arcade'?

This is how my setup looks like:

Code:
Arcade  --> Category
    MAME 1970s  --> Launchers
    MAME 1980s
    MAME 1990s
    MAME 2000s
    MAME CPS1
    MAME CPS2
    MAME CPS3
SNK
    Neo Geo MVS
SEGA
    Saturn (Retroarch Mednafen)
    SMS (Retroarch Genesis Plus GX)
    SMS (Retroarch MAME)

I use NARS to split the MAME games into several launchers each having about 1000 ROMs (except the individual CPS and NeoGeo drivers which have a bout 50 ROMs in average). Also, I like to include the emulator in the launcher name because sometimes I have several emulators pointing to the same ROMs/assets to compare which one works best. For example, emulating the SMS MAME outperforms Retorarch Genesis Plus GX and Picodrive).

In your case, you may want to have something like this:

Code:
Arcade
     MAME
     Triforce (Dolphin)

If you have only parent working ROMs, you MAME launcher will have about 6000 ROMs, which should load in about 5 seconds. However, you may consider splitting the MAME ROMs by some criteria so loading times will be much slower.

If you want to have MAME and Triforce (Dolphin) ROMS mergued in the same launcher... currently this is not possible. However, maybe an interesting idea will be a Category virtual launcher. For example:

Code:
Browse by Category
    Arcade --> Virtual launcher that includes all ROMs under Arcade category
    SEGA --> Virtual launcher that includes all ROMs unders SEGA category

What do you think?