Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. My bare hosting costs are currently not met so please consider becoming a contibuting member by either clicking this text or the Patreon link on the right.

Patreon

If neither of those of work for you, you can donate any amount by clicking here.

Recommended Posts

Posted
  TSpeirs said:
Yeah sorry for confusing you, thats an overloaded function that takes Game_Info but it then takes it converts it to an intptr and calls InvokeMethod again, see 3rd line.

lol yes it was the overloaded InvokeMethod that got me. I would never have expected that, and I thought you were going crazy because the problem looked so obvious to me! Oh well, time to keep racking our brains.

Posted
  headkaze said:
lol yes it was the overloaded InvokeMethod that got me. I would never have expected that, and I thought you were going crazy because the problem looked so obvious to me! Oh well, time to keep racking our brains.

Can you go crazy when you already are!?

All,

Here is an updated GameEx.exe can you please let us know if it fixes the speech plugin?

GameEx.zip

Posted

Just tested.. I can get the error everytime after selecting a few games from the mame list. Then it will close the plugin.

  Quote
17:43:25.8 26/11/2006: Testing Main Loop Once: Processing Frame

17:43:26.1 26/11/2006: Testing Main Loop Once: Main Loop ran successfully

17:43:44.7 26/11/2006: PlugIn: "Speak Game Name" caused an exception and is being disabled.

17:43:44.7 26/11/2006: Exception has been thrown by the target of an invocation.

17:43:44.7 26/11/2006: at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess)

17:43:44.7 26/11/2006: at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean verifyAccess)

17:43:44.7 26/11/2006: at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

17:43:44.7 26/11/2006: at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)

17:43:44.7 26/11/2006: at GameEx.PlugIns.InvokeMethod(Object obj, String sProperty, Object oValue)

17:43:44.7 26/11/2006: at GameEx.PlugIns.InvokeMethod(Object obj, String sProperty, Game_Info oValue)

17:43:44.7 26/11/2006: at GameEx.PlugIns.Event_GameShowInfo(Game_Info gi)

I also got a few of the following errors when running GameEx again. Then it started working again.

post-367-1164534561_thumb.jpg

Posted

Not sure about the unhandled exception maybe a windows issues.

Can you do some more testing. I was wondering if it has something to do with the games being run, in terms of data being sent to the plugin?

Posted
  TSpeirs said:
Not sure about the unhandled exception maybe a windows issues.

Can you do some more testing. I was wondering if it has something to do with the games being run, in terms of data being sent to the plugin?

Can you not get the error on your machine? It's easy to get it to happen here. All I do is go into the Mame list, select the first game (005), press backspace, select game again, press backspace etc. a few times then it will cause the exception.

I don't understand this, it was working fine before!

Posted
  headkaze said:
Can you not get the error on your machine? It's easy to get it to happen here. All I do is go into the Mame list, select the first game (005), press backspace, select game again, press backspace etc. a few times then it will cause the exception.

I don't understand this, it was working fine before!

Okay,

What I actually got was a complete freeze in gameex after a few games, next time I tried Visual Studio reported an exception after a few games again, but I was not debugging. So I compiled as Debug. Solid as a rock. So compiled as release. Can't get it to crash and there was loads of speech queued, took 20 seconds to exit GameEx with Sam rattling on but it closed fine.

So basically try this version. Maybe a Visual Studio bug or something on my dev machine with the compile. PC's been up a little while.

GameEx.zip

Posted

Still getting those "memory could not be read" errors.

Also a new error message

18:31:01.5  26/11/2006:  PlugIn: "Exit GameEx" caused an exception and is being disabled.
18:31:01.5 26/11/2006: Object reference not set to an instance of an object.
18:31:01.5 26/11/2006: at System.Runtime.InteropServices.Marshal.StructureToPtr(Object structure, IntPtr ptr, Boolean fDeleteOld)
18:31:01.5 26/11/2006: at GameEx.PlugIns.InvokeMethod(Object obj, String sProperty, Game_Info oValue)
18:31:01.5 26/11/2006: at GameEx.PlugIns.Event_GameShowInfo(Game_Info gi)
18:31:30.1 26/11/2006: PlugIn: "Speak Game Name" caused an exception and is being disabled.
18:31:30.1 26/11/2006: Exception has been thrown by the target of an invocation.
18:31:30.1 26/11/2006: at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess)
18:31:30.1 26/11/2006: at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean verifyAccess)
18:31:30.1 26/11/2006: at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
18:31:30.1 26/11/2006: at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)
18:31:30.1 26/11/2006: at GameEx.PlugIns.Event_AppExit()
18:31:30.1 26/11/2006: Exiting GameEx!
18:31:30.1 26/11/2006: Saving Settings
18:31:30.2 26/11/2006: Disposing Plugins
18:31:30.2 26/11/2006: Checking for applications to Launch On Exit

There is definately something fishing going on!

Posted

Well I found a really bug in the code. See if you can see :)

Dim InfoPtr As IntPtr = Marshal.AllocCoTaskMem(Marshal.SizeOf(oValue))

Marshal.StructureToPtr(oValue, InfoPtr, True)

Return InvokeMethod(obj, sProperty, InfoPtr)

Marshal.FreeCoTaskMem(InfoPtr)

So this version should be ok I think.

You may also need to reboot, due to the memory leak. Probably explains the unhandled exceptions.

GameEx.zip

Posted
  TSpeirs said:
Well I found a really bug in the code. See if you can see :)

Dim InfoPtr As IntPtr = Marshal.AllocCoTaskMem(Marshal.SizeOf(oValue))

