Author Topic: Bear with me and this bug report please (AM not launching emulator).  (Read 16628 times)

xod

  • Full Member
  • ***
  • Posts: 25
    • View Profile
I registered to report a bug and relaized that the bug report subforum just links to github. Since I have no github account (the interface is horrible enough to keep me away, for anything) and already registered here, I was thinking if you don't want this bug report in here, then I would be grateful if someone posts following report in below paragraph to github on account (note the different semantics of "account" now) of me or him/herself if need be.

Ok, so I have set everything up for running MAME 0.78, and no matter what myriads of custom config (related to paths and args) I could come up with, the AM refused to launch emulator (just a brief "black screen" for a few milliseconds, after which attract mode GUI returned back). As I examined the log file (and attract-console), I saw no wrong. The paths and args expanded as intended and yet nothing happened. I copied that exact expanded commandline into console and executed with success. Ths was perplexing, very perplexing. I lanched DebugView to see if it had functionality to intercept and log the "commandline" (precesses and args) invoked by a given process (in this case, AM). While I had DEbugView open, I ran AM again, and suddenly...YES. I thought to myself: "wtf!!!". I exited AM, closed DebugView and ran AM again, and again it refused to launch emulator. I lanched DebugView again and repeated, and again AM DID lanch emulator. I wondered if it had anything to do with DebugView's window set to "always in front", so launched another app to verify, this time Task Manager. So I launched task manager with and without "always on top" (in that order), with the result of success and failure (in that order). I further examined by changing AM's window mode to the other options, and it becomes clear that..

Attract mode can only successfully launch emulator if..

1) at least one app (for example Task Manager) runs with it's window being in front layer ("always on top").
or
2) Attract-Mode runs in windowed mode.

System:
    CPU: AMD Athlon 64 X2 5200+ (2GB RAM)
    GPU: ATI Radeon HD4550 (512MB VRAM)
    OS: Windows 7 Home Premium 32-bit
« Last Edit: November 03, 2018, 01:39:55 PM by xod »

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1167
    • View Profile
Re: Bear with me and this bug report please (AM not launching emulator).
« Reply #1 on: November 03, 2018, 09:22:14 AM »
Both of those two items are not valid in my case. I have been running my arcade with windows 10 1606 enterprise an hd5450. Boots straight to attract with nothing else (no explorer). However, I have never run such an old mame version.

Are you running a fresh install of windows?
What apps do you have open? Is explorer running?
Can you post your emulator config file?
What terminal command are you using to launch separately of attract?

xod

  • Full Member
  • ***
  • Posts: 25
    • View Profile
Re: Bear with me and this bug report please (AM not launching emulator).
« Reply #2 on: November 03, 2018, 02:19:51 PM »
Both of those two items are not valid in my case. I have been running my arcade with windows 10 1606 enterprise an hd5450. Boots straight to attract with nothing else (no explorer). However, I have never run such an old mame version.

I assumed that most users are not suffering from this, or else we'd be reading about it, alot.

Quote
Are you running a fresh install of windows?

I installed the OS about 4-5 years ago. Although I have never experienced such behavior with any other app. None.

Quote
What apps do you have open? Is explorer running?

Different apps at different times (includes explorer). Sometimes nothing.
Explorer, Notepad, Notepad++, Opera, qBittorrent...
Doesn't matter in which combo. The one and only pattern I can see is that at least one app (window) must be "always on top" for AM to successfully launch emulator. I just tried again without any app "always on top", and mame was not launched (through AM that is, launching mame independently is always successful). This time I tried yet another app, VLC, and set it's window "always on top", and as expected, mame was launched successfully. I will later disable the TortoiseHg Overlay Icon Server to see if that has any effect. Btw, by "explorer", do you mean as file manager, or as desktop shell ? I have not tried terminating explorer as desktop shell yet, but I'd rather lanuch an app "always on top" rather then kill explorer for AM to work. Not that I woulnd't love to get rid of the former annoyance (random app "always on top") though.

Quote
Can you post your emulator config file?

You mean AM's MAME.cfg, or MAME's mame.ini ?

Quote
What terminal command are you using to launch separately of attract?

Anything that's valid, like: c:\path\to\mame.exe 1942 -rompath e:\path\to\mameroms.
But also I take, for validation, the expanded (by AM) commandline, like..

