Linus Torvalds To me, the best part of diving is the floating, and the three-dimensionality of it. I like being upside down with my face to coral, I like floating on my back watching the bubbles, I just like “up” and “down” not mattering that much. 2018-02-27 Kristaps

Interviewer: After a delightful time interviewing Jef Driesen, we continue this line with another significant member of the open source and diving community: none other than Linus Torvalds. You may know of Linus from his development of the Linux kernel and the git version control system. But he also started Subsurface, a well-known open source utility for dive logging and planning. Linus was kind enough to take time away from working around the latest CPU bugs and submit to a Q&A series over e-mail about open source and diving. Thanks, Linus, for taking the time to talk to us!

Every story has a beginning.

Interviewer: we all know who Linus is, but not many people know he’s also a proficient diver. Why don’t we start at the beginning: where you first started diving, and when you started to take diving seriously.

Actually, it was related to open source, in some way.

I was on a “geek cruise” (Neil Bauman of Insight Cruises still do them). That one was open source and Linux, and while we would have talks in the evenings (or during the days when the ship was en route somewhere), during shore excursions you’d do the usual touristy cruise things.

Interviewer: this would be in the early 2000s at one of the “Linux Lunacy Geek Cruises”.

Linus by the Linux Foundation—CC BY-NC 2.0

And one of the touristy cruise things I did was to go Discover SCUBA with my wife. My wife didn’t get the bug, but I did, and I got certified the next year.

For 5+ years, the only diving I would ever do was purely the standard tourist diving, mostly one week a year on our family vacation. So mostly Maui, but one trip to Belize for my 40th bday, and some very occasional local dives up to Puget Sound during the summer (in a 7mm farmer john, not drysuit). I got Nitrox certified. I had the Advanced Open Water (“AOW”) cert too, although technically I never took the course—I’d been diving enough with the local dive shop that the instructor there felt I’d completed the course that way.

So by 2010, I had closer to 200 dives, but I was really not a great diver. I was comfortable in the water, but I had always just been diving with tourist groups, never having had a real buddy except for the kind of “hey, you two don’t have buddies, why don’t you buddy up” kind of buddy that you still just follow the group around.

Interviewer: Many people have a few dives behind them, but not many have enough to build their own diving software. At what point did diving become a hobby instead of an occassional event?

What happened in 2010 was that the Linux Foundation (“LF”) had a conference in Brazil, and wanted me to speak In São Paulo. Now, I’m not a huge fan of long flights to big cities (and very few cities are bigger than São Paulo), and I still dread public speaking even after all thee years. In fact, I’m so not into public speaking that my work contract even says that the LF can’t really ask me to.

But the LF said “why don’t you go, and we’ll make it fun, and you don’t have to go just to a big city, you could go diving in Brazil to make it worth your while”.

So I went diving for two days to Fernando de Noronha, and it was stunning, with 200 ft (61 metres) visibility etc. And Dirk Hohndel, who was at the same conference, joined me and did mostly snorkeling, but I convinced him to at least do a Discover SCUBA dive. He’d been swimming somewhat competitively during highschool, I think, and was very comfortable in the water, but had never SCUBA dived.

And so he got the bug too.

Eduardo Muruci—CC BY-SA 3.0

He did the “certify locally in cold water”, because he’s kind of stupid that way, and then he decided (not entirely unrelated) that he was never going to do that in a wet-suit, and he wanted to get drysuit certified. I convinced him he wanted Nitrox too, and I joined him for the Dry Suit Diver certification.

And Dirk—I blame him being German—decided that if we’re diving, we’re going to do it right, and get the certs, and learn what we’re doing.

So after about 7 years of being a certified diver and never even trying to actually learn what I’m doing, I have a buddy, and we’re doing certifications. Rescue diver, solo, decompression, trimix, gas blending, and dive master. I went from having three cert cards to having a stack of them in about a couple of years.

In fact, we even did the tech diving divemaster course—but that was the point where I decided that “ok, I did the course, but I would actually not be comfortable doing this for real or even claiming that I’m competent to do it”.

So I got my AOW cert card without ever really doing the course, but then evened it out by doing the tech dive master course but not taking the cert card.

