Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Rumble stop working after a couple of minutes #3

Open
nalf3in opened this issue Dec 10, 2020 · 31 comments
Open

[Bug] Rumble stop working after a couple of minutes #3

nalf3in opened this issue Dec 10, 2020 · 31 comments

Comments

@nalf3in
Copy link

nalf3in commented Dec 10, 2020

On my machine (Windows 10 x64 20H2) the rumble works great at the start, but end up stopping working (no rumble at all) after a couple of minutes. The bug can be reproduced easily when playing Halo MCC or many of the Call of duty. Unfortunately, I do not see any error message in the console that opens with the app.

@nalf3in nalf3in changed the title Rumble stop working after a couple of minutes [Bug] Rumble stop working after a couple of minutes Dec 10, 2020
@71
Copy link
Owner

71 commented Dec 10, 2020

Hey there. How intense is normally the rumble? Is it constant for a couple of minutes and then stops, or rather works intermittently for a couple of minutes and then stops?

@nalf3in
Copy link
Author

nalf3in commented Dec 10, 2020

Wow that's a quick answer :) Anyway, the intensity must be roughly the same (or at least, I can't tell just by playing) the whole time it works. The way I noticed the bug is by firing up a game, noticing the rumble works when firing with a weapon and then noticing the controller doesn't rumble anymore when pulling the trigger ~ 5 mins in the match. I will try to do more interesting tests (such as leaving it rumbling at full speed for a couple of minutes).

TLDR for the wall of text : here
On a bit of an unrelated note (but hopefully that can maybe be of use to you), I was planning to do a similar program but I don't have any experience with HID devices and the usb protocol in general so that and my finals of the semester were slowing me down quite a bit. Anyway, I noticed that while the controller is detected as a directinput device in most applications, Chromium based browsers such as Edge (and not Firefox) were able to use the analog triggers and the rumble using the Gamepad Api (you can see what I'm talking about here). This make me thinks that the code for communicating with the controller (when wired) must be located in this directory which I found thanks to this github (which is a patch to make stadia works on unsupported AOSP devices)

I won't have the time mess around the project much for the next week (thanks to my finals) but I'm now able to run and debug the project in vscode so I will try to debug this more proactively if it's still there once they are over :)

@71
Copy link
Owner

71 commented Dec 13, 2020

Yeah, I also noticed that Chromium was able to interpret the keys better than regular Windows apps, but didn't manage to find where it was implemented, thanks for the pointer!

As for the issue, I just tried reproducing it with the following code in main.go:

go func() {
	for {
		controller.Vibrate(5, 5)
		time.Sleep(1 * time.Second)
		controller.Vibrate(0, 0)
		time.Sleep(5 * time.Second)
	}
}()

which has been running for 20 minutes now, and the rumbling still hasn't stopped.

I think the first step is to find out if the vibration event is sent to the Stadia controller by eg setting a breakpoint or printing something here (it may also be interesting to see the values of smallMotor and largeMotor).

@nalf3in
Copy link
Author

nalf3in commented Dec 13, 2020

Just a quick update to let you know what I found so far

I just tried a quick and dirty test with a rubber band on the trigger and I was indeed, not able to reproduce the bug even after one hour. However, I'm now able to reproduce it with merely about 20 secs of "normal" playing. That is pretty strange considering that the rumble level in the quick test has 3 "phases" with different rumble level depending of if the guy is shooting or reloading.

Anyway, jumped in the vscode debugger and logged the 2 bytes and the variable iterationCount (corresponding to the number of times the function (modified code here) (Debug console output here) and what actually happens when the bug occurs is the function Vibrate() stop getting called (and no logs are generated). Clearly, the rest of the code is still running (breakpoints in other parts of the code are still working).. With that being said, I think the issue leans toward the "listener of vigem events" or my installation of vigem itself.

I will try to understand the mechanism vigem sends "events" in vigem.go and let you know if I find something of interest. Let me know if you have an idea :)

@EthanZoneCoding
Copy link

Just letting you know I'm having the same issue. I have been working in Unreal Engine for a few hours and now it stopped. Lemme know if you find a fix!

@Gabi10017
Copy link

Gabi10017 commented Nov 9, 2021

After a few hours lost on searching, I finally found the one that works. No rumble stop bug, and also it has support for analog triggers.

Prerequisites:
ViGEmBus
.NET Desktop Runtime 3.1 - https://dotnet.microsoft.com/en-us/download/dotnet/3.1
.NetFramework 4.5
Requirement: Run the program using Run as Administrator for the best performance.

Optional: Use HidHide in order to avoid double commands.

https://github.com/MWisBest/StadiEm - here is the original project if you want to build your own from it.
https://drive.google.com/file/d/10lHU0kbI3hkNHlYEqfN-4I3rhRMAdSyF/view?usp=sharing - debug build compiled by me using Visual Studio - OLD BUILD - use only if newer builds have bugs!

https://drive.google.com/file/d/1_HXN-1yywvOYilD1EYVY8ByU4-SdJxn_/view?usp=sharing - release build compiled by me using Visual Studio - NEW BUILD - no bugs found yet, leave a comment if you experience one.

@moba86
Copy link

moba86 commented Dec 5, 2021

Hello,

I opened and closed the issue, I didn't see there was already this issue...

I used v1.3.1 on pc game Gears 4 but after 10 minutes of gaming, the vibration on Stadia controller gone, I have to stop and start manually the .exe (Stadiacontroller 1.3.1) to have the vibration again. I have the same issue on Battlefield V, the vibration stopped after few minutes (about 10 minutes) of gaming.

Thanks in advance for your work and your help :)

@Gabi10017
Copy link

Use the file I sent. Stadiacontroller had and still has this issue, and seems like it will not be fixed too soon. Instead, StadiEm works flawlessly.

@moba86
Copy link

moba86 commented Dec 6, 2021

Thanks a lot Gabi10017 for your prompt answer, I tried your file and it works ;)

@Gabi10017
Copy link

Glad I could help 😄

@kastle1
Copy link

kastle1 commented Jan 5, 2022

another thank you to Gabi10017 for providing the build of StadiEm, it works almost perfectly - only issue is that the unmapped buttons (the two below the select and start) sometimes cause the app to crash, but probably an issue with the original project, and I've just learned to stay away from those buttons.

@Gabi10017
Copy link

Gabi10017 commented Jan 5, 2022

Oh, I didn’t know that. I pressed that 2 buttons only once or twice while using StadiEm only to see if they work or not :D Luckily the app didn’t crash then. Anyway, after that I literally forgot about their existence until you mentioned them 😅. The thing is, even if you would want to, they can’t be really mapped to something since the Xbox Controller doesn’t have that 2 buttons. I’m glad that sharing this build helps others too 😌 Enjoy!

LE: Seems like the StadiEm owner made some modifications to its project a few days ago, I’ll try later tonight to build another .exe from it. I’ll post the link to the new version next to the first, and if it works without issues, I’ll then remove the old build, From what I see he added ‘combo buttons’, whatever that means. I’ll keep you updated ;)
EDIT: New build is UP!

@Gabi10017
Copy link

another thank you to Gabi10017 for providing the build of StadiEm, it works almost perfectly - only issue is that the unmapped buttons (the two below the select and start) sometimes cause the app to crash, but probably an issue with the original project, and I've just learned to stay away from those buttons.

Hi! Just released the new build, you could try that one, as far as I saw it has a bit better controls and a bit nicer rumble IMO. Also, I tried crashing the app by spamming those 2 buttons and it didn't crash on my PC (I tried with the new build), please tell me if you still get crashes while pressing the 2 buttons. Thanks!

@kastle1
Copy link

kastle1 commented Jan 5, 2022

