when I exit out of an emulator wahcade keeps restarting it

A nice (keyboard based) front end for Arcade / Console game emulators.

Moderator: battlecat

when I exit out of an emulator wahcade keeps restarting it

Postby efaustus9 » Fri May 21, 2010 3:52 pm

I am having an issue; when I wish to exit a game I close the emulator with esc key, however soon as I am back at the wahcade screen it starts the emulator back up again. The only way to stop this cycle is to rapidly hit the esc key so that I catch the wahcade menu and close wahcade. This does not happen every time but it happens very frequently. Any ideas as to the cause and maybe a possible solution? Thanks in advance.

update:
It might have something to do with the controller I am using, sony wireless dual shock 3. when setting up keys in wahcade-setup I would freqently get this error message;

Traceback (most recent call last):
File "/usr/local/share/games/wahcade/joystick.py", line 176, in poll
event_cb(active_window, e, "JOYSTICK", mw_key)
File "/usr/local/share/games/wahcade/wc_setup.py", line 215, in on_cboJoystick_key_press_event
self.lblJoystick.set_text(self.rev_joystick_ctrls[joystick_key])
File "/usr/local/share/games/wahcade/glade2.py", line 63, in __getattr__
raise AttributeError('Widget %s not found' % (key))
AttributeError: Widget lblJoystick not found

which would close the setup utility.
efaustus9
 
Posts: 5
Joined: Thu May 20, 2010 2:12 pm

Re: when I exit out of an emulator wahcade keeps restarting it

Postby Zombie » Fri May 21, 2010 8:20 pm

This is a known bug in WahCade. Its been around for the past several releases and we still don't know a fix.
User avatar
Zombie
 
Posts: 791
Joined: Mon Oct 06, 2008 2:52 pm

Re: when I exit out of an emulator wahcade keeps restarting it

Postby efaustus9 » Fri May 21, 2010 9:29 pm

Thanks for the reply. Do you suggest I use an earlier version of wahcade then? If so what version is not afflicted? This happens rather frequently and just about defeats the appeal of wahcade.

I also found the bug listing here:
https://bugs.launchpad.net/wahcade/+bug/318921
efaustus9
 
Posts: 5
Joined: Thu May 20, 2010 2:12 pm

Re: when I exit out of an emulator wahcade keeps restarting it

Postby Zombie » Sat May 22, 2010 2:46 am

All versions of WahCade have this bug that I know of. There are a few work around.

1. Don't use the joypad to start the emulator. Use something that can emulate a keystroke,
2. Use a Wiimote. A wiimote sends keypad inputs.
User avatar
Zombie
 
Posts: 791
Joined: Mon Oct 06, 2008 2:52 pm

Re: when I exit out of an emulator wahcade keeps restarting it

Postby sairuk » Tue May 25, 2010 6:03 pm

I had this happen over the weekend after i'd configured my psx gamepads. I've come up with my own workaround tonight (new version is working so far for me, no loops anymore).

*** This is now an updated attempt at the fix from yesterday, previous attempt initiated the loop shortly after posting.

my edited win_main.py attached, changes listed below

Installation:
  • Backup old win_main.py file
  • Extract new win_main.py
  • Copy new win_main.py to wahcade directory
  • Add new entry to wahcade.ini


This workaround attempts to address 3 issues:
  • Key Repeat on Launch of Item
  • Initiating numerous sessions by keyboard when existing the emulator, before the wahcade screen is visible
  • Initiating a second session by joypad when exiting the emulator, before the wahcade screen is visible
Seems to be something going on with key repeat where i can replicate the loop manually. Hard to lock down because the loop seems execute randomly???

Changes to WAHCADE v0.99pre8

wahcade.ini
Code: Select all
lock_time                               1

number of seconds the lock will be active for, set long enough to allow the wahcade screen to become visible
add to wahcade.ini as below
Code: Select all
### Addtional Wah!Cade Options (not used by MameWAH) ###
fullscreen                              1
setup_window_size                       734x731
layout_orientation                      0
show_list_arrows                        0
shuffle_music                           0
lock_time                               3


win_main.py
__init__()
Code: Select all
added: lck_filename global var
added: lck_time global var
added: if lck_filename is found when starting wahcade it is deleted


on_winMain_focus_in()
Code: Select all
added: wait_with_events(lck_time) then remove lck_filename if exists


on_winMain_key_press()
Code: Select all
changed: moved entire function into an if not statement. Based around the existence of lck_filename

if lck_filename exists all key presses are ignored until lck_time expires at which point lck_filename is removed

launch_game()
Code: Select all
added: write executing command line to lck_filename


I'd hope there was better way to determine if the main window for wahcade was visible instead of using a counter. This is only my second look at python so i'm not to familiar with whats available at the moment.
You do not have the required permissions to view the files attached to this post.
Last edited by sairuk on Thu May 27, 2010 12:11 am, edited 4 times in total.
mameau - My random bits | Wah!Ki - A Wah!Cade wiki | Mah!Cade - Experimental Wah!cade Branch | ListGen | Lazarus
User avatar
sairuk
 
Posts: 432
Joined: Sat May 22, 2010 12:37 am

Re: when I exit out of an emulator wahcade keeps restarting it

Postby sairuk » Wed May 26, 2010 1:34 pm

I have edited my previous post with a new workaround, working for me so far.
mameau - My random bits | Wah!Ki - A Wah!Cade wiki | Mah!Cade - Experimental Wah!cade Branch | ListGen | Lazarus
User avatar
sairuk
 
Posts: 432
Joined: Sat May 22, 2010 12:37 am

Re: when I exit out of an emulator wahcade keeps restarting it

Postby balki » Wed May 26, 2010 7:53 pm

sairuk wrote:I have edited my previous post with a new workaround, working for me so far.


Good work! I'll see if I can figure out your changes and get them incorporated into the main branch. Part of my problem has been that I've never been able to duplicate the issue (it seems to be limited to certain controllers).

Cheers,
Andy
User avatar
balki
Site Admin
 
Posts: 425
Joined: Thu Jan 01, 1970 1:00 am
Location: Huddersfield, UK

Re: when I exit out of an emulator wahcade keeps restarting it

Postby sairuk » Thu May 27, 2010 12:55 am

balki wrote:Good work! I'll see if I can figure out your changes and get them incorporated into the main branch. Part of my problem has been that I've never been able to duplicate the issue (it seems to be limited to certain controllers).


Ta, thanks for wahcade..., you can simulate a loop with the keyboard when exiting an emulator you oly want to do this first time only by pressing and holding key 1 the instant after you press ESC to exit. (with the default settings).
This appears to execute the emulator cmd once for each time the key is repeated while held and throws you into a loop after the first exit.

The same loop can be triggered by pressing and holding (or tapping) the launch joypad button the instant after you ask the emulator to exit, which I'm thinking is perhaps triggering key_repeat in some regard.

All of this happens before the wahcade screen is visible in most cases (on my pc). My workaround simply disables registering any type of keypress for lck_time while a program exits, I still create lck_filename, which (a global var would probably suffice) stores the last executed commandline I was checking against in an earlier attempt.

I have 2 thoughts on a fix this issue, but not the experience with python to implement them properly.
  • Replace lck_time solution with a method of removing the file when the system detects that the wahcade window is fully rendered on the machine after emulator exit
  • Register all input with pygame instead of gtk.gdk(?). The default for pygame key_repeat is off from what I have read. Although you will still have to ignore input until the wahcade screen is fully rendered after exit

If going to work with my current solution, (and I was thinking of this last night). I intend to move the lck_time ini file setting to the emulator configs because each emu has different system requirements and in theory different exit durations.

Being that i'm forcing a loop manually, I can't guarantee this as a 100% fix. I can say with this new code inserted I have not seen a single joypad loop, where I was seeing them every few launches.
mameau - My random bits | Wah!Ki - A Wah!Cade wiki | Mah!Cade - Experimental Wah!cade Branch | ListGen | Lazarus
User avatar
sairuk
 
Posts: 432
Joined: Sat May 22, 2010 12:37 am

Re: when I exit out of an emulator wahcade keeps restarting it

Postby sairuk » Mon May 31, 2010 12:33 pm

previous version did not work in windows. I hadn't reset the launch_game function correctly after editing and it was indented into the platform != win32 if statement. (obviously not an issue when running previous code in linux).