I found the tech classes interesting, and I think I’m a much better diver for it all, but I also never really found it all that enjoyable. I definitely like knowing what I’m doing, and I’m really happy I’ve done the whole deco thing and felt what it feels like to be down at 150 ft on air and in total darkness, narced out of your skull.

So now I go to warm water, and feel like it’s all nice and easy, and 150 ft in warm clear water when you can see is a nice relaxing excursion.

Diving with Linus.

Interviewer: where—and how—will we find you in the water, Linus?

I’m tech and solo certified, but it’s not the kind of diving I like. I hate gear. I don’t like hoses. To me, the best part of diving is the floating, and the three-dimensionality of it. I like being upside down with my face to coral, I like floating on my back watching the bubbles, I just like “up” and “down” not mattering that much.

Bubbles by Russ Soukoreff—CC BY-NC 2.0

So I’ve done the whole “big twin tanks on the back, deco bottle on the side”, and they may not weigh a lot under water, but they definitely take away from the freedom of just swimming any which way. Same very much goes for dry-suit, and for rebreathers.

I’m not rebreather certified, but I’ve done the rebreather discovery thing, and while I loved being down for 2+ hours and just not having to worry about gas supply all that much (and the whole “moist warm breathing air” thing was a pleasant surprise), I really didn’t like the “diving on rails” feeling I got from the fact that my rebreather really wanted to be in one particular position in the water.

So you’ll find me in warm water where I can dive with a 5mm or less (preferably much less), and I’ll be the diver in the group that you’ll look at and wonder why I’m floating upside down, and want to talk about “trim” and “proper positioning in the water” after the dive.

And I’ll be diving with two different wireless cylinder pressure sensors, because I don’t like the extra high pressure hose but I also don’t trust a single wireless enough. And I don’t have an octopus: if you’re my buddy and you run out of air, you’ll take my primary out of my mouth and I’ll breathe off my integrated inflator/second air.

I think that’s why I end up not really liking photography enough to really try to improve. A proper camera with lights ends up being another thing that really just keeps you from the whole “floating” thing. And without the proper lights, you really don’t tend to get much of a picture.

The other thing I don’t do is “swim”. The whole “floating” part is very much about the relaxation and just that—floating. I love drift dives, and I loathe fast swims over sand to get to some allegedly “interesting” site. To me, the floating tends to be more interesting than most sites.

My main dive buddy—Dirk—dives very differently from me. We tend to go to the same tech conferences, and try to dive when traveling. He is very much into photography, and when you see him dive he really dives like he’s on rails. Great buoyancy, very stable in the water, great trim.

This photo is neither of Linus or Dirk, but just for illustration. Pablo A. Arias Cid—CC BY-NC-ND 2.0

Don’t get me wrong—I can do buoyancy if I need to, but I’ll go up and down and sideways. In fact, because of the “no swimming” thing, I often go up and down more than sideways, because I do that just with breathing. Vertical swim-throughs? I’m down for that. And my ears don’t care (again, very much unlike Dirk).

I have a second dive buddy—John—whom I tend to dive with in Maui the last couple of years. We’re both local to Portland, and we independently ended up going to Maui to dive, with families that didn’t dive, and both with a daughter who did gymnastics, which is how we met and realized that we had a common dive destination.

The ascent of Subsurface.

Interviewer: let’s jump back to 2011. The libdivecomputer project had been around since 2007 or so. You start a project, Subsurface, because (according to the v1.0 README) you’re “tired of java programs that don’t work etc.”. Can you tell me the series of events that caused you (and, according to the commits, possibly Dirk) to start the project? Was it just you, or did you have a community already?

It was originally just me. I’ve never logged my dives, because I didn’t see the point. Some people do it for the numbers, others do it because they want to do things by the book (literally), and some people seem to just collect the dive shop stamps. For me, the paper logbook just didn’t make sense.

At the same time, I’m a huge believer in dive computers. The first piece of scuba equipment I bought was a Suunto Gekko, because while I’m fine renting everything else (I’m apparently very regular sized, and I’ve never had issues with mask fitting etc either), I also think it’s stupid to do dive tables when a dive computer can just do so much better.

So I had my dives logged on the computer, but the Gekko would only remember profiles for about 20 dives or so. So I did want to download, but the Suunto downloader only worked on Windows, which I don’t have, and didn’t work for the Gekko anyway. I looked into a few projects, but they really didn’t work at all.

