Bluetooth issues? Buy a dongle.

After a few years of hard work, my laptop had served his purpose and was being replaced with a newer one. I now have a HP ZBook Fury 15 G7 with everything a developer could wish for. Computers are never too fast of course, but this one comes close. Unfortunately, my new Bluetooth adapter was pretty bad.

I have a lot of headphones; I think it might be an obsession. But my excuse is that I have a few at work, and a few at home. On my previous laptop, this wasn’t an issue at all. Actually I was surprised how Windows seemed to always exactly know what the preferred headset was for my conference call.

But with my new laptop, these days were over. The most common problem was that I could not hear the others, but they could hear me. So basically the Bluetooth connection to the headset was working, but it’s not just functioning well. Rebooting the laptop helped. If, after the reboot, I started calling, the headset worked perfectly. But then suddenly a few hours later, or when switching it off/on, it would mysteriously stop working. Yes, I know I can select what device Teams should use, this was all set correctly.

Bluetooth settings in Windows 10Old school sound settings in Windows 10Bluetooth devices nowadays have different profiles, to provide the best experience for each usage. This means that when you want to use your headset for a call, it switches to “voice” mode, which uses different codecs than for music. My theory is that switching between these profiles doesn’t work properly in my case. Maybe some software or resource is keeping the handler open to the “music” profile, while it should switch to “voice” when needed. So voice should take precedence above music. I tried disabling the music profile for some devices in Windows, which is possible, but it didn’t help a bit.

Eventually I was so fed up with this, I impulsively bought a Bluetooth dongle. Since I have two MPOW headsets (H21 for music, M5 for calls), I figured buying a MPOW dongle would probably work best. So I went to my friend Ali, and this time didn’t choose the cheapest option. I bought the Mpow BH519 and hoped for the best. Maybe, just maybe, the problem was within the Bluetooth protocol itself. Maybe some older Bluetooth adapters cannot handle this profile selection thingy at all.

Well, the title of this post already mentioned it of course: it seems to work! Even the cheap bone conducting headphones that wasn’t able to reconnect the music profile at all now suddenly works like a charm.

So, stop tormenting yourself and buy that dongle. And HP and other manufactures: go fix your Bluetooth adapter :-(

By the way, the story continues (a bit). I thought I was being smart by disabling the Bluetooth adapter in my bios, so Windows wouldn’t get confused about which adapter to use to pair with my headphones. At home I don’t use Bluetooth, so for me, so I plugged the dongle in my docking station at work, and I should be fine.

But Windows is still a bit silly. The Bluetooth that were paired to my, now disabled, Bluetooth adapter still show up in my devices, but I cannot remove them. Computer says “remove failed”, that’s it. I could however pair my Bluetooth devices to the new dongle, but now their name was something like “2- V11 Headphones”. It was prefixed with a 2. That annoys the hell out of me.

When I was at home, without the Bluetooth dongle, I re-enabled the Bluetooth adapter in my BIOS and tried removing the devices. Still didn’t work. I had to go to the old school Windows 7 window as shown in the picture above, and from that list I was able to remove the devices.

So my advice would be to remove these Bluetooth devices before you begin. Then disable your Bluetooth adapter in the bios, and then insert the Bluetooth dongle. That would probably keep things as neat as possible.

Network share cache

Problem

At work we have an iOS app that is communicating with a windows application. In fact, it communicates to a WAMP (Apache on Windows) server. On the first request, data is being sent, which is then passed to our Windows application. This application creates a PDF report on a network share. This report will then be fetched by the iOS app.

We had a problem though with fetching the content after the process was done creating the PDF. The file was there, but Apache didn’t see it yet, so it returned a 404. We created a workaround by requesting the URL in a for loop to see when the file was available, and then the creation process would end. In the Apache access logs we could see that after retrying for about 10 seconds, the file finally became available to Apache.

Network cache

The webserver is running on a different server as the fileserver. The file is being saved to a location on the file server. So after testing and debugging for a while, we searched how we might improve the performance of the network.

Finally we found this article by Microsoft, which documents some configuration settings that can be set in the registry. I didn’t think this would help, but we tried it anyways.

To my great surprise: it did work! Now the file was already present at the first request that was made by the Apache web server. So our performance increased 10 times.

The settings we added to the registry were:

FileInfoCacheLifetime: set to 1 sec
DirectoryCacheLifetime: set to 1 sec
FileNotFoundCacheLifetime: set to 1 sec

We added this settings on the client machine, so in our case the webserver that is reaching out to the file server. A reboot was not required. The next time we checked, the response was a lot quicker.

So this was a great improvement. We’re not sure yet what the cost of this change is, but since the servers are running on the same virtual platform, I don’t think there will be any downside to this setup. Maybe when you’re on a slow network these settings could make things worse. But for us this really helped.

Hopefully for you too.