Emulator Issues #10625

When utilizing a Real Wii Remote through the emulated Bluetooth adapter, launching directly into a game with the -e parameter results in a crash

Added by NarryG over 3 years ago. Updated 9 months ago.

% Done:


Operating system:
Issue type:
Relates to usability:
Relates to performance:
Relates to maintainability:
Regression start:
Fixed in:


Game Name?

N/A (Any Wii Game)

Game ID? (right click the game in the game list, properties, info tab)

N/A (Any Wii Game)

MD5 Hash? (right click the game in the game list, properties, info tab, MD5 Hash: Compute)


What's the problem? Describe what went wrong.

When launching Dolphin and a Wii game directly using the -e launch parameter, Dolphin will crash when connecting to a real wiimote if "Real Wii Remote" is selected as the control options. The crash only occurs if the controller actually connects to Dolphin. If no controller connects, this issue doesn't occur.

What steps will reproduce the problem?

Set the controller input to "Real Wii Remote" and make sure continuous scanning is on so it'll connect right away.
Launch Dolphin using the -e parameter to load a game directly
Dolphin will load, you'll get a black screen in the emulation window, the controller will vibrate signaling it's connected, then Dolphin will crash (no HUD text is ever drawn)

Is the issue present in the latest development version? For future reference, please also write down the version number of the latest development version.

Yes. 5.0-5796

Is the issue present in the latest stable version?

No. 5.0 Stable

If the issue isn't present in the latest stable version, which is the first broken version? (You can find the first broken version by bisecting. Windows users can use the tool and anyone who is building Dolphin on their own can use git bisect.)


What are your PC specifications? (CPU, GPU, Operating System, more)
Windows 10 Fall Creator's Update
GTX 1080ti

Is there anything else that can help developers narrow down the issue? (e.g. logs, screenshots,
configuration files, savefiles, savestates)

I was using a Dolphinbar and a RVL-CNT-01-TR


#1 Updated by JosJuice over 3 years ago

  • Regression start set to 5.0-5726
  • Regression changed from No to Yes
  • Milestone set to Current

#2 Updated by leoetlino over 3 years ago

  • Operating system Windows added
  • Operating system deleted (N/A)

Might be specific to Windows. I cannot reproduce the issue on Linux with Bluetooth (bluez) or the DolphinBar (hidapi).

#3 Updated by NarryG over 3 years ago

leoetlino wrote:

Might be specific to Windows. I cannot reproduce the issue on Linux with Bluetooth (bluez) or the DolphinBar (hidapi).

Turns out there may be more to this.

As of the latest build when writing this (5.0-5944) it actually appears to be inconsistent. Sometimes the wiimote will start vibrating, dolphin will crash, and the wiimote will keep vibrating until the error reporting window goes away. Other times it'll work fine.

Here's a video of it occurring almost every time on the latest build/

Now here's the part that I say makes it weird. I went back and re-tested it on 5707 and if I restart enough times, the same issue will crop up. The difference is, instead crashing the majority of the time it crashes the minority of the time.

Video of it occurring after many restarts on 5707:

#4 Updated by JosJuice over 3 years ago

  • Regression start deleted (5.0-5726)
  • Regression changed from Yes to No
  • Milestone deleted (Current)

I'll remove the regression marker, then.

#5 Updated by NarryG over 3 years ago

JosJuice wrote:

I'll remove the regression marker, then.

I've done some research and found that it appears to be a thread sync issue. If I put my computer under heavy load then launch Dolphin, the issue does not occur (even on the latest dev build as of posting this). If I make sure everything is closed and use a recent build, it happens almost every single time.
If I had to guess, it's probably something with initializing the Wiimote before something else is initialized.

#6 Updated by NarryG over 3 years ago

I'm also running a batch script which automatically restarts Dolphin the moment it crashes (I'm corrupting the game so it's crashy) which seems to trigger it more. If you use this script it makes it occur even more than if you manually re-open the program over and over again.

title Watchdog
echo (%time%) dolphin started.
Dolphin.exe -b -e "F:\Dropbox\Emulation\Roms\Nintendo GameCube\Metroid Prime (USA) (v1.00).gcz"
echo (%time%) WARNING: dolphin closed or crashed, restarting.
goto dolphin

#7 Updated by NarryG over 3 years ago

Sorry to spam with updates, but I just confirmed the theory.
WiimoteReal.cpp, void Wiimote::ThreadFunc()

Adding a 1000ms sleep after bool ok = ConnectInternal(); results in the issue going away.

Increasing the sleep that's already present right after this line (within the if (!ok) block) doesn't fix the issue. Someone with more knowledge of how it functions can probably find where the sync issue lies and implement a better fix than just waiting for 1000ms.

#8 Updated by Billiard26 9 months ago

Is this issue still present?
There have been some significant changes to real Wii remote code.

Also available in: Atom PDF