And then we had problems with kernel.org, and for a couple of weeks there was basically nothing kernel-related for me to do until the infrastructure was cleared up, and I started writing something to save an electronic log-book. It actually started with just parsing some XML that I had from a Suunto export that Dirk had done for me—I think I had given him my Gekko because I had upgraded to a Vyper Air, and he had saved the dives I had on it using the Suunto app and exported them as xml, so I had some data that I wanted to look at.

Interviewer: kernel.org is the home for the Linux kernel source code.

There was no UI at all originally, because I don’t really do UI’s. But the XML parser started working, then I added support for the XML that libdivecomputer can generate as part of its download testing tools. And then I wrote a small GTK+ window just to wrap the Cairo graphics library so that I could show the profile. I was somewhat familiar with Cairo, because I had used it earlier to write a program to do icon previews of my wife’s PES files (embroidery machine format).

So then I had to have a scrolling dive list to pick the dive, and it all kind of went downhill from there. It’s not like I wanted to write a dive log program, but nobody else had done one that worked on Linux (despite some claims of a Java-based one), so there we were.

The early versions were “interesting”. I was playing around with UIs for a while, and used GTK+ docking windows to let me have the dive list and the profile in different windows entirely, and play with placement. There were a lot of ugly prototypes due to experimentation, but also due to the whole “I don’t do UIs” thing. The current Subsurface layout works pretty well, and I will give some credit to that odd original “let’s try separate windows that you can dock together” model, but I was looking at some early screenshots some time ago, and let’s just say that it wasn’t pretty.

Interviewer: what was your initial usage profile for Subsurface? And the initial target functionality—meaning, what did you have in mind when thinking “here’s what I want from this system”? According to the initial code, it was primarily for dive analysis, with deco planning coming out in v3.0 or so. Was this trajectory planned or ad hoc?

I had no interest in planning, I just wanted to be able to see my dives in some reasonable overview format, and get a profile and gas usage. I had been annoyed by all the crazy XML I saw, so I also wanted our save format to be saner. I stuck with XML (initially—that changed when we did the cloud saving with git), but I got rid of most of the nastiest crazy stuff, so that the XML files Subsurface would write would at least be somewhat legible.

Dive planning with Subsurface.

I also cared about getting units right, and not having crazy floating-point issues. Again, that was something I had seen many times when looking for anything that could work: truly bad unit handling, and not understanding the limitations of floating point. I’d seen XML files with exponents in them because people did bad things.

So for me, the initial goes were to just be able to download from a dive computer, and to show the end result. I didn’t really care about dive notes etc, outside of just being able to specify the location. But obviously, as things started working, it expanded, and then Dirk got involved, and he laughed at my GUI work, and took that over, and the rest is history.

Interviewer: let’s take a step back and consider the state of open source diving in 2011. libdivecomputer is there. Some Java applications that didn’t work properly. Can you tell us about the open source ecosystem of the day? Or even the closed source ecosystem?

There really wasn’t any ecosystem at all. Not anything that worked for me. libdivecomputer could generate the XML files, and as mentioned, I had some other XML files of my own, that was pretty much it. I could have used a Windows app in a VM, but honestly, I think Suunto DM5 (or whatever it was at the time) was not a great application either, and I just don’t like working in those conditions anyway.

Interviewer: probably DM3 at the time, upgraded from time to time by the Suunto folks.

So I had XML that I detested (it really is not a great file format for so many reasons), and no way to really display them. There were several xml parsing libraries, so there was some infrastructure at that level, and I could use libxml2 to do the basic parsing (we still do), but that was pretty much it.

So libdivecomputer did a good job getting the data out from the dive computer, but pretty much everything else was missing.

Interviewer: what were the main stumbling blocks in developing Subsurface? Hardware support? GTK+ pain? libdivecomputer? Deco algorithm availability?

The UI has always been a big pain. Also, since GTK+ supported cross-platform development, we tried to use it. That was painful. Dirk uses OSX on his laptops, so cross-platform became an issue.

Interviewer: according to the GitHub sources, one major change was switching from GTK+ to Qt/C++ for v4.0. What spurred this change? Were there any other significant changes along the way that helped the system in its development?

