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

Merged
merged 3 commits into from Dec 11, 2015

Conversation

@jloehr
Contributor

jloehr commented Nov 9, 2015

  • Fixes the IOWrite for Windows, so the newer "-TR" Wii Remotes are usable with the Microsoft Bluetooth Stack.

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:

x MS-Stack Toshiba DolphinBar
non "-TR" Working Working Working
"-TR" Won't Fix Working Working

Windows 8:

x MS-Stack Toshiba DolphinBar
non "-TR" - - -
"-TR" - - -

Windows 10:

x MS-Stack Toshiba DolphinBar
non "-TR" - - -
"-TR" - - -

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.

@delroth

This comment has been minimized.

Show comment
Hide comment
@delroth

delroth Nov 9, 2015

Member

@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

Member

delroth commented Nov 9, 2015

@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

@jloehr

This comment has been minimized.

Show comment
Hide comment
@jloehr

jloehr Nov 9, 2015

Contributor

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.

Contributor

jloehr commented Nov 9, 2015

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.

@JMC47

This comment has been minimized.

Show comment
Hide comment
@JMC47

JMC47 Nov 10, 2015

Contributor

Does not work with the DolphinBar.

Contributor

JMC47 commented Nov 10, 2015

Does not work with the DolphinBar.

@JMC47

This comment has been minimized.

Show comment
Hide comment
@JMC47

JMC47 Nov 10, 2015

Contributor

I also cannot get a standard (white, no motion+) Wiimote to connect on Windows 7 via standard bluetooth.

Contributor

JMC47 commented Nov 10, 2015

I also cannot get a standard (white, no motion+) Wiimote to connect on Windows 7 via standard bluetooth.

@JMC47

This comment has been minimized.

Show comment
Hide comment
@JMC47

JMC47 Nov 10, 2015

Contributor

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.

Contributor

JMC47 commented Nov 10, 2015

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.

@jloehr

This comment has been minimized.

Show comment
Hide comment
@jloehr

jloehr Nov 10, 2015

Contributor

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.
From the VID&PID i can tell, that both adapters use CSR Chips.
For me the build-in worked fine with Wiimotes on Windows 8/8.1, Windows 10. And the Dongle worked fine with Wiimote on Windows 7, 8.1 & 10.

What is exactly the error? Does you adapter find the Wiimote and is it possible to successfully syn it?
Regardless of the Application that will use the Wiimote, my steps for syncing are:

  1. Init search for Bluetooth Devices on the Host System
  2. Press 1+2 or Sync button on the Wiimote
  3. Continuously press any button on the Wiimote to keep it alive
  4. Initiate Pairing on Host
  5. If asked for a PIN, leave it empty and just press "Next" (If next is grayed out abort the Sync, turn of the Wiimote and start over again)
  6. Wait for Windows to successfully connect it and load drivers, while still pressing a button
  7. When Windows finished its paring/driver thing, start any programm, that will communicate with the Wiimote and at least set the LEDs
  8. If the LEDs are set, stop pressing the button.

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.

Contributor

jloehr commented Nov 10, 2015

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.
From the VID&PID i can tell, that both adapters use CSR Chips.
For me the build-in worked fine with Wiimotes on Windows 8/8.1, Windows 10. And the Dongle worked fine with Wiimote on Windows 7, 8.1 & 10.

What is exactly the error? Does you adapter find the Wiimote and is it possible to successfully syn it?
Regardless of the Application that will use the Wiimote, my steps for syncing are:

  1. Init search for Bluetooth Devices on the Host System
  2. Press 1+2 or Sync button on the Wiimote
  3. Continuously press any button on the Wiimote to keep it alive
  4. Initiate Pairing on Host
  5. If asked for a PIN, leave it empty and just press "Next" (If next is grayed out abort the Sync, turn of the Wiimote and start over again)
  6. Wait for Windows to successfully connect it and load drivers, while still pressing a button
  7. When Windows finished its paring/driver thing, start any programm, that will communicate with the Wiimote and at least set the LEDs
  8. If the LEDs are set, stop pressing the button.

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.

@JMC47