Code: [Select]
[name] -rompath [rompath] -d3d -d3dfilter 1 -d3deffect scan75 -d3dscan 75 -skip_disclaimer -skip_gameinfo
..which is expanded to..

Code: [Select]
C:\__etr7priv\Applications\mame078b\mame.exe 1942 -rompath C:\__etr7priv\Emulation\MAME/ROMs\0.78/ -d3d -d3dfilter 1 -d3deffect scan75 -d3dscan 75 -skip_disclaimer -skip_gameinfo
..and I copy that expansion to command processor console and execute, and it runs without any problem.

-edit-

I closed the TortoiseHg Overlay Icon Server without postive outcome.

If I had modded this windows installation I would suspect that could possibly be the problem, but I have not touched it, unlike my old XP which I modded with various desktop shells, custom icons (tango) reinforced by an on-boot always executing program, hacked uxtheme.dll, etc. But again, I have not touched this Win7 installation.
« Last Edit: November 03, 2018, 02:35:06 PM by xod »

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1167
    • View Profile
Re: Bear with me and this bug report please (AM not launching emulator).
« Reply #3 on: November 03, 2018, 02:27:45 PM »
Not sure if it matters, but your mixing slashes and backslashes in your path.

Try closing all apps including explorer (shell).

xod

  • Full Member
  • ***
  • Posts: 25
    • View Profile
Re: Bear with me and this bug report please (AM not launching emulator).
« Reply #4 on: November 03, 2018, 02:40:10 PM »
Not sure if it matters, but your mixing slashes and backslashes in your path.

I have only used backward slash in the paths I set. It's Attract-Mode that adds forward slashes. But it doesn't matter, since I have copied AM's expanded commandline, pasted into command processor console, and executed (very) successfully. Also, backward/forward slash doesn't explain why I have to ha at least one random app's window "always on top" for AM to successfully execute MAME.

Quote
Try closing all apps including explorer (shell).

Sure.

xod

  • Full Member
  • ***
  • Posts: 25
    • View Profile
Re: Bear with me and this bug report please (AM not launching emulator).
« Reply #5 on: November 03, 2018, 03:01:57 PM »
I did terminate explorer as desktop shell, with positive outcome.

So, an updated statement:

Attract mode can only successfully launch emulator if..

1) at least one app (for example Task Manager) runs with it's window being in front layer ("always on top").
or
2) Attract-Mode runs in windowed mode.
or
3) Explorer shell is not running.

qqplayer

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
Re: Bear with me and this bug report please (AM not launching emulator).
« Reply #6 on: November 03, 2018, 05:42:58 PM »
I did terminate explorer as desktop shell, with positive outcome.

So, an updated statement:

Attract mode can only successfully launch emulator if..

1) at least one app (for example Task Manager) runs with it's window being in front layer ("always on top").
or
2) Attract-Mode runs in windowed mode.
or
3) Explorer shell is not running.
1 Try resfix plugin.
2 Add minimun runtime to your mame.cfg

Code: [Select]
minimum_run_time     103 Try AM console version to check if your launching comand is right.
4 Create a .bat file with your AM launching command to check if there is some issue.

I have mame 0,78 working without poblems on w8,1 and mltiple AM versions.So its not an AM problem.

« Last Edit: November 03, 2018, 05:51:01 PM by qqplayer »

xod

  • Full Member
  • ***
  • Posts: 25
    • View Profile
Re: Bear with me and this bug report please (AM not launching emulator).
« Reply #7 on: November 04, 2018, 10:08:42 AM »
1 Try resfix plugin.
2 Add minimun runtime to your mame.cfg
Code: [Select]
minimum_run_time     103 Try AM console version to check if your launching comand is right.
4 Create a .bat file with your AM launching command to check if there is some issue.

I have mame 0,78 working without poblems on w8,1 and mltiple AM versions.So its not an AM problem.

1) What does resfix do ? (edit: nevermind, I thought I had to find and download it)
2) It seems that "minimum_run_time" is the setting name of old(er) AM version, and whose modern equivalent is "nb_mode_wait" ? In any case I have tried both from 1 all the way up to 240, without success. AM waits for chosen amount of seconds, and then continues. Also what is the intended semantics for "non-blocking" in this case ? I ask because it sure as heck is BLOCKING (and definitely NOT non-blocking). So if I have 240 seconds, the AM GUI blocks/sleeps for 4 minutes after which is responsive again.
3) I have already checked the log (both "last_run.log" as well as "attract-console.exe") and there is nothing wrong there.
4) Why a .bat file ? I doubt AM, instead of simply outputting any error to either stderr or stdout, would instead set some error level ! That would make no sense, and I doubt that's what you meant.

