diff --git a/module/device/platform/platform_windows.py b/module/device/platform/platform_windows.py index c7fbeb497..2a520e8a6 100644 --- a/module/device/platform/platform_windows.py +++ b/module/device/platform/platform_windows.py @@ -92,11 +92,14 @@ class PlatformWindows(PlatformBase, EmulatorManager): # NemuPlayer.exe -m nemu-12.0-x64-default self.execute(f'"{exe}" -m {instance.name}') elif instance == Emulator.MuMuPlayer12: - # MuMuPlayer.exe -v 0 - # MuMuNxMain.exe -v 0 + # MuMuManager.exe api -v 0 launch_player + # Launch via MuMuManager instead of MuMuPlayer.exe/MuMuNxMain.exe. + # MuMuNxMain.exe is a GUI singleton, if two instances get launched at the same time, + # the second launch request is handed over to a MuMuNxMain.exe that is still initializing + # and gets silently dropped, while MuMuManager queues requests in backend service. if instance.MuMuPlayer12_id is None: logger.warning(f'Cannot get MuMu instance index from name {instance.name}') - self.execute(f'"{exe}" -v {instance.MuMuPlayer12_id}') + self.execute(f'"{Emulator.single_to_console(exe)}" api -v {instance.MuMuPlayer12_id} launch_player') elif instance == Emulator.LDPlayerFamily: # ldconsole.exe launch --index 0 self.execute(f'"{Emulator.single_to_console(exe)}" launch --index {instance.LDPlayer_id}') @@ -314,9 +317,12 @@ class PlatformWindows(PlatformBase, EmulatorManager): return False # Start if self._emulator_function_wrapper(self._emulator_start): - # Success - self.emulator_start_watch() - return True + if self.emulator_start_watch(): + # Success + return True + else: + # Start command was sent but emulator didn't come online, stop and start again + continue else: # Failed to start, stop and start again if self._emulator_function_wrapper(self._emulator_stop):