This comment has been minimized.

Show comment
Hide comment
@JMC47

JMC47 Nov 10, 2015

Contributor

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.

Contributor

JMC47 commented Nov 10, 2015

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.

@jloehr

This comment has been minimized.

Show comment
Hide comment
@jloehr

jloehr Nov 10, 2015

Contributor

As figured in IRC, seems to be a bug in the Dolphin Code Base.
Dolphin Bar as well as Wiimotes work fine on Windows 7 with Dolphin Master and my HIDAPI test program.
Some snippet from the Error log:

37:44:680 HW\WiimoteReal\IOWin.cpp:833 N[Wiimote]: Found Wiimote (28:22:a7:51:e7:e0). Enabling HID service.
37:47:682 HW\WiimoteReal\IOWin.cpp:705 W[Wiimote]: _IOWrite: Error on WriteFile: 00000057
...
37:47:683 HW\WiimoteReal\IOWin.cpp:705 W[Wiimote]: _IOWrite: Error on WriteFile: 00000057
37:47:683 HW\WiimoteReal\IOWin.cpp:705 W[Wiimote]: _IOWrite: Error on WriteFile: 000006f8
37:50:731 HW\WiimoteReal\IOWin.cpp:705 W[Wiimote]: _IOWrite: Error on WriteFile: 00000057
...
37:50:732 HW\WiimoteReal\IOWin.cpp:705 W[Wiimote]: _IOWrite: Error on WriteFile: 00000057
37:50:732 HW\WiimoteReal\IOWin.cpp:705 W[Wiimote]: _IOWrite: Error on WriteFile: 000006f8
37:53:779 HW\WiimoteReal\IOWin.cpp:893 N[Wiimote]: Removing remembered Wiimote.

0x57 is ERROR_INVALID_PARAMETER and
0x6f8 is ERROR_INVALID_USER_BUFFER

Contributor

jloehr commented Nov 10, 2015

As figured in IRC, seems to be a bug in the Dolphin Code Base.
Dolphin Bar as well as Wiimotes work fine on Windows 7 with Dolphin Master and my HIDAPI test program.
Some snippet from the Error log:

37:44:680 HW\WiimoteReal\IOWin.cpp:833 N[Wiimote]: Found Wiimote (28:22:a7:51:e7:e0). Enabling HID service.
37:47:682 HW\WiimoteReal\IOWin.cpp:705 W[Wiimote]: _IOWrite: Error on WriteFile: 00000057
...
37:47:683 HW\WiimoteReal\IOWin.cpp:705 W[Wiimote]: _IOWrite: Error on WriteFile: 00000057
37:47:683 HW\WiimoteReal\IOWin.cpp:705 W[Wiimote]: _IOWrite: Error on WriteFile: 000006f8
37:50:731 HW\WiimoteReal\IOWin.cpp:705 W[Wiimote]: _IOWrite: Error on WriteFile: 00000057
...
37:50:732 HW\WiimoteReal\IOWin.cpp:705 W[Wiimote]: _IOWrite: Error on WriteFile: 00000057
37:50:732 HW\WiimoteReal\IOWin.cpp:705 W[Wiimote]: _IOWrite: Error on WriteFile: 000006f8
37:53:779 HW\WiimoteReal\IOWin.cpp:893 N[Wiimote]: Removing remembered Wiimote.

0x57 is ERROR_INVALID_PARAMETER and
0x6f8 is ERROR_INVALID_USER_BUFFER

@jloehr jloehr changed the title from Real Wiimote Windows "-TR" Fix | Index LED Fix to [WIP]Real Wiimote Windows "-TR" Fix | Index LED Fix Nov 10, 2015

@JMC47

This comment has been minimized.

Show comment
Hide comment
@JMC47

JMC47 Nov 11, 2015

Contributor

Tried ToshibaStack as well now. All three have failed for me.
ToshibaStack.txt

Contributor

JMC47 commented Nov 11, 2015

Tried ToshibaStack as well now. All three have failed for me.
ToshibaStack.txt

@JMC47

This comment has been minimized.

Show comment
Hide comment
@JMC47

JMC47 Nov 11, 2015

Contributor

Tried a second bluetooth with a -TR Wiimote I bought, same problem.

Contributor

JMC47 commented Nov 11, 2015

Tried a second bluetooth with a -TR Wiimote I bought, same problem.

@jloehr

This comment has been minimized.

Show comment
Hide comment
@jloehr

jloehr Nov 11, 2015

Contributor

What do you mean specific by

All three failed

?

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.

Contributor

jloehr commented Nov 11, 2015

What do you mean specific by

All three failed

?

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.

@JMC47

This comment has been minimized.

Show comment
Hide comment
@JMC47

JMC47 Nov 11, 2015

Contributor

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.

Contributor

JMC47 commented Nov 11, 2015

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.

@jloehr

This comment has been minimized.

Show comment
Hide comment
@jloehr

jloehr Nov 11, 2015

Contributor

My program also works with Toshiba Stack?
I think i have to do some more major changes to get it properly working. Only problem is for me all my Wiimotes work. The question is, whether it is a problem with Windows 7 or with your different Bluetooth Dongle

Contributor

jloehr commented Nov 11, 2015

My program also works with Toshiba Stack?
I think i have to do some more major changes to get it properly working. Only problem is for me all my Wiimotes work. The question is, whether it is a problem with Windows 7 or with your different Bluetooth Dongle

@JMC47

This comment has been minimized.

Show comment
Hide comment
@JMC47

JMC47 Nov 11, 2015

Contributor

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.

Contributor

JMC47 commented Nov 11, 2015

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.

@JMC47

This comment has been minimized.

Show comment
Hide comment
@JMC47

JMC47 Nov 11, 2015

Contributor

Wiimote successfully connected on Windows 10

Contributor

JMC47 commented Nov 11, 2015

Wiimote successfully connected on Windows 10

@JMC47

This comment has been minimized.

Show comment
Hide comment
@JMC47

JMC47 Nov 11, 2015

Contributor

Wiimote audio is actually working properly in Wii Sports Resort with 1 Wiimote on a pretty shoddy bluetooth.

Contributor

JMC47 commented Nov 11, 2015

Wiimote audio is actually working properly in Wii Sports Resort with 1 Wiimote on a pretty shoddy bluetooth.

@jloehr

This comment has been minimized.

Show comment
Hide comment
@jloehr

jloehr Nov 23, 2015

Contributor

Updated initial post.

Contributor

jloehr commented Nov 23, 2015

Updated initial post.

@JMC47

This comment has been minimized.

Show comment
Hide comment
@JMC47

JMC47 Nov 23, 2015

Contributor

Regular Wiimotes work on Windows 7, MSBT Stack now. No working Wiimote audio, though.

DolphinBar and Toshiba Stack remain broken.

Contributor

JMC47 commented Nov 23, 2015

Regular Wiimotes work on Windows 7, MSBT Stack now. No working Wiimote audio, though.

DolphinBar and Toshiba Stack remain broken.

@jloehr jloehr changed the title from [WIP]Real Wiimote Windows "-TR" Fix | Index LED Fix to [WIP]Real Wiimote Windows "-TR" Fix Nov 23, 2015

@jloehr

This comment has been minimized.

Show comment
Hide comment
@jloehr

jloehr Nov 27, 2015

Contributor

For Overview fixing Windows 7:

Windows 7 HIDAPI-Test:

x MS-Stack Toshiba DolphinBar
non "-TR" Working Working Working
"-TR" Not Working: WriteFile Argument Error Working Working

Notes:

  • Toshiba needs the OuputBuffer to have the size of HidCaps.OutputReportSize and the bytes to write paramenter set to HidCaps.OutputReportSize.
  • Toshiba uses its own HIDClass Driver for Bluetooth devices
  • Seems like Toshiba sets the HID Product String to an empty string
  • DolphinBar uses up to four USB devices as Wiimotes, which use Microsoft HID Class Driver. Therefore WriteFile is not working; SetOutputReport is working with "-TR".
Contributor

jloehr commented Nov 27, 2015

For Overview fixing Windows 7:

Windows 7 HIDAPI-Test:

x MS-Stack Toshiba DolphinBar
non "-TR" Working Working Working
"-TR" Not Working: WriteFile Argument Error Working Working

Notes:

  • Toshiba needs the OuputBuffer to have the size of HidCaps.OutputReportSize and the bytes to write paramenter set to HidCaps.OutputReportSize.
  • Toshiba uses its own HIDClass Driver for Bluetooth devices
  • Seems like Toshiba sets the HID Product String to an empty string
  • DolphinBar uses up to four USB devices as Wiimotes, which use Microsoft HID Class Driver. Therefore WriteFile is not working; SetOutputReport is working with "-TR".
@jloehr

This comment has been minimized.

Show comment
Hide comment
@jloehr

jloehr Dec 3, 2015

Contributor
x Toshiba Stack Win 7 Win 8.1 Win 10
WriteFile OutputReportSize + - - -
WriteFile Acutal Report Size - - + +
SetOutputReport - +* +* +*

* does not support "-TR" when connected via Bluetooth

Notes:

  • Toshiba Stack is tested on Windows 7, but is believed to behave the same on Windows 8.1/10
  • DolphinBar behaves like Win 7/8.1/10, except_SetOutputReport_ supports "-TR"
  • WriteFile OutputReportSize: On Win 7/8.1/10 will always transfer 22 Bytes to Wiimote, resulting in Error on Wiimote
  • WriteFile Acutal Report Size: Toshiba and Win 7 will throw ERROR_INVALID_USER_BUFFER, because they expect the bytes_to_write parameter to be OutputReportSize
  • SetOutputReport: Not supported by Toshiba Stack; Won't work with "-TR" Wiimotes
Contributor

jloehr commented Dec 3, 2015

x Toshiba Stack Win 7 Win 8.1 Win 10
WriteFile OutputReportSize + - - -
WriteFile Acutal Report Size - - + +
SetOutputReport - +* +* +*

* does not support "-TR" when connected via Bluetooth

Notes:

  • Toshiba Stack is tested on Windows 7, but is believed to behave the same on Windows 8.1/10
  • DolphinBar behaves like Win 7/8.1/10, except_SetOutputReport_ supports "-TR"
  • WriteFile OutputReportSize: On Win 7/8.1/10 will always transfer 22 Bytes to Wiimote, resulting in Error on Wiimote
  • WriteFile Acutal Report Size: Toshiba and Win 7 will throw ERROR_INVALID_USER_BUFFER, because they expect the bytes_to_write parameter to be OutputReportSize
  • SetOutputReport: Not supported by Toshiba Stack; Won't work with "-TR" Wiimotes
Add Methods to check for Toshiba Stack
Check is done by checking the driver provider property of the HID Class Driver. As the Toshiba Bluetooth Stack provides its own.
The initial enumerated device node is a empty hid interface node. Therefore first one node is moved up and then the provider property check is done.

@jloehr jloehr changed the title from [WIP]Real Wiimote Windows "-TR" Fix to [RFC]Real Wiimote Windows "-TR" Fix Dec 6, 2015

@jloehr

This comment has been minimized.

Show comment
Hide comment
@jloehr

jloehr Dec 6, 2015

Contributor

Ok, i think i am done. I hope i didn't miss anything. Feel free to test.
I've reset the tables in the initial post. If it is not working on any platform, please state the platform, used Wiimote ("-TR"/non-"TR"), used Stack(MS, Toshiba, DolphinBar) and append the Dolphin Log.

Contributor

jloehr commented Dec 6, 2015

Ok, i think i am done. I hope i didn't miss anything. Feel free to test.
I've reset the tables in the initial post. If it is not working on any platform, please state the platform, used Wiimote ("-TR"/non-"TR"), used Stack(MS, Toshiba, DolphinBar) and append the Dolphin Log.

else
{
found_wiimotes.push_back(wm);
}

This comment has been minimized.

@Helios747

Helios747 Dec 6, 2015

Contributor

The braces can be removed on single statement if/else's.

@Helios747

Helios747 Dec 6, 2015

Contributor