Marshal.StructureToPtr(oValue, InfoPtr, True)

Return InvokeMethod(obj, sProperty, InfoPtr)

Marshal.FreeCoTaskMem(InfoPtr)

So this version should be ok I think.

You may also need to reboot, due to the memory leak. Probably explains the unhandled exceptions.

lol returning before freeing the the mem! Doh! I'm glad it was something simple :)

Posted

Nope still getting the same errors. Perhaps you need to change that true back to false. It might be causing the a problem. Since we FreeCoTaskMem I don't think it should destroy the structure first.

This is after a fresh reboot, and when I exited GameEx I also got a Application Error. Sorry I always close them before I remember to take a screenshot.

EDIT: There still is something wrong. Try running GameEx from remote desktop, the Plugin will cause an exception after you select a game.

EDIT2: I think I've found out why I'm getting that error Tom. You must be Disposing the plugin before the "Goodbye" when you exit because I removed "voice.Speak("Goodbye", 0);" from the plugin and I don't get that error anymore. The second parameter in voice.Speak() as "0" means play asyncronously so when it finishes saying the word "Goodbye" it goes to return back to the plugin but it has been disposed already. I dunno, just a guess.

Posted
  headkaze said:
Nope still getting the same errors. Perhaps you need to change that true back to false. It might be causing the a problem. Since we FreeCoTaskMem I don't think it should destroy the structure first.

This is after a fresh reboot, and when I exited GameEx I also got a Application Error. Sorry I always close them before I remember to take a screenshot.

EDIT: There still is something wrong. Try running GameEx from remote desktop, the Plugin will cause an exception after you select a game.

I think that did it. There was another place I was not freeing the intptr too.

I really hammered it, working for me.

Never had issues with Remote Desktop, i pretty much do everyhing through remote desktop.

Try this one.

EDIT: I checked, the disposing is in the right place. Not too sure about that, it should be changed to async though I think, because on my system if theres a queue of speech gameex wont close untill its all been said!

GameEx.zip

Posted

See my EDIT2, I think it's working fine aside for the Goodbye causing an exception when you exit. If I comment out voice.Speak("Goodbye", 0); I no longer get the exception. I think the bugs have been sorted now :)

Yep I think I'm right about this one. Change the line to voice.Speak("Goodbye", SpeechLib.SpeechVoiceSpeakFlags.SVSFlagsAsync); and it will cut out the voice halfway through saying "Goodbye" but will not cause an exception.

BTW You don't actually notice the exception unless you view the log file.

Posted
  headkaze said:
See my EDIT2, I think it's working fine aside for the Goodbye causing an exception when you exit. If I comment out voice.Speak("Goodbye", 0); I no longer get the exception. I think the bugs have been sorted now :)

Yep I think I'm right about this one. Change the line to voice.Speak("Goodbye", SpeechLib.SpeechVoiceSpeakFlags.SVSFlagsAsync); and it will cut out the voice halfway through saying "Goodbye" but will not cause an exception.

BTW You don't actually notice the exception unless you view the log file.

Sorry Ben, can you confirm the exception your talking about is handled. ie in the gameex log?

Posted

20:09:41.1  26/11/2006:  Testing Main Loop Once: Processing Frame
20:09:41.3 26/11/2006: Testing Main Loop Once: Main Loop ran successfully
20:09:48.5 26/11/2006: PlugIn: "Speak Game Name" caused an exception and is being disabled.
20:09:48.5 26/11/2006: Exception has been thrown by the target of an invocation.
20:09:48.6 26/11/2006: at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess)
20:09:48.6 26/11/2006: at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean verifyAccess)
20:09:48.6 26/11/2006: at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
20:09:48.6 26/11/2006: at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)
20:09:48.6 26/11/2006: at GameEx.PlugIns.Event_AppExit()
20:09:48.6 26/11/2006: Exiting GameEx!
20:09:48.6 26/11/2006: Saving Settings
20:09:48.7 26/11/2006: Disposing Plugins
20:09:48.7 26/11/2006: Checking for applications to Launch On Exit

All I have to do to get the above error is open GameEx, then close GameEx. So that narrows it down. Also removing the last "Goodbye" speech line removes the error.

BTW We could use the SpeechLib.SpeechVoiceSpeakFlags.SVSFPurgeBeforeSpeak so it doesn't queue up speech. I think you can just | (OR) them together

SpeechLib.SpeechVoiceSpeakFlags.SVSFPurgeBeforeSpeak | SpeechLib.SpeechVoiceSpeakFlags.SVSFlagsAsync

Should mean it will speak without waiting and not queue up speech.

Posted

Thanks for that works great.

Does this cause an exception?

public void Event_App_Exit()
{

voice.Speak("Goodbye", SpeechLib.SpeechVoiceSpeakFlags.SVSFPurgeBeforeSpeak | SpeechLib.SpeechVoiceSpeakFlags.SVSFlagsAsync);
System.Threading.Thread.Sleep(2000);


}

Posted
  headkaze said:
Yep I think I'm right about this one. Change the line to voice.Speak("Goodbye", SpeechLib.SpeechVoiceSpeakFlags.SVSFlagsAsync); and it will cut out the voice halfway through saying "Goodbye" but will not cause an exception.

So yeah your code will work, as will the above code. But it will cut out the voice halfway through.

The code below dosn't work however...

public void Event_App_Exit()
{
voice.Speak("Goodbye", 0);
System.Threading.Thread.Sleep(2000);
}

I take it your not getting this exception at all?

Guest
This topic is now closed to further replies.
×
×
  • Create New...