Some additional info: I set "nb_mode_wait" to 240, and as soon as I (attempted to) launch an emulator/game, I went over to the Process Explorer window that was waiting for me, and I saw attract.exe without a child (mame.exe).

Downloaded Process Monitor, and while I have no familiarity (only tested it for a few minutes 10+ years ago), I have created a filter (to capture mame.exe activity, if it is even starting..), and using that, mame.exe seems to start.....and quit 1-2 seconds later:

Started:  2018-11-04 18:57:36
Ended:    2018-11-04 18:57:37

If developer needs extensive log from Process Monitor, just let me know.

-edit-

Oh I forgot, Process Monitor provides the commandline that mame.exe was invoked with:
Code: [Select]
C:\__etr7priv\Applications\mame078b\mame.exe 1942 -rompath C:\__etr7priv\Emulation\MAME/ROMs\0.78/ -d3d -d3dfilter 1 -d3deffect scan75 -d3dscan 75 -skip_disclaimer -skip_gameinfo
Also, as requested, MAME.cfg (Not needed IMO, but anyway):
Code: [Select]
# Generated by Attract-Mode v2.4.1
#
executable           C:\__etr7priv\Applications\mame078b\mame.exe
args                 [name] -rompath [rompath] -d3d -d3dfilter 1 -d3deffect scan75 -d3dscan 75 -skip_disclaimer -skip_gameinfo
workdir              C:\__etr7priv\Emulation\MAME
rompath              ROMs\0.78
romext               .zip;.7z
system               Arcade
info_source          listxml
artwork    marquee         Marquees
artwork    snap            Snaps;Flyers
« Last Edit: November 05, 2018, 03:16:25 PM by xod »

qqplayer

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
Re: Bear with me and this bug report please (AM not launching emulator).
« Reply #8 on: November 05, 2018, 03:27:42 PM »
Try this ,put your roms in this rompath, edit or create your mame.ini adding the rompath directory.

Code: [Select]
# Generated by Attract-Mode v2.4.1
#
executable           C:\__etr7priv\Applications\mame078b\mame.exe
args                 "[romfilename]"
rompath              C:\__etr7priv\Applications\mame078b\mame.exe\roms\
romext               .zip

Once you get this basic config working add all the other -config options.


xod

  • Full Member
  • ***
  • Posts: 25
    • View Profile
Re: Bear with me and this bug report please (AM not launching emulator).
« Reply #9 on: November 05, 2018, 06:24:29 PM »
Try this ,put your roms in this rompath, edit or create your mame.ini adding the rompath directory.

Code: [Select]
# Generated by Attract-Mode v2.4.1
#
executable           C:\__etr7priv\Applications\mame078b\mame.exe
args                 "[romfilename]"
rompath              C:\__etr7priv\Applications\mame078b\mame.exe\roms\
romext               .zip

Once you get this basic config working add all the other -config options.

I did that, except I pointed 'rompath' to my actual rompath, and same problem as before. Not sure why you suggest putting the roms in<mameroot>\mame.exe\roms\, I'm over 100% certain that won't help the slightest.

For everyone's information, my SNES9X emulator's Attract-Mode config gives no problem at all. I do NOT have to have at least one random application window "always on top", or terminate explorer shell or whaetver. AM -> SNES9X is always successful.

toothlessgrinn

  • Sr. Member
  • ****
  • Posts: 190
    • View Profile
Re: Bear with me and this bug report please (AM not launching emulator).
« Reply #10 on: November 06, 2018, 12:03:16 AM »
Here's my 2 cents if its worth at least one.... Imho I think your args. Have way to much going on. Try leaving it at default setting and delete working path line. Think its conflicting with its self cuz its got too much going on. My mame config is default and have no issues running any version of mame. And my working path is blank.

Good luck.
we came , we saw , we lost LOTS of quarters...

Win 7
Asus mobo amd 64bit 3core
12g ram
4 player. Custom built woody cab
46" plasma screen with 22" marquee

xod

  • Full Member
  • ***
  • Posts: 25
    • View Profile
