Archive for November, 2004

Gentoo Linux, MythTV, and LIRC

For those of you who know me in real life, you know that I am have been somewhat (obsessed seems like such a strong word) active trying to get MythTV up and running on my Linux box. As it turns out, the above combination is currently very problematic, and I figured I would go ahead and post how I got it running (at least until Lirc updates their code, and Gentoo fixes their packager) I am sure that there are other infrared controllers out there, and some people probably even make their own… but these directions are specific to the Hauppauge 2/350 (a very common setup for MythTV).

I have been at this some time, as you may have seen in an old entry about how to deal with the MPEG files I was getting. I had Myth up and running (and quite well, I might add, until I had a hard drive blow up on me. Took me months to get running the first time, and only about a week in my spare time the second time, so I guess I am getting better at it.

However, Lirc (Linux Infra Red Controller, the remote control software) is currently not as ready to go as the rest of the package. (Apparently, it used to be just fine, and has only been broken recently, as most of the tutorials I read simply said emerge lirc and then went on to the next subject, like it would work automagically.)

Well, it doesn’t. We’ll go over the problems one by one, and how to solve them.

NOTE: The following procedures are NOT SAFE. They involve intentionally installing unstable, buggy software. The following procedure worked for me. If you follow these steps, and your computer explodes, takes up drinking and smoking, or runs away with your wife, it’s not my problem. You have been warned.

Problem 1: Lirc has a faulty pre-requisite, which has been hard masked by Gentoo

Seems as though the current version of Lirc must compile a kernel module, which demands write access to the kernel module directories, which portage does not normally have. The solution to this is a package called config-kernel, which unfortunately, has been hard masked due to instability, and there is even a note from it’s creator that it needs to be removed altogether. That’s the bad news. The good news is that if you FORCE portage to install it, it works, uh, well, good enough. It’ll crash, but it will accomplish the task you need first. So here are the two steps to force it to install. (Yes, I know there are safer ways to do this, but all the safe methods listed at Gentoo.org just didn’t seem to work for me.)

First, open /usr/portage/profiles/package.mask in your editor of choice.

Find the lines:

# <latexer@gentoo.org> (11 Oct 2004)
# Broken, soon to be removed pending reworking.
sys-kernel/config-kernel

And comment out that last line (put a # in front of it).

If you do not find them, quit your editor, do an emerge sync, and look again. If you still don’t find it, maybe they have fixed the problem, and this guide is out of date.

Once that file is edited (be careful anytime you emerge sync to update your package listing, it will change back) you should be able to

emerge config-kernel

Once that is done, you need to issue the following command:

config-kernel --allow-writable yes

For those of you who are wondering… yes, the config-kernel app just crashed. However, it did what you needed it to before it wiped out.

Again with the warnings. This is a security risk. Don’t leave your kernel this way. Yes, there is a safer way to do this which involves re-compiling your kernel. Recompiling is not that big of a deal, but recompiling after I set options using an app that just crashed on me, worries me a bit. So I did it this way.

Now you should be able to

emerge lirc
without further incident. It merges version 0.7.0-pre7 as of this writing. That version can be made to work.

If I were you, I would immediately undo all the stuff I did to make that work. Namely:

config-kernel --allow-writable no
emerge unmerge config-kernel

Problem 2: The Portage package for lirc is not quite right

The biggest problem is that it doesn’t point to the right device after it is all installed.

Go check these files, and make sure they look right.

/etc/conf.d/lircd

# Options to pass to the lircd process
LIRCD_OPTS="-d /dev/lirc/0"

/etc/lircd.conf from the ivtv package… utils/lircd-g.conf

# this config file was automatically generated
# using lirc-0.6.6(animax) on Tue Apr 15 19:50:27 2003
#
# contributed by 
#
# brand:                                Hauppauge
# model no. of remote control: 
# devices being controlled by this remote: PVR 2/350
#

begin remote

  name  hauppauge_pvr
  bits           13
  flags RC5|CONST_LENGTH
  eps            30
  aeps          100

  one           969   811
  zero          969   811
  plead        1097
  gap          114605
  toggle_bit      2


      begin codes
          Power                    0x00000000000017FD
          Go                       0x00000000000017FB
          1                        0x00000000000017C1
          2                        0x00000000000017C2
          3                        0x00000000000017C3
          4                        0x00000000000017C4
          5                        0x00000000000017C5
          6                        0x00000000000017C6
          7                        0x00000000000017C7
          8                        0x00000000000017C8
          9                        0x00000000000017C9
          Back/Exit                0x00000000000017DF
          0                        0x00000000000017C0
          Menu                     0x00000000000017CD
          Red                      0x00000000000017CB
          Green                    0x00000000000017EE
          Yellow                   0x00000000000017F8
          Blue                     0x00000000000017E9
          Ch+                      0x00000000000017E0
          Ch-                      0x00000000000017E1
          Vol-                     0x00000000000017D1
          Vol+                     0x00000000000017D0
          Ok                       0x00000000000017E5
          Mute                     0x00000000000017CF
          Blank                    0x00000000000017CC
          Full                     0x00000000000017FC
          Rewind                   0x00000000000017F2
          Play                     0x00000000000017F5
          Forward                  0x00000000000017F4
          Record                   0x00000000000017F7
          Stop                     0x00000000000017F6
          Pause                    0x00000000000017F0
          Replay                   0x00000000000017E4
          Skip                     0x00000000000017DE
      end codes

end remote

~/.lircrc AND ~/.mythtv/lircrc (No I didn’t both to figure out which one it was reading… once I got it working I just started playing. If I were guessing, though… it’s using the first one.) This is a sample setup, and the syntax is pretty clear… feel free to customize as you see fit. I got this file from the Gentoo Wiki.

begin
    prog = irxevent
    button = OK
    repeat = 3
    config = Key M CurrentWindow
end
begin 
    prog = irxevent
    button = CH+
    repeat = 3
    config = Key Up CurrentWindow
end
begin
    prog = irxevent
    button = CH-
    repeat = 3
    config = Key Down CurrentWindow
end
begin
    prog = irxevent
    button = MENU
    repeat = 3
    config = Key Return CurrentWindow
end
begin
    prog = irxevent
    button = RECORD
    repeat = 3
    config = Key Return CurrentWindow
end
begin
    prog = irxevent
    button = RED
    repeat = 3
    config = Key X CurrentWindow
end
begin
    prog = irxevent
    button = GREEN
    repeat = 3
    config = Key I CurrentWindow
end
begin
    prog = irxevent
    button = YELLOW
    repeat = 3
    config = Key bracketleft CurrentWindow
end
begin
    prog = irxevent
    button = BLUE
    repeat = 3
    config = Key bracketright CurrentWindow
end
begin
    prog = irxevent
    button = BLANK
    repeat = 3
    config = Key D CurrentWindow
end
begin
    prog = irxevent
    button = VOL-
    repeat = 3
    config = Key Left CurrentWindow
end
begin
    prog = irxevent
    button = REV
    repeat = 3
    config = Key Left CurrentWindow
end
begin
    prog = irxevent
    button = PLAY
    repeat = 3
    config = Key P CurrentWindow
end
begin
    prog = irxevent
    button = MUTE
    repeat = 3
    config = Key backslash CurrentWindow
end
begin
    prog = irxevent
    button = VOL+
    repeat = 3
    config = Key Right CurrentWindow
end
begin
    prog = irxevent
    button = FFW
    repeat = 3
    config = Key Right CurrentWindow
end
begin
    prog = irxevent
    button = BACK/EXIT
    repeat = 3
    config = Key Escape CurrentWindow
end
begin
    prog = irxevent
    button = FULL
    repeat = 3
    config = Key Escape CurrentWindow
end
begin
    prog = irxevent
    button = PAUSE
    repeat = 3
    config = Key P CurrentWindow
end
begin
    prog = irxevent
    button = 0
    config = Key 0 CurrentWindow
end
begin
    prog = irxevent
    button = 1
    config = Key 1 CurrentWindow
end
begin
    prog = irxevent
    button = 2
    config = Key 2 CurrentWindow
end
begin
    prog = irxevent
    button = 3
    config = Key 3 CurrentWindow
end
begin
    prog = irxevent
    button = 4
    config = Key 4 CurrentWindow
end
begin
    prog = irxevent
    button = 5
    config = Key 5 CurrentWindow
end
begin
    prog = irxevent
    button = 6
    config = Key 6 CurrentWindow
end
begin
    prog = irxevent
    button = 7
    config = Key 7 CurrentWindow
end
begin
    prog = irxevent
    button = 8
    config = Key 8 CurrentWindow
end
begin
    prog = irxevent
    button = 9
    config = Key 9 CurrentWindow
end

Final checklist… make sure that you have the lirc_i2c module listed in /etc/modules.autoload.d/kernel-2.6 and make sure that it is BELOW ivtv. Also make sure that /etc/modules.d/ivtv contains the lines:

alias char-major-61 lirc_i2c
add above ivtv lirc_dev lirc_i2c

Now, are you still reading this? All caught up? Now, reboot. I know, I know, linux folks hate rebooting, but the fact is, if you have been playing with lirc to get it working, it’s hopelessly screwed up in RAM. It’ll be faster to start over.

Once that’s done, from a terminal window, do the following:

/etc/init.d/lircd start
irxevent &
mythfrontend

And try out your remote. Should be working at this point. If it is, you can set all this stuff to happen automatically at startup by using rc-update and editing your .xsession appropriately.

Now Playing:When We Dance” by Sting from the album …All This Time

Happy Thanksgiving

Just a note wishing all two of you that read this a happy Thanksgiving.

We’ve all got a lot to be thankful for, and a lot of us, myself included, are not really all that great at recognizing that throughout the year.

And on an extremely trivial note: The song linked under this entry is free on the iTunes music store until Tuesday. It’s probably the best free track I have heard Apple feature. This might actually be the song that gets me to go buy something there. :-) (or maybe not, it’s the only song they have by her, at least for now)

It’s kind of a cross between Nora Jones and Fiona Apple. At least those were the two I thought of when I heard it. Four stars, Joe Bob says check it out. (Does anyone even get that reference anymore? /sigh)

Now Playing:Breathe (2AM)” by Anna Nalick from the album Breathe (2AM) - Single

And today’s winner…

For “Video Game in the Worst Possible Taste” award goes to:

These people.

There’s going to be a particularly hot spot in Hell, just for them.

Click fast! This won’t last long!

I’m sure that this is a typo, but I don’t have any idea what it was SUPPOSED to say.

Now Playing:Uninvited” by Alanis Morissette

Well, the days of my youth are over.

<grin>

After two weeks of nearly continuous headaches… I was finally convinced I needed to go to the doctor, rather than continue to pop ibuprofen. Given what I do for a living (computer programmer), I figured an eye doctor was a good bet to eliminate the headaches.

For better or for worse, I was right. Turns out my vision pretty much blows. I always thought it was fine. The doctor disagreed. So now some factory somewhere (probably populated with the mystical, magical “lens gnomes”) is producing a pair of glasses for me. Bah.

And I am sure almost everyone who reads this knows, but DAMN, glasses are expensive. and let’s just say that the vision benefit (yes, there is only one) supplied to me by my employer blows chunks.

So, the next time anyone sees me (after Thanksgiving) I’ll probably be wearing my new faithful companions… feel free to tell me they make me look smarter.

(The links below should actually work, now, BTW… if they don’t, let me know. They should trigger a search in the iTunes music store. If you are planning to buy a song from Apple, I’d appreciate it if you clicked below. They’ll give me a nickel :-) I do, however realize that a lot of my songs are not in the iTunes music store, there’s nothing I can do about that. It’ll just trigger a search that returns no results.)

Now Playing:Downtime” by Jo Dee Messina from the album Burn

My first post with a registered ecto

So I finally got around to registering ecto. I don’t know that I feel better about myself or anything, but it’s a good product, and it wasn’t expensive. The other thing that got added today is that my iTunes links at the bottom of posts, which I had stopped doing, but will now try again, actually trigger searches on the iTMS. We’ll see if this works when I submit this post. As a final note? Does anyone actually still read this? I need to come up with something interesting to post :-) Any suggestions?

Now Playing:I Deserve It” by Madonna from the album Music

Recent History Question

I’m going to write this little article intentionally without Googling all my facts. For a variety of reasons… one, I can’t think of search terms that won’t give me a lot of crap, and two, I had the initial discussion without Googling, and it’s all about perception.

So I was having a discussion the other day, about the fact that the casualties in Falluja have surpassed those that were incurred taking over Baghdad. I expressed some surprise that should be the case. I expressed some dismay that the casualties had continued to accumulate (and even accelerate) since the operations in Iraq had been declared â??over.â?

â??The President never said it was over.â? Came the response.

â??He didn’t? He didn’t say that ‘the era of major operations in Iraq is over’? I could have sworn that was an exact quote.â?

(To be fair, I am recapping the discussion from memory, and I am almost certainly misrepresenting the other side of the conversation, my apologies)

â??No, that quote has been misrepresented in the press, and the hundreds of times where he expresses that more casualties are coming have gone unreported.â?

â??Well, that is certainly true, I have never heard the White House say that the American public should expect more casualties.â?

The conversation continued along many fronts… has Bush gotten a fair shake from the media? Did he ever say it was over? Was my expectation that casualties would decrease (not disappear) following that declaration unrealistic? Was that statement reported out of context? Would a statement such as the following have been reported more accurately by the media (and would it have set expectations among the public to a more realistic level?

â??The era of major operations in Iraq is done. This does not mean there is not a long road in front of us. This does not mean that servicemen will be coming home in 6 months. Nor does it mean that American lives are no longer at risk. This task will still take American effort, and American blood. The end result, I believe is worth it, as we will make the world a safer place, not only for Americans, but all human beings.â?

EDIT: I wrote the above, with the intention of being much more explicit, much more media spin-proof, and much less likely to inspire unrealistic expectations among the public. (end edit)

The reaction I got to that statement was â??That WAS what he said.â? I don’t recall ever being told that the lives that have been lost were worth it.

So my question to you is… was that what he said? Was that what you heard? Has the government done what it could to manage expectations appropriately?

If you post a comment, great. If you answer in your own blog, post a link. Or if you just want to drop me a line, feel free.

Skype is Cool

For those that don’t know, Skype is teleconferencing software (voice chat) from the same guys that invented Kazaa. It’s good. It’s really, really good. And it’s free.

I know some of you have done internet chat before, and had the same problems everyone did. Quality sucked. Lag was bad. Anytime two people spoke at once, the whole system broke down. It ate up all your bandwidth. It ate up all your processor. It only worked on certain machines, with certain headsets, and was difficult to set up.

I’ve been there, and I know all those things were true.

Not any longer. Skype sounds terrific. Lag is almost non-existent. It is fully â??full duplexâ? (meaning you can both talk at once). I didn’t have a bandwidth meter, but it seemed happy even though I had a pretty mediocre wireless connection downstairs. It used (complete with the rest of the OS) less than 40% of my processor. Skype runs on OS X, Windows, and Linux. In my small sample, it has worked with every microphone or headphones I have tried it with. And it’s a total breeze to set up.

Did I mention that it’s free?

OK, the question you should be asking (at least, the question I was asking) is â??Great, but why are these guys doing this for free?â? Well, if you want, you can call a real telephone from Skype. If you do that however, you have to buy minutes. Their rates are very competitive with international long distance. But all computer to computer communication is totally without charge. Sans fees.

My complete Skype buddy list is currently… one person. If you want to try it out, feel free to give me a call at ender3mc. (It works like an IM client… you have a handle, rather than a phone number) I’ll try to remember to turn it on at night, but you might want to drop me a line or leave a comment if you want me to add you to my list. I won’t have it on during the day, as I don’t want to have Skype on while at work.

Hope I have convinced someone to try it out.

OK, it’s official. The Cowboys suck.

For all two of you who still had any doubt, the final ballots have been counted (from some suburban municipalities in Ohio) and by a 78-21 margin, the Dallas Cowboys have been deemed to suck (1 % voted for Ralph Nader)

It’s only halftime, and the Philadelphia Eagles have done something that no other team in the 45 year history of the Dallas Cowboys have done. They scored 4 touchdowns in a single quarter (the second). It was, pretty much without a doubt, the worst quarter of professional football I have ever seen.

Parcells is right, this team is stupid. Too stupid to be playing a complex sport like football. Maybe they should try checkers.

I have a couple of other things to mention, but I’ll put them in separate entries to keep it organized.

Quick thoughts…

Just some random stuff…

Do the liberty Mutual commercials where the contractor calls before the accident has happened bother anyone? They seem to subtlely sending the wrong message. I’m reading far too much into a silly commercial, but they really leave me with a bad impression of Liberty Mutual.

â??You should never attach a possum to your bosom.â?
– George Dunham

I have gotten the feeling from some e-mails and comments that more people are reading this blog somewhat regularly than I know about… I think I am feeling shy. :-)

Oh, I have the Carlsbad Caverns shots done. There’s only one issue. Has anyone ever seen a cave with full lighting? All the stalactites and stalagmites look like, well, there’s not nice way to say it… snot. I think the pictures are quite cool, but they do have a significant gross out factor. And there’s always the technical issues behind taking a picture in the dark. Some turned out quite nicely, though.

The NHL canceled their All-Star game today. That’s all the way out in February. Not a good sign that we’ll see hockey again anytime soon.

Macromedia announced at their MAX conference about the ability to play back Flash content on your cell phone. My phone is supposedly capable. I’ll post a triumphant message if I ever get it working.

I honestly believe that the pattern that the networks had of â??callingâ? states for one candidate or the other had nothing to do with bias. Either pro-Kerry or pro-Bush. It did however, serve to maximize their own ratings. They wanted to call states first, so that you felt like you were getting news, but when it came to the important states, they didn’t call, even after the result was obvious, in order to maintain suspense. Florida, Pennsylvania, and Ohio were all decided LONG before any of the networks would admit to it. Of the three, Ohio was the only one I would consider â??closeâ? and many, many states that were closer than Ohio had been â??calledâ? much earlier in the evening. I prepared a longer entry on this subject, but it ended up overly mathematical, and I figured everyone would be bored.

However, hats of to John Kerry for knowing when to throw in the towel, and not subjecting the country to a month long temper tantrum, ala petulant child Al Gore.

Next »