Hacker News new | ask | show | jobs
by lasryaric 3482 days ago
Why is general bluetooth connectivity so "buggy"? Why am I always struggling connecting my iPhone 6s to my bose bluetooth speaker? I would love to understand that.
14 comments

Bluetooth is complex. Lots of devices have crappy software which gets things wrong. And it doesn't help that the 2.4GHz band is full of radio noise, either. But most of the problems aren't with transmission, they are with setting things up and turning things on and off. Crappy software.

Also, it doesn't help that everything in Bluetooth until BLE (Low Energy) arrived was pretty bad. BLE changed everything and turned Bluetooth around, but BLE doesn't do audio.

There is lots of confusion in the naming, Bluetooth 4.0 incorporated BLE, and later they decided to just call the whole thing Bluetooth, even though it's now a set of two entirely different protocols, not even radio-compatible.

"not even radio-compatible"

Bluetooth 1.0 uses GFSK at 1 Msym/s, just like BLE / Bluetooth 4.0. So it's the same r/f modulation protocol (it's the higher layers that are incompatible.) Is it the actual GFSK parameters, eg. frequency shifts, that are different?

I know that Bluetooth 2.0 and 3.0 use different r/f modulation (π/4-QPSK and 8DPSK at 1 Msym/s), but why do people say Bluetooth 4.0 is so different when it seems to be the same as Bluetooth 1.0?

One difference is that BLE uses 40 channels in its adaptive frequency hopping scheme, from Wikipedia: "Instead of the Classic Bluetooth 79 1-MHz channels, Bluetooth Smart has 40 2-MHz channels"

Now that I write it out, I see that frequency hopping would count as a "higher layer," but I think it's still managed in hardware, which could be why there are many BLE-only chips. It's possible the GFSK parameters are also different, and of course the layers above the link manager are vastly different (for some reason).

https://en.wikipedia.org/wiki/Bluetooth_low_energy#Technical...

A major difference is that while original Bluetooth used time-based channel hopping BLE uses sequence-based channel hopping. This means you don't have to keep your local clock or receiver running to know what channel to listen to, rather you listen on a given channel just before you want to speak/receive something and once something shows up there you know where you are in the sequence. BLE-only chips can basically be entirely powered off most of the time without losing connection, whereas bluetooth needs a running clock or a large receive window to stay connected.
In my experience, connecting a device with bluetooth has less than 50% chance of continued success. When it doesn't work it really doesn't work, and there's only so much you can do with most device interfaces. I avoid it whenever possible. Hopefully this new release will change that for future devices.
Yep, I wanted to love Bluetooth for keyboards, but my Logitech and Microsoft wireless keyboards (work and home, respectively) work great with their proprietary receivers (basically like a wireless wire), while the Logitech K810 has random key lag and connectivity issues (try typing your password when Bluetooth doesn't work and you can't log in to re-pair it).

Windows 10 also seems monumentally bad at Bluetooth, and I've tried with a few different Bluetooth dongles with different chipsets. I've had the best luck with the one from Pluggable, which IIRC uses a Cambridge Silicon radio / driver stack. I really wish we had wireless serial instead of wireless USB, as most of the time, that's basically what I want, and stuff like the ESP, nRF24*, or even RFM69 does this quite well. I honestly wish they'd do a 433/900mhz standard for wireless HID only, and another for audio only.

OTOH, I have a Logitech Megaboom which always works amazingly well. Whoever did the Bluetooth radio on that...A+ .

> try typing your password when Bluetooth doesn't work and you can't log in to re-pair it

Haha. That reminds me of the classic, "Simply goto to http://example.com/drivers to download the network drivers for your new desktop".

I once bought a brand new Acer Aspire series desktop. Shame it didnt ship with network drivers preinstalled...
> basically like a wireless wire

Yeah, watch out with those, because a wireless wire is about accurate security wise too. Typically the proprietary dongles have very little security wise.

It can be even worse than I suspected. Turns out, even your mouse dongle can be used to inject keystrokes: https://media.defcon.org/DEF%20CON%2024/DEF%20CON%2024%20pre...
I recall when the first Logitech wireless keyboards came out.

Me and a friend were at a regional lan party, and he had one of those keyboard. As we soon learned someone else in the locale also had one, because he would ever so often get random inputs on screen...

The Logitech 810 is a fantastic keyboard however I pretend to ignore the connectivity shortcomings that you describe...

What I would like with the Logitech keyboards and mice is an option to plug in with micro USB or to go Bluetooth, i.e. wired but detachable if your Bluetooth happens to be reliable that day.

There already is a micro USB socket for power on the 810 keyboard, sadly they don't do a mouse that charges on microUSB and can also work on micro USB. Regardless, there is not a lot that really needs to be added on the hardware side to implement such a feature.

If such goodies existed then I would not need that normal keyboard/mouse that I have in my draw for the unpaired situation you describe. I could also do things such as BIOS UEFI settings without having to reach for the emergency input devices.

Despite deficiencies, I find the 810 to be the best keyboard going, I carry mine around instead of a laptop, it works great with work PC, my phone and my home PC.

What use cases do you find Bluetooth keyboard / mice enable? Maybe I'm old fashioned, but I've never been able to come up with a compelling answer for myself.
Another gripe I have with bluetooth on PCs (I also have the K810) is that most bluetooth receivers don't come with what's called the "HID Proxy" mode.

If most bluetooth adapters had that, I could use it to navigate the BIOS, etc.

Similar experiences with Windows, but my Bluetooth devices usually work without any issues on Macs though.
Most chip manufacturers keep their firmware very close to the chest and from my anecdotal experience, a lot of that firmware is of a low quality; mush a smattering of shoddy chips together and you end up with really weird behavior.

FCC certs of a custom radio used with a bluetooth chip with a binary blob for firmware is the most painful thing I've ever done in my career...I think.

I think we'd need an RF engineer to answer this more thoroughly, but it's my understanding that there are a lot of materials capable of absorbing the low-energy microwaves that it uses as its transmission medium.

Water is a big one, which I think is one reason that having my phone in my back pocket almost always results in a dropped connection to my headphones over the course of working outside for a few hours, compared to my side or front jacket pocket. Too much water in our tissues.

Hi! RF Engineer here. Bluetooth sucks for a number of reasons, only a few of which actually relate to RF.

First, we're bad at naming things. Is it BLE? Bluetooth Smart? BTLE? Bluetooth 4.0, or Bluetooth 4 Low Energy? And what does this have to do with ANT+? This doesn't seem to be a big problem, but it's a sign of deeper problems with the spec. In the long run it makes it very difficult for developers to implement.

Bluetooth 2.0 is radically different from BTLE. In 2.0, you had one device which acts like a microphone, and another device which acts like a speaker. This was like getting two people to dance together, it takes a lot of practice to get the joined movements right. If one person stumbles, it all goes down like dominoes.

BTLE on the other hand, acts like a (more familiar) client server model. You come up to the bank teller, and have a limited set of operations you can preform (withdraw/deposit money, open/close account). Here's the catch though... the teller is only open for 10 seconds during a 24 hour day, and moves throughout the city. You have to arrive at just the right time, or you have to wait until tomorrow. (This was done for battery saving.) The throughput is also MUCH slower than 2.0, which makes applications like audio out of the question for now.

There's also a lot of bureaucratic hype surrounding it. If you look at the release from the BT SIG, it seems very much similar to Java's claim that it runs on a bajillion devices. All in all, BTLE seems to be a solution in search of an IoT related problem, much like Java.

So in short, the reason I think it sucks is because it's a very complicated protocol with poor and confusing naming conventions. It sure doesn't help that it keeps getting re-invented! (Although BT5 seems to just be add-ons, finally!) Implementers (both on the HW side and the mobile/desktop side) have a difficult time figuring out how to do things correctly, much less why they need to be done. Things are getting better, but until the next "killer BTLE" application comes out, it's just heart rate monitors and useless iBeacons.

Another RF engineer here. What the bipolar junction transistor parent has written is exactly correct.

Here is another discussion of Bluetooth vs. Ant as written by someone in my industry (fitness): http://keithhack.blogspot.fr/2016/11/why-hasnt-ant-been-crus...

Ironically... I'm awful at analog design. I don't deserve this handle :(
You worked on BT specs ? BT seems an acute case of design by comittee. It's huge, full of profiles and corners. Nobody implements it really well, everything moves before it's finished. Makes you dream of wires some times.
I was involved in the 1.0 Bluetooth specifications and can confirm it was "designed by committee". IIRC the original wireless specification came from either Nokia or Ericsson and they drove a lot of the initial development. They had already developed the RF technology before the Bluetooth SIG was even formed. The original stated goal for Bluetooth was "cable replacement". Features such as pairing a headset to a phone, or a phone to a laptop were an essential part of the original profiles.

A reason for the complexity was that the BT 1.0 profiles often leveraged existing technology, for example:

- RFCOMM was a way of sending arbitrary serial data, reusing RS232 comms which were very common.

- OBEX was a way of sending data which was previously sent over IrDA

- The "LAN access profile" basically said "use RFCOMM to do PPP over a serial link like you do with a modem"

If you tried to implement any of these from scratch then not only do you have to implement the BT part, you also have to implement the technologies that BT reused.

If you look at the initial SIG members, Nokia and Ericsson took care of the initial phone developments. Intel, IBM, Microsoft and Toshiba represented the PC side of things. I was working for 3Com at the time and we were interested in it as a short range network technology. 3Com developed a network device conforming to the "LAN access profile" but it was never released. 3Com also owned Palm and they were interested in incorporating BT with the hand held devices.

It is interesting to compare BT to Wireless Ethernet (IEEE 802.11) world. The IEEE Ethernet (802.3) specifications are pretty much only concerned with getting data packets from A to B at layers 0 through 2. At layer 3 and above they don't care if those packets are IPv4, IPv6 or some other protocol like IPX.

Bluetooth tried to define everything from the the RF communications all the way up to the application layer. The specification mentions how to the PIN code request should be presented to the user when authorizing a new connection. It also mentions which audio codecs should be supported for streaming audio. The BT profiles also tried to define how to transfer files, business cards or print documents.

These detailed application layer specifications simply don't exist in something like Ethernet. There might be an argument that BT tried to over specify things but it was attempting to give a level of interoperability which we still struggle to achieve over other networks.

Yeah, that's how it felt, they provided an out of the box full stack. Maybe this AND the field it lived in, cellphones as opposed to computers, made it too hard to do right. Cellphones changed a lot since the BT 1.0 days, instead of implementing gradual layers, you have to deliver a monolith..
Ericsson. They named it after a viking king, and thus the official logo to this day is a "runic" B.
As a user i kinda like the profiles, in particular the OBEX based ones. This because it means i can expect two devices to be able to share files out of the box if both of them have a bluetooth radio. Nothing like that exist for wifi, and i have to set up some client-server scheme to make anything happen.
The OBEX profiles predate even BT, they were inherited from IrDA. IrDA was an earlier method for transferring business cards or similar small files between hand held devices over an infra-red link link.
On that note, i think one of the big Japanese companies were working on a new high speed irda version.
Not that I disagree with you, but I would love to see examples where it would be the opposite and you would say it was a beautiful and well implemented.

Tends to be hard to implement a specification without any implementation to test it out together with it, but those who do work out, should be looked into why so we all can learn from it.

FYI, Orion Labs claims that they do audio over Bluetooth LE for their Onyx microphone device.
You can do anything over BLE, it's just that it isn't supported natively.
Very informative, thanks! I had no idea the naming conventions were that wonky.
I think Bluetooth is the worst spec ever. What we need is something that happened to ARMv8, you get a clean room implantation with everything you learned before, and you provide a compatibility layer much like the 32bit ARMv7.

It is a gigantic pile of mess and it never worked well enough for the majority of users.

Talking about design by committees, even the Wifi 802.11 has much improved.

I really wish Apple could design new one and force market adoption with the spec opened.

As long as you're within the communication range and in whatever your protocol calls a "reasonable" environment (e.g. not underwater), you're OK. The strength of the signals isn't chosen at random, it's chosen so that it allows devices to function well (within the design constraints -- range, environment conditions etc.) -- and so that it meets the power consumption constraints imposed by size, design, cost and technology.

tl;dr when someone decided to use a 4 dBm transceiver, they (should have) made a conscious choice about it and would have verified that it's enough.

Quite plainly, if the connection drops when it shouldn't, it's either bad software or bad design.

Bad software is either the Bluetooth stack (especially in legacy Bluetooth devices; newer stacks tend to fare better) or the firmware that talks to the Bluetooth stack (if it's BLE, this is the safer bet).

Bad design on the hardware level is less excusable than it would seem, because a Bluetooth device is not exactly a long-haul wireless link that has to work during the mother of all thunderstorms. There's a wealth of information and modeling tools that help you with this stuff, too. Bad antenna design, bad filtering, bad casing are all common culprits, but I've seen a lot of electronic engineers who wouldn't call themselves RF engineers get it right by just following common sense and doing the math.

Sometimes (but even less often), it's not a design problem, it's a manufacturing problem (e.g. PCB antennas that get damaged or don't get etched right. But this is pretty rare.

Certainly, the operating environment plays a role, but that's why you consider it while you're designing the whole gizmo. You don't (or shouldn't) get to shrug and say hey, it's not my fault we're basically walking cucumbers.

So if a pair of super high-end Bose speakers and a super trendy iPhone keep dropping connection while they're within range, not inside and, respectively, outside a Farady cage or whatever, the reason isn't the black magic that RF design is, it's Bose's and Apple's profit margin.

Edit: I do concur with the other fellow who posted here, Bluetooth really is complex and the band it operates in isn't exactly a charm to work with, but frankly, neither of these reasons account for the huge range of devices that are simply badly designed and/or run bad software. There are a lot of Bluetooth devices that work just fine, a lot of other protocols that operate in the 2.4 GHz band and work just fine, a lot of other protocols that operate in similarly noisy bands and work just fine and a lot of protocols that are more complex and work just fine.

The only thing I've seen work reliably with Bluetooth, ever, is the PlayStation 4 controller. And only when pairing with the PS4 and not a PC. Sony seems to have gone out of their way to add some magical layer to establish and maintain those connections without the end user having to know or see anything about it.
The Apple keyboard and trackpad are rock-solid with Macs, probably for the same reason: the same vendor controls both ends.
I use the Apple BT keyboard & mouse with a work MacBook Pro, and it was fine. When I added a pair of BT headphones into the mix, it quickly became a mess (audio would drop out when I started typing or moving the mouse). I wonder how much of that is on the headphone manufacturer vs. saturation of BT.
I remember seeing something similar when one or more devices used the serial profile, or related ones (PPP for instance).

When those where in use, it would basically block all other traffic for the duration.

I noticed this back in the day when i really pushed my bluetooth usage.

My setup was a SonyEricsson featurephone, a Nokia N800, some Jabra headphones, and a white box folding keyboard.

As long as i used the "LAN" connection between the N800 and the phone to get online, it all worked fine. But switch it to PPP and the music would stutter whenever there was network activity.

Both endpoints have to have perfect implementation, or: your connection is only as good as the worst of the two devices.
In my experience, Bluetooth audio devices have been the most stable.

SPP (serial port) on the other hand has never worked reliably for me. I mean, I have seen it work. I just never take it as granted that it will work, and thus far have not been disappointed.

Bluetooth drivers in both ios and android never work right. You might get random undocumented error codes on some devices. Some of your connection/transmit functions will just get lost never activating a callback so every single thing needs a timeout handler. I've seen on older androids a callback inexplicably starts getting called twice in a row. I've seen the bluetooth object suddenly is null so you get a hard crash next time something tries to use it. These smartphone drivers fail in every way imaginable and in ways you can't imagine. Be impressed when a bluetooth app works reliably.
Frankly on Android it went to hell when Google decided to drop bluez and go with a stack co-developed with Qualcomm from 4.4 onwards.
It depends, but i can't help suspect that sharing the increasingly saturated 2.4Ghz band (microwave ovens, wifi, who knows what else), and being built around channel hopping (apparently this lead to some issues with US regulators) makes for a fault prone system.

This because while i have had problem on urban streets with a device in my hand and one in my ear, i have observed rurally living relatives that can walk around their whole house with the phone sitting in some corner and not suffering a connection outage.

I have never found it to be an issue and I dont use high end stuff. For example I have a xiaomi redmi note which connetcs to my xiaomi bluetooth speaker or my car system (Nissan) with ease,i dont even think about it. If bluetooth is turned on on my phone it will connect to these without fault and i never get drop outs, same with a bluetooth headset that I sometimes use. I paired with all of them once and now i just turn on bluetooth on my phone and it connects to whatever device i am near.
This comment (in the tree above but relinking here) helped me understand: https://news.ycombinator.com/item?id=13126964

Bluetooth frequencies are absorbed by water (and your body is water)

I have problems with Macbook + JBL xtreme. It's not working. But any other combinations working fine: macbook + any other bluetooth speaker (i have 4 different speakers + headphones) and several mobile phones + JSB xtreme. Just magic.
Complex consumer standard implementations tend to be "buggy", that's how economy works. More robust implementation after "it mostly works" level would give diminishing returns for average consumer product company.
Having to constantly repair my car with my phone and GPS is one of the frustrations of daily life. It's ridiculous - both the car and phone "remember" each other by their list of previously paired devices, yet they don't connect. Only when I repair do they suddenly "find" each other. Crazy.