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
[RFC]Real Wiimote Windows "-TR" Fix #3245
Conversation
@JMC47 care to test with a DolphinBar to confirm it doesn't break compatibility? And a few other weird setups if you have time. @dolphin-emu-bot rebuild |
{ | ||
auto const overlapped_err = GetLastError(); | ||
|
||
//In case it was aborted by someone else |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
8ac2ad7
to
c244c6f
Compare
Regarding the Wii U Pro Controller: When it is configured as Real Wiimote and a Button is pressed as normal, nothing happens, because it is stuck on IORead. When Dolphin is then closed, the Controller briefly vibrates and the LED is set, so it seems that the messages are somehow stalled. |
Does not work with the DolphinBar. |
I also cannot get a standard (white, no motion+) Wiimote to connect on Windows 7 via standard bluetooth. |
I'm not sure if this is a Windows 7 problem or not, but, i can't get any Wiimote to connect to my computer with this build. Sorry for the complications, but, I honestly don't know what to try next. |
By standard you mean a official Nintendo Wiimote? What Bluetooth Dongle/Adapter do you use? I use either a build-in adapter in my laptop or a Speedlink Dongle. Both have the same VID&PID(VID_0A12 & PID_0001) but different Revision. What is exactly the error? Does you adapter find the Wiimote and is it possible to successfully syn it?
Lately if figured, that on Windows 10 and also Windows 8.1 the continuous button pressing is not needed, when Windows pairs and loads the drivers in an appropriate time frame. Also it seems to keep the Wiimote alive itself afterwards. |
I did all of this, in fact, I used the same bluetooth to connect it to the regular builds of Dolphin. I was using standard Nintendo Wiimotes; when I switched over to your PR builds, it just didn't work. It would stay flashing forever, I had no way to get it to connect the rest of the way for use in Dolphin. |
As figured in IRC, seems to be a bug in the Dolphin Code Base.
0x57 is ERROR_INVALID_PARAMETER and |
Tried ToshibaStack as well now. All three have failed for me. |
Tried a second bluetooth with a -TR Wiimote I bought, same problem. |
What do you mean specific by
? Can you test it with my program always as well. As long as my program works, there's nothing wrong with the API and Dolphin will work as well. |
Your program works fine, it's just Dolphin that doesn't work at all. There has to be some setting or something I messed up, I don't get why two bluetooth (and a DolphinBar) and 3 different kinds of wiimotes wouldn't connect to Dolphin. |
My program also works with Toshiba Stack? |
Your program worked the same as it did on the DolphinBar with Toshiba Stack (tons of inputs all the time) I have a Windows 10 Computer in the other room; if my brother lends it to me I will test there as well. |
Wiimote successfully connected on Windows 10 |
Wiimote audio is actually working properly in Wii Sports Resort with 1 Wiimote on a pretty shoddy bluetooth. |
c244c6f
to
99136fa
Compare
Updated initial post. |
Regular Wiimotes work on Windows 7, MSBT Stack now. No working Wiimote audio, though. DolphinBar and Toshiba Stack remain broken. |
@@ -395,15 +502,18 @@ void WiimoteScanner::CheckDeviceType(std::basic_string<TCHAR> &devicepath, bool | |||
u8 const disable_enc_pt2_report[MAX_PAYLOAD] = {WM_SET_REPORT | WM_BT_OUTPUT, WM_WRITE_DATA, 0x04, 0xa4, 0x00, 0xfb, 0x01, 0x00}; | |||
|
|||
CheckDeviceType_Write(dev_handle, | |||
write_method, |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
488c42d
to
41170e9
Compare
} | ||
|
||
// Create a new empty device info set for the device info data | ||
(*parent_device_info) = SetupDiCreateDeviceInfoList(NULL, NULL); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
41170e9
to
4c3e911
Compare
write_method, | ||
disable_enc_pt1_report, | ||
sizeof(disable_enc_pt1_report), | ||
1); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
"-TR" Wiimotes don't accept output reports via the Control Channel. HidP_SetOutputReports will send the data via the Control Channel, whereas WriteFile will send it via the Interrupt Channel. Therefore using WriteFile enables "-TR" Wiimotes on Windows. There are some issues to be aware of. First the Toshiba Bluetooth Stack needs the output report buffer to have the size of the largest output report supported by the device. This requirement is also enforced by the Windows 7 default stack. However the Toshiba Stack, will only send the actual report bytes to the device, whereas on Windows 7 the full resized buffer is sent, resulting in an error on the Wiimote. This issue renders WriteFile unusable on Windows 7 with the default stack. On Windows 8/8.1/10 this requirement is somehow not implemented and it is possible to send smaller buffers via WriteFile to the device, enabling "-TR" Wiimotes.
4c3e911
to
e076098
Compare
One thing I'm going to text extensively: Wiimote audio works on -TR Wiimotes, MS Bluetooth Stack, Windows 10. Regular Wiimotes DO NOT have working Wiimote audio! Also, the audio can lag depending on bandwidth, but, it's so close to perfect. It's better than a Wii in many points, except on longer sounds, where it tends to struggle. |
Here's my testing! All tests were performed in the version of pr3245 dated as 06-Dec-2015 19:19 on https://dl.dolphin-emu.org/prs/. Continuous scanning was used throughout to make the poor little tester's life easier! Also, all tests were performed with the bluetooth adapters on my desk, with less than half a meter away from the wiimotes during testing, with line of sight between the wiimotes and the adapters. The tests are:
The devices are:
Test results:DolphinBar
Toshiba Stack
MS Bluetooth Stack
So um, basically, no regressions, and everything worked as expected on Windows 7. All as this PR brings lots of benefits to other operating systems (which I can't test...) Everything seems fine to me! |
Everything works as good or better than before. LGTM. |
Tested Wii Balance Board as well, it works. |
Well, I saw you guys saying this PR improved Wiimote Audio as well so I gave it a try and while everything is working as expected, Wiimote audio still sounds like a noisy mess (just like before). I tested the latest build of this PR on Windows 10 with both MS Stack (with an Atheros AR5B22 combo card -- identified as Atheros AR3012 Bluetooth 4.0 on Device Manager) and DolphinBar. Am I missing something or that's expected? (BTW, great work @jloehr) |
Audio only is improved on -tr wiimotes. On Mon, Dec 7, 2015, 11:30 AM Mateus B. Cassiano notifications@github.com
|
Gotcha, now it makes sense (my wiimotes are all non-TR)... |
Is there any reason not to merge this now? I'm not sure if the code has all been looked at, but we're pretty certain this is a huge improvement for Wiimotes. |
[RFC]Real Wiimote Windows "-TR" Fix
@jloehr can you give me a summary of these changes? A kind of before and after of what does not work and what works for each operating system? It would be really helpful for the progress report! |
@MaJoRoesch: Short: It changes the way of communication/used API on Windows 8 and higher. Long: The distinction between Microsoft and Bluesoleil Bluetooth Stack(old code) was cleaned up, and a new API for Windows 8 and higher was implemented (the same that is used for the Toshiba Stack, but slightly different parameters to get it working). The new way/API is unfortunately not working for Windows 7 due to a bug in the Windows HID Class Driver, otherwise all those changes would also effect Windows 7. A distinction detection for the Toshiba Stack was implemented, by examining the Provider Name of the Class Driver of the HID Device. Overall: Code for branching according to the provided Stack was changed. Therefore behavior on Windows 8 and higher with MS default stack changes:
If the behavior for the DolphinBar changed in any way, someone else need to add those as i don't have a DolphinBar and don't whether and what changed. Hope i didn't miss something, if so, others shall feel free to add comments of what change as well. |
Nah, old Wiimote audio never worked. There is no regression in old wiimotes. They're unchanged. -TR wiimotes now work, old are unchanged. Only change with DolphinBar is that audio now sorta works on -TR wiimotes, but it's definitely laggier than a good bluetooth. I bet it's due to the bluetooth being lower quality. |
Tested with :
Ps : thanks, i can finally play Skyward on 1080p 😄 |
Important:
For "-TR" Wiimotes it is important that the sync is initiated by the Red Sync Button on the back. "1+2" Sync does not work.
Test Results:
Windows 7:
Windows 8:
Windows 10:
Known Issues/Bug:
"-TR" Support only works on Windows 8/8.1 and 10. On Windows 7 the old HidD_SetOutputReport is used, that doesn't support "-TR" Wiimotes.
Side Note:
My guess, why WriteFile works, but HidD_SetOutputReport does not. HidD_SetOutputReport may result in a Bluetooth HID "SetReport" Message via the Control Channel, which is not supported by the "-TR" Wiimotes. (Asynchronous) WriteFile result in a "Data" Message via the Interrupt/Data Channel.
For Windows 7; WriteFile needs the Buffer size to be 22 otherwise throws an error. Wiimote however doesn't take Buffer size of 22, when the Report Type is smaller and throws an error itself.