Re: Bear with me and this bug report please (AM not launching emulator).
« Reply #11 on: November 06, 2018, 02:08:23 AM »
Here's my 2 cents if its worth at least one.... Imho I think your args. Have way to much going on. Try leaving it at default setting and delete working path line. Think its conflicting with its self cuz its got too much going on. My mame config is default and have no issues running any version of mame. And my working path is blank.

Good luck.

I have cut down on them. It was simple to begin with, but since I could not launch MAME through AM, I started modifying and adding properties (including workdir and explicitly including rompath in args) and that's the story of how my .cfg ended up bloated like that.

But all the cleanup doesn't help. And since I use Process Monitor to monitor mame.exe, I can see the exact args that are given to it by AM, and like before the cleanup, there is no problem there, the args are as expected and correct. As I have written before, there there is a breakage on MAME's execution when following things are combined.

MAME is launched by AM (important: NOT when MAME is lanched by user directly, or NOT when AM launches another emu, like SNES9X).
+
Explorer shell IS running, or AM is NOT running in windowed mode, or there is NOT ONE SINGLE (other) application window that is "always on top".

With the comination/circumstances like above, MAME will start but 1-2 seconds later it will have exited (NOT crash). And here's the important part, regardless of when MAME fails to keep executing due to the combination above being TRUE, or when it succedes to keep executing due to the combination above being FALSE, the ARGUMENTS that mame.exe is given by attract.exe is ALWAYS one and the same CORRECT arguments (I can clearly see that with Process Monitor). Therefore, the problem has absolutely nothing to do with arguments passed to mame.exe. The problem is raised by one of the parts involved (AM or MAME or any part of Wiindows 7 Home Premium 32-bit SP1). That other users do not seem to suffer could be due to them not running Wiindows 7 Home Premium 32-bit SP1, or that those that do suffer are not posting in forums or report bugs, and just stop with any FE alltogether or move on to some other FE.

toothlessgrinn

  • Sr. Member
  • ****
  • Posts: 190
    • View Profile
Re: Bear with me and this bug report please (AM not launching emulator).
« Reply #12 on: November 06, 2018, 07:42:50 PM »
then you have a bad capacitor. and yes that can cause issues with programs. cuz there should be no issues then. i dont know why any one is ha ving such issues .... wait what layout are you using? may sound nuts but squirrel is kinda touchy with the layouts. if your using a custom one sometimes they make am do crazy crap. seriously. took me months to figure this one out!! i switched to am3.2 i think and mame .191 and everything works flawlessly. daphne nes snes and atari 2600. i even have wii remotes for light guns. so if none of this is helpful im sorry but i tried. lol

good luck 
we came , we saw , we lost LOTS of quarters...

Win 7
Asus mobo amd 64bit 3core
12g ram
4 player. Custom built woody cab
46" plasma screen with 22" marquee

xod

  • Full Member
  • ***
  • Posts: 25
    • View Profile
Re: Bear with me and this bug report please (AM not launching emulator).
« Reply #13 on: November 07, 2018, 05:47:46 AM »
I use default layout (attrac-man), and the problem cannot have much to do with layouts (I have tested to verify as well).

Has anyone tested any AM version on Win7 Home Preium 32-bit (SP1), testing MAME (0.78) with it ?
I suppose in the upcoming days I'll download newest mame with a few new roms, and see if that version raises problems as well.

toothlessgrinn

  • Sr. Member
  • ****
  • Posts: 190
    • View Profile
Re: Bear with me and this bug report please (AM not launching emulator).
« Reply #14 on: November 07, 2018, 08:36:33 AM »
THEN YOUR ARGS ARE WRONG AND YOUR CODE IS OFF!

i dont understand how people are having such problems. mine WORKS FLAWLESSLY

then you need a new board and get windows 64 bit. mame DOES NOT need any args to work. even the older versions.
SOMTHING is conflicting so that tells me either you have a bad BOARD  or your CODE is off some how or yor windows instal is CORRUPT cuz it aint ATTRACT MODE!!

ATTRACT MODE NEEDS NOHELP TO WORK AND ALOT OF YOU "TINKERS" ARE FILLING YOU CONFIGS WITH UNNEEDED CRAP AND WONDER WHY IT DOESNT WORK....

im a hardware guy i am by NO means a command line/code person and mine works FINE!

sorry for the caps but goddamn ......
we came , we saw , we lost LOTS of quarters...

Win 7
Asus mobo amd 64bit 3core
12g ram
4 player. Custom built woody cab
46" plasma screen with 22" marquee