If you develop under Windows and use WSL... READ THIS

Here's What's Going On...
Post Reply
User avatar
pmaillot
Posts: 881
Joined: Wed Apr 14, 2021 1:32 pm

If you develop under Windows and use WSL... READ THIS

Post by pmaillot »

Yesterday, while testing a program I recently released (wda2wing) and wanted to extend it to support XTouch as a controlling device for my RACK (spoiler here!!!!),I found out I had totally lost USB MIDI and USB audio on my Std WING. Tried out different cables, validate my PC was working with using my Rack (USB worked with that unit) etc...

I got some support and test ideas from the B devs (always great guys, even at 11 at night!) but nothing made it. And so I went to bed with the feeling my Std WING HW was faulty for an unknown reason.

<night and dreams about what could have gone wrong, some ideas...>

I often use Linux under Windows [a.k.a. WSL] for my Linux builds, as I try to make my programs multiplatform when I can. WSL generally works like a charm, and I was trying to get a way to access Windows MIDI under Linux. Microsoft has that utility called 'usbipd' that maps USB to IP in order to pass Windows USB data flow to Linux. Great idea in fact, but what a bad implementation. Read on...

I had been testing this to a point a few days back, and it didn't go all the way through, because right in the middle of the process, M$ tells you you have to be under WSL2 and not WSL1 to finalize attaching the USB flow to an IP. I am not running (and don't want to run) WSL2 (too messy for my internet IPs, with unneeded tunnelling etc...) and let it there, continuing to therefore not use USB MIDI under WSL1, as this is not possible.

And went to other business, i.e. I have other things in my life :-).
Until I came back to use USB audio/MIDI under Windows to find out it was no longer working... and had totally forgot about the possible consequences of my previous attempt using usbipd.... Turns out usbipd created in Windows a kind of permanent attachment of a USB ID to whatever, and this survives a Windows reboot without any warning to the user... [that's why I call it a bad implementation]... I know I'm supposed to know what I'm doing, or at least remember my actions and always be able to undo them.

So this morning I tested another PC (stole my wife's PC... don't tell her) with my trusty WING and found audio and USB MIDI were in fact registering and working fine. A real relief to me (and you too I hope) in the fact there are no HW issues with WING.

Back to my W11 environment, use that usbipd command again to unbind the USB ID that was kept 'shared'. And... Victory! my USB is back...

Conclusion: Beware of these weird, experimental Windows commands that can let you in the dark...

Code safely :-)
-Patrick
Post Reply

Return to “Announcements”