Attaching gamepad crashes Panda3d

I have been making a game using Panda3D 1.9.4 and today I upgraded to 1.10 to add native gamepad support to my game.

However, when I attach the gamepad, Panda3D crashes. If the gamepad is already plugged in, Panda3D crashes on launch.

The images above show the what the console outputs for two different USB gamepads. No error messages though.

Thanks in advance for the help

Yikes. We’ll need to address this one immediately.

It would really help to get a stack trace here; would you be willing to get one? This would involve getting the debugging symbols (the archive for your exe here) and extracting those alongside the appropriate Panda DLLs. It also requires installing Microsoft Visual Studio (a free download). Then, when reproducing the crash you should be given the option to launch into the debugger, and you can find the Call Stack window.

Otherwise, I could produce a build for you that prints out more debugging information so that we can isolate the source of the crash.

I’ve produced some new Panda builds with more checks and debugging logging:

Try running the gamepad sample and give me the output. You’ll want to change notify-level-device debug to notify-level-device spam in the loadPrcFileData call to get even more info printed out.

thank you for the prompt reply, rdb

I installed the SDK and changed “notify-level-device” from debug to spam and when I ran the game:

Voila! It works.

I originally installed Panda3D from pip using:
pip install panda3d==1.10.0

When using the pip version, everything but the gamepad worked. The regular SDK from the website works just fine too.

Interesting, thanks so much for testing! What’s interesting is that it properly selected XInput now, whereas in your first post, Panda seemed to fall back to the raw input layer despite it being an XInput-capable gamepad.

Which Windows version are you on?

Could I bother you to try installing Panda3D via pip again, but this time grab the .whl file matching your architecture and Python version from here and pass the URL to the .whl directly to the “pip install” command? I’d like to know whether the crash will still occur in the newer version when installing via pip/wheel, and if so, what kind of debug output you get.

I’m using windows 8 and I ended up installing python 3.7 yesterday to see if there were any errors on my side.

I uninstalled Panda3D 1.10 and ran pip install using this file:

This also works just fine and I can plug and unplug the gamepad as expected.

I hope that helps :slight_smile:

Glad to hear that it works as expected. Thanks for testing!

We actually experienced this issue on Mac OS too. It would work for the first run but throw an assertion error when a device is disconnected/connected after the initial devices setup at launch.

That is undoubtedly a separate issue. The macOS implementation does not use the same code as the Windows implementation.

Could you report that issue in a new thread / issue?

@wholetonegames I suspect that when you originally installed Panda3D, you installed it into a 32-bit copy of Python, but that when you installed the SDK later on, you grabbed the 64-bit version, which did not have the problem. I say that because I just managed to reproduce a crash that appears to be the same one as you were getting, and it specifically happens on 32-bit Windows.

I’ve checked in a fix (it’s not on the master branch yet, though, and the automatic build server is currently not functioning). It will be in the upcoming 1.10.1 bugfix release.

@rdb Yes, that’s probably it! Prior to installing Panda3D 1.10, I had Python 3.6 32-bit installed.

Thank you for looking into this issue.