I simply lowered the time the real Wiimote thread sleeps from 2ms to 1ms when m_audio_reports FifoQueue is empty, which seems to be most of the time.
This change is done in WiimoteReal.cpp, function Wiimote::ThreadFunc().
This fixes a no-brand-Wiimote bough in Dealextreme last year that was working correctly with GlovePie but not with Dolphin (vibrated but disconnected right away 99% of the times), so I thought it should be related to Dolphin's code. Another wiimote I have, also bought in DX but branded "Nintendo", worked perfectly with Dolphin.
I infer by this chage in code that this 3rd party Wiimote has to be read/written at least once each millisecond not to get disconnected. I've tried this change with Win7 MS stack & Toshiba 8 bluetooth stack.
As performance impact seems to be minimal (same FPS or maybe 1fps lower) on my machine, I think this change should be pushed to master, cause it probably will help with many 3rd party Wiimote connections/disconnections.
Should I do a push? Never did one :-)
diff --git a/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp b/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp
index 204a1fc..3c1d0f8 100644
--- a/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp
+++ b/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp
@@ -323,7 +323,8 @@ void Wiimote::ThreadFunc()
{
if (m_audio_reports.Size() && !read)
Read();
- Common::SleepCurrentThread(m_audio_reports.Size() ? 5 : 2);
+ //Common::SleepCurrentThread(m_audio_reports.Size() ? 5 : 2);
+ Common::SleepCurrentThread(m_audio_reports.Size() ? 5 : 1);
read = false;
}
#endif
This change is done in WiimoteReal.cpp, function Wiimote::ThreadFunc().
This fixes a no-brand-Wiimote bough in Dealextreme last year that was working correctly with GlovePie but not with Dolphin (vibrated but disconnected right away 99% of the times), so I thought it should be related to Dolphin's code. Another wiimote I have, also bought in DX but branded "Nintendo", worked perfectly with Dolphin.
I infer by this chage in code that this 3rd party Wiimote has to be read/written at least once each millisecond not to get disconnected. I've tried this change with Win7 MS stack & Toshiba 8 bluetooth stack.
As performance impact seems to be minimal (same FPS or maybe 1fps lower) on my machine, I think this change should be pushed to master, cause it probably will help with many 3rd party Wiimote connections/disconnections.
Should I do a push? Never did one :-)
diff --git a/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp b/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp
index 204a1fc..3c1d0f8 100644
--- a/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp
+++ b/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp
@@ -323,7 +323,8 @@ void Wiimote::ThreadFunc()
{
if (m_audio_reports.Size() && !read)
Read();
- Common::SleepCurrentThread(m_audio_reports.Size() ? 5 : 2);
+ //Common::SleepCurrentThread(m_audio_reports.Size() ? 5 : 2);
+ Common::SleepCurrentThread(m_audio_reports.Size() ? 5 : 1);
read = false;
}
#endif