Thank you again Gabi10017 for the new build, I really appreciate you compiling and making the builds available, as I don't have any of the necessary tools to compile myself. I tried out the new release, and it seems to be working well enough. I can't really tell the difference between the old one and the new one, other than that the rumble might be a little shorter than it used to be, which I think is a good thing.

As for the app crashing with the extra buttons, it is nearly impossible to reproduce, as it didn't crash before just pressing the buttons after starting up stadiem. I only noticed it twice, both times the stadiem instance had been running for at least a week, and I would accidentally press the lower button instead of the start button while playing something, and windows would make the sound that a device disconnected and my controller would stop working. Both times, inspecting the task bar showed that stadiem was no longer running at that time. I've since just learned to stay away from those buttons, so it'll be hard to tell if the new build is more stable from that standpoint, but will definitely post back here if I notice it again.

Thanks again for your help

@kastle1
Copy link

kastle1 commented Jan 5, 2022

I'm not sure if this is a new 'feature' with the new StadiEm build, but I just noticed that those extra buttons actually do something! Pressing the buttons in firefox seems to emulate the equivalent of Cntl+Shft+E and Cntl+Shft+Z! No idea what the point of those keypresses might be, but that might be the source of the unintended crashes?

@Gabi10017
Copy link

Gabi10017 commented Jan 5, 2022

Thank you again Gabi10017 for the new build, I really appreciate you compiling and making the builds available, as I don't have any of the necessary tools to compile myself. I tried out the new release, and it seems to be working well enough. I can't really tell the difference between the old one and the new one, other than that the rumble might be a little shorter than it used to be, which I think is a good thing.

As for the app crashing with the extra buttons, it is nearly impossible to reproduce, as it didn't crash before just pressing the buttons after starting up stadiem. I only noticed it twice, both times the stadiem instance had been running for at least a week, and I would accidentally press the lower button instead of the start button while playing something, and windows would make the sound that a device disconnected and my controller would stop working. Both times, inspecting the task bar showed that stadiem was no longer running at that time. I've since just learned to stay away from those buttons, so it'll be hard to tell if the new build is more stable from that standpoint, but will definitely post back here if I notice it again.

Thanks again for your help

I see. Thanks for testing. Interesting keybinds.. They might be the source of crash, idk for sure, I am not a developer yet, so I can't debug it to see exactly what's going on. I hope it will not crash again, but if it does leave a message here, even though we can't fix it. I also want to mention that I am not related to the Dev of StadiEm in any way, so the only way to fix the bug would be to open a issue on its page (if it still occurs) and see what happens ig? I found StadiEm after lots of hours of desperation and Google Searches :/ The rumble bug really pissed me off :D

Now that I think of it, you could actually map CTRL+Shift+Z (The screenshot button) to actually take a screenshot if you want :))
Google Assistant is unavailable on Windows (also unavailable on the web version of Stadia), so it's useless for now, though you can map it to do something else (open Cortana maybe? XDD)

@kastle1
Copy link

kastle1 commented Jan 6, 2022

Thank you again Gabi10017 for the new build, I really appreciate you compiling and making the builds available, as I don't have any of the necessary tools to compile myself. I tried out the new release, and it seems to be working well enough. I can't really tell the difference between the old one and the new one, other than that the rumble might be a little shorter than it used to be, which I think is a good thing.
As for the app crashing with the extra buttons, it is nearly impossible to reproduce, as it didn't crash before just pressing the buttons after starting up stadiem. I only noticed it twice, both times the stadiem instance had been running for at least a week, and I would accidentally press the lower button instead of the start button while playing something, and windows would make the sound that a device disconnected and my controller would stop working. Both times, inspecting the task bar showed that stadiem was no longer running at that time. I've since just learned to stay away from those buttons, so it'll be hard to tell if the new build is more stable from that standpoint, but will definitely post back here if I notice it again.
Thanks again for your help

