Project

General

Profile

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.

Status:
New
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
Windows
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

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)

N/A

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 https://forums.dolphin-emu.org/Thread-green-notice-development-thread-unofficial-dolphin-bisection-tool-for-finding-broken-builds and anyone who is building Dolphin on their own can use git bisect.)

5.0-5726

What are your PC specifications? (CPU, GPU, Operating System, more)
Windows 10 Fall Creator's Update
i7-6700k
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

History

#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/
https://www.dropbox.com/s/upr1nfnxjjlhdfn/2017-11-26%2011.31.01.mp4?dl=0

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:
https://www.dropbox.com/s/fftqw107u4ip5zf/2017-11-26%2011.36.06.mp4?dl=0

#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 dolphin.com Watchdog
:dolphin
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