Switching from GTK+ to Qt was a big pain, but it helped a lot with the cross-platform issues, and then later made bluetooth support possible sanely.

Outside of UI, everything else was just small details. libdivecomputer “just works”, although we ended up having to add a few features that Jef doesn’t like to do things we needed, so we end up maintaining our own branch of it. Things like deco algorithms aren’t that nasty—Bühlmann is documented, and it’s just math. That’s fine. We had more problems with VPM-B, because honestly, the math there doesn’t make any sense. Just from what I’ve seen doing deco algorithms, I think you’d have to be crazy to trust VPM-B.

We have had lots of problems with getting a lot of details right—and the fact that different dive computers describe things differently. Being able to import the same dive from several different dive computers, and making sense of it all, and doing the right thing when there are multiple cylinders and the dive computers number them differently or have different models for handling cylinders (and can have pressure data for just a subset of them), and merging it all into a coherent whole—that’s been occasionally challenging.

And imperial cylinder sizing is crazy, people get confused with that all the time. Plus gas compression constants are interesting and confusing, and they actually do end up making a difference to SAC rate calculations.

SCUBA tanks by Tim Daoust—CC BY-NC 2.0

Talking about SAC rates—one of the challenges is just terminology. You’ll find some divers swearing that SAC rate should be about pressure drop, not volume, and people should use RMV. Or “tank” vs “cylinder” or whatever.

Interviewer: on the main Subsurface site, you say that this handoff to Dirk was in 2012, which would place it in around v2.0. Did you feel that Dirk’s vision for the software was/is different than yours? Was he a willing victim or did you need to be… persuasive for him to take over?

Dirk was really doing all the GUI stuff anyway, and that’s really the bulk of the project. So I didn’t need to pressure him to take over, it was very natural for him to be the maintainer, especially since he was then doing the conversion to Qt, which was a big deal.

Compared to the GUI stuff, the rest really is pretty easy. Some of it may be math, which some people find scary, but I had a strong minor in math, and Dirk actually majored in it, so neither of us thinks that is the least worrisome.

We’ve done ridiculous things like do function fitting of the gas compressibilities of the three diving gases to a fifth-order formula, just to get our compressibility be right for any arbitrary breathing gas for any relevant cylinder pressure.

I doubt anybody else does anything like that, but that’s what you get when some of the maintainers are math people.

It’s actually just a few tens of lines of code in the end, along with a ridiculous script for R (the statistical computing programming language) just to do the proper quintic curve fitting.

Math is easy. GUIs are hard.

Interviewer: tell us about Subsurface today. Do you use it in analysis or deco planning? What do you see as being a missing feature that is, say, beyond the limits of time or energy to add personally? Or perhaps something that can’t be done for other reasons? Do you feel that Subsurface has spurred any other advances in open source dive technology?

So I actually don’t even use all the features of Subsurface. Because I don’t do tech diving, I don’t do deco planning. I like seeing the deco calculations of my dives, just to compare with what the dive computer reports, but on the whole I’m not a big user. To me, the visualization is the thing I care about most.

That has improved a lot—the nice map layer wasn’t part of the original plan at all, but I religiously map out my dives because I consider that to be a vital part of the visualization.

I care about the tank pressure curves and our SAC rate calculations, because I not only like seeing which dives I do better at, I try to see where in the dive I use more gas (we color our pressure graph with “relative SAC rate”, so that you can see whether you’re breathing more or less).

But it’s not missing features for me. Other people may want to do things like equipment tracking etc, but it’s not something I care about.

Interviewer: let’s take an alternative view of Subsurface today. What do you consider a failure of the tool to address? Why? Hardware friction? GUI toolkits? Contributors? User interest?

I think Subsurface is doing fairly well. The biggest problem spot is probably hardware and particularly Bluetooth. It’s a fairly recent thing for us to support, but it’s getting pretty common in new dive computers, and particularly on Windows we don’t support it at all right now. That’s mostly because Qt on windows doesn’t support it, and most of our developers aren’t on Windows.

Most of the dive computer manufacturers seem to consider Bluetooth a “phone” thing, and often don’t support it on the desktop at all.

Talking about dive computer manufacturers—some of them have been very supportive, and it’s been great getting docs etc. from them. Others, not so much. This is seldom a problem for Subsurface directly, but it obviously limits libdivecomputer, and then that causes problems for us.