I see. Thanks for testing. Interesting keybinds.. They might be the source of crash, idk for sure, I am not a developer yet, so I can't debug it to see exactly what's going on. I hope it will not crash again, but if it does leave a message here, even though we can't fix it. I also want to mention that I am not related to the Dev of StadiEm in any way, so the only way to fix the bug would be to open a issue on its page (if it still occurs) and see what happens ig? I found StadiEm after lots of hours of desperation and Google Searches :/ The rumble bug really pissed me off :D

Now that I think of it, you could actually map CTRL+Shift+Z (The screenshot button) to actually take a screenshot if you want :)) Google Assistant is unavailable on Windows (also unavailable on the web version of Stadia), so it's useless for now, though you can map it to do something else (open Cortana maybe? XDD)

Yes, I'm definitely aware you're not the owner of the project, and even if you were, I don't have any expectations that anyone would fix this, it's a public free project, after all, and it doesn't really cause any real problems. Mostly I'm very happy that it works, as, just like you, I was super annoyed that every other solution I looked at had some random problem or another.

Thanks again for providing the compiled builds, now it's time to get back to gaming!

@kastle1
Copy link

kastle1 commented Jan 6, 2022

I just realized that I use autohotkey, and I can actually map the two extra buttons to whatever I want! This tool is great!

@Gabi10017
Copy link

Gabi10017 commented Jan 6, 2022

Thank you again Gabi10017 for the new build, I really appreciate you compiling and making the builds available, as I don't have any of the necessary tools to compile myself. I tried out the new release, and it seems to be working well enough. I can't really tell the difference between the old one and the new one, other than that the rumble might be a little shorter than it used to be, which I think is a good thing.
As for the app crashing with the extra buttons, it is nearly impossible to reproduce, as it didn't crash before just pressing the buttons after starting up stadiem. I only noticed it twice, both times the stadiem instance had been running for at least a week, and I would accidentally press the lower button instead of the start button while playing something, and windows would make the sound that a device disconnected and my controller would stop working. Both times, inspecting the task bar showed that stadiem was no longer running at that time. I've since just learned to stay away from those buttons, so it'll be hard to tell if the new build is more stable from that standpoint, but will definitely post back here if I notice it again.
Thanks again for your help

I see. Thanks for testing. Interesting keybinds.. They might be the source of crash, idk for sure, I am not a developer yet, so I can't debug it to see exactly what's going on. I hope it will not crash again, but if it does leave a message here, even though we can't fix it. I also want to mention that I am not related to the Dev of StadiEm in any way, so the only way to fix the bug would be to open a issue on its page (if it still occurs) and see what happens ig? I found StadiEm after lots of hours of desperation and Google Searches :/ The rumble bug really pissed me off :D
Now that I think of it, you could actually map CTRL+Shift+Z (The screenshot button) to actually take a screenshot if you want :)) Google Assistant is unavailable on Windows (also unavailable on the web version of Stadia), so it's useless for now, though you can map it to do something else (open Cortana maybe? XDD)

Yes, I'm definitely aware you're not the owner of the project, and even if you were, I don't have any expectations that anyone would fix this, it's a public free project, after all, and it doesn't really cause any real problems. Mostly I'm very happy that it works, as, just like you, I was super annoyed that every other solution I looked at had some random problem or another.

Thanks again for providing the compiled builds, now it's time to get back to gaming!

That's the spirit!
I tried autohotkey too, I wanted to map windows search (win+s) to the assistant button, and I didn't succeed.. If you can make a script that actually works for that, I would be really grateful. The screenshot button was of course mapped to do Full Screen Screenshots.

@kastle1
Copy link

kastle1 commented Jan 6, 2022

I tried using a basic keymap in ahk and it didn't work right like you said. Sometimes ahk gets hung up on key presses that include modifiers like shft/ctrl, so putting in a short delay seems to fix it. Try this, it works on my machine:

^+e::
Sleep 200
Send #s
return

The downside to this hack is the delay needs to be long enough to allow you to release the original key, so if the delay is too short (or your button press is too long), it'll not work correctly.