new code attached.
You do not have the required permissions to view the files attached to this post.
mameau - My random bits | Wah!Ki - A Wah!Cade wiki | Mah!Cade - Experimental Wah!cade Branch | ListGen | Lazarus
User avatar
sairuk
 
Posts: 432
Joined: Sat May 22, 2010 12:37 am

Re: when I exit out of an emulator wahcade keeps restarting it

Postby stealth » Thu Jul 22, 2010 12:19 pm

Hello all,

Do you have any news about this problem, maybe a new version of wahcade ?

Thank's forl all
A little mamecab OS - Mah!Cade, mame , retroarch - Livemamecab
The live CD can be used for a quick demo or test, Download ISO
stealth
 
Posts: 70
Joined: Tue Jan 01, 2008 6:26 pm

Re: when I exit out of an emulator wahcade keeps restarting it

Postby sairuk » Sat Jul 24, 2010 2:10 am

you can try out my modified test version, until someone has a chance to review for inclusion in the main source. it includes the fixes above plus some other mods i required for my setup.

http://www.mameau.com/index.php?d=mahcade
mameau - My random bits | Wah!Ki - A Wah!Cade wiki | Mah!Cade - Experimental Wah!cade Branch | ListGen | Lazarus
User avatar
sairuk
 
Posts: 432
Joined: Sat May 22, 2010 12:37 am

Re: when I exit out of an emulator wahcade keeps restarting it

Postby stealth » Mon Aug 09, 2010 8:00 am

Thank Sairuk

I already use wahcade (last version) with ubuntu, how i can replace with yours ?
A little mamecab OS - Mah!Cade, mame , retroarch - Livemamecab
The live CD can be used for a quick demo or test, Download ISO
stealth
 
Posts: 70
Joined: Tue Jan 01, 2008 6:26 pm

Re: when I exit out of an emulator wahcade keeps restarting it

Postby sairuk » Mon Aug 09, 2010 9:46 am

stealth wrote:Thank Sairuk

I already use wahcade (last version) with ubuntu, how i can replace with yours ?


You can extract it to its own directory (in your home directory) and run it manually by executing waycade.py whilst you test it, then change the existing desktop icons or however you normally execute it once you are satisfied it is working

NOTE: i just installed this on my htpc with 9.10 and the loop has returned. [Un]fortunately the loop never occurred again on either of my machines with 10.04. I will have to try to work out another fix so I can use this frontend on my plasma.
mameau - My random bits | Wah!Ki - A Wah!Cade wiki | Mah!Cade - Experimental Wah!cade Branch | ListGen | Lazarus
User avatar
sairuk
 
Posts: 432
Joined: Sat May 22, 2010 12:37 am

Re: when I exit out of an emulator wahcade keeps restarting it

Postby stealth » Mon Aug 09, 2010 5:18 pm

Ok i tried, wahcade freeze after playing games so i can't chose another game. My artwork have disappeared maybe a link with the error code (see http://numsys.eu/TMP/)

Arg ! I work with 9.10 :(
A little mamecab OS - Mah!Cade, mame , retroarch - Livemamecab
The live CD can be used for a quick demo or test, Download ISO
stealth
 
Posts: 70
Joined: Tue Jan 01, 2008 6:26 pm

Re: when I exit out of an emulator wahcade keeps restarting it

Postby sairuk » Tue Aug 10, 2010 10:35 am

stealth wrote:Ok i tried, wahcade freeze after playing games so i can't chose another game. My artwork have disappeared maybe a link with the error code (see http://numsys.eu/TMP/)

Arg ! I work with 9.10 :(


you will need to add fuzzy_artwork_search 0 to wahcade.ini, or set it to 1 and wahcade will do a partial name lookup when matching artwork. There is a lot of system overhead currently when using this option. As I said earlier though, this fix doesnt work on my 9.10 box
mameau - My random bits | Wah!Ki - A Wah!Cade wiki | Mah!Cade - Experimental Wah!cade Branch | ListGen | Lazarus
User avatar
sairuk
 
Posts: 432
Joined: Sat May 22, 2010 12:37 am

Next

Return to Wah!Cade

Who is online

Users browsing this forum: No registered users and 2 guests

cron