The braces can be removed on single statement if/else's.

This comment has been minimized.

@BhaaLseN

BhaaLseN Dec 6, 2015

Member

I don't mind having them. It's acceptable without, but not mandatory to be without.

@BhaaLseN

BhaaLseN Dec 6, 2015

Member

I don't mind having them. It's acceptable without, but not mandatory to be without.

This comment has been minimized.

@Helios747

Helios747 Dec 6, 2015

Contributor

I don't mind either, I personally prefer braces on single lined conditionals in most cases. I was actually under the impression that Dolphin's Contribution Guidelines required that formatting. I double checked though and it's not. It just says how not to format them if used. So never mind

@Helios747

Helios747 Dec 6, 2015

Contributor

I don't mind either, I personally prefer braces on single lined conditionals in most cases. I was actually under the impression that Dolphin's Contribution Guidelines required that formatting. I double checked though and it's not. It just says how not to format them if used. So never mind

Fix "-TR" Wiimotes on Windows 8/8.1/10, by using WriteFile for sending
"-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.
@JMC47

This comment has been minimized.

Show comment
Hide comment
@JMC47

JMC47 Dec 7, 2015

Contributor

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.

Contributor

JMC47 commented Dec 7, 2015

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.

@MayImilae

This comment has been minimized.

Show comment
Hide comment
@MayImilae

MayImilae Dec 7, 2015

Contributor

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:

  • connectivity test: connects to dolphin, shakes, and lights indicate its player number
  • Classic Controller test: loading brawl and making sure the extension works
  • Motion Plus and Nunchuk test: Checking the longterm connectivity issue on skyward sword, making sure I am about to pass the plug in motionplus/nunchuk screen either instantly or with no more than one reconnection (which can happen even on console)
  • Wiimote audio test - With Enable Speaker Data set to ON, run Mario Kart Wii and hit the home button on the wiimote during the select license menu. Go into the wii remote settings, and then raise and lower volume rapidly with the - and + buttons, noting quality and if the connection drops.
  • Three Wiimotes connectivity and game test- Connecting my non-TR, first gen TR, and wiiu gen TR wiimotes, making sure their lights correctly indicate their player positions, and loading wii sports to make sure the pointers of all three wiimotes appear on screen

The devices are:

  • MS Bluetooth Stack - Asus BT211 (which windows says is an Atheros AR3011)
  • Toshiba Stack - Azio BTD-V201
  • Dolphinbar - Running V5 firmware

Test results:

DolphinBar

  • Dolphinbar Win7 single non-TR wiimote - connectivity test: Pass
  • Dolphinbar Win7 single non-TR wiimote - Classic Controller test: Pass
  • Dolphinbar Win7 single non-TR wiimote - Motion Plus and Nunchuk test: Pass
  • Dolphinbar Win7 single non-TR wiimote - wiimote audio test:
    • Severe crackling, but sound was discernible as the sound. However, pressing the button rapidly resulted in mostly silence
    • No apparent lag, other than the silence when pressing rapidly which could be lag?
    • No disconnections
  • Dolphinbar Win7 single TR wiimote - connectivity test: Pass
  • Dolphinbar Win7 single TR wiimote - Classic Controller test: Pass
  • Dolphinbar Win7 single TR wiimote - wiimote audio test:
    • Crackling is significantly less than the non-TR, while not great, it is very clear what the sound is
    • No lag when pressing a single button immediately, but on pressing rapidly considerable lag built up
    • No disconnections
  • Dolphinbar Win7 three wiimotes connectivity and game test: Pass
    • (first wiimote did not vibrate, others did, all worked anyway)