I'm sure there's a better, more correct way to do this, but I usually deal with it like this...

@Gabi10017
Copy link

Gabi10017 commented Jan 6, 2022

I tried using a basic keymap in ahk and it didn't work right like you said. Sometimes ahk gets hung up on key presses that include modifiers like shft/ctrl, so putting in a short delay seems to fix it. Try this, it works on my machine:

^+e:: Sleep 200 Send #s return

The downside to this hack is the delay needs to be long enough to allow you to release the original key, so if the delay is too short (or your button press is too long), it'll not work correctly.

I'm sure there's a better, more correct way to do this, but I usually deal with it like this...

It works perfectly! Thank you so much for this! Now all the buttons are mapped and every feature works. The only thing left would be for Google to release a patch for the controllers so that we could pair them to devices through Bluetooth :D
I don't think they'll ever do that though.

@kastle1
Copy link

kastle1 commented Jan 6, 2022

Glad I was able to help! Yes, wireless stadia on windows would be the icing on the cake, but I like the controller enough that I'm willing to tough it out on wired.

@Gabi10017
Copy link

Glad I was able to help! Yes, wireless stadia on windows would be the icing on the cake, but I like the controller enough that I'm willing to tough it out on wired.

Yeah, wired works well enough for me too. I really like the fine attention to details of Google, like you can also plug a pair of headphones to the controller which it’s plugged by USB to your PC and they’ll work!! Both the headphones and mic (if you have one, on your set of headphones).

@wombatpandaa
Copy link

Sorry to necro an old thread, but I just got a Stadia controller for use on Windows after Stadia's official shutdown and came across this while looking for a way to make it more compatible with Windows. I tried the solution above, but the StadiEm.exe executable always gives me an error saying I need .NET core installed when I run it, even though I have the required .NET packages installed. Has anyone else encountered this issue or know how to fix it?

@Gabi10017
Copy link

Gabi10017 commented Jan 30, 2023

Sorry to necro an old thread, but I just got a Stadia controller for use on Windows after Stadia's official shutdown and came across this while looking for a way to make it more compatible with Windows. I tried the solution above, but the StadiEm.exe executable always gives me an error saying I need .NET core installed when I run it, even though I have the required .NET packages installed. Has anyone else encountered this issue or know how to fix it?

Sorry for the delayed answer. Please try installing this Runtime then try running StadiEm again and see if it works.
https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-3.1.32-windows-x64-installer

@wombatpandaa
Copy link

No problem! I wasn't super expecting an answer at all so this is already a nice surprise. I installed that .NET version you said, and ran StadiEm again, and now it just doesn't seem to to anything at all. No error message, no installation wizard, nothing. Is it a silent installer?

@Gabi10017
Copy link

It is an executable (so there is no installation required, you just run it). It should show an icon in the system tray. You should hear the USB Plug-in sound when you connect the controller and then, if you installed all the prerequisites, you should be able to use the controller to play anything, just like an Xbox 360 Controller.

@wombatpandaa
Copy link

Ah, I see! Thank you, I see the item in the system tray now. And it seems to work so far! Thanks again for your help.

@FvPntO
Copy link

FvPntO commented Feb 2, 2023

Does it work via BT?

Becaus all i receive is the error message from StadiEm "Unable to open device in exclusive mode..."

@kastle1
Copy link

kastle1 commented Feb 2, 2023

Unfortunately it does not, however there is another tool that does work for both USB and BT:

https://github.com/walkco/stadia-vigem

HOWEVER - I found that either the controller BT implementation or this other tool causes the controller to be detected as a generic controller after a number of connects/disconnects. I don't know what it is, but fixing it requires uninstalling the controller device from device manager and restarting the computer so it's not ideal.

After a number of tries, I've returned to just using it via USB. Hopefully another more robust solution will pop up soon...

@FvPntO
Copy link

FvPntO commented Feb 2, 2023

Thx for the quick reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants