misson20000 / twili

Homebrew debug monitor for the Nintendo Switch.
GNU General Public License v3.0
184 stars 23 forks source link

Missing steps in getting Windows driver installed #114

Open Honeybunch opened 2 years ago

Honeybunch commented 2 years ago

Following the readme in contrib/windows/driver left me a bit stumped for a while. I installed the certificate correctly but the driver wouldn't install to any Transistor USB device. After some fiddling I saw that the driver's .inf file was trying to install libusbK_x86.dll and libusb0_x86.dll even though this was a 64-bit system. Duplicating libusbK and libusb0 in the x86 version of the driver and copying them to the amd64 folder with the added _x86 part of the name and I was allowed to install the driver.

This seems like a bug in the driver itself; trying to install things that aren't there. I can't just modify the .inf file as that would require re-creating a certificate for the new .inf contents.

I was hoping that I'd be able to get twib working to verify that the driver is functional. But I'm seeing that the twib binary available is from 1.2.0 and it's not able to connect at all:

λ .\twib_win64.exe -v list-devices
[2][2021-10-27 18:00] C:\projects\twili\twib\tool\Twib.cpp:596: starting twib
[0][2021-10-27 18:00] C:\projects\twili\twib\tool\Twib.cpp:917: connecting to \\.\pipe\twibd...
[5][2021-10-27 18:00] C:\projects\twili\twib\tool\Twib.cpp:925: Could not open pipe. GLE=2

I'll try building twib for windows manually and see if that works.

Honeybunch commented 2 years ago

I've gotten twib and twibd built for windows. The error on circleci is just a matter of bumping the C++ version from C++17 to C++20 for the parts that need it. That and there are some uses of std::min that conflict with window's default defines for min and max, undefining min and max at the start of common/Logger.hpp did the trick.

The problem I'm seeing now is actually that I only have one device showing up in Windows. I see Transistor USB (Composite) but I never saw Transistor USB (Twili) or Transistor USB (Serial) showing up in device manager. Not sure if they maybe got automatically assigned default drivers by Windows but I did a diff of devices with the powershell command Get-PnpDevice and I'm not seeing any other devices show up :(

Honeybunch commented 2 years ago

I tried uninstalling and re-installing the driver. Once that did actually get Twili and Serial to show up. The device quickly crashed but twibd did end up showing some activity. I haven't been able to get that to happen again. I wonder if being on 12.0.2 is causing problems. I'm also on Atmosphere 1.2.1.

I've been having pretty bad stability problems with twili installed. I can't get to hbmenu unless I unplug the usb cable while trying to launch hbmenu via the album. And even then that only sometimes works. Maybe I'll try downgrading an emunand to 8.0.0 and see if that's any better.

Sorry for all the spam here. Just wanted to get a debugger attached to debug a project of mine :(