In yesterday's article I
described a simple and useful feature that could have been added to
the standard I/O library, to allow an environment variable to override
the default buffering behavior. This would allow the invoker of a
program to request that the program change its buffering behavior even
if the program itself didn't provide an option specifically for doing
Roderick Schertler pointed out that Dan Bernstein wrote a utility
in 1990, atop which my pseuto-tty-pipe program could easily be
built; or maybe its ptybandage utility is exactly what I wanted.
A later version is still available.
Here's M. Bernstein's blurb:
ptyget is a universal pseudo-terminal interface. It is designed to be
used by any program that needs a pty.
ptyget can also serve as a wrapper to improve the behavior of existing
programs. For example, ptybandage telnet is like telnet but
be put into a pipeline. nobuf grep is like grep but won't
block-buffer if it's redirected.
Previous pty-allocating programs — rlogind, telnetd, sshd, xterm,
screen, emacs, expect, etc. — have caused dozens of security problems.
There are two fundamental reasons for this. First, these programs are
installed setuid root so that they can allocate ptys; this turns every
little bug in hundreds of thousands of lines of code into a potential
security hole. Second, these programs are not careful enough to
the pty from access by other users.
ptyget solves both of these problems. All the privileged code is in
tiny program. This program guarantees that one user can't touch
ptyget is a complete rewrite of pty 4.0, my previous pty-allocating
package. pty 4.0's session management features have been split off
a separate package, sess.
Finally, Leonardo Taccari informed me that NetBSD's stdio actually
has the environment variable feature I was asking for! Christos
Zoulas suggested adding stdbuf similar to the GNU and FreeBSD
implementations, but the NetBSD people observed, as I did, that it
would be simpler to just control stdio directly with an environment
variable. Here's the relevant part of the NetBSD setbuf(3) man
The default buffer settings can be overwritten per descriptor
(STDBUFn) where n is the numeric value of the file descriptor
represented by the stream, or for all descriptors (STDBUF). The
environment variable value is a letter followed by an optional
numeric value indicating the size of the buffer. Valid sizes range
from 0B to 1MB. Valid letters are:
Earlier this morning, I finally got my hands on the companion book to James Cameron’s Story of Science Fiction, which is airing this month on AMC. Naturally, I immediately looked for references to the four main subjects of Astounding, and the passage that caught my eye first was an exchange between Cameron and Steven Spielberg:
Spielberg: The working title of E.T. was Watch the Skies. Which is sort of the last line from The Thing. I just remember looking at the sky because of the influence of my father, and saying, only good should come from that. If it ain’t an ICBM coming from the Soviet Union, only good should come from beyond our gravitational hold…He was a visionary about that, yet he read all the Analog. Those paperbacks? And Amazing Stories, the paperbacks of that. I used to read that along with him. Sometimes, he’d read those books to me, those little tabloids to me at night.
Cameron: Asimov, Heinlein, all those guys were all published in those pulp magazines.
Spielberg: They were all published in those magazines, and a lot of them were optimists. They weren’t always calculating our doom. They were finding ways to open up our imagination and get us to dream and get us to discover and get us to contribute to the greater good.
The discussion quickly moves on to other subjects, but not before hinting at the solution to a mystery that I’ve been trying to figure out for years, which is why the influence of Astounding and its authors can be so hard to discern in the work of someone like Spielberg. In part, it’s a matter of timing. Spielberg was born in 1946, which means that he would have been thirteen when John W. Campbell announced that that his magazine was changing its title to Analog. As a result, at a point at which he should have been primed to devour science fiction, Spielberg doesn’t seem to have found its current incarnation all that interesting, for which you can hardly blame him. Instead, his emotional associations with the pulps were evidently passed down through his father, Arnold Spielberg, an electrical engineer who worked for General Electric and RCA. The elder Spielberg, remarkably, is still active at the age of 101, and just two months ago, he said in an interview with GE Reports:
I was also influenced by science fiction. There were twins in our neighborhood who read one of the first sci-fi magazines, called Astounding Stories of Science and Fact. They gave me one copy, and when I brought it home, I was hooked. The magazine is now called Analog Science Fiction and Fact, and I still get it.
And while I don’t think that there’s any way of verifying it, if Arnold Spielberg—the father of Steven Spielberg—isn’t the oldest living subscriber to Analog, he must be close.
This sheds light on his son’s career, although perhaps not in the way that you might think. Spielberg is such a massively important figure that his very existence realigns the history of the genre, and when he speaks of his influences, we need to be wary of the shadow cast by his inescapable personality. But there’s no denying the power—and truth—of the image of Arnold Spielberg reading from the pulps aloud to his son. It feels like an image from one of Spielberg’s own movies, which has been shaped from the beginning by the tradition of oral storytelling. (It’s worth noting, though, that the father might recall things differently than the son. In his biography of the director, Joseph McBride quotes Arnold Spielberg: “I’ve been reading science fiction since I was seven years old, all the way back to the earliest Amazing Stories. Amazing, Astounding, Analog—I still subscribe. I still read ’em. My kids used to complain, ‘Dad’s in the bathroom with a science-fiction magazine. We can’t get in.'”) For Spielberg, the stories seem inextricably linked with the memory of being taken outside by his father to look at the stars:
My father was the one that introduced me to the cosmos. He’s the one who built—from a big cardboard roll that you roll rugs on—a two-inch reflecting telescope with an Edmund Scientific kit that he had sent away for. [He] put this telescope together, and then I saw the moons of Jupiter. It was the first thing he pointed out to me. I saw the rings of Saturn around Saturn. I’m six, seven years old when this all happened.
Spielberg concludes: “Those were the stories, and just looking up at the sky, that got me to realize, if I ever get a chance to make a science fiction movie, I want those guys to come in peace.”
But it also testifies to the ways in which a strong personality will take exactly what it needs from its source material. Elsewhere in the interview, there’s another intriguing reference:
Spielberg: I always go for the heart first. Of course, sometimes I go for the heart so much I get a little bit accused of sentimentality, which I’m fine [with] because…sometimes I need to push it a little further to reach a little deeper into a society that is a little less sentimental than they were when I was a young filmmaker.
Cameron: You pushed it in the same way that John W. Campbell pushed science fiction [forward] from the hard-tech nerdy guys who had to put PhD after their name to write science fiction. It was all just about the equations and the math and the physics [and evolved to become much more] human stories [about] the human heart.
I see what Cameron is trying to say here, but if you’ve read enough of the magazine that turned into Analog, this isn’t exactly the impression that it leaves. It’s true that Campbell put a greater emphasis than most of his predecessors on characterization, at least in theory, but the number of stories that were about “the human heart” can be counted on two hands, and none were exactly Spielbergian—although they might seem that way when filtered through the memory of his father’s voice. And toward the end, the nerds took over again. In Dangerous Visions, which was published in 1967, Harlan Ellison wrote of “John W. Campbell, Jr., who used to edit a magazine that ran science fiction, called Astounding, and who now edits a magazine that runs a lot of schematic drawings, called Analog.” It was the latter version of the magazine that Spielberg would have seen as a boy—which may be why, when the time came, he made a television show called Amazing Stories.
Hey all, Ernie here with a classic (though lightly updated) Tedium piece about one of the defining pieces of ’90s computer technology: The Sound Blaster. Crank it up!
Today in Tedium: Before we embraced MP3s as the official noise of the internet (taking the place of screechy modems), it took a while before the synthesized notes of our musical past could be modulated through the inner-workings of a computer. Some of our earliest computers, for example, could only make very basic bleeps and bloops. But in 1989, everything changed when a Singaporean company called Creative Technology hit upon the perfect approach for synthesizing sound. Today’s Tedium is an ode to the Sound Blaster, the PC peripheral that helped turn the modern computer into a multimedia powerhouse—as well as the company that busted through by breaking some major cultural rules in its home country. — Ernie @ Tedium
The business oversight that created the market for sound cards
The IBM PC was created squarely for the business market, and while such machines were far more powerful than most video game consoles of the day, two places where they fell flat were video and audio.
The reason? At the time of the machine’s initial release—particularly before clones came about—there was no real business case for a computer to support a wide array of graphics and sound. The graphics-heavy GUI as we know it was still years from becoming commonplace, and it wasn’t like you needed robust sound capabilities when writing documents or crunching numbers.
While early IBM PCs had speakers, they effectively existed only to allow for error messages—and as a result were heavily crippled. As developers got their hands on these devices and moved beyond purely business programs, they eventually figured out ways to stretch this incredibly limited palette of sound using a hack called “pulse width modulation.”
This eventually allowed for the PCs to make 6-bit digitized sounds—not enough, say, to play a pop song through your speakers, but plenty to make music for your average King’s Quest game.
IBM, nor many early clone-makers, were really interested in improving the sound element much for the business computers, but they did try to make overtures to the home market. IBM’s PCjr, released in 1984, had better sound capabilities, thanks to its use of the Texas Instruments SN76489 chip. You may not have owned a PCjr, but you’ve probably come across a SN76489, as the chip was used in many video game systems—both of the arcade variety and in home consoles like Sega Master System and Genesis. But the PCjr’s lack of compatibility with PC software, along with its inability to play games very well, killed the machine on the market.
Eventually, though, peripheral developers in the PC world spotted an opportunity of their own.
The number of sounds that a Yamaha YM3812 chip could make simultaneously, due to FM synthesis. If you wanted access to a series of percussion sounds, you could lose three of those tones and put the drum sounds in its place. This Yamaha chip became the de facto standard for sound cards throughout the late ‘80s and ‘90s, thanks to its use in both the AdLib and Sound Blaster sound cards. David Murray, the YouTuber known as “The 8-Bit Guy,” pointed out a while back that a number of Yamaha keyboards in the late ‘80s used this very same computer chip.
Why the Sound Blaster broke through
The Sound Blaster wasn’t the first attempt to create decent sound on an IBM PC. In fact, it wasn’t even the first attempt by its creator, Creative Technology, to take on this market—it made its first attempt in 1987 with the launch of its Creative Music System, then in 1988 with its Game Blaster card.
Nor was it the only major player in the market. Also in 1987, a Canadian company called AdLib was the first major player to the musical computing market, and its device proved an early success. These cards relied on the Industry Standard Architecture, or ISA, expansion slots that had been common on IBM PCs since their 1981 release.
The complexity of this approach might sound a little surprising to those who missed the early PC era. Unlike a USB device that you might plug into your laptop, these expansion slots (which you had to open your machine to access) were fairly large and could generally just do one or two things. So one card might be a modem, and another might add a printer port to your machine. Desktop machines tended to only allow for two or three of these cards, while a tower could take half a dozen or more. But because you were plugging these cards directly into the motherboard, the result was a notable speed boost compared to an external device.
Complicating matters at the time was that peripherals didn’t just work when you plugged them in—they required complex drivers, often a new one for every single program you installed. It was pretty much the opposite of “plug and play.”
Anyway, as we mentioned earlier, AdLib’s card relied on the Yamaha YM3812 FM synthesizer chip, which allowed it to create high-quality synthesized music. However, it couldn’t play any type of audio file you threw at it, because it didn’t support pulse-code modulation, or PCM. (PCM is the secret sauce that allows digital devices, like CD players or computers, to handle analog audio.)
Like what you‘re reading?
Consider subscribing to our freaking newsletter. We publish stuff like this twice a week.
Creative wasn’t the first mover in the sound card market, but much like the clone-makers of the era did, the company took advantage of the fact that most computer chips weren’t proprietary. In other words, the AdLib wasn’t using unique chips, so Creative used those same chips and improved on AdLib’s offering slightly, launching a fully compatible card with PCM support.
And because Creative was building its devices in Singapore rather than Canada, its production costs were a lot lower. It wasn’t perfect—it could only play sound samples in mono, not stereo—but it was a huge leap forward for computer audio, especially on the PC. And Creative did it using off-the-shelf parts.
On top of this, Creative made some smart strategic moves—it worked with a bunch of major game publishers to ensure that they supported the Sound Blaster natively, and also made drivers widely available to developers. Further, Creative added a game port on the back of the sound card—taking advantage of the fact that most computers of the era didn’t have game ports—which gave gamers an incentive to buy.
The result was that, within a year, the Sound Blaster had become the de facto standard for the PC industry, and over the next few years, the company was able to iterate on this initial success, creating a product line that led its market for more than a decade.
“In Singapore, the no U-turn without sign culture has permeated every level of our thinking and every segment of our life. This no U-turn has created a way of life that is based on rules. When there is a U-turn sign or when there is a rule, we can U-turn. When there is no sign, we cannot U-turn. When there is no rule, we cannot do anything. We become paralyzed.”
— Creative Technology founder Sim Wong Hoo,writing about the “No U-Turn Syndrome” that he claimed had permeated Singaporean culture. Sim’s point, first explained in his 1999 book Chaotic Thoughts From the Old Millennium, is essentially his way of arguing that people from Singapore are often waiting for someone to tell them what to do before they take any action—something he argues shows up in driving, as Singaporeans won’t take a U-turn unless explicitly told. Sim, who built a reputation as a business maverick in the culturally-conservative Singapore, argues that the mindset of inaction is incompatible with the modern business world. “We are moving faster and faster into many uncharted territories, where there are no rules,” he adds. “We do not want to be paralyzed by waiting for the rule to be formulated before moving—it will be too late.”
These days, Creative is still active in the technology space, though perhaps with a smaller profile than it had during its ‘90s heyday. It was an early competitor in the MP3 player market, hoping to take on the world with its Nomad device, but things changed one day when Apple decided it wanted to get in on the market itself.
Not that Creative didn’t have passionate supporters.
Creative got around this problem by classing up its offerings—going back to its roots as a luxury for gamers. And because most people these days are more likely to own laptops or tablets than towers with room for extension cards, most Sound Blasters the company sells these days aren’t sound cards in the traditional sense. Instead, they’re more like mini-amplifiers that you put on your desk or in your pocket. They often support Bluetooth, and some of them, like the Sound Blaster X7, sell for hundreds of dollars.
But the company is showing willingness to stretch beyond its corporate expectations. The company, for example, makes tiny-but-powerful mixers that effectively work as recording studios.
But it’s Creative’s most audacious recent product—an elaborate no-compromises soundbar for television sets called the X-Fi Sonic Carrier—that has people talking. When it was first announced, the asking price was an absurd $5,000; the manufacturer’s suggested retail price on the device ended up around $5,800—though the device can be had at a budget-minded $3,999.
The webpage for the Sonic Carrier, which is one of the longer non-Wikipedia pages I've run into in recent years, bludgeons you with details about its amazingness. “We have created a work of art so magical, so magnificent, so mind-blowing, industry experts have dubbed it the ‘Soundbar of the Gods,’” the site says.
It seems like a surprising move for a company that once sold sound cards by the truckload. But it actually fits pretty nicely into Sim Wong Hoo’s stance against the “no U-turn without sign culture.” Long story short, sign or no sign, Creative is making a U-turn.
“Two years ago, I put my foot down,” Sim told The Straits Times last year. “If we are putting so much effort into low-end products that don't give us the returns we want, shouldn't we focus our efforts on the high-end products that people can appreciate at a higher price point, albeit in a smaller market?”
Reviews seem to suggest that the more ambitious sound approach might be the right move for Sim and his company—TechRadarrecently gushed about the Sonic Carrier, stating “specs can only do so much justice to this soundbar.”
Sure, it sounds over-the-top, and it probably is, but this guy has earned the right to sell $6,000 speakers.
Back in March, I published a post here about the unpleasant personal life of Saul Bellow, whose most recent biographer, Zachary Leader, has amply documented the novelist’s physical violence toward his second wife Sondra Tschacbasov. After Bellow discovered the affair between Tschacbasov and his good friend Jack Ludwig, however, he contemplated something even worse, as James Atlas relates in his earlier biography: “At the Quadrangle Club in Chicago a few days later, Bellow talked wildly of getting a gun.” And I was reminded of this passage while reading an even more horrifying account in D.T. Max’s biography of David Foster Wallace, Every Love Story is a Ghost Story, about the writer’s obsession with the poet and memoirist Mary Karr:
Wallace’s literary rebirth [in the proposal for Infinite Jest] did not coincide with any calming of his convention that he had to be with Karr. Indeed, the opposite. In fact, one day in February, he thought briefly of committing murder for her. He called an ex-con he knew through his recovery program and tried to buy a gun. He had decided he would wait no longer for Karr to leave her husband; he planned to shoot him instead when he came into Cambridge to pick up the family dog. The ex-con called Larson, the head of [the addiction treatment center] Granada House, who told Karr. Wallace himself never showed up for the handover and thus ended what he would later call in a letter of apology “one of the scariest days in my life.” He wrote Larson in explanation, “I now know what obsession can make people capable of”—then added in longhand after—“at least of wanting to do.” To Karr at the time he insisted that the whole episode was an invention of the ex-con and she believed him.
Even at a glance, there are significant differences between these incidents. Bellow had treated Tschacbasov unforgivably, but his threat to buy a gun was part of an outburst of rage at a betrayal by his wife and close friend, and there’s no evidence that he ever tried to act on it—the only visible outcome was an episode in Herzog. Wallace, by contrast, not only contemplated murdering a man whose wife he wanted for himself, but he took serious steps to carry it out, and when Karr heard about it, he lied to her. By any measure, it’s the more frightening story. Yet they do have one striking point in common, which is the fact that they don’t seem to have inspired much in the way of comment or discussion. I only know about the Wallace episode because of a statement by Karr from earlier this week, in which she expressed her support for the women speaking out against Junot Díaz and noted that the violence that she experienced from Wallace was described as “alleged” by D.T. Max and The New Yorker. In his biography, Max writes without comment: “One night Wallace tried to push Karr from a moving car. Soon afterward, he got so mad at her that he threw her coffee table at her.” When shown these lines by a sympathetic reader on Twitter, Karr responded that Wallace also kicked her, climbed up the side of her house, and followed her five-year-old son home from school, and that she had to change her phone number twice to avoid him. Max, she said, “ignored” much of it, even though she showed him letters in Wallace’s handwriting confessing to his behavior. (In his original article in The New Yorker, Max merely writes: “One day, according to Karr, [Wallace] broke her coffee table.” And it wasn’t until years later that he revealed that Wallace had “broken” the table by throwing it at her.)
There’s obviously a lot to discuss here, but for reasons of my own, I’d like to approach it from the perspective of a biographer. I’ve just finished writing a biography about four men who were terrible husbands, in their own ways, to one or more wives, and I’m also keenly aware of how what seems like an omission can be the result of unseen pressures operating elsewhere in—or outside—the book. Yet Max has done himself no favors. In an interview with The Atlantic that has been widely shared, he speaks of Wallace’s actions with an aesthetic detachment that comes off now as slightly chilling:
One thing his letters make you feel is that he thought the word was God, and words were always worth putting down. Even in a letter to the head of his halfway house—where he apologizes for contemplating buying a gun to kill the writer Mary Karr’s husband—the craftsmanship of that letter is quite remarkable. You read it like a David Foster Wallace essay…I didn’t know that David had that [violence] in him. I was surprised, in general, with the intensity of violence in his personality. It was something I knew about him when I wrote the New Yorker piece, but it grew on me. It made me think harder about David and creativity and anger. But on the other end of the spectrum, he was also this open, emotional guy, who was able to cry, who intensely loved his dogs. He was all those things. That, in part, is why he’s a really fascinating guy and an honor to write about.
Max tops it off by quoting a “joke” from a note by Wallace: “Infinite Jest was just a means to Mary Karr’s end.” He helpfully adds: “A sexual pun.”
It’s no wonder that Karr is so furious, but if anything, I’m more impressed by her restraint. Karr is absurdly overqualified to talk about problems of biography, and there are times when you can feel her holding herself back. In her recent book The Art of Memoir, she writes in a chapter titled “The Truth Contract Twixt Writer and Reader”:
Forget how inventing stuff breaks a contract with the reader, it fences the memoirist off from the deeper truths that only surface in draft five or ten or twenty. Yes, you can misinterpret—happens all the time. “The truth ambushes you,” Geoffrey Wolff once said…But unless you’re looking at actual lived experience, the more profound meanings will remain forever shrouded. You’ll never unearth the more complex truths, the ones that counter that convenient first take on the past. A memoirist forging false tales to support his more comfortable notions—or to pump himself up for the audience—never learns who he is. He’s missing the personal liberation that comes from the examined life.
Replace “memoirist” with “biographer,” and you’re left with a sense of what was lost when Max concluded that Wallace’s violence only made him “a really fascinating guy and an honor to write about.” I won’t understate the difficulty of coming to terms with the worst aspects of one’s subject, and even Karr herself writes: “I still try to err on the side of generosity toward any character.” But it feels very much like a reluctance to deal honestly with facts that didn’t fit into the received notions of Wallace’s “complexity.” It can be hard to confront those ghosts. But not every ghost story has to be a love story.
Mangia: the Italian verb “to eat.” Apocalypse: the complete final destruction of the world. Push them together and you get the Mangiapocalypse. This portmanteau was suggested by a friend who was describing the philosophy of preparing for disaster in a way that’s abundant, fun, productive, and oriented toward a better overall quality of everyday life. This is the opposite of a bunker in the woods loaded with military rations and ammunition.
The most important part of any emergency plan is people. Friends, neighbors, extended family, and even folks you may not know terribly well might prove critically useful in a time of need. Yesterday I wandered around the block knocking on doors and inviting everyone to another backyard shindig. The home made pizza and booze did all the persuading. One of the side effects of these parties is community, social capital, or what used to be called “good will.”
The outdoor kitchen is a work in progress. It began as a collection of temporary individual parts set up on a concrete slab where an old metal shed used to be. A summer kitchen off the back deck is great for weekend barbecues. It’s also the right arrangement for pressure canning and making jams and jellies in summer. In fact, it’s perfect for cooking all meals in warm weather to keep heat out of the house and eliminate the need for air conditioning. And having multiple ways to cook and heat water with a generous reserve of propane tanks and wood fuel might be super handy in a power failure or earthquake when electricity and/or piped gas is unavailable.
I found three granite slabs with bullnose edges at a salvage yard that work really well as durable outdoor work surfaces. The wooden bases allow the units to be moved around and reconfigured as needed. The folding table will be replaced by the additional counter units as carpentry progresses.
A garden hose attached to a spigot and a galvanized bucket work wonders as an outdoor sink. Camp soap made for outdoor use is garden friendly and nontoxic so waste water can be used to irrigate fruit trees. I hasten to mention that an outdoor sink plumbed with a pipe would have set off a cascade of government regulations and prohibitions. But a garden hose and a bucket? No problem. Why ask for trouble with the authorities? See also: the garden shed/home office/guest bedroom. For a landlord/tenant situation this also makes a lot of sense since parts of the kitchen can be packed up and moved while other parts can remain for the next occupants to use and enjoy.
Most homes have at least a little garden space that’s almost always ornamental rather than productive. People are busy. Food from the store is convenient and affordable. And in many locations municipal regulations and home owners associations forbid productive gardens because they aren’t always sufficiently tidy or attractive. But if you can grow a little food it’s a good idea to keep your horticulture skills sharp. Supplemental home grown food might be an important part of your future diet in the event of unemployment or supply chain disruptions. A deep pantry with a generous supply of staple foods compliments a garden. Prepping isn’t about the Zombie Apocalypse. It’s about the mundane challenges of ordinary life.
Outdoor rooms double the size and utility of a small house and make entertaining that much more pleasant. The same space that works for al fresco dining and lounging could be pressed in to service as a refuge for people displaced by an emergency event.
This isn’t hypothetical. Thousands of nearby homes burned on the same day a few months back. RVs are now parked around the neighborhood in the driveways of friends and family. They’re occupied by people who are otherwise homeless. You just never know who you might need to take in during a crisis.
Here’s another point that’s often ignored. Owning a modest home outright with little or no debt makes a household radically more resilient than owning a larger home that’s loaded down with debt service. The existence of debt complicates and magnifies all other problems. Leverage can be magnificent on the way up, but it crushes you on the way down. Too few people stop and ask what they really need and can truly afford. That might be the best place to start when considering your own personal mangiapocalypse.