USBugs

I've been having a lot of problems lately, but it turns out I might have been impacted by a hardware bug

About a year ago as I'm writing this (so, around March 2020), I started having some hardware issues. The particulars aren't that important, but I had some extra money laying around for unrelated reasons, so I started throwing hardware at the problem. This is usually a mistake.

I went a little nuts. I bought hard drives, I bought a new motherboard (which required buying a new case since the old one was too small), I bought a new video card (back when you could do such things). I, basically, bought most of a new computer over the span of a few weeks. I installed and reinstalled operating systems because I was convinced that I had bad hardware.

I eventually discovered through lots of trials that the Debian installer (and, by extension, the Ubuntu installer) doesn't like disks that were 'dangerously dedicated' under FreeBSD (which I was switching from at the time as a part of my troubleshooting). It turns out that when the Debian installer encounters a dangerously dedicated disk, everything proceeds normally. The installation looks like it's successful. But when you go to reboot you get a big middle finger instead. The installation is unbootable and if you try the installation again, there's a chance that the installer won't be able to find the drive. It might look like the drive has failed.

Of course, the drive could have failed, but it's more likely that the disk tools included in the Debian installer just fall over when they encounter a dangerously dedicated disk. My solution was to use a copy of GParted that I had laying around to delete all the partitions, create a new MBR and go down the road. I installed Debian but ended up bouncing back and forth between Debian and FreeBSD over the next few weeks because by then the Great Lockdown of 2020 had begun and it was too cold to do anything outside, so I had nothing else better to do. Also because under FreeBSD I had this strange audio issue that I didn't have under Debian. Specifically that the audio would just stop working occasionally. I reference this in the FreeBSD installation notes (which I really should update for 13.0), and in the Sound Blaster Z note (which we'll get to). What would happen is that occasionally after a period of time, sometimes minutes, sometimes hours, sometimes days, the audio would freak out and then just stop cold. It couldn't be restarted no matter what you did. This happened on the motherboard I had upgraded from as well, which was one of the reasons I started this upgrade madness in the first place. There was a workaround posted in the FreeBSD forums that works, but the audio still freaked out sometimes for whatever reason it was doing it in the first place, so I just dealt with it.

Fast forward to now, which is about a year later. I occasionally like to make videos about video games (you know, like four hundred million other people online these days), and with Spring rolling around, I started to feel like doing something new, like making some videos again (the last one I made that wasn't a vlog was way too long ago), and I realized that I had all of the components that I needed to set up a machine to do some capturing and some streaming, so I got to work on that.

Eventually, though, it dawned on me that for a bump in encoding quality I need an nvidia GPU so I can take advantage of nvenc, instead of the AMD GPU that I had laying around (which is a great card, fully supported 'out of the box' under recent distributions of Linux, but doesn't have that sweet, sweet hardware-assisted encoding unless you jump through some hoops that I don't feel like doing). But, since a few months ago, GPUs no longer exist in stores for purchase. This is inconvenient.

However, I did have an nvdia GPU in my main FreeBSD machine. The nvidia drivers under FreeBSD don't support nvenc, so that's unfortunate, but I figured that I could drop back into Linux-land and install Steam and all the associated goodies and do some recording/streaming of whatever it is that I decided to record (I hadn't gotten that far yet).

So I picked Kubuntu (which just had a fancy-pants new release), backed up all my files and things, and braced myself for a weekend of massaging my config files into something that would give me a some semblance of my old desktop, but I had problems with the (k)ubuntu installer right away, too.

I learned my lesson about dangerously dedicated drives and I don't do that any more, but I have been using the old CSM instead of the fancy new UEFI to boot, which is a lot harder to do on (k)ubuntu than it was the last time I tried it. So I figured that since I was installing a more 'mainstream' Linux distribution that I would go all in and try UEFI, too.

I have six hard drives in my computer (don't judge me). They're all different sizes and are used for different things, like one drive just for /home, and one big cheap slow drive for all of the multimedia I've gotten over the years, so I usually have to do the 'something else' or 'advanced setup' or whatever to set up the drives just so. I did that and the installer formatted all my drives, and then barfed when it tried to install the bootloader. It turns out that you need to make a small /boot partition, which the installer didn't tell me about, probably because I entered 'expert mode' with the implication that I knew what I was doing (which is almost never the case). Instead it just crashed and made me start over. After way too long I finally let the Kubuntu installer carve up the drive in 'auto' mode and I just manually added the other drives later.

I spent the next few days trying to remember how to get Ubuntu to recognize UFS drives, copying things over, and generally trying to remember everything I needed to do to get my computer usable again. And it mostly worked after some growing pains. I had nvenc enabled, and my sound even stopped freaking out.

But I noticed after I ran dmesg to check out an unrelated issue that there was an entry talking about how some IRQ workaround was being implemented. I figured that this was probably related to the ridiculous sound issue (the Linux driver was probably working around the problem that FreeBSD got hung up on), and I decided that I would try something I hadn't done in a long time: I would buy a sound card for my computer.

I haven't bought a sound card for a very long time. I think the last sound card I bought was some version of the Sound Blaster Live! in the late 90's, which I still have, but cramming a PCI card into a PCIe slot is not something I wanted to do (you need an adapter and I didn't want to deal with that headache). I hadn't looked at discrete sound cards for a long time because onboard audio was generally good enough for whatever I was doing, plus I had some decent speakers that tended to sound pretty good no matter what was plugged into them, so I hadn't really thought about it.

I wasn't initially looking at Creative Labs cards because I remember them being difficult to use under anything but Windows in the late 90's / early 00's (something about them not playing well with the rest of the system and not adhering to the PCI specifications, but it's been a really long time and I've slept since then, so the details are fuzzy). I looked around at the usual sites for hardware figuring that even with a global parts shortage, sound cards are probably lousy for mining digital play money, so those would be easy to find.

And they were! But figuring out if they would work with my computer was another issue entirely.

Like a lot of hardware, a lot of sound cards are built around a handful of chips with some chrome around them to make them all look different, and it can be tough to find out what chip is actually powering any individual card. After scouring forums and YouTube videos and manual pages, I landed on the Creative Labs Sound Blaster Z. It's an older card (released initially in 2012), so odds of it working with Free Operating Systems are increased. There were some posts where people complained about the card doing weird things or otherwise having weird workarounds (like having to dual-boot your computer so you could boot into Windows to initialize the card, and then do a reboot (but not a full shutdown) and then it would work under Linux). But these seemed to be no more numerous than any other problem posts I find when doing searches for other hardware. I always expect to see a few complaints because someone got a defective thing or they did their installation wrong or something like that, and I found some proof that it worked under some Linux distributions, so I decided to give this a shot.

I ordered it, installed it, and it worked! Once.

In my haste to try out the card, I forgot to disable the onboard audio on my motherboard, so I rebooted to do that and then everything with the Sound Blaster Z went sideways. In the GUI mixers, all of the outputs except for the TOSLINK disappeared and would not be enabled no matter what I did.

I tried turning the onboard sound off and back on. I tried using pavucontrol I tried alsamixer I tried driver options. The only thing that I could get working was if I used alsamixer as the root user, then I could get audio out of the front headphone connection and nothing else. This was less than ideal.

As a last resort, I tried updating my motherboard's BIOS. I had never updated the BIOS on this thing, so I was missing over a year's worth of updates and there were a lot of them. Several of them related to 'improving USB disconnects'. This was interesting because very occasionally when I would reboot the computer the mouse wouldn't work. It would be completely dead until I unplugged it and plugged it back in. I figured it was a problem with the mouse, but maybe it wasn't? So I decided to take the plunge and update the BIOS.

And nothing obvious happened.

After getting nowhere I remembered I had FreeBSD-12.something install media laying around from the last install I did. So I loaded up the installer and loaded the sound driver. I tested it out and found that the card was detected and after a little massaging seemed to work. So I updated my media and started rebuilding my operating system (again).

After getting the basics set up I started restoring my files from backup. I found that the copy operation was going a lot slower than normal, and I kept getting USB transfer errors. This was new. The restore operation did eventually complete and I installed a bunch of software that I wanted and generally started getting back up to speed. Again. But then I started noticing other odd problems. Specifically the computer would just stop after a while, usually when I was away from it for any length of time, but sometimes when I was in the middle of using it. This was not great news.

I thought it might be the desktop environment I was using, but it wasn't. I thought it might be the new hard drive I got (I accidentally bought one from a shady third party seller on Amazon with a weird 'warranty'. The serial number shows that it was an OEM drive shipped to Australia and I'm definitely not there.). Finally, after experiencing an uptime of less than an hour, I finally realized that the motherboard may be defective. It's been over a year, but maybe the problem has existed since day one, but I just didn't know about it.

While looking at replacement motherboards and I came across some interesting information. Apparently there's been a big kerfuffle around AMD motherboards with the 500 series chipsets (mine is an X570). Digging deeper into this world I had no idea existed, I found a lot of people were having the same problems I was (and some were having worse issues). There are workarounds that might work, and a BIOS update coming... eventually, that is supposed to take care of this issue, but this was a revelation. If the workarounds work, then it'll save me a hundred bucks or so and hours of work transplanting a motherboard. Oddly enough, though, one of the workarounds involved setting the pci-e slots and the m.2 slots on the motherboard to pci-e 3.0 mode instead of 4.0. This won't make a bit of difference for most of the hardware I have, so it was worth a shot. I made the adjustments and so far... everything has been stable. Audio has been good, the mouse hasn't just decided to quit, and the system hasn't frozen up. It's too early to definitely call it fixed, but it's looking good so far.

So, what have I learned?

I don't know that I learned a whole lot that I didn't already know (That's a lie. I learned a lot basic stuff and edge cases that I may never need to know again). I ended up doing a lot of work only to end up right back where I started. That's always annoying, but I guess it was nice to get some software installation practice in again. And, hey, FreeBSD had a version update while I was tearing my hair out, so that was nice, too. I should probably update my install notes, since I found some errors in there. But for now, I think I'm going to go take a nap.

This entry's fake tags are:

● FreeBSD ● Kubuntu ● annoyances ● bugs ● good backups 



Read more blog · Go back to the homepage