Posts: 55
Joined: Jan 2018
Reputation:
0
Yes, Zach, and of course I sent you the two commands that I added to the main.py code and that effectively kill RetroArch.
Right now I can not but as soon as I can I'll upload it to you here. I'm not at home, sorry.
Really, they are two different commands launched on Android and I imagine one of them does the magic.
What actually do is throw the three (the one that is included in IAGL and the second one's i've added), so I do not know which of the three is the one that does the work. But if I leave only the initial one, the one that comes with your IAGL, it does not work.
Again, thanks very much for your addon. It's marvellous.
Posts: 55
Joined: Jan 2018
Reputation:
0
Sorry, "sent" not, I wanted to say "will send"
Posts: 55
Joined: Jan 2018
Reputation:
0
In my modified main.py I execute three commands.
The original of your addon, and these two:
'/system/xbin/su -c "/system/bin/killall -SIGKILL com.retroarch"'
and
'/system/xbin/su -c "/system/bin/am force-stop com.retroarch"'
I do not know which of the last two does it, but if I leave only the original, then it does not work. It does not kill RetroArch. I hope it serves you somehow and again, thank you very much for such a wonderful addon.
Posts: 55
Joined: Jan 2018
Reputation:
0
Hello, Zach
Sure enough, I saw that you were trying to throw the am force-stop command in two different ways, but as I said, at least I could not kill RetroArch.
So I tried to launch the same command but using the root user and also tried using the kill command. And I checked that it worked.
Although it is true that the use of the kill command is drastic, but we achieve the goal, which is to kill a possible Retroarch that was running at that moment.
I send you the changed code in the function launch_external_android. And if you need it, tell me and I'll send you the Kodi log. Again, thank you very much for your great addon.
This is the changed code:
def launch_external_android(self):
import subprocess
self.update_external_launch_command()
if self.external_launch_command != 'none':
if xbmc.Player().isPlaying():
xbmc.Player().stop()
xbmc.sleep(500)
xbmc.audioSuspend()
xbmc.enableNavSounds(False)
android_stop_command = '/system/bin/am force-stop com.retroarch'
android_stop_command2 = '/system/xbin/su -c "/system/bin/killall -SIGKILL com.retroarch"'
android_stop_command3 = '/system/xbin/su -c "/system/bin/am force-stop com.retroarch"'
try:
if self.IAGL.get_setting_as_bool(self.IAGL.handle.getSetting(id='iagl_enable_android_stop_command')):
xbmc.log(msg='IAGL: Sending Android Stop Command: %(android_stop_command)s' % {'android_stop_command': android_stop_command}, level=xbmc.LOGNOTICE)
external_command_stop = subprocess.call(android_stop_command,shell=True,executable='/system/bin/sh')
xbmc.sleep(500)
external_command_stop = subprocess.call(android_stop_command2,shell=True,executable='/system/bin/sh')
xbmc.sleep(500)
external_command_stop = subprocess.call(android_stop_command3,shell=True,executable='/system/bin/sh')
xbmc.sleep(500)
xbmc.log(msg='IAGL: Sending Android Launch Command: %(external_command)s' % {'external_command': self.external_launch_command}, level=xbmc.LOGNOTICE)
external_command = subprocess.call(self.external_launch_command,shell=True,executable='/system/bin/sh')
xbmc.sleep(500)
# Launch twice because it seems it doesn't open first time
xbmc.log(msg='IAGL: Sending Android Launch Command: %(external_command)s' % {'external_command': self.external_launch_command}, level=xbmc.LOGNOTICE)
external_command = subprocess.call(self.external_launch_command,shell=True,executable='/system/bin/sh')
except Exception as exc:
xbmc.log(msg='IAGL: Unable to use subprocess call. Exception %(exc)s' % {'exc': exc}, level=xbmc.LOGNOTICE)
if self.IAGL.get_setting_as_bool(self.IAGL.handle.getSetting(id='iagl_enable_android_stop_command')):
xbmc.log(msg='IAGL: Sending Android Stop Command: %(android_stop_command)s' % {'android_stop_command': android_stop_command}, level=xbmc.LOGNOTICE)
os.system(android_stop_command)
xbmc.sleep(500)
os.system(android_stop_command2)
xbmc.sleep(500)
os.system(android_stop_command3)
xbmc.sleep(500)
xbmc.log(msg='IAGL: Sending Android Launch Command: %(external_command)s' % {'external_command': self.external_launch_command}, level=xbmc.LOGNOTICE)
os.system(self.external_launch_command)
# Launch twice because it seems it doesn't open first time
xbmc.sleep(500)
xbmc.log(msg='IAGL: Sending Android Launch Command: %(external_command)s' % {'external_command': self.external_launch_command}, level=xbmc.LOGNOTICE)
os.system(self.external_launch_command)
xbmc.audioResume()
xbmc.enableNavSounds(True)
return True
else:
return False
Posts: 55
Joined: Jan 2018
Reputation:
0
2018-11-17, 13:50
(This post was last modified: 2018-11-17, 14:58 by lunamoon.)
I think only launching second command (killall -SIGKILL) it will achieve kill RetroArch. I launch the three ones so I am sure we kill RetroArch.
Perhaps, we could send SIGTERM first, then check if RetroArch is stopped, and if it is running, then send SIGKILL.
But I think that it is not necessary, really the objective is to stop the com.retroarch process and I really believe that what it was doing is not important at the moment we try to stop it.
Now I do not have time, but later, I will do a test by sending the original IAGL command (am force-stop) and then I will change it to only launch the SIGKILL signal and send you the logs of the two tests.
Posts: 55
Joined: Jan 2018
Reputation:
0
2018-11-17, 21:10
(This post was last modified: 2018-11-17, 21:21 by lunamoon.)
Hello again, Zach.
I already have the two logs.
I have seen that IAGL always enters by the first form of call you use (subprocess.call), and no exception is thrown, so os.system is not called.
However, as I have already mentioned, and as you will see in the logs if you want, I first launched the game Galaxian (MAME2003 core), and then the Pac-Man plus. And although in the log we can see that he is trying to launch the Pac-Man, I can assure you that the Galaxian is still opening for me.
However, by changing the main.py and launch SIGKILL signal to RetroArch, although in the log we still see the same, however, when launching the Pac-Man Plus, this game opens and not the Galaxian.
I do not know if you want I paste logs here or there is some way to make them arrive you, but if you are interested, tell me and I will send them to you in the way you indicate.
Greetings.
Posts: 55
Joined: Jan 2018
Reputation:
0
Probably, I wrote you because if I change the code to directly launch the call to os.system instead of calling subprocess.call, then it may work. I haven't tested it, but in next update from repository, this modification will be deleted, as you know.
But you're right. Maybe in some OS an exception is thrown and in others like mine, IAGL doesn't launch exception; and therefore, directly fails, it does not kill the com.retroarch process, but in the log it seems that it does.
So, if you want, you can incorporate, as I have done, the command to send the SIGKILL signal, so you make sure that in those systems, like mine, you kill the RetroArch process.
It's up to you.
Again, Zach, thank you very much for this wonderful addon.
Posts: 12,638
Joined: Oct 2014
Reputation:
631
The board language is English only please.
Posts: 42
Joined: Jan 2013
Reputation:
0
kpop
Junior Member
Posts: 42
how do i go about to change the backgrounds in all the menus(the ones that say internet archive with a grey background ,to a custom one?
Posts: 1,043
Joined: Oct 2015
Reputation:
50
So, im still a bit confused. Do we still need to use a special Retroplayer build to play games with Kodi video player? Has the support been added in the latest Leia yet? Can we just install binary liberto cores on the latest Leia to use with IAGL??