-
Notifications
You must be signed in to change notification settings - Fork 260
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
crash to desktop when configuring inputs #2293
Comments
Please attach your settings.ini file in order for us to investigate the problem. You can delete RecentXbeFiles history from the file before upload. |
Added .txt to the filename so that I could upload it to Github. |
Hmm... all of your inputs are not assigned base on the file. Since you are saying it happen either during assign each layout's buttons or on exit input dialog. I am unable to reproduce this issue. Which emulation device and what hardware device you are trying to use? |
By emulation device and hardware device, are you meaning input devices? I have attempted selecting all of the options: MS Gamepad Duke, S, Steel battalion etc. As for hardware, I would've used an Xbox One controller with the official wireless USB dongle. It reads up as a generic Xinput device by Windows. Xemu can open it up without any config. I thought at first this might be a permission issue with the settings.ini but there isn't a difference in if I run cxbxr in portable or install the settings in %AppData%. |
I tried to reproduce this issue with the settings file you posted and selecting all the different device types, and I never got a crash either. Either this is a corner case in the input code or it's an issue on your end specific of your system. Can someone else in the community try to reproduce this, preferably with an xbox one wireless controller if possible?
That's because xemu does not yet support button remapping, but they have plans to do it in the future. |
I'll try out older versions of cxbxr to see if it's a regression. I did play JSRF successfully on the same Windows 10 install on this same machine roughly 6 months ago. None of the other menu settings have had issues with crashing, only input. Are there any options in cxbxr I can set via the application that should get written to the ini? I could try to debug if it's a read/write or folder permission error. |
I tested older builds. Up until CI-f7042be, the older builds were working for me. I tested the four previous builds and the input menu opens up without issues while the latest and the build before that introduces some breaking bug on my end. I can only see the introduction of libusb so I'd guess there's something with either the included library or the implementation of it that creates a fatal callback exception. |
Thank you for confirmation older builds were working for you. It would make sense hardware passthrough pull request #2290 would likely be the cause for your end of the issue. The only possibilities cause I can think of right now are:
EDIT: Sorry we haven't asked you before. Without your wireless Xbox One controller connected, are you still receiving the crash as well? Or is it only specifically your wireless Xbox One controller? |
I've tried both with and without any controller. I removed all of the controllers from the Devices and Printers and everything disconnected and tried with the controller connected as well, no difference. Xbox One Wireless Controller USB Input Device Those two were both grouped under the same game controller in Devices and Printers. |
Okay, even without any controller connected; you still have the same issue. Which lead to something else. Download 7z file from official libusb's release page (v1.0.24). Here's the direct download link. Our libusb is currently about a year ahead of development's commits. Once you have download libusb-1.0.24.7z file, Open it with 7z software and navigate to examples > bin64 > listdevs.exe file. This is the file you need to extract from 7z archived file. Then run it from a terminal to see any results and if it does crash or not. If listdevs.exe do crash, then the issue is from one of your drivers or programs. Although if listdevs.exe does not crash. I am willing to make a draft pull request for you to test and see if it works. What draft pull request will do is move our libusb submodule back to libusb's release tag commit. |
Doesn't crash, here's the output. Just FYI, I'm perfectly content playing on an older build. This has mostly turned into a curious case for me on what's actually happening. As long as this continues to be useful for you guys, I'm willing to test this out. I appreciate all the debugging help I've gotten so far. |
Cool, I recently made a draft pull request for you to test after our CI is done building and produce artifact build. |
I'm still seeing the same issue with https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/actions/runs/1488582716 |
Can you run listdevs.exe one more time then check in event viewer for any error from it? |
No events happening after running. |
Then we're not sure how it is affecting from your end. The error and address when the crashed occur shows it is origin from Currently, we are stumped. Only way to find out the cause is by catch the exception from IDE such as Visual Studio and read the call stack for how it happened in the first place from your end. |
Alright well I'll clone the repo and install Visual Studio and see what happens :) |
In case you're having issue with setup Cxbx-Reloaded from Visual Studio. The following requirement are:
Individual components (tab)
|
The original author did not respond after almost a month, and no other user has ever reported this problem. Assuming this was a user-specific issue, closing this for now. This can be reopened in the future. |
Another user has reported this problem again here, so this is probably a real issue now. However, we can't fix this until we are able to reproduce it. |
I'm not sure how to contribute toward helping anyone else reproduce it, but it happens here too, and similarily, old builds from last year work okay. If I select a device and hit configure, it crashes with cxbx.exe as the application, and ntdll.dll as the faulting module in event viewer. Error code is 0xc0000005. I also tried the listdevs.exe thing linked earlier, and it works fine. As does the newer 1.0.25 version. No errors thrown in Event Viewer. So I feel like this is just a big '#MeToo' thing, but thought I might as well. |
PR #2375 fixes a freeze of cxbxr caused by libusb. Since this problem is also very likely caused by libusb, there's a chance that it might improve/fix this issue as well. So, affected users should try testing that PR to see if they are still affected by the issue. |
I've been having the same issue with an original Xbox Controller S with a modded USB cable, only happens when it's plugged in. Originally I thought it was caused by XBCD, but I removed that entirely, removed the drivers for the controller, reinserted it, and still had the same issue. No problems with libusb listdevs.exe either:
I went and got everything running with Visual Studio, and this is where it's throwing an exception when clicking the Configure button in Input Settings. Let me know if there's any other info you'd like me to share or want me to try. Edit: I also wanted to mention that if I leave the controller unplugged, open the Input Settings page, then plug it in, it will allow me to open the Configure window and it will display the controller. However, it will still crash after that point when trying to Test the controller or exit out of any of the open windows. |
I've looked into it a little bit more, and I've found that this particular controller is coming back with -12 LIBUSB_ERROR_NOT_SUPPORTED with usbi_backend.open(_dev_handle) in libusb_open. I'm wondering then why m_Type is not marked as DEVICE_INVALID and thus ends up with the interface trying to be released resulting in the read access violation in my previous comment. I'm also wondering why it's getting LIBUSB_ERROR_NOT_SUPPORTED when it tries to open it, as for all I know it should be supported with the USB passthrough. Still hoping someone can help with this, as the only other controller I have kinda sucks and I'd like to use this one. Even though I'm a developer, a lot of this stuff is far from what I'm familiar with. As much as I'd like to figure it out myself, I'm not sure I can! Edit: the controller is an Xbox Controller S, device id 0x0285 |
Great research progress so far! 😃 |
It's because that device id is in the supported list here, which in turn was taken from here. According to the list, this should correspond to a Japanese orginal xbox controller. So either your device has the same id of that controller or the list is incorrect. EDIT: When I read "Xbox Controller S", I thought it was an xbox one controller, but now I understand the user is referring to an original xbox controller though. |
Not sure I understand the question, but I'll try. It was trying to clear m_Devices (line 780 in InputManager.cpp), then it ended up in the destructor for the libusb device. When debugging I can't get passed the unhandled exception, I assume that's where cxbx is closing, but I'm not that familiar with C++ so I don't really know what happens after unhandled exceptions.
Yes, it is an original Xbox Controller S, although nothing on the outside of it tells me that it's a Japanese one. It certainly doesn't resemble the grey with green logo one I see online called the "Japanese" Controller S. Wonder if that has anything to do with it. |
Okay, it clearly populate devices when open up input config window. Then populate devices again for port # configure. It's clear that LibusbDevice.cpp at line 190 for attempt to open device through libusb_open call you mentioned return as an error. You are right for missing DEVICE_INVALID set to m_Type and a return. For rough translation into C++ code is: // check if we are able to open device through libusb
if (int err = libusb_open(Dev, &m_hDev) != 0) {
// Couldn't open device, create an error log report then don't use it.
EmuLog(LOG_LEVEL::ERROR2, "Unable to open original xbox device \"%s\" (%hX:%hX), libusb's error was: %s",
m_Name.c_str(), Desc->idVendor, Desc->idProduct, libusb_strerror(err));
m_Type = XBOX_INPUT_DEVICE::DEVICE_INVALID;
return;
}
// If we are able to open device, continue with query process.
else {
// Duke, S and SBC have 1 configuration, 1 interface and 2 endpoints (input and output) and use the default alternate setting zero.
// The code below assumes that third-party controllers follow suit. Above code will avoid unintentional crash, yet will cause lose support for it. It is unclear if we did something wrong on our end or an issue between the device and computer. EDIT: |
We think @ergo720 gave me the link for libusb's suggestive software to use for install WinUSB driver. If haven't installed WinUSB driver for og xbox devices. |
I found the OP, @httpsterio, and @TakkuZakku's latter issue for the crash. According to this line
end-user's vendor id is getting overriden by using assignment instead of comparison operator. I notice their product ids do indeed match on I have prepared a branch to resolve two separate issues on this ticket. |
Quick summary
cxbx crashes when configuring input devices.
Details
Latest version (4457d11) crashes after opening input configuration and either configuring one of the ports or by exiting the input config.
System Configuration:
Additional Information (if any):
Event viewer displays an Error in the Application logs.
And the Information event before the crash
The file mentioned above doesn't get created.
The text was updated successfully, but these errors were encountered: