LWN.net Weekly Edition for January 22, 2015
The democratization of radio
David Rowe started off his linux.conf.au 2015 talk by saying that he is excited about what is happening to radio. The era of proprietary control is fading away, and, at this point, the free-software community owns the whole stack — or something close to it. If we can overcome a few remaining obstacles, we will have succeeded in taking control of a crucial communications technology.There are several components in a typical radio-based system, starting with the antenna where signals are transmitted and received. From the antenna, a received signal goes through a filter module to cut it down to the frequency range, and an amplifier to make that signal accessible. There is an oscillator/mixer step to convert a signal to a more useful frequency range. After that, it goes into a modem to convert analog signals to digital, some sort of forward error-correction module, a codec, then finally to protocol-handling code and the final application. For transmission, of course, that sequence of steps is reversed.
Once upon a time, every one of those steps was implemented by a separate hardware module. Over time, software has been able to take over more of them. David's question is: how much closer to the antenna can we push open software? In the Open Radio miniconf held earlier in the week, developers still had to build a hardware-based module for the filter and oscillator steps to use with their software-based systems. David would like to reach a point where the only hardware in the system is the antenna itself.
Case studies
Why do software-based radio systems make sense? David had a few case
studies of projects he had worked on showing where the advantages lie; the
first of them being the Mesh Potato project, which
has produced a voice-over-IP (VOIP) router based on a mesh network. This
project, which started in 2008, was meant to enable the creation of
telephony networks in remote villages; they were trying to help people, not
to get rich. In the process, they ran into trouble with the AR2317 chipset
used in the router; it was a closed device with proprietary drivers and it
was impossible to get information about it. In the absence of support from
the vendor, they ran into no end of "pain, frustration, and delay" in the
project. In contrast, the more complex parts of the system (the kernel,
the Asterisk telephony system, and Speex) "just worked."
To summarize, the parts of the project that worked well were those based on open-source software. The closed radio hardware, instead, was an impediment. David also noted that "WiFi sucks for VOIP" — a point he came back to later on.
The next case study had to do with echo cancellation — keeping a voice signal from echoing back to the speaking party. It was, he said, a big problem for Asterisk. Telephony developers who knew this area said that the only solution was to put a digital signal processor (DSP) into the system; it had to be a hardware-based solution, and, by the way, there were a lot of patents to deal with in that area.
But, David said, open-source software gave them an edge. The ability to get widespread, crowdsourced testing for echo-cancellation software allowed the quick discovery and fixing of strange corner cases. It also eliminated the need for formal speech testing. The self-instrumentation built into the code allowed users to dump out its state when things went wrong. In short, David said, the echo-cancellation project was successful and open-source software delivered a superior solution. It worked quickly, and with relatively little effort.
Finally, David mentioned the FreeDV project, which is concerned with digital voice service over high-frequency (HF) radio. HF, he said, is the last bastion of analog radio technology; this frequency range is lossy in ways that degrade modem signals in particular. It is a difficult technical problem to solve. Until recently, the only way to approach it was with proprietary, hardware-based modems and codecs; there was no way to develop components that cross between the layers of the system.
Except that, with software, you can mix the layers. So David designed an HF modem to suit the codec that would be used, and the codec was designed specifically for the HF channel. He was able to mix in some analog techniques like boosting the power for the more important parts of a speech signal. That's something that can't be done with proprietary solutions, and it led to a better solution overall.
From hardware to software
In general, realtime speech compression has gone through an evolution over the years. In the 1940s, it was handled with vacuum-tube-based hardware. By the 1970s, the industry had moved to custom hardware at the chip level. The 1980s saw the first programmable DSP chips; by the 1990s it was possible to do realtime compression on an x86 processor. In the 2010s, it can be done with a fraction of a $2 microcontroller. This same evolution has applied to the other components of a digital radio system.
That evolution points to the way forward: over time, hardware-based functionality always moves to software. And that's a good thing: software can be free, and, thus, radio communications can be free. Indeed, he said, they must be free.
There are a lot of interesting new chipsets out there, providing radio-frequency modems, up/down converters, and so on. But David doesn't normally get all that excited about chips, since hardware vendors control them. So they will always have bugs that can't be fixed and end-of-life issues. They cannot be modified, and, often, one must sign non-disclosure agreements to work with them at all. There can also be security issues with proprietary, hardware-based solutions.
The better approach is to use a general-purpose CPU and to design the system to minimize the amount of hardware needed. We should not rely on black boxes and binary blobs, he said. If we work with open software we'll benefit from better development, better security, and better performance.
Spectrum and standards
As radio moves into software, there are going to be some interesting issues around spectrum use. Radio spectrum is a scarce resource; it is heavily regulated by governments and mostly reserved. A recent study showed that, of all the allocated spectrum, only about 15% of it is actually used. That creates a temptation for unlicensed uses, something that will get harder to police as the costs of using that spectrum go down. The HF range is already difficult to use in many areas due to the amount of urban noise. On the other hand, many interesting things have happened in the unregulated parts of the spectrum, with WiFi being the classic example.
Another would be the AirJaldi project, which provides free Internet service for over 30,000 people. It is, he said, a poster child demonstrating what can be done when spectrum is free.
Then there is the issue of pirating — the illegal use of spectrum which, most of the time, is unused anyway. The cost of using spectrum will approach zero over time; the legal model around spectrum, David said, is fracturing. The situation is much like that with illegal movie downloading. There are some ethical questions to be addressed; is "pirating" spectrum really wrong if that use is not bothering anybody? And can it be stopped even if we as a society want to stop it?
Consider the AirChat project, which enables the creation of inexpensive communication devices using unlicensed spectrum. There's voice communications, a computer-based modem, texting, chatting, email, and more. Can a project like this be stopped? And, again, do we want to stop it?
Then there is the issue of standards, which often get in the way. As mentioned before, VOIP over WiFi is highly inefficient. By using the right protocols, a thousand-times improvement in efficiency can be obtained. With software-defined radio, it is possible to send a non-802.11 signal in the WiFi bands, so why not do it? Standards, he said, should not be confused with the laws of physics. They are often not the best solution to the problem and, in many cases, they may just exist to support somebody's patent pool. The limitations on what we can do with radio come from physics, he said, not from big business.
The open-source-software culture is poised to make big changes in the radio world. We like to work in small teams, and we are not content with being told what we may or may not do. We have motives like helping people or simply having fun. A lot of interesting things are going to happen with open-software radios in the coming year. We'll have communications that are portable, free, secure ("as in Snowden"), hackable, and accessible. We are heading toward fully software-defined radios, and that is a good thing; when hackers get control, wonderful things happen.
[Your editor would like to thank linux.conf.au for funding his travel to the event.]
Drones running (and compiling) Linux
Andrew "Tridge" Tridgell may be best known for his work on Samba, but in recent years his interest in unmanned aerial vehicles (UAVs) threatens to become even more popular. On the last day of linux.conf.au 2015 in Auckland, Tridgell gave an update on his recent UAV development work—complete with a live demonstration conducted via video link from Australia.
This year's talk, Tridgell said, was the follow up to his LCA 2014 talk, during which he promised to start porting the ArduPilot UAV autopilot software from the Arduino to a Linux system. In 2014, he had shown the PixHawk autopilot board and announced a plan to create a PixHawk "cape" for the BeagleBone Black (BBB).
As it turns out, far more has happened than that. The cape that was promised (called the PixHawk Fire) is complete, but the ArduPilot software is regularly running not only on the BBB, but on several other Linux devices as well. In addition, there are several other Linux-based autopilot projects, a new collaborative project has been created, and multiple companies have been launched to make Linux-based UAVs.
He then moved straight into a demonstration, opening a Skype call to Grant Morphett, who was standing by at an airfield in Canberra. Tridgell logged into the UAV remotely, putting the telemetry data and a terminal window from the plane onto the projector screen. The UAV itself was a Skywalker 2013 model (a modest-sized all-electric plane), loaded with a BBB and PixHawk cape running ArduPilot 3.2.1. Just to add some additional challenge, Tridgell started compiling the Linux kernel on the BBB before starting the flight.
For the demonstration, Morphett simply picked up the plane and threw it; sensors on board detected the movement and started the propeller in response. The UAV flew a pre-determined course, making three loops around the airfield, then coming in for an unassisted landing. All the while, the telemetry data on Tridgell's laptop displayed the location and orientation of the plane overlayed on a satellite image of the field—he pointed out how the wind direction was discernible through the orientation of the plane's wings and the variations in ground speed.
During the test, he continued, the UAV performed about 1200 Serial Peripheral Interface (SPI) transactions per second from its sensor array: gyroscopes, accelerometers, barometers, and magnetometers. "Usually we have some LiDARs on board as well, so we not only get to tell people that we have flying Linux robots, but that they have lasers attached to them." There are also a set of real-time units on the PixHawk cape, he explained, to handle the I/O load.
As expected, the demonstration was a success: the UAV landed without incident (although it did not finish compiling the kernel). Tridgell then provided some more detail about the specifics of device: which sensors were used and how they are connected, for example.
SPI is used for the "fast" sensors like the accelerometers and gyroscopes, which need to be sampled at around 1KHz. For maximum performance, they have to sit very close to the BBB, a centimeter or less. In contrast, the "slow" sensors (such as GPS, magnetometers, and radios) are connected over I2C and, fortunately, perform best when they are placed as far away from other components as possible, where there is less interference. "The rule with drones is that every component wants to be as far away as it can be from every other component."
The BBB, he said, ran kernel 3.8.13 with the realtime patch set. It is rather slow by modern CPU standards, but is capable of handling 4000 transactions per second without exceeding 25% CPU load—and with no loss of sensor data.
A year ago, it was an open question whether or not Linux on the BBB would be capable of handling that kind of sensor and I/O throughput using userspace drivers. So it was welcome news to learn that the system was up to the task. In addition, the ability to use userspace drivers has the benefit that the driver code only needs to be written once; non-Linux UAV projects can—and do—reuse the ArduPilot code.
The Linux-based ArduPilot system manages all of that sensor data with six realtime threads using the FIFO scheduling policy. One is a 1KHz timer thread for regularly scheduled tasks, one is a UART thread for serial operations, one is an RC (radio control) input thread for handling RC input pulses, one is a thread dedicated to the on-board buzzer (which generates diagnostic tones), one is dedicated to filesystem I/O, and one is used for the main logic and navigation loop.
In a recent test, Tridgell said, he ran a test system for 11 hours, executing 2 million loops with an expected loop time of 20ms. Only 19 of those loops exceeded 30ms, and only one exceeded 40ms—although that one took 1.7 seconds, he noted, which is quite troubling. The challenge now is to find the cause and fix it, he said, and he had already had several valuable conversations on the subject at LCA.
Only two tasks are not handled by Linux at the moment: processing RC input and generating pulse-code modulation (PCM) output for the servos that control the UAV's steering. Both of these tasks require microsecond timing, and Linux is not good at these things—"at least, not if you're also doing other things," he added. The solution for the PixHawk is to include two programmable realtime units (PRUs), which share 8K of memory with the main CPU and have direct access to the necessary I/O pins. Unfortunately, he said, there is only a proprietary C compiler available for the PRUs as of today.
Still, Tridgell's project has published its PRU code, hoping to make it available for all platforms. In 2014, he reported, the team participated in the UAV Outback Challenge, a "search and rescue" contest in which drones had to locate a life-sized dummy and drop a parachute packet as close as possible to it. Tridgell and the Canberra team had taken first the 2012 contest, although it did not win the "grand prize," because its parachute landed too far from the dummy.
In the 2014 edition of the contest, he said, he was happy to report that the Canberra team had won the grand prize—and, just as importantly, that every team in the competition was using at least some of his team's code. Some might have argued that releasing all of the code to the public was a bad idea from a competitive standpoint; Tridgell said that the results demonstrated that sharing information with everyone was the right strategy after all.
Along the same lines, Tridgell highlighted how much the Linux-based UAV community had grown over the past year. There have been several ports of the ArduPilot software to new hardware that are now commercially available, including the PixHawk Fire Cape, the Erle Brain from Erle Robotics, and the navIO line for the Raspberry Pi from Emlid. There are still other prototype ports, such as an i.MX 6 port done in-house at 3D Robotics and the Zynq ARM-and-FPGA port by John Williams. In fact, he added, the newest had arrived during LCA 2015 itself: during a talk earlier that week, he saw a pull request arrive for the BBBMINI port by Mirko Denecke. Not only was the patch good, he said, but it added support for a new hardware platform in just 43 lines.
Erle Robotics, he noted, was founded by a former Google Summer of Code (GSoC) student—and it was only one of several new Linux-based UAV companies launched in the past year. In October, the Dronecode project was launched to provide an umbrella under which these companies and other open-source UAV efforts could collaborate. The first Dronecode conference is scheduled to take place in March 2015, co-located with the Embedded Linux Conference. Tridgell encouraged everyone to come along and to get involved.
[The author would like to thank LCA 2015 for travel assistance to Auckland.]
Eben Moglen returns to LCA
One of the defining moments of LCA 2005 was Eben Moglen's keynote, which was mostly focused on the dangers that software patents presented to our community. Ten years later, Eben returned to LCA for another keynote address. While he had some things to say about software patents, it is clear that Eben thinks that the largest threats to our community — and our freedom in general — come from elsewhere.
The last ten years
Eben started by saying that a lot has happened in the last ten years; a lot of great software has been created, and we have fewer enemies than we did then. He had warned us about software patents, and, in the last ten years, the full patent war that he had feared has come to be. It has cost billions of dollars and distorted the industry; companies have done their best to make use of patent monopolies to slow down their competitors. But, in the middle of this, the free software community got a lot of help, and the worst laws around the world began to change.
Some years ago, he had been discussing various ideas for patent pools and other defensive techniques with Richard Stallman; the idea was to be able to sit at the table with at least a few chips with which to negotiate some freedom to operate. They came up with "lots of inoperable plans" and, meanwhile, the business community put together some real patent pools.
But, importantly, during this time judges were starting to figure out that
something is wrong with the patent system; they were "losing their
enthusiasm for the subject." In the last year, Eben said, we have won
three unanimous decisions in the US Supreme Court. That has put the
community into an extraordinary position. The patent wars are still
raging, but the possibility that the system will be used against free
software developers is disappearing. We're not done yet, but the playing
field is much more level.
The most interesting aspect of the patent situation in the coming decade will result from the fact that the largest economy in the world will no longer be the United States — it will be China. So the most important patent system in the world will be in China; we will be contending with lots of statutory monopolies in a society without the rule of law. The problem will affect us lightly, he said, but it will hit our industrial partners much more heavily; their response may be one of our most interesting challenges.
So, he concluded, in the last decade we have made a great deal of good software and managed to abate some serious nuisances. We have been at least partially successful in communicating our message; everything from ice cream to weapons is described as "open source" now. What we have done is to show how things will work in the 21st century. 20th century industrial society loved hierarchies; they were intrinsic to the organization of that society. We, instead, have shown the workings of a society based on transparency, participation, and non-hierarchical structures.
Our relationship to transparency is so intimate, he said, that you cannot describe the free software community without it. We are not a business with a big show window; we are a porous community that anybody can join. Participation is thus the outcome of our commitment to transparency. And we don't just do non-hierarchical projects; to a great extent, we invented them. We have taken over because we have shown that non-hierarchical collaboration is how you have to make everything. Nobody can live without our software; even Microsoft recognizes that we have won.
The threat to freedom
This is the structure that we need to face our next big threat: the all-seeing surveillance society that was spotlighted by the Snowden disclosures. It appears that there is little hope that we can prevent powerful interests from turning the net into a tool for totalitarians. We are living in the world, he said, that people like Richard Stallman and Phillip Zimmermann were trying to prepare us for.
Eben recounted how he stumbled across the first PGP posting on a FIDO board in 1991; he sent Phillip a message congratulating him for his work and for having changed the world. He also pointed out that Phillip was "in a shitload of trouble" and that he, Eben, would be there to help.
Try to imagine, Eben said, a world where PGP had been intimidated out of existence. We would have no PGP, no SSH, no OpenSSL. We would be facing "irresistible despotism" now. Even with those tools, we are facing powerful entities that can use surveillance to predict behavior and prevent the coalescence of dissent. We now live in the world that we are afraid of, and we now have a responsibility to improve our inventions and to spread them as widely as possible to fight that outcome.
We are moving toward the net as a single exoskeleton nervous system that embraces all of humanity. Will it be built to be controlled by its users at the endpoints, or will it be controlled from the center? This is the political decision that we will make for the future. We don't have any direct say over what will happen to the climate of the planet, but we can determine the physiology of its nervous system. As was foreseen by our various "crackpot visionaries," our freedom will depend on how we use our technologies. If our political ideas are to survive the surveillance society, we must continue the process of building our political and social theory. We must, he said, become more aware of the political implications of what we do.
Edward Snowden has done the important work, he said. Most people who are connected to the net want to do something to improve the situation; that means they want to meet us more than they did before. In the last decade, "our software was convenient, but we weren't." But "everybody wants to meet us now." We need to go out and explain how we can save freedom together. It would be a convenient time to build freedom into the net. But it is hard to sustain freedom in an engineering environment that is designed to take it away. Free software, instead, is software that preserves freedom, autonomy, and privacy. Nobody in their right mind will use security-oriented software that they can't read anymore.
In other words, Snowden proved that we were right. We had been saying that you cannot trust software that you cannot read; we thought it was an obvious point. Now everybody understands that point.
The first law
Even so, nothing has happened yet for users whose technology sells them out every day. What we need, he said, is a First Law of Robotics for software. If the free software community doesn't implement such a law, nobody will. Big power is committed against the First Law; it wants devices to work for it, not for their owners. If it succeeds, the human race could pay a price that lasts for generations.
So, he said, we have to start taking ourselves a little more seriously. What little has protected us from disaster already has been made in our community. We are why non-hierarchical modes of community exist, why it is possible at all. "Terrific!," he said, we did a great job. But we're not done.
Neither are we alone. When the Diaspora developers decided to try to fix social networking to make it ethical, it was surrounded by a huge community of supporters. But we have also had casualties, people like Aaron Swartz and Ilya Zhitomirskiy. We have to honor the sacrifices these people made.
In the current era, people are beginning to understand that the freedom of the net is the freedom of our society. Now is the time when we find out if we can use what we have done to keep humanity free. If we don't do it, it will not happen. We have narrowly escaped a few catastrophes in the last ten years, and we have gotten a lot of information from Snowden on what we did right. The unlimited resources devoted to breaking our view of the net have failed because of what we have made. We have demonstrated our vitality, and are now merging into the larger movement for freedom of the net. We will soon demonstrate whether we can carry this work forward.
Everybody's power, he concluded, runs on our plumbing. Whether it takes us toward freedom is up to us. We have a lot to do, and we will get lots of help. But, to start, there will be 1.6 billion people living in China without freedom, and the world's flagship democracy has abandoned the rule of law when it comes to surveillance. These forces are pushing us toward darkness. We have a lot to do to prevent that, but, if we don't do it, freedom stops. Free software is necessary for a free society, he said, and "we are playing for keeps now."
[ Your editor would like to thank linux.conf.au for funding his travel to the event. ]
Page editor: Nathan Willis
Inside this week's LWN.net Weekly Edition
- Security: A verifiable source of random numbers; New vulnerabilities in coreutils, firefox, java, samba, ...
- Kernel: Dropping x86 EISA support; When real validation begins; FALLOC_FL_INSERT_RANGE.
- Distributions: Lots of progress for Debian's reproducible builds; Planning for Fedora Workstation 22, Smart things powered by snappy Ubuntu Core, ...
- Development: Application containers in GNOME; GNU coreutils updates; LibreOffice Android; gnome-battery-bench; ...
- Announcements: Sandstorm raises $1.3M seed, Cory Doctorow Rejoins EFF, LCA videos, ...
