Skip to content

making wii motes less crashy#1853

Open
Squall-Leonhart wants to merge 1 commit into
cemu-project:mainfrom
Squall-Leonhart:notcrashywiimotes
Open

making wii motes less crashy#1853
Squall-Leonhart wants to merge 1 commit into
cemu-project:mainfrom
Squall-Leonhart:notcrashywiimotes

Conversation

@Squall-Leonhart
Copy link
Copy Markdown

@Squall-Leonhart Squall-Leonhart commented Mar 28, 2026

probe devices outside the exclusive lock to avoid blocking reader/writer threads during I/O

Replace newly opened handles with existing ones for already-active devices to avoid closing and reopening handles every poll cycle (handle shenigans can be racy)

improve device connect/disconnect safety.

remove early is_connected return that prevented cemu from setting the LED on re-associated wiimotes on hot-swap/reconnect and on start if a mote is already associated and attached.

probe devices outside the exclusive lock to avoid blocking reader/writer threads during I/O

Replace newly opened handles with existing ones for already-active devices to avoid closing and reopening handles every poll cycle

improve device connect/disconnect safety.

remove early is_connected return that prevented cemu from setting the LED on re-associated wiimotes.
@Squall-Leonhart
Copy link
Copy Markdown
Author

review please @capitalistspz

@Squall-Leonhart
Copy link
Copy Markdown
Author

so far i've been able to bind the same remote to every tab, remove it, and bind it again without a crash, usually it'd happen by the 4th or 5th.

std::vector<WiimoteDevicePtr> reachableDevices;
for (auto& device : devices)
{
const auto writeable = device->write_data({kStatusRequest, 0x00});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HidapiWiimote::write_data calls hid_write, which isn't thread safe

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants