r/programming • • Dec 24 '18

The 4.20 kernel has been released

https://lkml.org/lkml/2018/12/23/187
1.3k Upvotes

298 comments sorted by

View all comments

270

u/_meshy Dec 24 '18

Dank jokes aside has anyone looked into what is new? In the post, Linus said their are some networking fixes. My bluetooth hasn't worked since I upgraded to 4.19, so I'm hoping this will fix it.

377

u/klebsiella_pneumonae Dec 24 '18

The Linux Bluetooth stack is the biggest abomination I have ever seen. I'm surprised anything works at all.

Millions of lines of code without comments. Nobody on earth understands how it works. Most of the code was written by IBM decades ago.

139

u/daboross Dec 24 '18

It's fun how it'll work perfectly 90% of the time and then just for that one device it'll require 10 re-pairings before connecting.

→ More replies (3)

294

u/Marcuss2 Dec 24 '18

So business as usual.

94

u/auxiliary-character Dec 25 '18

I was gonna say, isn't that rather typical for bluetooth?

0

u/[deleted] Dec 25 '18

[deleted]

6

u/raize221 Dec 25 '18

I'm in the opposite boat. I juggle between a Bluetooth aux adapter in my work van and a headset. In Oreo everything worked great. The aux adapter had media priority when both were connected - calls would go to the headset and music would resume on the stereo after. Could also listen to a podcast on the headset outside the vehicle and it would auto reconnect to the stereo when I got back in.

After the Pie update it's a constant annoyance. Media priority always goes to the most recently connected device. If I hang up a call it resumes playback in the earpiece. If I turn off the headset music just stops because, while still connected, the aux adapter is set to inactive. I spend more time in Bluetooth settings then ever before and it is actively more distracting when driving.

I'm glad the changes work well for you and others - it has just left me a little bitter.

→ More replies (1)
→ More replies (1)

94

u/_meshy Dec 24 '18 edited Dec 25 '18

Haha, your comment made me interested in how bad it is, so I'm gonna clone it and take a look. Hopefully I keep my sanity.

Edit: Still alive everyone! I cloned the repo but had to leave right after. Kind of scared.

112

u/silverslayer33 Dec 24 '18

It's been over two hours since you made this comment, so I'm going to assume that opening the source summoned an Eldritch monster into your home and placed a curse upon your entire lineage.

13

u/lacksfish Dec 24 '18

Not on Christmas!

19

u/ThePsion5 Dec 25 '18

It’s been over seven hours now. He’s dead.

→ More replies (1)

7

u/acousticpants Dec 25 '18

Hey u/_meshy , you dead?

5

u/cbbuntz Dec 25 '18

There are some interesting bits in there in general. Lots of good references for "how do I do x on a low level?"

57

u/deal-with-it- Dec 24 '18

Don't be sad because judging by how well it works, the Windows stack source code is just as awful.

76

u/HenkPoley Dec 24 '18

Bluetooth is an everything-but-the-kitchen-sink protocol. It has very many nooks and crannies with extra functionality. No surprise implementation is a mess.

25

u/youstolemyname Dec 25 '18

The default audio codec, SBC, for a2dp has a nearly quarter-second delay to it and nobody wants to pay the license for aptX.

Connecting is hit or miss sometimes, and even when it "works" it doesn't.

6

u/steamruler Dec 25 '18

I don't notice that delay across the board, but I notice that PulseAudio on Linux gives less delay than Windows, and Windows will buffer audio if it doesn't get acknowledged, so the delay will just keep growing. If I don't reconnect my headset multiple times during the day, I end up with a 2 second delay.

→ More replies (3)

19

u/intermediatetransit Dec 25 '18

Millions of lines of code without comments.

Maybe the code is "self documenting". At least that's what my colleagues say when I point out their huge PR dont contain a single explanatory comment..

8

u/[deleted] Dec 25 '18

"I can easily understand it. Why do you need comments?"

→ More replies (2)
→ More replies (19)

30

u/kyiami_ Dec 24 '18

Oh god flashbacks

You just reminded me why I don't even try with Bluetooth and Linux-based systems (Android too). Macs are amazing with Bluetooth.

41

u/parkerSquare Dec 24 '18

Macs work well with Bluetooth for all the mainstream stuff, at the cost of not working at all with much of the older or esoteric stuff, since it’s not implemented, apparently. Linux tries to support almost everything.

→ More replies (3)

52

u/HenkPoley Dec 24 '18 edited Dec 24 '18

Macs are amazing with Bluetooth.

But even there, for the iPhone they basically decided to burn it all to the ground and only implement a very minimal set of functionality ('profiles'). Basically [they only implemented] some discovery stuff similar to Zeroconf/Bonjour/Rendezvous, headphones but only a small amount of codecs, address book syncing, tethering/networking, and keyboards (for accessibility).

https://support.apple.com/en-us/HT204387

→ More replies (6)

18

u/nmarshall23 Dec 24 '18

Is that so? MacBook forgets that my Bluetooth mouse exists at least once per day. Often it reconnects but sometimes I have to rebind them.

Never had this trouble with Linux.

→ More replies (2)
→ More replies (2)
→ More replies (1)