#909 Overlay does not work with Guild Wars 2

1.2.5
closed
Kissaki
5
2013-12-25
2012-09-05
Anonymous
No

The overlay doesn't work with Guild Wars 2.

Discussion

  • CamEL

    CamEL - 2012-09-07

    Guild Wars 2 launcher problem, workaround solution you may append options in gw2 shortcut:
    e.g.
    -email youremail -password yourpassword -nopatchui

     
  • Kissaki

    Kissaki - 2012-10-19

    Confirmed. We are aware of this.

    Thank you for reporting. And esp. for the work-around.

     
  • Nicos Gollan

    Nicos Gollan - 2012-10-19

    I'll just add what I found so far, can't hurt to have it in here.

    The launcher uses some Flash-based framework, which creates a D3D device. When running dbgview, I get messages about DXGI which appear to come from the D3D10 overlay.

    After the launcher runs, the 3D context is recreated for the game proper, which uses "pure" D3D9 (not Ex) which should not have an issue with the overlay. However, the overlay doesn't detect any of that anymore after it has been triggered by the launcher. That is probably the reason why "hacking around" the launcher makes things work.

     
  • James Orr

    James Orr - 2013-01-10

    Just a note that while the work-around works, you can no longer access the trading post in the game if you use it due to authentication errors.

     
  • Tarun

    Tarun - 2013-03-25

    Do not use this "workaround".

    This will show your account name and password in plain text. Anyone who gets access to your computer could easily get this information. It's not worth the security risks.

     
  • James Orr

    James Orr - 2013-03-25

    Well, I'd say that's a judgement call. If you are the only person with physical access to your computer it's not really a risk.

    Anyway, there's a better work-around now so this is unnecessary. If you start another program such as Bandicam or Overwolf before mumble, the mumble overlay will work. I guess the mumble overlay is going on top of the bandicam overlay.

    The trading post still works using this method.

     
    • Tarun

      Tarun - 2013-04-01

      And should your computer get infected with malware it can very easily get that information from the shortcut(s) used. It really is not worth the risk.

      Kissaki has said they are working on it. I just wonder if there's any ETA for the fix.

       
  • Wesley W. Terpstra

    The work-around now breaks any in-game web actions requiring authentication (trading post, etc). I have a patch that fixes this in mumble properly. I will submit it as soon as I reduce it to be minimally invasive.

    The actual problem is not "device recreation". Rather, the game loader spawns a new thread for the actual game. Both loader and game use directx. When the loader thread quits, the reference count drops to zero and directx is unloaded. It is then reloaded by the main game. However, mumble does not rerun HardHook.setup for the reloaded directx DLL. Adding a reference to directx after hooking it solves the problem, but changes the visible interface to the game, so I am currently testing a better solution which detects the reload of the DLL and only then repatches the entry functions.

    I will attach a finished patch later today.

     
  • Wesley W. Terpstra

    Ok. Things worked out more or less exactly as I'd hoped. I've attached a patch that gets GW2 overlay working as cleanly as possible.

    Note: the hook check before library load is needed because unfortunately d3d9.dll is the very first DLL loaded by the new thread.

    For reference, I tried hooking FreeLibrary, but that doesn't work because the library loses references by the thread exiting. Also, trying to track the d3d9.dll reference count seems quite fragile to me. I briefly considered also hooking DllMain of d3d9.dll to watch for DETACH, but chickened out. The approach taken should be fairly robust to the manner in which the DLL gets unloaded. Also, since the new code only triggers if the DLL was unloaded, it is likely only GW2 will be affected.

     
  • Wesley W. Terpstra

    In case anyone needs GW2 mumble overlay working already, I've put a prebuilt installer up at https://roguestoriches.org.uk/mumble.msi Seems to work for our GW2 guild until there is a mumble release incorporating this fix.

    Don't use the server in that MSI as it has no ICE support.

     
  • Kissaki

    Kissaki - 2013-04-20

    Thank you for your contribution!

    First of all:
    It works!

    I will commit your patch under your displayed sf name here (as author) and do a follow-up commit. It will land in the after-1.2.4 branch.
    Again, thank you for your fix!

     
  • Wesley W. Terpstra

    Thank you for your contribution!

    Well, thank you for mumble. ;-)

    It will land in the after-1.2.4 branch.

    Ok. That means that the upcoming 1.2.4 release will still be broken with GW2, right?

    Again, thank you for your fix!

    I was a bit surprised it hadn't been fixed by someone else earlier. I'd been using mumble since before the release of GW2 and just expected someone else to solve it. Eventually, my pain threshold was reached and I found your nice wiki page on how to build mumble, so I decided to take a crack at it. Was quite straight-forward to fix really.

     
    Last edit: Wesley W. Terpstra 2013-04-21
    • Kissaki

      Kissaki - 2013-04-21

      Yes, it will still be broken for 1.2.4. But after 1.2.4 is out of the door, the follow-up snapshots should work just fine. :)

      (reposted as reply, for tree-view)

       
  • James Orr

    James Orr - 2013-04-21

    I have reports from my guild members that this patch doesn't work with windows 8.

     
  • Wesley W. Terpstra

    Hmm. I only have Windows 7, so I can't test that. However, I don't see any reason why it would depend on the Windows version. It seems more likely that something else is wrong. Did they enable the overlay and whitelist GW2 in the settings, for example. In case it really is Windows 8, though, I'll see if I can find a guinea pig to test it.

    Also, I know from one of our guild members that a custom d3d9.dll in the GW2 folder will break the overlay. SweetFX is an example that places one.

    If the problems persist, have them create a file called "debugoverlay" (no file extension) in their GW2 folder and post the output of the "Dbgview" program when starting GW2.

     
    Last edit: Wesley W. Terpstra 2013-04-21
  • James Orr

    James Orr - 2013-04-21

    I'm trying to get them to post here directly. As I understand it mumble is crashing with a dll error.

    They do have the overlay working when loading bandicam or enjin first.

     
    • Kissaki

      Kissaki - 2013-04-21

      What did they test with?
      Did they build themselves? Or download the installer Wesley linked to?

      And as Wesley pointed out, debugoutput would be very useful.
      Also with bandicam started first; it may show why it works then.

      (reposted as reply, for tree-view)

       
  • James Orr

    James Orr - 2013-04-21

    They downloaded the installer.

     
  • Robert Tiscavitch

    Pestered here by James. I've tried using the installer as he mentioned and everything seems to install fine. Later trying to run the program I get an immediate error that kernelbase.dll isn't found and to attempt to reinstall; needless to say that doesn't help either.

    Currently running Vista Home Premium SP2. Doing a quick google search it seems most kernelbase.dll problems are in Win7, but I can find tangential references to it maybe being used in Vista as well. The file does not exist in C:\Windows\System32 where it seems it should be, though.

    Not sure how to provide a debugoutput. If that's part of the program crash message it doesn't even appear to be starting. I'm also not certain that this is the same problem that others in the guild are experiencing.

     
    • Kissaki

      Kissaki - 2013-04-21

      Does your GW2 crash?
      Mumble stays open and responsive?
      This is an issue only with the packaged build the installer was linked to in an earlier post?
      The issue does not occur with the current version of Mumble (the 1.2.4 RC)?

       
      • Robert Tiscavitch

        GW2 remains open and fine. Mumble doesn't start at all.
        It only happens with the packaged build provided, downloading the normal version of the client runs fine.

         
        • Kissaki

          Kissaki - 2013-04-22

          So it happens when you have GW2 running before launching Mumble?
          At what point does Mumble crash? Launch-up? Connecting to a server? X-Time?

          I just tried launching GW2 first, then Mumble with my build. It works fine.
          Without showing the overlay though ofc.

           
          Last edit: Kissaki 2013-04-22
          • Robert Tiscavitch

            It happens no matter when I try to start Mumble. And the crash is instant when I attempt to run, none of the Mumble gui ever appears. It seems to be looking for this kernelbase.dll, a file that I don't have and haven't ever needed before, to run the program.

            I've included the error messages I've gotten in a .jpg to try and make things clearer. They appear in sequence as soon as run the program. Running in Admin mode did not help, either.

            http://tinyurl.com/c9jop7f

             
            • Kissaki

              Kissaki - 2013-04-22

              Mh well yeah, wait for an official snapshot. :)

               
            • Jacob Peddicord

              Jacob Peddicord - 2013-04-22

              This is more than likely a build issue with the linked MSI, and unlikely to do with this patch/fix. If you're up for the task, consider building your own copy of Mumble from the after-1.2.4 branch and see if it launches.

               
  • Kissaki

    Kissaki - 2013-04-21

    Landed as 84307bb6606411b20c393e0424f23e9ba96afaac
    with some follow-up commits cleaning overlay code and then another one adjusting it a bit
    c1bef92cb234b70734fb674857a1dfe3d2cf87dd

    https://github.com/mumble-voip/mumble/commit/84307bb6606411b20c393e0424f23e9ba96afaac

    The changes also fixed the overlay for some other games; I just verified that the overlay works with TF2, CS:S, LOL which the wiki page Overlay lists as not working.
    So, thank you again. :)

     
  • Kissaki

    Kissaki - 2013-04-21
    • status: open --> closed
    • assigned_to: Kissaki
    • Release: 1.2.3 --> 1.2.5
     
  • Kissaki

    Kissaki - 2013-04-21
    • labels: Mumble --> Mumble, overlay, windows
     
  • Wesley W. Terpstra

    Perhaps Kissaki could provide an installer built from his build environment? If it is the installer I built, it could either be broken by the newest mumble changes (all of which I included) or my build environment. Using another new installer could distinguish between the two causes.

     
  • Wesley W. Terpstra

    I can't help but notice two things in your follow-up patch:
    1- You hooked FreeLibrary to detect unload. When I tried this, it didn't work. Are you certain FreeLibrary is called on d3d9.dll? It seemed to be unloaded by the loading thread exiting, without a FreeLibrary call.
    2- You restore the hooks AFTER the library was potentially freed. That memory would now be unmapped, so you are essentially writing to undefined memory. On linux, I would expect a segfault. Perhaps windows isn't so rigorous.

     
    • Kissaki

      Kissaki - 2013-04-22

      @1: MSDN doc says:

      When a DLL is unloaded from a process as a result of process termination or as a result of a call to FreeLibrary, the system does not call the entry-point function of the DLL with the DLL_THREAD_DETACH value for the individual threads of the process. The DLL is only given DLL_PROCESS_DETACH notification.

      What I take from that is
      a) exiting threads don’t cause module unloading as modules are process-scoped; only process exits do
      b) there is only FreeLibrary as an alternative

      The library is freed if the reference count (adjusted by LoadLibrary and FreeLibrary) hits 0, or the process exits.

      When I tested it with the FreeLibrary code the overlay worked in GW2.

      @2: Oh shit you’re right. I added the restore later on, which is obviously wrong.
      Thanks for the review. :)

       
      Last edit: Kissaki 2013-04-22
      • Kissaki

        Kissaki - 2013-04-22

        I pushed the @2 fix as a303b57.

         
  • Wesley W. Terpstra

    Re 1: If it works, it works. Perhaps I messed up the hook in my attempt.

    Re 2: I still think it's wrong. FreeLibrary only decreases the reference count. So you may now unhook when the library is only decreased reference count. Like I said in my original post, I think trying to track the reference count is fragile code. Simplest and safest is just to detect when the library was gone at some point in the past and then reload the hooks. There are no bonus points for cleaning up/restoring the DLL that is about to be unloaded anyway.

     
  • Wesley W. Terpstra

    Actually, I see that you test for "!hD3D" in restoreD3D9Hook. Since that happens before the real FreeLibrary, the code will never be run. Since I am essentially advocating the removal of restoreD3D9Hook and the code is dead already, I'm happy. ;-)

     
    • Kissaki

      Kissaki - 2013-04-22

      Oh god, that was a codechange without thinking.
      Yes, once you pointed to it again with your last post it became obvious to me as well that it’s useless.
      I just removed it.
      Pushed as 9c811103.

       
  • Tarun

    Tarun - 2013-04-22

    Any chance to get this pushed into the 1.2.4 release instead of post 1.2.4?

    It'd be really nice to have this working in GW2. Many of my guild members and friends would also like to see it make it in the 1.2.4 release.

    Would also solve many questions I see posted to reddit and several forums about how to get the overlay to work.

    Currently, the method people are being told is a very insecure way (exposes account name and password as plaintext) of getting the overlay to work. By pushing it to release it kills two birds with one stone, so to speak. People will no longer try and use the insecure method of getting the overlay to work and it also solves people asking on forums about getting it working.

    I do hope you reconsider pushing this to 1.2.4 release. Especially since 1.2.4 betas to RC has been well over one year in development and the GW2 game has been out for almost 8 months now. Though I'm also taking into consideration the age of this ticket (September 9th, shortly after the game was released) which means Mumble was still in beta for 1.2.4 as well.

     
    • James Orr

      James Orr - 2013-04-22

      Tarun, there is no need to use the insecure method. Download either bandicam or enjin (both free), start that first, then mumble, then Guild Wars 2.

      It's not ideal as you need to run another program, but it works for most people. If you have trouble with one of the two programs mentioned, try the other.

       
      • Tarun

        Tarun - 2013-04-22

        Using bandicam or enjin (or any other software to try and get Mumble's overlay working with GW2) != (does not equal) a solution.

        Also, I never said I use the insecure method. If you noticed earlier in this thread, I clearly advocate '''against''' using it because it exposes your username and password in plain text.

         
  • Kissaki

    Kissaki - 2013-04-22

    I’m against pushing it into 1.2.4. There is a feature freeze and RC for a reason. So we can be sure the release we publish is well tested and doesn’t have any big issues.
    By pushing new features or code changes at all we throw this away.

    Of course, that the release from a ready RC to the actual release is taking so long is stupid.
    It’s our (previous) bottle-neck the release system and one who was in power of it. We changed all that but still are not ready to publish the release yet sadly.
    Let’s hope next week …

     
    • Kissaki

      Kissaki - 2013-04-22

      Once 1.2.4 is released snapshots with the fix should be a matter of hours.

       
  • Wesley W. Terpstra

    FYI, I have confirmed it does work on Windows 8. Whatever problems Robert had, they are not Windows 8 related. Without more information, I can't help him. The only thing I can think of is that I didn't build with the installer this "embedded MSVC library" thing as I didn't have enough disk space to install the software that bundles it.

     
    Last edit: Wesley W. Terpstra 2013-05-01
  • Kissaki

    Kissaki - 2013-06-12

    FYI: Snapshots with the fixed overlay are now available!
    Check mumble.info for the Snapshot download.