Toshiba Stack

  • Toshiba Win7 single non-TR wiimote - connectivity test: Pass
  • Toshiba Win7 single non-TR wiimote - Classic Controller test: Pass
    • (wiimote did not vibrate, worked anyway)
  • Toshiba Win7 single non-TR wiimote - Motion Plus and Nunchuk test: Pass
  • Toshiba Win7 single non-TR wiimote - wiimote audio test:
    • Nothing but crackling, no discernible audio came through. It did not however lag, and did not disconnect
  • Toshiba Win7 single TR wiimote - connectivity test: Pass
  • Toshiba Win7 single TR wiimote - Classic Controller Test: Pass
  • Toshiba Win7 single TR wiimote - wiimote audio test:
    • Produces actual audio, with no discernible lag
    • Minor ringing sounds during the note, very faint, and could occur on console
    • No disconnections
  • Toshiba Win7 three wiimotes connectivity and game test:
    • Wiimote 3 was "disconnected by emulated software", pressing alt-f7 restored it and it worked
    • Retest result: Pass
    • Overal test conclusion: Pass
    • (not all wiimotes vibrated again, unable to track precisely which this time)

MS Bluetooth Stack

  • MS Win7 single non-TR wiimote - connectivity test: Pass
  • MS Win7 single non-TR wiimote - Classic Controller test: Pass
  • MS Win7 single non-TR wiimote - Motion Plus and Nunchuk test: Pass
  • MS Win7 single non-TR wiimote - wiimote audio test:
    • Sound was crackling and poor quality, lagged behind my button presses
    • The wiimote disconnected twice as I raised and lowed volume rapidly, pressing A restored the connection both times.
      • Interestingly, this means Dolphin lost the connection, and not the bluetooth adapter (the bluetooth adapter would require pressing 1+2 to reconnect) Hmm...
  • MS Win7 TR wiimote - connectivity test:
    • TR Wiimote "connected" to the MS bluetooth stack, did not get connected in dolphin
    • Running Wii Sports Resort, Wiimote 1 connected and disconnected rapidly for several times before failing, logs giving lots of [Wiimote]: IOWrite[WVM_WRITE_FILE]: Error on WriteFile:00000057 and a few [Wiimote]: IOWrite[WVM_WRITE_FILE]: Error on WriteFile:00000015
    • Retest results: Fail
    • Overall conclusion: Fail
  • Unable to perform further TR wiimote tests or the three wiimote test

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!

Contributor

MayImilae commented Dec 7, 2015

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:

  • connectivity test: connects to dolphin, shakes, and lights indicate its player number
  • Classic Controller test: loading brawl and making sure the extension works
  • Motion Plus and Nunchuk test: Checking the longterm connectivity issue on skyward sword, making sure I am about to pass the plug in motionplus/nunchuk screen either instantly or with no more than one reconnection (which can happen even on console)
  • Wiimote audio test - With Enable Speaker Data set to ON, run Mario Kart Wii and hit the home button on the wiimote during the select license menu. Go into the wii remote settings, and then raise and lower volume rapidly with the - and + buttons, noting quality and if the connection drops.
  • Three Wiimotes connectivity and game test- Connecting my non-TR, first gen TR, and wiiu gen TR wiimotes, making sure their lights correctly indicate their player positions, and loading wii sports to make sure the pointers of all three wiimotes appear on screen

The devices are:

  • MS Bluetooth Stack - Asus BT211 (which windows says is an Atheros AR3011)
  • Toshiba Stack - Azio BTD-V201
  • Dolphinbar - Running V5 firmware

Test results:

DolphinBar

  • Dolphinbar Win7 single non-TR wiimote - connectivity test: Pass
  • Dolphinbar Win7 single non-TR wiimote - Classic Controller test: Pass
  • Dolphinbar Win7 single non-TR wiimote - Motion Plus and Nunchuk test: Pass
  • Dolphinbar Win7 single non-TR wiimote - wiimote audio test:
    • Severe crackling, but sound was discernible as the sound. However, pressing the button rapidly resulted in mostly silence
    • No apparent lag, other than the silence when pressing rapidly which could be lag?
    • No disconnections
  • Dolphinbar Win7 single TR wiimote - connectivity test: Pass
  • Dolphinbar Win7 single TR wiimote - Classic Controller test: Pass
  • Dolphinbar Win7 single TR wiimote - wiimote audio test:
    • Crackling is significantly less than the non-TR, while not great, it is very clear what the sound is
    • No lag when pressing a single button immediately, but on pressing rapidly considerable lag built up
    • No disconnections
  • Dolphinbar Win7 three wiimotes connectivity and game test: Pass
    • (first wiimote did not vibrate, others did, all worked anyway)

Toshiba Stack

  • Toshiba Win7 single non-TR wiimote - connectivity test: Pass
  • Toshiba Win7 single non-TR wiimote - Classic Controller test: Pass
    • (wiimote did not vibrate, worked anyway)
  • Toshiba Win7 single non-TR wiimote - Motion Plus and Nunchuk test: Pass
  • Toshiba Win7 single non-TR wiimote - wiimote audio test:
    • Nothing but crackling, no discernible audio came through. It did not however lag, and did not disconnect
  • Toshiba Win7 single TR wiimote - connectivity test: Pass
  • Toshiba Win7 single TR wiimote - Classic Controller Test: Pass
  • Toshiba Win7 single TR wiimote - wiimote audio test:
    • Produces actual audio, with no discernible lag
    • Minor ringing sounds during the note, very faint, and could occur on console
    • No disconnections
  • Toshiba Win7 three wiimotes connectivity and game test:
    • Wiimote 3 was "disconnected by emulated software", pressing alt-f7 restored it and it worked
    • Retest result: Pass
    • Overal test conclusion: Pass
    • (not all wiimotes vibrated again, unable to track precisely which this time)

MS Bluetooth Stack

  • MS Win7 single non-TR wiimote - connectivity test: Pass
  • MS Win7 single non-TR wiimote - Classic Controller test: Pass
  • MS Win7 single non-TR wiimote - Motion Plus and Nunchuk test: Pass
  • MS Win7 single non-TR wiimote - wiimote audio test:
    • Sound was crackling and poor quality, lagged behind my button presses
    • The wiimote disconnected twice as I raised and lowed volume rapidly, pressing A restored the connection both times.
      • Interestingly, this means Dolphin lost the connection, and not the bluetooth adapter (the bluetooth adapter would require pressing 1+2 to reconnect) Hmm...
  • MS Win7 TR wiimote - connectivity test:
    • TR Wiimote "connected" to the MS bluetooth stack, did not get connected in dolphin
    • Running Wii Sports Resort, Wiimote 1 connected and disconnected rapidly for several times before failing, logs giving lots of [Wiimote]: IOWrite[WVM_WRITE_FILE]: Error on WriteFile:00000057 and a few [Wiimote]: IOWrite[WVM_WRITE_FILE]: Error on WriteFile:00000015
    • Retest results: Fail
    • Overall conclusion: Fail
  • Unable to perform further TR wiimote tests or the three wiimote test

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!

@JMC47

This comment has been minimized.

Show comment
Hide comment
@JMC47

JMC47 Dec 7, 2015

Contributor

Everything works as good or better than before. LGTM.

Contributor

JMC47 commented Dec 7, 2015

Everything works as good or better than before. LGTM.

@JMC47

This comment has been minimized.

Show comment
Hide comment
@JMC47

JMC47 Dec 7, 2015

Contributor

Tested Wii Balance Board as well, it works.

Contributor

JMC47 commented Dec 7, 2015

Tested Wii Balance Board as well, it works.

@mbc07

This comment has been minimized.

Show comment
Hide comment
@mbc07

mbc07 Dec 7, 2015

Contributor

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)

Contributor

mbc07 commented Dec 7, 2015

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)

@JMC47

This comment has been minimized.

Show comment
Hide comment
@JMC47

JMC47 Dec 8, 2015

Contributor

Audio only is improved on -tr wiimotes.

On Mon, Dec 7, 2015, 11:30 AM Mateus B. Cassiano notifications@github.com
wrote:

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 https://github.com/jloehr)


Reply to this email directly or view it on GitHub
#3245 (comment).

Contributor

JMC47 commented Dec 8, 2015

Audio only is improved on -tr wiimotes.

On Mon, Dec 7, 2015, 11:30 AM Mateus B. Cassiano notifications@github.com
wrote:

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 https://github.com/jloehr)


Reply to this email directly or view it on GitHub
#3245 (comment).

@mbc07

This comment has been minimized.

Show comment
Hide comment
@mbc07

