He's everything you want; he's everything you need; he's everything indise of you that you wish you could be. He says all the right things, at exactly the right time, but he means nothing to you and you don't know why. -- Vertical Horizon, Everything You Want

MythTV: Volume Leveling

Back at the other end of this year, I decided to retire my aging TiVo, and become a full-time user of the magic that is MythTV. For those of you who don’t know, MythTV is a software package you can run on a computer (Linux based. I won’t swear that there isn’t a Windows port, but of this, I know little) which does more or less what a Digital Video Recorder does — it can record TV to its hard drive so you can watch it whenever you like. But because you’ve got a whole computer which is under your control, it can also do, well, anything else you want. For my purposes, the most useful thing that it does is to act as a sort of video jukebox: I can back up all my DVDs to a network hard drive, and thereby avoid all the hassle of (a) having to keep piles of DVDs in the living room, (b) risking scratches, and (c) dealing with temperamental DVD players. Another of its nice features is that, with an add-on called MythNetTV, you can subscribe to video podcasts via MythTV, and it will deliver new episodes to you just as if they’d been broadcast over the air, allowing you to watch grainy, low-resolution YouTube quality video of cats doing amusing things on your 40 inch HDTV. I’ve long found it ironic that as TVs get bigger and resolutions increase, we’re increasingly willing to huddle around a laptop monitor to watch a 320×200 viral video. Well, suck it, losers, because I’m watching The Spoony Experiment and The Nostalgia Critic on the big screen.
Now, like most Linux projects, it’s not all sunshine. I’ve got two cheap TV tuner dongles, which don’t work with it (There’s several very nice tuners which work with it, but I really wanted just a cheap one to use as a secondary tuner). And the usability is not nearly as polished as, say, TiVo (That said, it’s miles beyond most cable box DVRs in the UI department). There’s a few annoyances that I have yet to be able to overcome (The size at which subtitles render is hard-coded, which means that it displays at a size which was plainly selected for a Standard Definition screen, making it slightly microsocopic at 1080p), but, like I said, it’s a whole computer, and you can bring to bear all that implies.
I’d been meaning for some time to write a series of articles about the cool things I’ve written to bend the Mythtv to my will, but actually banging any of my hacks into a presentable state has required a bit more time than I’ve been willing to invest. But this week, I found something so handy and so elegant that I thought it was time to share it.
So, MythTV trick Number One:
One problem with playing back video from various disparate sources is the volume level. You know how when you’re watching regular old-fashioned TV, more often than not, the commercials will be about a million decibels louder than the show? The volume will be different from one channel to the next. When you’re also downloading New Media from The Intertubes, those too will be at radically different levels from TV, and from each other. DVDs are usually at a much lower level than TV (I think this may be caused by the downmix from 5.1 to stereo). And if, say, you’re watching a third generation rip from a grainy VHS of a film so rare that no one involved in it will even admit to having heard of it, you’re talking borderline inaudible.
With months of training, I’ve got Leah to the point where she’ll actually give me a fair chance to reach the remote control and turn the volume down before she yells at me to turn it down the instant the sound starts, but it’s still not really an optimal solution for me to keep having to adjust the volume from one video to the next.
If you are a modern person who keeps all your music in digital format, you may be familiar with the concept of volume normalizing, which analyses a whole song and works out how to adjust the overall volume to the song so that you don’t blow out your ear drums if Shuffle Play puts a John Tesh song right after one by Alice in Chains (Which is not to say that you don’t deserve deafness for your taste in music).
But the tools for doing this to video are less mature, and besides, you might be willing to spend 2 minutes preprocessing a 4 minute song you’re going to keep for the rest of your life, but I’m not willing to spend 30 minutes processing an episode of Stargate Universe which I’m going to delete as soon as I’ve finished watching it.
As it turns out, though, since you’re running a whole computer, and it’s Linux, the Magical World Where You Can Basically Do Anything You Want So Long As You’re Willing To Carve It From the Solid Granite of the OS With Your Bare Hands, it’s possible to just order your sound card to do that normalization for you as it plays — in this case, it’s called Compression and Limiting.
I could just about muddle through the science of how it works, but probably not well enough to explain it to anyone in detail. The general gist of it is that a “compressor” squishes audio such that it reduces the difference between the loudest sounds and the softest. When a sound is louder than some threshhold, it reduces the volume, but it does it in a very smooth way that sounds good. This is something radio stations do so that you can turn the volume up loud enough to hear the soft bits without blowing out your speakers for the loud bits. A “limiter” is the same basic process, but it’s much more powerful and lacks the subtlety of a lower-rate compressor. Basically, the purpose of the compressor is to make the audio all “fit” within a certain range of loud-to-soft, and then the limiter boosts the gain (ie. “Turns the volume up”) while keeping it from exceeding a certain threshold.
In Linux’s ALSA sound system, you can create plugins which (long story short) basically act like virtual sound devices. You tell an application to use that sound device, and any audio the application tries to put out will be sent through the plugin before it’s turned into sweet delicious audio. Here’s an audio compressor that I threw together based on some stuff I found on the ALSA wiki:

pcm.ladcomp {
type plug
slave.pcm "ladcomp_compressor";
}
pcm.ladcomp_compressor {
type ladspa
slave.pcm "ladcomp_limiter";
path "/usr/lib/ladspa";
plugins [
{
label dysonCompress
input {
controls [0 1 0.5 0.99]
}
}
]
}
pcm.ladcomp_limiter {
type ladspa
slave.pcm "default";
path "/usr/lib/ladspa";
plugins [
{
label fastLookaheadLimiter
input {
controls [ 15 0 0.8  ]
}
}
]
}

This code can be put in your /etc/asound.conf, then just tell MythTV to use the sound device ALSA:ladcomp (It’s under Utilities / Setup -> Setup -> General if you’re using the default menus. I’ve hacked mine up a bit, so it took me longer to find it). It should have defaulted to something like ALSA:default. Restart MythFrontend, and voila: all your audio should play at around and about the same level. To use this, you’ll need the ladspa plugins. If your MythTV is running on Ubuntu Linux (I use Mythbuntu, a version of Ubuntu oriented toward MythTV (For the non-Linux experienced, you can basically run any Linux software on any Linux box. The major difference between various Linux distributions is basically which software it installs by default, as opposed to which ones you have to download and install on your own. Ubuntu is a distribution which takes the radical step of assuming that its users may include actual human beings and might want to spend more time actually using their computer than assembling it.)), you can get them by running “sudo apt-get install ladspa-sdk swh-plugins”.
If you want this trick to apply to other applications, you can tell them to use ladcomp as their audio device too. For instance, with mplayer, try mplayer -ao alsa:device=ladcomp.
If you want to do some fine tuning, you can try changing that 15 to other numbers to change the range for the final audio (You have to restart MythFrontend before the changes will be honored). I haven’t found quite the right setting for me personally yet — 15 is a bit higher than I want, I think, since it makes the “comfortable” position on my stereo’s volume dial around 6 out of 30 — I think somewhere in the 10-15 range would be better. But, at least for me, it does put MythTV in about the same volume zone as the Nintendo Wii, so I’m not racing to turn the volume down when we turn the game consoles on.
So, with any luck, and a little bit of work, you too can bend the sound system to your will, and watch whatever you like without fear of getting yelled at by your fiancee for having the TV turned up too high.

A Conversation at the Library

Me: Well here’s a serious question: If you could change one thing about me, what would it be?
Leah: [laughs]
Me: Just one
Leah: Two things.
Me: [fake sulk]
Leah: I really wish you’d lose some weight. We both should. Because I worry about you, and I know you haven’t been watching what you eat so much.
Me: Yeah. I know.
(a pause, while I wait for her to ask the reciprocal question. She doesn’t)
Me: I ask, because I’ve been thinking
Leah: Oh?
Me: Yeah. And I guess, maybe there’s one thing I might change about you.
Leah: Um.
Me: Your last name. [produces a ring] Will you marry me?

Continue reading A Conversation at the Library

Read This: Bad Faith

Ever since the McCain campaign put out this little piece of propaganda (in which McCain points out that Obama supported teaching kindergarteners to how to recognize and respond if someone tries to molest them, and treats that like a bad thing, I, who haven’t been exactly slow-to-anger in matters political for a few years, have sort of shifted into an “Incoherent with rage” position. The phrase “I’m as mad as hell, and I’m not going to take it any more,” keep popping into my head.
I’m really too angry about it to formulate ideas coherently, but here’s some people who aren’t:

For what it’s worth, I do disagree with Adam on the matter of Red-State folks being stupid. I’m actually breaking with most of my friends — liberal and conservative here, but I don’t think stupidity actually enters into it. In a quasi-unrelated article, Fred Clark over at Slacktivist talks a bit about bearing false witness. One of the things he has to say is this:

Stupidity alone doesn’t make one hostile to irrefutable facts. Stupidity cannot account for their vicious anger when the rumor is debunked — anger at the person doing the debunking, and anger at the whole world for not turning out to be the nightmare they wanted it to be.

Elsewhere, in his discussion of the epic eschatological “prophecy” novel (The scare quotes are intentional, because of my opinion of the authors’ grasp of theology) Left Behind, the Slacktivist asks this:

The authors’ disproportionate sense of the U.N.’s importance and their utter ignorance of its actual role and function cannot be easy to maintain. How do you convince yourself that a topic is of unrivaled significance while simultaneously preventing yourself from learning anything about it?

But no matter how intricate or comprehensive such theories are, the authors can never rest. Unreality cannot withstand the ever-present and unavoidable contact with actual reality, so the lie must always be reinforced and reconstructed.

He knows — knows — that he cannot allow himself to read that article if he wants to continue believing the things he wants to continue believing. In other words, he knows — or at least some part of him knows — that the things he wants to continue believing are not true.

If you’ve ever had occasion to research how a polygraph works, you may have heard that one of the fundamental principles on which it operates is that, simply put, it is harder to lie than to tell the truth. It requires effort. This has nothing to do with being tense or nervous. It has to do with the fact that to tell the truth, all you have to do is recall the truth and say it. To lie, you have to think of the truth, and then go out of your way to avoid it.
So, no, I don’t think the red-state “Reality Show” voters are stupid. Someone who was simply stupid would not behave this way. Someone who was stupid would respond if you could just “dumb down” your message enough. But that’s not what’s going on here. When you show them the absolute, undeniable, incontrovertible truth, they don’t fail to comprehend, they get angry. They don’t just fail at learning the truth, they avoid the truth.
And that’s really something. It’s, as Fred Clark says, a lot of work, and it implies that they actually do know the truth — they have to be able to recognize it in order to avoid it. They know the truth and they are wilfully ignoring it. That’s actually a rather complicated feat of mental gymnastics. That’s not stupidity. It’s insanity.
Yeah. I said it. It’s not stupidity, it’s insanity. The economy is in trouble. We’re stuck in an unpopular, vaguely defined war that isn’t working. Our civil liberties are being stripped away. We’ve become a country that supports torture. And there are still people who want to vote into office a man who would continue the Iraq war for Ten Thousand Years with a running-mate who Doesn’t actually know what the Vice President’s job is. That’s not stupidity. That’s insanity.
“Insanity: doing the same thing over and over again and expecting different results.” — Albert Einstein
But I’m not actually saying that as a personal attack or anything. I don’t blame them for their insanity. It’s not like I think there’s something in the water or, outside a few remote areas, the result of generations of inbreeding. No, I think this is socially-induced insanity. Lots of people have pointed out that in the past few elections, many of the campaigns have sold us their candidates by presenting America as a sort of family, and we’ve been trying to “elect dad”. In ’04, a lot of this was about electing a “dad” who could beat up Iraq’s dad.
So here’s the thing. Something happens when you elect your dad based on the fact that he’s big and strong and can kick the asses of the other kids’ dads. You end up with a dad who’s a bully. You know who else says, “He’s consistently done the wrong thing, and I am constantly the worse for it, but I’m going to close my eyes to all that and remain loyal, and if I just love him and do what he says, daddy will stop drinking, and things will all be better someday.”? People whose husbands or dads are bullies.
So no, red states, I don’t think you’re stupid. I really don’t. And I know that you feel like you’ve got so much invested. And I know that it’s scary and painful to face the truth. But the chickenhawks aren’t going to stop warmongering until it stops winning them elections, and the religious right aren’t going to stop hatemongering until it stops winning them elections, and the obscenely rich plutocrats aren’t going to stop destroying the economy in order to ruby-encrust their bald-eagle-tipped walking sticks until is tops winning them elections, and he’s never going to stop hitting you unless you leave him.
Oh, and one more thing. When Karl Rove says– Sorry. I meant, when Karl “John McCain has an illegitimate black baby” Rove says you’ve crossed the line in your smear campaign, you have crossed the line in your smear campaign.

Anyway, Anyhow, Anywhere

Hey all. I know I don’t blog in this category very often, but ever since I started working for a living, my dreams have been trending less coherent and harder to remember. All the same, I had a long and coherent one last night, which I would like to share with you now. I largely suspect that my dream was inspired in part by the fact that I fast-wound through Knight Rider‘s third season premier, “Knight of the Drones” last night.
Hit the jump for the details…

Continue reading Anyway, Anyhow, Anywhere

And you, sir, are a formidable opponent

When we just saw that man, I think it was Mr. Myers [i.e. biologist P.Z. Myers], talking about how great scientists were, I was thinking to myself the last time any of my relatives saw scientists telling them what to do they were telling them to go to the showers to get gassed … that was horrifying beyond words, and that’s where science — in my opinion, this is just an opinion — that’s where science leads you
…Love of God and compassion and empathy leads you to a very glorious place, and science leads you to killing people.

— Ben Stein, 2008 In an interview with TBN’s Paul Crouch Jr. (video here)
I don’t even need to summarize. “Science leads to killing people.”
Someone disagrees (emphasis mine):

I hereby offer a few suggestions on how we can ruin American competitiveness and innovation in the course of this century:
Elevate mysticism, tribalism, shamanism and fundamentalism–and be sure to exclude educated, hardworking men and women–to an equal status with technology in the public mind. Make sure that, in order to pay proper (and politically correct) respect to all different ethnic groups in America, you act as if science were on an equal footing with voodoo and history with ethnic fable.

— (wait for it) Ben Stein, 2002, in Forbes
Ben Stein wants to kill American competitiveness.
I think it’s our turn to use everyone’s favorite right-wing mudsling:
Ben Stein, why do you hate America?

Suspended

It is worth mentioning again, in case you somehow missed it and care.
Expelled is a film narrated by Ben “Bueller, Bueller” Stein for the Discovery Institute to help convince people that there’s no such thing as evolution and that evil atheists are going to force your children to have gay sex or something.
Well, anyway, it’s a creationist propaganda film which claims things like Darwin -> Atheism -> Nazis. In fact, it’s the central thrust of the film so far as I can see.
PZ Myers is a well-known blogger in the fields of evolution and biology. He runs a little thing called Pharyngula, which I gather is pretty good. He’s also a self-professed “godless liberal” (So, the other kind of liberal from me, and the other kind of godless from Ayn Rand), and not a big fan of that thing that is both bad science and bad theology and is pretending to be both under the name of “Intelligent Design”.
So, the target audience if you’re legitimately trying to have a dialogue about ID and whether it’s a legitimate thing to teach our childen.
Also, not the target audience if you know your claim is bogus and are trying to trick people into supporting you anyway.
So, suppose that you’re putting on a propaganda film about Intelligent Design. Your “science” relies on misquoting people, taking things out of context, and being academically dishonest. PZ Myers has filled out the form to be given an invitation to come see your movie. How should you handle this in a way that won’t make you look bad?
Well, one thing you could do is let him see it, and show photos of him going to see it. Hopefully, he’ll do something childish like throw eggs or something, then you can call him a big baby and make everyone laugh at him.
If he doesn’t oblige you, you could instead just treat the fact that he saw it as a tacit approval of your message: “Hey, even this well-known darwinist saw our movie!”
Of course, if he writes a bad review, that won’t work. Though maybe it won’t hurt so much, since the opinion of PZ Myers doesn’t exactly carry a lot of weight with anyone who is going to support your message to begin with. You could probably just laugh it off: of course the godless liberal hated it. It might even spin for you, you could quote him, citing him as a godless darwinist liberal. It would work the same way that it would work to use “I hated it — Joseph Stalin, Adolph Hitler, Osama Bin Laden” as a review of your movie to trick people into not wanting to hate it to avoid being lumped in with that lot.
Or, if all else fails, just stick a whoopie cushion in his chair. Who will take him seriously when it gets out that he let a big one fly the moment he sat down?
Hey, you know what wouldn’t work though? Kicking him out. You know what would work less? Kicking him out and threatening to have him arrested.
Want to guess which one they chose?
It gets better.
So, having handed their enemies a press coup on a silver platter, the makers of Expelled tried a few different tacks to save the situation.
Attempt 1: Lie: So they said that PZ had tried to sneak in to a by-invitation-only event to which he
had not been invited. I will quote someone on the subject. Who I am quoting is going to be the punch line to this article, so I will not attribute this quote yet. “The way to get into this showing of the film was simply to go on the Internet and apply. This was exactly what PZ did. He went on the Web and put his name down for a place at the showing.” PZ Myers had been invited.
Attempt 2: Spin (at windmills) (And also lie): From a press release: “I hope PZ’s experience has helped him see the light. He is distraught because he could not see a movie. What if he wasn’t allowed to teach on a college campus or was denied tenure? Maybe he will think twice before he starts demanding more professors be blacklisted and expelled simply because they question the adequacy of Darwin’s theory.”
Yes, because (patriotic music plays) Here in America, you should never be denied the right to see a movie, no matter how sane you are, and you should never be denied a job teaching biology no matter how totally incompetent you are in the field of biology. Because in America, if you show up and pay for your ticket, you have a right to be a college professor.
Oh, and it’s a lie because PZ has, so far as I can tell, never demanded that anyone be blacklisted for anything other than incompetence (Heck, maybe not even that).
Attempt 3: Be Holier than Thou (and also lie): Again, from them: “Recognizing the opportunity to make a point of the inconvenience and pain that they, and others like them, have caused to numerous scientists and educators, the decision was made beforehand to deny Myers access to the film if he actually showed up.”
So, “we banned him to annoy him,” is being used as an excuse? Besides, according to line producer Mark Mathis, “I banned pz because I want him to pay to see it. Nothing more.” (source)
So, they seem to have dug themselves in pretty deep.
It gets better.
Now, PZ Myers brought a guest with him to the screening. The Discovery Institute claims that his guest registered under a false name. This is a lie; the form PZ filled out did not allow him to enter his guests’ names, only the number of them. This guest was not actually asked to show any, ahem, ID. The Discovery Institute has claimed that this guest was a “gate-crasher” who tried to get in uninvited. But, as I mentioned, PZ had filled out the paperwork and registered his guest.
At any rate, this guest was allowed to go see the movie unaccosted. He’s the person who wrote the unattributed quote up there. Who was this guest?
Well, here’s a hint. He’s married to a former Doctor Who companion.
Give up?
Wait for it…
Wait for it…
Richard Dawkins.
Pretty much the most famous atheist in the entire world.

And Are Concordances Do Easy Hard Lyric Or Read Rock Roll Think To You?

Can you identify these popular songs when their lyrics have been rearranged into alphabetical order?
And Great Lyrics Quiz Rock Roll The
(For I It’s Got What Worth, 35 right, 12 wrong because I didn’t know the lyrics to the song, 3 wrong in spite of knowing the lyrics to the song.)