Kodi Community Forum

Full Version: Advanced Emulator Launcher - Multi-emulator frontend for Kodi
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I use:
python:

            current_OS = xbmc.getInfoLabel('System.OSVersionInfo')
            xbmc.log(msg='IAGL:  OS found - %(current_OS)s' % {'current_OS': current_OS}, level=xbmc.LOGDEBUG)
            if 'OS X' in current_OS:
                self.handle.setSetting(id='iagl_external_user_external_env',value='OSX')
                xbmc.log(msg='IAGL:  External Launch Environment auto selected to OSX', level=xbmc.LOGDEBUG)
            elif 'Windows' in current_OS:
                self.handle.setSetting(id='iagl_external_user_external_env',value='Windows')
                xbmc.log(msg='IAGL:  External Launch Environment auto selected to Windows', level=xbmc.LOGDEBUG)
            elif 'Android' in current_OS:
                self.handle.setSetting(id='iagl_external_user_external_env',value='Android')
                xbmc.log(msg='IAGL:  External Launch Environment auto selected to Windows', level=xbmc.LOGDEBUG)
            elif 'Linux' in current_OS:
                self.handle.setSetting(id='iagl_external_user_external_env',value='Linux/Kodibuntu')
                xbmc.log(msg='IAGL:  External Launch Environment auto selected to Linux/Kodibuntu', level=xbmc.LOGDEBUG)                
            else:
                xbmc.log(msg='IAGL:  External Launch Environment is unknown', level=xbmc.LOGDEBUG)

I've looked at this and I believe with Android 8 permission restrictions there are two options:
1)  A change in Kodi that enables the correct permissions (so Kodi's python interpreter has permissions to make the calls just as it was before) and/or a change in StartAndroidActivity that allows for all the extras in the intents required for launching various apps
2) Interfacing with android ADB somehow to pass the calls from Kodi/python to Android.  This isn't ideal because the user would have to enable ADB in their OS in order for this to work.
(2018-07-13, 14:52)chrisism Wrote: [ -> ]But it might also have to do with the way the application is called. Currently I am using:
python:

/system/bin/am start --user 0 -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -e ROM .....

Do we need to do it in a different way now?
These are the params of the user who reported that it works for him:
Code:
/system/bin/am start --user 0 -n org.mupen64plusae.v3.fzurita/paulscode.android.mupen64plusae.SplashActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
He tested with other emus and they also work.

RCB is still using the "os.system" command to launch the emulator in this case.
(2018-07-15, 08:46)malte Wrote: [ -> ]
(2018-07-13, 14:52)chrisism Wrote: [ -> ]...
These are the params of the user who reported that it works for him:
Code:
/system/bin/am start --user 0 -n org.mupen64plusae.v3.fzurita/paulscode.android.mupen64plusae.SplashActivity -a android.intent.action.VIEW -eu Uri "file://%rom%"
He tested with other emus and they also work.

RCB is still using the "os.system" command to launch the emulator in this case. 
 So. Finally got it. With a little manipulations in the script to try out everything.
python:

            with open(self.logFile.getPath(), 'w') as f:
                #cmds = ' '.join(command)
                #os.system(cmds.encode('utf-8'))

                cmds = ''
                try:
                    cmds = 'am start --user 0 -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -e ROM "/storage/MEDIASERVER/Media6/Roms/Nintendo/NES/Games/Asterix/Asterix (Europe) (En,Fr,De,Es,It).nes" -e LIBRETRO /data/data/com.retroarch/cores/nestopia_libretro_android.so -e CONFIGFILE /storage/emulated/0/Android/data/com.retroarch/files/retroarch.cfg -e IME com.android.inputmethod.latin/.LatinIME -e REFRESH 60 -n com.retroarch/.browser.retroactivity.RetroActivityFuture'
                    retcode = subprocess.call(cmds.encode('utf-8'), stdout = f, stderr = subprocess.STDOUT, close_fds = True)
                    log_info('1 LinuxExecutor: Process retcode = {0}'.format(retcode))
                except Exception as e:
                    log_info("1 Unexpected error: {}".format(e))

                try:    
                    cmds = '/system/bin/am start --user 0 -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -e ROM "/storage/MEDIASERVER/Media6/Roms/Nintendo/NES/Games/Asterix/Asterix (Europe) (En,Fr,De,Es,It).nes" -e LIBRETRO /data/data/com.retroarch/cores/nestopia_libretro_android.so -e CONFIGFILE /storage/emulated/0/Android/data/com.retroarch/files/retroarch.cfg -e IME com.android.inputmethod.latin/.LatinIME -e REFRESH 60 -n com.retroarch/.browser.retroactivity.RetroActivityFuture'
                    retcode = subprocess.call(cmds.encode('utf-8'), stdout = f, stderr = subprocess.STDOUT, close_fds = True)
                    log_info('2 LinuxExecutor: Process retcode = {0}'.format(retcode))
                except Exception as e:
                    log_info("2 Unexpected error: {}".format(e))

                try:
                    retcode = subprocess.Popen(cmds.encode('utf-8'), shell=True)
                    log_info('3 LinuxExecutor: Process retcode = {0}'.format(retcode))
                except Exception as e:
                    log_info("3 Unexpected error: {}".format(e ))                

                try:    
                    cmds = 'adb shell am start --user 0 -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -e ROM "/storage/MEDIASERVER/Media6/Roms/Nintendo/NES/Games/Asterix/Asterix (Europe) (En,Fr,De,Es,It).nes" -e LIBRETRO /data/data/com.retroarch/cores/nestopia_libretro_android.so -e CONFIGFILE /storage/emulated/0/Android/data/com.retroarch/files/retroarch.cfg -e IME com.android.inputmethod.latin/.LatinIME -e REFRESH 60 -n com.retroarch/.browser.retroactivity.RetroActivityFuture'
                    retcode = subprocess.call(cmds.encode('utf-8'), stdout = f, stderr = subprocess.STDOUT, close_fds = True)
                    log_info('4 LinuxExecutor: Process retcode = {0}'.format(retcode))
                except Exception as e:
                    log_info("4 Unexpected error: {}".format(e))               

                try:    
                    cmds = '/system/bin/am start --user 0 -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -e ROM "/storage/MEDIASERVER/Media6/Roms/Nintendo/NES/Games/Asterix/Asterix (Europe) (En,Fr,De,Es,It).nes" -e LIBRETRO /data/data/com.retroarch/cores/nestopia_libretro_android.so -e CONFIGFILE /storage/emulated/0/Android/data/com.retroarch/files/retroarch.cfg -e IME com.android.inputmethod.latin/.LatinIME -e REFRESH 60 -n com.retroarch/.browser.retroactivity.RetroActivityFuture'
                    retcode = subprocess.check_output(cmds.encode('utf-8'), close_fds = True)
                    log_info('5 LinuxExecutor: Process retcode = {0}'.format(retcode))
                except Exception as e:
                    log_info("5 Unexpected error: {}".format(e))

                try:
                    cmds = 'am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -e ROM "/storage/MEDIASERVER/Media6/Roms/Nintendo/NES/Games/Asterix/Asterix (Europe) (En,Fr,De,Es,It).nes" -e LIBRETRO /data/data/com.retroarch/cores/nestopia_libretro_android.so -e CONFIGFILE /storage/emulated/0/Android/data/com.retroarch/files/retroarch.cfg -e IME com.android.inputmethod.latin/.LatinIME -e REFRESH 60 -n com.retroarch/.browser.retroactivity.RetroActivityFuture'
                    retcode = subprocess.call(cmds.encode('utf-8'), stdout = f, stderr = subprocess.STDOUT, close_fds = True)
                    log_info('6 LinuxExecutor: Process retcode = {0}'.format(retcode))
                except Exception as e:
                    log_info("6 Unexpected error: {}".format(e))

                try:    
                    cmds = '/system/bin/am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -e ROM "/storage/MEDIASERVER/Media6/Roms/Nintendo/NES/Games/Asterix/Asterix (Europe) (En,Fr,De,Es,It).nes" -e LIBRETRO /data/data/com.retroarch/cores/nestopia_libretro_android.so -e CONFIGFILE /storage/emulated/0/Android/data/com.retroarch/files/retroarch.cfg -e IME com.android.inputmethod.latin/.LatinIME -e REFRESH 60 -n com.retroarch/.browser.retroactivity.RetroActivityFuture'
                    retcode = subprocess.call(cmds.encode('utf-8'), stdout = f, stderr = subprocess.STDOUT, close_fds = True)
                    log_info('7 LinuxExecutor: Process retcode = {0}'.format(retcode))
                except Exception as e:
                    log_info("7 Unexpected error: {}".format(e))

                try:    
                    cmds = '/system/bin/am start --user 0 -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -e ROM "/storage/MEDIASERVER/Media6/Roms/Nintendo/NES/Games/Asterix/Asterix (Europe) (En,Fr,De,Es,It).nes" -e LIBRETRO /data/data/com.retroarch/cores/nestopia_libretro_android.so -e CONFIGFILE /storage/emulated/0/Android/data/com.retroarch/files/retroarch.cfg -e IME com.android.inputmethod.latin/.LatinIME -e REFRESH 60 -n com.retroarch/.browser.retroactivity.RetroActivityFuture'
                    retcode = os.system(cmds.encode('utf-8'))
                    log_info('8 LinuxExecutor: Process retcode = {0}'.format(retcode))
                except Exception as e:
                    log_info("8 Unexpected error: {}".format(e))

And all the commands gave me issues or nothing, except .... the os.system(..) as you mentioned @malte .
At least it started Retroarch with me. Still have to check if all the parameters still work.
@Wintermute0110  I'll go and make a branch for this, to separate it from the linux calls and test it out further. Looks like we have a winner.
Question: Are there any versions of Advanced Launcher or any skins/themes that are currently available to support video snaps in Kodi (ala Rom Collection Browser or Attract Mode)?

Thanks!
(2018-07-15, 19:45)chrisism Wrote: [ -> ]And all the commands gave me issues or nothing, except .... the os.system(..) as you mentioned @malte .
At least it started Retroarch with me. Still have to check if all the parameters still work.
@Wintermute0110  I'll go and make a branch for this, to separate it from the linux calls and test it out further. Looks like we have a winner. 
 Do you happen to have the debug log from this test script?  I'd be interested in what errors, if any, are thrown when it doesn't work.
(2018-07-16, 18:12)zachmorris Wrote: [ -> ]
(2018-07-15, 19:45)chrisism Wrote: [ -> ]And all the commands gave me issues or nothing, except .... the os.system(..) as you mentioned @malte .
At least it started Retroarch with me. Still have to check if all the parameters still work.
@Wintermute0110  I'll go and make a branch for this, to separate it from the linux calls and test it out further. Looks like we have a winner. 
 Do you happen to have the debug log from this test script?  I'd be interested in what errors, if any, are thrown when it doesn't work. 
As requested omosohunoz (paste)
So, this is a clean run with that block of test code. I added an altered original subprocess.call before that. I did not open Retroarch beforehand and I do not have my Shield rooted.
As you see the last call actual executes and I can confirm that it indeed opened up Retroarch with the actual rom.
Also the launcher.log file which all the stdout is written to is completly empty. Ofcourse os.system does not have an option for stdout parameters anyway.
@marcoooo although the pullrequest is ready and the fix for Android can be merged, if you cannot wait untill its in the main repo you can already test it if this fix works for you.
You can download it from https://github.com/chrisism/plugin.progr...call_issue
Thank you very much @chrisism for the patch and everybody for their help. I'm very busy with RL right now but will release a patched 0.9.8 ASAP. Also, when I had time I will investigate the code of the Python standard library to track down the problem further.
(2018-07-15, 22:19)coverflow_rider Wrote: [ -> ]Question: Are there any versions of Advanced Launcher or any skins/themes that are currently available to support video snaps in Kodi (ala Rom Collection Browser or Attract Mode)?

Thanks!
Estuary AEL mod should render the trailers in most views. Make sure "Render trailers" is ON in the addon settings. I think is ON by default but it doesn't hurt to check it.
verry nice  will check this out as soon as possible
Hello ! 

Screenscaper support is still planned for 0.9.8 release ?
(2018-07-23, 18:27)yevaman44 Wrote: [ -> ]Hello ! 

Screenscaper support is still planned for 0.9.8 release ?
I'm afraid not. Release 0.9.8 will be a bug fix release with very limited new features. I plan to release 0.9.8 soon, but currently I'm really busy with RL, so soon means maybe a couple of weeks, maybe a month.

Screenscraper support is in the TODO list and presumably will be done for 0.10.0. Release 0.10.0 will be a major upgrade of AEL with a lot of new stuff. About the release date for 0.10.0 ... I don't know. Several months at least.
OK thanks for the quick answer !! Will waiting for the 1.0 release ! Smile
Hello,

I am using the latest version 0.9.7 but when I launch the game either kodi minimizes and never maximizes after the game is finished or if I set it to borlderless fullscreen mode the input from the controller is passed to both the game and kodi.

Is this a known bug ?

I am launching windows games (steam and non steam)
(2018-07-25, 12:49)Blink123123 Wrote: [ -> ]Hello,

I am using the latest version 0.9.7 but when I launch the game either kodi minimizes and never maximizes after the game is finished or if I set it to borlderless fullscreen mode the input from the controller is passed to both the game and kodi.

Is this a known bug ?

I am launching windows games (steam and non steam)
Some users reported problems like yours in Windows, please search through the thread for possible solutions. Also, it will help if you give information about your setup: Kodi version, Windows version, are you using the Windows standard shell or a different one, the described behavior is for all programs you launch or only one, etc.