mbc07 Dec 8, 2015

Contributor

Gotcha, now it makes sense (my wiimotes are all non-TR)...

Contributor

mbc07 commented Dec 8, 2015

Gotcha, now it makes sense (my wiimotes are all non-TR)...

@JMC47

This comment has been minimized.

Show comment
Hide comment
@JMC47

JMC47 Dec 11, 2015

Contributor

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.

Contributor

JMC47 commented Dec 11, 2015

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.

delroth added a commit that referenced this pull request Dec 11, 2015

Merge pull request #3245 from jloehr/RealWiimote-Windows-Fix
[RFC]Real Wiimote Windows "-TR" Fix

@delroth delroth merged commit 8acf8cf into dolphin-emu:master Dec 11, 2015

11 checks passed

default Very basic checks passed, handed off to Buildbot.
Details
lint Build succeeded on the Buildbot.
Details
pr-android Build succeeded on the Buildbot.
Details
pr-deb-dbg-x64 Build succeeded on the Buildbot.
Details
pr-deb-x64 Build succeeded on the Buildbot.
Details
pr-freebsd Build succeeded on the Buildbot.
Details
pr-osx-x64 Build succeeded on the Buildbot.
Details
pr-ubu-nogui-x64 Build succeeded on the Buildbot.
Details
pr-ubu-x64 Build succeeded on the Buildbot.
Details
pr-win-dbg-x64 Build succeeded on the Buildbot.
Details
pr-win-x64 Build succeeded on the Buildbot.
Details
@MayImilae

This comment has been minimized.

Show comment
Hide comment
@MayImilae

MayImilae Dec 12, 2015

Contributor

@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!

Contributor

MayImilae commented Dec 12, 2015

@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!

@jloehr

This comment has been minimized.

Show comment
Hide comment
@jloehr

jloehr Dec 13, 2015

Contributor

@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.
Toshiba and Windows 7: uses same method as before
Windows 8 and higher (including Dolphin Bar on those Systems): use of new API (same as Toshiba, but slightly different)

Therefore behavior on Windows 8 and higher with MS default stack changes:

  • "-TR" Wiimotes are now working with MS Stack
  • Audio for "-TR" Wiimotes now works almost perfectly (according to others)
  • Audio for non-"TR" Wiimotes seem to not work anymore (as i understand the others, it worked before merging my PR, but i am not totally sure)

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.

Contributor

jloehr commented Dec 13, 2015

@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.
Toshiba and Windows 7: uses same method as before
Windows 8 and higher (including Dolphin Bar on those Systems): use of new API (same as Toshiba, but slightly different)

Therefore behavior on Windows 8 and higher with MS default stack changes:

  • "-TR" Wiimotes are now working with MS Stack
  • Audio for "-TR" Wiimotes now works almost perfectly (according to others)
  • Audio for non-"TR" Wiimotes seem to not work anymore (as i understand the others, it worked before merging my PR, but i am not totally sure)

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.

@JMC47

This comment has been minimized.

Show comment
Hide comment
@JMC47

JMC47 Dec 13, 2015

Contributor

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.

Contributor

JMC47 commented Dec 13, 2015

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.

@RandomDolphinUser

This comment has been minimized.

Show comment
Hide comment
@RandomDolphinUser

RandomDolphinUser Dec 14, 2015

Tested with :
Dolphin current dev build : 4.0-8329

x H/S
OS Win 8.1
BT A random adapter "Sitecom" branded recognized as a "Generic Bluetooth Radio"
x MS-Stack
non "-TR" Working
"-TR" Working

Ps : thanks, i can finally play Skyward on 1080p 😄

RandomDolphinUser commented Dec 14, 2015

Tested with :
Dolphin current dev build : 4.0-8329

x H/S
OS Win 8.1
BT A random adapter "Sitecom" branded recognized as a "Generic Bluetooth Radio"
x MS-Stack
non "-TR" Working
"-TR" Working

Ps : thanks, i can finally play Skyward on 1080p 😄

@jloehr jloehr deleted the jloehr:RealWiimote-Windows-Fix branch Jan 13, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment