9 ms·
Most long-standing XHCI (USB 3.0+) issues resolved
- userbinator 8y agoAs of this writing, the XHCI spec is an 8MB PDF containing 604 pages. In contrast EHCI is 155 pages and OHCI and UHCI 160 and 47(!) pages, respectively. There's a lot of complexity in USB3, so it's not surprising it took this long to get the bugs out. The fact that "real" debugging requires an extremely expensive protocol analyser/oscilloscope also adds to that; without, you're basically restricted to "guess and test" and reverse-engineering other drivers to see the differences in behaviour.
- dmitrygr 8y agoYou should see the Bluetooth spec 4kilopages, before you even get to actual profiles.
- MrBuddyCasino 8y agoTo be fair, they've realized BT was all a huge unfixable clusterfuck and started anew in the later versions. I've heard that USB is worse though, especially AUSB-Audio, -PD and -Video.
- dmitrygr 8y ago> and started anew in the later versions. entirely not true source: been working on this for any many years :(
- MrBuddyCasino 8y agoI've only heard that 2nd hand, so forgive me for spreading bullshit. The current situation is that we have Bluetooth Classic, high speed (used for AirDrop?) and BLE, right? I guess the confusion was caused by the "BT classic" terminology, which if I understand you correctly means is here to stay?
- dmitrygr 8y agoclassic is here to stay because car kits LE uses a lot of the same HCI commands and some of the same protocols (l2cap). airdrop uses LE to establish connection
- waddlesplash 8y ago(I'm the author of the blogpost.) > without, you're basically restricted to "guess and test" and reverse-engineering other drivers to see the differences in behaviour. Not entirely. If you look at the commits I linked in the post, you'll see that most of them fixed rather egregious spec violations. Arguably the spec could have been clearer; but still. > The fact that "real" debugging requires an extremely expensive protocol analyser/oscilloscope also adds to that USB packets can be sniffed in Wireshark. But for the kinds of bugs that this driver had, that isn't helpful; most of the problems were failure to initialize the controller or sending invalid command sequences. So that wouldn't be very helpful anyway.
- monocasa 8y ago> or sending invalid command sequences Most of the protocol analyzers I've seen go out of their way to highlight invalid sequences and spec violations. IMO, that's most of their benefit.
- waddlesplash 8y agoNo, I mean we were sending invalid command sequences to the XHCI controller, and as a result it wasn't sending anything to the ports at all.
- nitrogen 8y agoThere are probably ways of dumping PCI writes; I'm curious if any tracing of that sort was used (comparing traces to known working OSes), or if it was all about comparing code to the spec.
- jclulow 8y agoWe've gone through similar rounds of debugging our XHCI bits on illumos. PCI and USB sniffing hardware is expensive and we have access to neither. You can get a long way by becoming comfortable with the specification, reading and getting review on your source, and by using the debugging tools on your OS (we have MDB and DTrace, etc).
- ken 8y agoThat's not quite fair. They're not even printed on the same size page! XHCI has much bigger margins. Compared to EHCI, it's 4 times as many pages, but only 3 times as many words. Plus, adding diagrams can help clarify, rather than adding complexity. And XHCI now has a glossary! Anyway, is that a lot for a technical specification? Most programming languages I've used in the past year have had longer specs than that (if they have one at all). Even plain C is over 500 pages now. The biggest concern I have here is requiring an oscilloscope. Nothing here looks like it should require an actual physical layer. Why was USB designed to conflate these layers in the first place? The whole OSI stack might be silly but separating the physical layer has always been a great idea. When I upgrade from 10/100 ethernet to 10/100/1000 ethernet, I don't have to re-test my web server and mail server.
- waddlesplash 8y ago> The whole OSI stack might be silly but separating the physical layer has always been a great idea. When I upgrade from 10/100 ethernet to 10/100/1000 ethernet, I don't have to re-test my web server and mail server. No, but you had to change all your network cards on both ends of the connection, and of course there were new drivers for the new chipsets. Same with USB.
- makomk 8y agoAlso, a lot of the XHCI hardware is itself buggy. Linux has so many workarounds for different issues with XHCI host controllers that they had to increase the flags variable indicating which needed to be enabled to 64 bits because they'd run out of bits: https://patchwork.kernel.org/patch/10421969/ https://patchwork.kernel.org/patch/10421969/
- benj111 8y agoSo I guess Haiku development isn't going that well if they're struggling to get USB 3 sorted. Shame, it seemed a promising project. Edit: Okay my assessment was based on this, the fact that there only seems to be a beta release for download, and there didn't seem to be a decent web browser at some point fairly recently ( there was a story on HN?). Are these misunderstandings? Do we have different definitions of 'doing well'?
- hakfoo 8y agoI suspect their work optimizes around a relatively narrow band of supported hardware. The Beta 1 release, when I tried it on my Ryzen-based desktop, wouldn't get past the splash screen, stalling out at things that seemed to revolve around the SATA controller. Meanwhile, pop the same flash drive in a Thinkpad X230t, and it booted and installed fine, and even Wi-Fi worked without a significant hitch.
- waddlesplash 8y ago> The Beta 1 release, when I tried it on my Ryzen-based desktop, wouldn't get past the splash screen, stalling out at things that seemed to revolve around the SATA controller. Did any icons light up? There was (is) an undiagnosed issue that is preventing BIOS booting from working on Ryzen. I know one of the other devs runs Haiku on his Ryzen via EFI and says it works like a charm. > I suspect their work optimizes around a relatively narrow band of supported hardware. Not by design, but just by circumstance -- we developers optimize for the hardware we have and use, and not many others tend to submit patches, so that's the way it goes.
- puppetmaster 8y agoI've been using haiku as my main work os for a couple of months now. Granted, there are issues, but none of them too annoying to prevent me from getting things done... except for xhci. It would seem like this specification has been a pain point for many other projects before. For a os with only a few contributors doing work on their freetime, I think it is going great. (My opinion, like mouths... everybody has one)
- puppetmaster 8y agoGentlepeople... the time to try Haiku is now! get an image, and boot it. Out of 10 machines with different ages, all but one get to desktop in a few seconds. For the one that gets to a blank screen equally fast, make sure to press <space> on boot and choose vesa. Browsers? Usable for the focused mind, lots of wip... For me, I have text editors, compilers, a terminal, and aws cli... I can wish for more, but I am happy with this.
- themodelplumber 8y agoI just tried it for a few weeks, ending last week. It wasn't bad at all, though individual apps had various bugs such that the experience often came down to same-app-on-Haiku vs. same-app-on-Linux. Also, while I liked being able to join different apps into one tabbed window, the other workspace features in Linux DE's seemed even more useful. So: I was surprised at how easy it was to end the experiment early and try out another Linux distro, even though I'll probably try out other Haiku releases in the future. The boot time and single-user configuration was definitely a nice break.
- waddlesplash 8y ago> the other workspace features in Linux DE's seemed even more useful. Such as? Haiku has the "workspaces" concept too (https://www.haiku-os.org/docs/userguide/en/workspaces.html https://www.haiku-os.org/docs/userguide/en/workspaces.html), though perhaps not as full-featured as Linux's.
- themodelplumber 8y agoYes, I think it's the full-featured aspect that made a lot of difference in this case. Though I didn't have any _workspace_ problems in Haiku, it was more like the panel concept in e.g. XFCE is simply more refined. A really basic difference example though was that the default window move/resize RMB shortcut modifier is simply Alt in my Linux install, as opposed to Ctrl+Alt on Haiku. On a cramped keyboard this combination was fiddly. I also swap caps and CTRL on this keyboard in Linux and I hadn't checked yet if this could be accomplished. There were lots of things to look into. I appreciate your response, and will probably try out Haiku again in the future. I liked that it was easy to install and test. Also as someone who uses QMMP a lot, I was very pleasantly surprised at the neat Be-style skin that came in its Haiku install. :-)
- ky738 8y agoHaiku is an amazing project. I just wished they had like a shop to purchase t-shirts, stickers, plushies and whatnot like the FSF. I'd buy in an instant, and it probably would be great for their donation goals.
- waddlesplash 8y agoBut we do! https://www.cafepress.com/haiku_os https://www.cafepress.com/haiku_os
- ky738 8y agoThat's awesome! But I wish it was more visible in the website, I couldn't find it at first glance
- ky738 8y agoI just got a sticker, but I think you guys could improve on the work, I see potential with the logo and variants, and a mascot would be very cool. Just saying, well done merchandising sells well. Good luck!