Interviewer: has your diving changed along with the development for Subsurface; or, since developing the system, have you come to appreciate diving differently than beforehand?

I think I end up trying to be slower on my ascents due to Subsurface—just seeing a bad profile after the fact makes you more aware of “that was too fast”, and then you start thinking about it more. So visualization matters.

I also notice that I have a lower SAC rate in really warm waters. You’d think Hawaii is “warm water”, but looking at my last two dive trips (Bonaire and Maui) I see a SAC rate difference, and I think it’s because Maui was high 70’s (25–26°C) while Bonaire was approaching mid-80’s (28°C), and those differences seem to matter. At least the way I dive, trying to not do any actual work at all!

So again, just seeing the data makes you aware of things like that, that you might not otherwise think about at all.

Back to diving…

Interviewer: yes, “every dive is a good dive”. But we all have preferences: wrecks, or coral, or lakes, mine shafts, cold-water, warm-water, etc. What would you say is a great dive? Do you have a great dive story or two?

I don’t tend to care much for most critters, but I love octopuses, so any dive where I get to play with one is a great dive. The local octopus here are nice and big, but the water is cold. So a nice friendly octo in warm water is ideal.

Key West Octopus by Joe Parks—CC BY-NC 2.0

One of my favorite dives was two hours at 10–15 ft (~4 m), because there was an octopus that lived under the dive pier in Bonaire, and it was out hunting during the day. So warm water, and an octopus that didn’t mind divers at all, and it would crawl around on the bottom, digging for food and capturing it with its skirt, and it had a “dive buddy” in the form of some random fish that would follow the octopus along, and dart in and eat anything that escaped the octopus.

But there are lots of great dives. I’ve been to Palau several times—it’s a convenient short hop away if you have a conference in Tokyo or Seoul—and that’s probably the best diving I’ve done. Blue corner is famous, of course. And German Channel is great if there are sharks - the first time I dove there we spent the whole dive just in one spot, because we constantly just had sharks swimming around and being friendly. And I love the drift through Ulong Channel when the current is just pushing you, and you fly like superman over the coral formations.

Interviewer: on some architectures, Ulong Channel is just as wide as Uint Channel. I’ll see myself out…

Ulong Channel by Annette Bouvain—CC BY-NC-ND 2.0

We also did—by mistake—the Peleliu Express. We were actually supposed to do a calm drift a couple of sites north of it, but the current was rather much stronger than expected, and instead of doing that one site, we did three sites that dive—ending up with Peleliu Express. That was exciting. Especially since we hadn’t been briefed about just how exciting that drift gets in strong current. At one time the downdraft was so strong that bubbles were going down, and you had to inflate your BC and kick up just to not get sucked down. Not an example of a well-planned dive, but it’s actually one of my favorite memories from Palau.

Interviewer: what about just a good, run-of-the-mill dive? Where can we expect to find you? I’ve found that life-long divers take pleasure in the small stuff—say, a well-known octopus living in one’s “home base” dive or a particular outcropping of coral. Can you describe such a setting? How are you arranged in this space?

Much of my diving has been in and around Maui, because it’s our yearly family vacation spot. The rest of the family doesn’t really dive—my middle daughter is certified but that’s fairly recent, so most of the time I’d just go out with a group.

And because of the whole “no swimming over sand” thing, it’s almost invariably a boat dive. And I like boats, as long as they aren’t the small six-pack “just enough space for divers to sit down” kind, so that’s all part of the enjoyment—not just the floating on the dive itself, but just being out on the water.

But because my diving is always a trip away, there’s no critters I know, just formation. The true “run-of-the-mill” dive for me is probably Mala Pier in Lahaina, I’ve been there lots of times. It would be an easy shore dive, but I think I’ve done it as such only once—because I mostly didn’t have a dive buddy (John is just the last few years, and our family vacations don’t always match up), I go with the local dive companies that do groups. Admittedly I could just solo that site, but then I’d have to rent a cylinder and lug it around etc, so boat diving it is!

Mala Pier by Chad Goddard—CC BY-ND 2.0

Mala pier has nice formations (it’s a fallen-over pier with swim-throughs etc), often has octopus, almost always has a white-tip reef shark or two, and if you can find them there are several frog-fish on the site too. Sometimes I try to find them on my own, most of the time I fail and end up having the local dive guides point them out. They aren’t always in the same spot, but they obviously don’t move around all that much, so the local guides usually know where they have been recently.

Depending on season, there can be tons of turtles or just one or two.

Interviewer: now the obligatory bad dive.

I’ve had a bad night dive, where everybody lost the dive master early on, there was current and waves and wind, and just getting back to the boat was a major pain. We had people in our group thinking they’d not be able to make it. That was just bad. I’m not a huge fan of night-dives in general, although I have had a couple of great ones too.

On the whole “disappointing trip” side, we were in Costa del Sol in Spain, and it just wasn’t good. That was off-season, it’s probably better in summer, but I think the monkeys were more interesting than the diving in Gibraltar. I’ve had good diving in the Mediterranean too (the Zenobia was worth doing tech diving for), but that wasn’t it.

Interviewer: seemingly never far from divers: photography. Are you always packing a rig, or do you prefer diving unencumbered?

Unencumbered. I pack a rig by bringing a dive buddy who takes photos.

I’ve tried photography. Several times. I’ve even had some success—last time in Bonaire, I had two dive buddies that were macro photographers, so they’d spend easily ten minutes on just some random blenny. I like the floating around part, so most of the time I don’t really mind, but that trip we did a few dives that were long dives just for photography, and I joined in.

But on the whole, I don’t really like the equipment, and I’m just not interested enough in the sea-life to care, I think. I’ve got a great video of an octopus building a wall to keep us divers away on a night-dive, but honestly, I think I prefer to just admire the octopus while diving over making sure I have the lights positioned and the white balance right.

How too much equipment can feel… NASA Johnson—CC BY-NC 2.0

The future of diving and open source.

Interviewer: which areas of the open source and diving ecosystem do you personally think need the most attention from the community? For example, particular types of hardware donations to Jef and Dirk?

Hardware donations are nice, and we’ve had some of that, but often documentation would be even better, and that’s usually harder to get.

And honestly, just programmers who are into diving and are interested in cross-platform UI work would be great. It turns out there aren’t that many people who do that. I think Subsurface is actually unusual in really trying to support not only the three desktop environments, but mobile as well, both Android and iOS.

Interviewer: let’s throw around everybody’s favourite buzzword: the “cloud”. Do you use any of the “cloud” dive sites where readers might stalk^Wsee your dives? I know Subsurface interfaces with a few.

Subsurface has cloud infrastructure, but it’s all designed to be private—you can see your own dives, but not other peoples dives. It’s used to synchronize between your own devices running Subsurface, not to show off your dives to others. So I can sync my laptop with my cell phone and my desktop, but I can’t give you a web site to go look at my dives.

They’re not that interesting. I’ve got just under 800 dives, although the first ~100 dives I don’t have logged. They’re fairly well spread out, but I only have GPS locations from the last couple of years. Hawaii, Belize, Bonaire, Palau, Florida, Mexico, Fiji.

Thanks to conference flying, I’ve got a few less common areas—like Christmas Island (the Australian one), Lord Howe Island, Okinawa, and the already mentioned Fernando de Noronha.

But I’ve never done Indonesia or Thailand or the Red Sea, so there’s a lot of “normal” diving spots I’ve not done.

Interviewer: hardware! You’ve mentioned using some Suunto dive computers. Is there any particular manufacturer whom you think deserves accolades for their support of the open source community? Jef specifically mentioned HW.

Heinrichs Weikamp has been exceptional. They’ve made not only hardware available, but documentation too.

Suunto I started diving because I’m from Finland (even though I started diving after moving away), but they’ve also been pretty good in making hardware available. We support the EON Steel because of that, for example. They didn’t give docs, though, so that has all been reverse engineered.

Shearwater has been very good too and made documentation available, and the Perdix AI is probably my favorite computer right now (I really like the EON Steel too, but the Perdix has a better form factor).

I might be forgetting somebody, and Jef may have other experiences, but those three stand out.

Linus by the Linux Foundation—CC BY-NC 2.0

Interviewer: another big thanks to Linus for taking the time to talk to us. If you haven’t tried Subsurface, download it and give it a spin!