Tuesday, September 30, 2008

Monday

Pretty uneventful day. Fixed some bugs. Wasn't feeling too well.

Updated my Ubuntu laptop and worked on getting Kaffeine3 to build. Kaffeine4 is working fine, but I wanted to get the older version loaded so I could do some tuner profiling.

Did a bit more power analysis on the Pinnacle 801e tonight. Found out that the xc5000 tuner wasn't being put to sleep when disconnecting from the frontend. With the fix I put together idle power consumption dropped from 325 ma down to 124 ma. So now it looks like the analog decoder, the digital demodulator, and the tuner are all being properly powered down. The only thing remaining is the USB bridge. I sent Patrick some email tonight asking if he knew how the dib0700 power management registers work (the Pinnacle Windows driver does not appear to ever use it).

Watched a couple more episodes from season one of the West Wing.

Monday, September 29, 2008

Monday

My patch fixing the Pinnacle 801e regression didn't get merged yet, although mkrufky has ack'd it.

He also reproduced my problem with the xc5000 XREG_BUSY register using an HVR-950q. So that confirms that it had nothing to do with the dib0700 i2c bus. I submitted a cleanup patch for review that removes the offending logic and refactors the i2c handling routines. It's a bit bigger than I would like, so I might end up having to break it into smaller parts. But it does catch some edge cases previously missed and should make it easier to debug i2c issues in the future.

Victoria is sick. :-(

Tomorrow night after House I'll see about mapping out the rest of the GPIOs, since I will need to know where the s5h1411's reset and sleep pins are if I'm going to do analog support. It's a BGA, so this might be a bit tricky. I guess maybe I can pull the GPIOs low one-by-one and see when the s5h1411 stops responding.

Sunday, September 28, 2008

Pinnacle 801e Users: don't update yet!

Tested out the merged version of my Pinnacle 801e support (it went in to the v4l-dvb mainline this morning). It turns out a regression got introduced after my commit which causes the driver to panic the kernel.

I have submitted a patch to fix the issue. In the meantime, stick with the patch I provided in the earlier post and *don't* update to the latest v4l-dvb.

Thanks,

Devin

Washington D.C.

A few days ago, Victoria told me that this weekend we were going to do something fun and that it was going to be a surprise. She told me to bring a bathing suit, a pair of earplugs, and the underwater digital camera. Since it's September, I was a bit confused.

So we got into the car yesterday, and she started driving. We ended up in Washington D.C. The bathing suit and earplugs were just to throw me off.

On Saturday we had lunch at the Smithsonian National Museum of the American Indian (where they had vegetarian options), and then we spent the rest of the afternoon at the Smithsonian Air and Space Museum. Pictures will be posted this week. It was interesting because there was huge exhibit about the Soviet space program (covering it's progress and individuals like Chief Designer Sergey Korolyov). I had not been there since the mid 1980's while the Cold War was still going on, and at that time there had been no mention of the Soviet program that I can recall (most information was not declassified until after the collapse of the Soviet Union).

Today we walked around the Mall, Washington Monument, Lincoln Memorial, etc. It was a cloudy day, but as a result it also wasn't too hot.

Got back to New York this evening. My Linux-DVB patches got merged to the mainline in this morning, so I have to do a bit of testing tonight to make sure nothing was broken.

8967: http://linuxtv.org/hg/v4l-dvb/rev/dfcc941e4780
9039: http://linuxtv.org/hg/v4l-dvb/rev/5cf71b4a492b
9044: http://linuxtv.org/hg/v4l-dvb/rev/a79b809b763a
9045: http://linuxtv.org/hg/v4l-dvb/rev/b01e40350e0a
9046: http://linuxtv.org/hg/v4l-dvb/rev/2fb28c7f0dfb

Wednesday, September 24, 2008

Perspective

I woke up this morning and continued to be bothered about the board killing my ventilation initiative last night. I had spent hours analyzing the problem, researching, and coming up with possible courses of action. People have complained repeatedly about the issue at the last two shareholder meetings. To see it unanimously killed in sixty seconds seemed unjust - as though the board was out-of-touch with the problems that bothered people. They said "It's not a priority."

I ran into the building's managing agent in the lobby on my way out the door this morning, and he said to me "So now you can see the hard decisions that have to be made by a board." I asked him which decision he was referring to, and he started talking about two decisions made last night regarding people's mortgages and lines of credit. He shared an anecdote about a shareholder in another building whose apartment was in foreclosure and the board had to deny the sale to his perspective buyer.

Kind of puts things in perspective. While the logistical problems with the building are important to me, it doesn't compare to the financial issues that can affect the livelihood of the residents.

On the other hand, if the board doesn't care about the mechanical issues, and I don't know anything about finance, then perhaps I don't have anything to offer and don't belong there at all.

Tuesday, September 23, 2008

Discouraged

Went to my building's board meeting tonight. Basically came to the conclusion that the board doesn't care about the issues I care about. They've decided to not invest any of the building staff's time in continuing my investigation into the ventilation problems. I can't do the work myself because of the insurance issues, and despite the many complaints of the other shareholders, getting to the bottom of the issue just isn't a priority.

I've still got four patches pending against three different v4l-dvb trees. It's kind of frustrating since we're going on week three and there hasn't been so much as an acknowledgment as to when they will be merged. I can't do the xc5000 cleanup because the latest version of xc5000.c is in trunk and the Pinnacle 801e changes are still in the ~pb/v4l-dvb branch (and that's the only xc5000 device I have).

Added support to Kaffeine4 for the ATSC major/minor channel numbers. Also got the content scrambling flag to be read. I'm still not cleared to commit changes directly to svn though so I'm going to have to deal with the queue of changes building up while Christoph is on vacation for the next two weeks.

I discovered that most of the core functionality from Phonon that is needed for things like audio wasn't incorporated until QT 4.5, so there is basically no way to do a release of Kaffeine4 for the upcoming Ubuntu 8.10 release.

Oh, and my insomnia is back.

Monday, September 22, 2008

Pinnacle i2c

Didn't get home from work until after 8pm. :-(

In an effort to isolate the last remaining problem with my Pinnacle 801e, I went probing around for the i2c bus. It turns up the dib0700 has two separate i2c busses, one for the EEPROM, and one for the demodulator, so I couldn't just hook onto the eeprom as Steven Toth had suggested. From the CX25843 datasheet, I located the i2c pins (15/16) and used a meter to poke around the rest of the board to find somewhere easier to latch onto.

0.5mm is pretty damn small. It's especially annoying when you're trying to hold a probe against a pin on one side of the PCB while probing around the reverse side.

Found a pair of resistors near the s5h1411 where they're brought out. So now I just need to build a cheapi2c device and find someone with an iron that can do SMT. I've said this before, I miss not having a hardware lab. :-)

Assuming I can get that working, I should be able to determine pretty quickly whether the xc5000 is at fault or if it's the dib0700 not sending the right request.

Sunday, September 21, 2008

Small World

Spent the weekend in Philadelphia. Victoria, her friend Amanda, and I spent most of Saturday in the UPenn Veterinary ER. They found a stray cat that was really sick. As it turns out, the cat appears to only have been starving. As a pleasant outcome, the couple that found the cat with Amanda took it in when we came back from the hospital.

Victoria has been working at the Cooper Cancer Hospital. She called me tonight to tell me that she had to login to their system remotely to access some files. She was wondering if the name of the company I last worked at was in fact "AEP Networks" because she was using something called the "AEP Netilla Thin Client" to access the records.

She also pointed out that the Mac support doesn't work very well. :-)

I'm looking at my the todo list I wrote down last Sunday, and it would appear I didn't get a whole lot done this week.
  • Patch for Pinnacle 801e support for "Non-Pro" version
  • Get Kaffeine TODO list into source control
  • xc5000 i2c cleanup work
  • Identify AMD 600 thermal problem
  • Investigate tvp5150 sleep hook
  • Map out HVR-950 GPIOs so I can put the device to sleep properly
  • Look into A52 audio "Conversation level" field
  • Add major/minor channel numbers to Kaffeine4 ATSC scan results
Ok, looking at the list again, I guess I did get some stuff done...

Friday, September 19, 2008

Accusations

We're having a vote to see what the codename should be for the next product release at work (using Dan's homegrown voting system).

I just got the following rather entertaining IM:

(5:35:22 PM) Dan Cohen: Did you hack my voting file?!!!
(5:35:28 PM) devinheitmueller: pardon?
(5:36:02 PM) Dan Cohen: there is not that many people it could be, and based on what was done, I am guessing it was you......
(5:36:07 PM) devinheitmueller: I'm a little offended you would point the finger at me...
(5:36:41 PM) devinheitmueller: Besides, you closed the security hole I thought.
(5:37:13 PM) Dan Cohen: not the "log into empire as root and edit the file" security hole
(5:37:20 PM) devinheitmueller: I don't have root.
(5:37:31 PM) devinheitmueller: In fact, I don't think I have an account on that system at all.
(5:37:49 PM) Dan Cohen: Hmm, and it isn't empire anyway, it is the rt box, so I don't think it could have been you
(5:37:52 PM) Dan Cohen: interesting
(5:37:57 PM) devinheitmueller: indeed.

International Talk Like A Pirate Day

Now, nobody forget that today is International Talk Like A Pirate Day!

http://talklikeapirate.com/

Rrrrrr!!!

Tuesday, September 16, 2008

Tuesday

  • I missed another half a day of work for AC repair.
  • My Ubuntu PC is screwed up. KNotify keeps crashing. I think I need to rebuild it.
  • My air conditioner *still* doesn't work.
  • Wireless works on my MacBook running Ubuntu after all.
  • The new season of House started tonight (yay!)

Monday, September 15, 2008

AMD 600 thermal problem - solved

Finally got around to looking into the AMD 600 thermal problem Ronnie reported. It turns up the device has an XC3028L and *not* an XC3028. So it required different firmware.

Tweaked the code to use the right firmware and like magic no more thermal problem. The device also draws about 40 ma less power.

Will put together a patch to send the v4l-dvb mailing list. Would be good to see if I can get this in for 2.6.27 since it's a pretty serious bug.

Weekend

Had a busy weekend. Victoria came out to the City on Friday night. On Saturday, she visited some friends while I built my cable to measure USB power consumption (see previous post). On Sunday, we went to the Guggenheim, walked along the Park down to 55th street, and had fondue au fromage from La Bonne Soupe for a late lunch. Walked home from there, since it was such a nice day.

After Victoria left, met up with Carter and saw "Mirrors". In retrospect, I could have waited until it came out on Netflix. The highlight was where they panned the camera before he walked into the haunted department store, and I realized he was standing on 6th Avenue at 18 street (a block from my office). I knew going to that Bed Bath and Beyond was a bad idea....

Saturday, September 13, 2008

Tuner power consumption

Tired of using a meat thermometer to look for power problems, I borrowed Brendan's meter, cut up a USB cable, and built a rig to measure USB power consumption (my meter died and my old man's is MIA somewhere in a New Jersey basement). A 6" USB extension cable, a couple of banana connectors, some hookup wire, and viola!



Amazing though how your whole afternoon can get screwed up by a lack of 2 inches of heat shrink tubing. I had to run around Manhattan because it turns up I ran out and didn't realize it.

It's all working now. Some observations:
  • My Pinnacle PCTV HD Pro 801e consumes about 120ma at idle, and goes to 320 at digital capture.
  • The power consumption doesn't fall back to 120ma after I stop capture (suggesting the device is not being put back to sleep properly)
  • My Pinnacle PCTV HD Pro using em28xx consume 520ma both at idle and at capture. That's not good and suggests I might have both the lgdt3303 demodulator and the tvp5150 enabled at the same time.
Now that I have the rig setup, I should be able to quantitatively compare the devices at capture versus idle for both analog and digital, as well as comparing Linux versus Windows. Pretty cool.

Thursday, September 11, 2008

Boot Camp woes

So I picked up my own copy of Leopard last night so I could BootCamp my Macbook, I downloaded the latest Alpha release of Ubuntu Intrepid Ibex over BitTorrent this morning, and I repartitioned my drive.

Then I went to burn the ISO and found out I have two spindles of DVD-R discs, half a dozen 650MB CD-R discs, and zero 700MB CD-R discs. The Ubuntu ISO is 696MB.

Doh.

Wednesday, September 10, 2008

Automated News Crawling Evaporates $1.14B

All I could say after reading was, "Holy Shit."

http://online.wsj.com/article_print/SB122100794359017593.html
The stock market opened Monday with no drop in UAL shares, but the UAL story began circulating widely via a posting by research firm Income Securities Advisors Inc. that was made available to users of Bloomberg L.P., the financial-news service widely watched on Wall Street. Shortly after a headline from the outdated report flashed across Bloomberg screens at about 10:45 a.m., UAL shares began a precipitous drop. Over the next 15 minutes, before Nasdaq halted trading, they dropped as low as $3.
It took fifteen minutes to send the stock from 12 to 3.

Tax Returns: Sort of like Craps!

So for the first time in eight years, I decided to do my own taxes.

Last year, I watched the guy at H&R Block fumble around the keyboard for three hours. I could see his mind working:

Hmmm... Message box says, "Enter email address". Ok.

D... E... V... I... N...

Where is the "at" sign? Oh, there it is, above the "2".

I kept asking him what I would consider to be pretty routine tax questions, and he kept having to go ask somebody else. At one point the other person came over, at which point I realized the blind was being lead by the blind.
"Do I have to enter *every* one of these stock sales?"

"Oh, you don't have to do that. The IRS doesn't care. Just put the totals, and enter 'see attached', and include the report from the broker. I never do that for any of my clients, and I'm pretty sure none of them ever get audited. That will save you a whole bunch of time."
Shortcuts. I'm sure the IRS loves those.

Anyway, this year I downloaded TurboTax. Having not used tax preparation software since the 1990's, it was an interesting experience.

There's this box that's always on the screen that says "Your Refund" with the amount you're getting back in big green letters (or red if it's how much you owe). And the number changes as you're entering information. It's kind of nice in that you get an idea as to how different deductions affect the outcome.

But it's kind of feels like being in Atlantic City.
  1. You enter your W-2 data, and you get this *huge* green number. Wohoo, it's like you hit the Jackpot!
  2. Next you enter your dividends, and the number goes down a little. Ok, no big deal.
  3. Then you start entering your stock transactions, and you spend the next two hours watching the number trickle down to zero, and then it turns red and starts increasing again. Watching the red number get bigger and bigger is definitely not as fun as watching the number get bigger when it's green...
  4. You enter the mortgage interest and other deductions and the number starts to come back up towards zero. You're now at the point where you'll just be happy to break even.
  5. The night is over. You didn't lose as much as you thought you would. Now you can hit the free buffet (or in my case, eat a peanut butter and jelly sandwich).
Anyway. It's done. I just have to review the final documents, and compare them against last year to see if I have to file an amended return to unfuck what the guy from H&R block did. You know, little things, like how he didn't bother to ask if I had an IRA...

Monday, September 8, 2008

Plugging along...

Made my first commit to Kaffeine4 tonight:

http://websvn.kde.org/?view=rev&revision=858914

Also, pboettcher took the rest of my Pinnacle 801e changes without modification:

http://linuxtv.org/hg/~pb/v4l-dvb/rev/a79b809b763a
http://linuxtv.org/hg/~pb/v4l-dvb/rev/5cf71b4a492b

Now I just need Mauro to do an hg pull to v4l-dvb and it's done.

On a separate note, I had been using my em28xx HVR-950 for my Kaffeine4 ATSC scanning work. I tried my 801e in the same configuration, and wow is the tuning slow by comparison. I really should make the changes to Steven Toth's xc5000 driver to get rid of XREG_BUSY, since that's what's introducing the slowdown (every register write results in a 500ms delay). It would be great if I could get that in before the 2.6.28 window opens, so it gets merged at the same time as the rest of the 801e work.

Todo for this week:
  • Finish devinheitmueller.com domain transfer, cancel Yahoo hosting
  • Start looking at Kaffeine4 audio situation
  • Try to assemble a definitive list of work items for Kaffeine4
  • Cleanup xc5000 i2c code and submit to Steven
  • Figure out what I'm doing about building ventilation situation
  • Call Air conditioner people about coming out Friday, yet again
  • Clean apartment
  • Read the Phonon documentation
  • Buy my own copy of Leopard and Bootcamp my Macbook for Ubuntu

Sunday, September 7, 2008

Weekend

Spent the weekend in Philadelphia. On Saturday Victoria and I went to the Mutter Museum of Medical Oddities. Pretty disturbing stuff.

Today we spent the afternoon in Washington Square Park and played Scrabble.

Back in New York City tonight.

Patrick Boettcher accepted my i2c changes into his v4l branch and has submitted a pull request to Mauro. Tonight I sent the final set of changes that actually add support for the Pinnacle 801e (the i2c fix was separated out from the device support patch). If all goes well, this stuff will get into the mainline in the next few days.

Also submitted patch attempt #2 for the ATSC Extended Names support for Kaffeine. There were a few useful comments and a whole lot of what I will call "style issues". It's kind of annoying submitting to someone else's style, especially when the suggestions aren't really better and in fact contradict good practice learned in my years of doing protocol work.

For example, let's say there are ten possible values for a field. And let's assume that we implement support for two of those values, we explicitly don't add support for three values, and the other 5 are outright illegal. I believe it makes sense to break out the individual values, and for the ones that we don't support put a block indicating what each value means and that it's not supported (to make it easier for others to add it in the future). Further, if we hit illegal values, we should definitely log those. The point is I believe in making the code easy to extend and I think it's important to differentiate between things that are valid but we simply don't support and things that are outright invalid and should never appear.

His approach is to just have the three values we support, and drop everything else on the floor as "unknown".

Dumping Yahoo web hosting

So I logged in to my Yahoo! Geocities account a few days ago, and was shown this fine message:

Important Announcement

At the beginning of October 2008, to continue to provide you the best web hosting service possible, we will no longer offer GeoCities Pro. All GeoCities Pro customers will be moved to our more powerful Yahoo! Web Hosting Starter plan, with a new monthly fee of $12.95.

With this change, you will not experience any disruption in your service, and you'll also gain great features, including our easiest-to-use site building tool and 24-hour phone support. After you switch to Web Hosting, you'll simply sign in to your new Web Hosting Control Panel much like you signed in here today.

Well gee, that's awfully nice of you, taking the service that I'm perfectly happy with and giving me features I don't need and raising my price by 50% (I previously paid $8.95/month). What's the difference between what I have now and what I'm getting? Who the hell cares? I'm fine with the features I had and they're raising the price by 4 bucks a month.

So, I initiated a domain transfer through GoDaddy and Charles was kind enough to set me up with some space on his server (since I have about 10MB of content and average about 10 hits a month). That will change my $8.95/month to $6.99/year.

The transfer went through today, but Yahoo waited until the last minute to approve the transfer (the transfer takes place automatically after five days unless the previous registrar objects). To GoDaddy's credit, they did have a very well written document describing how to transfer from Yahoo, even walking you through Yahoo's user interface with the steps necessary to get the required information.

For those of you who might be asking "why the hell did you use Yahoo in the first place?", the answer is pretty simple. I had a Geocities page since 1998, and when I decided I wanted to own "devinheitmueller.com", I was lazy and just clicked the "Upgrade me to paid service" button on Yahoo's website (who had bought Geocities.com). That way I didn't have to deal with moving all the content over to a different host.

Tuesday, September 2, 2008

Kaffeine4 ATSC extended channel names

Now that the ATSC scanning support is basically working in Kaffeine4, it made sense to start looking at the proper representation of the "Extended Channel name". This is where you see "My Fox Simulcast" instead of "WWOR-DT1". A major component of this is supporting what are known as ATSC MultipleStringStructures. These are used for other functions as well, such as the program guide, so it's generally useful work.

The MultipleStringStructures supports several formats for encoding, including UTF-16. Great. Unfortunately most broadcasters, at least those in the New York area, decided to go with an obscure English-specific encoding that uses Huffman compression. This is especially annoying because that means I have reproduce both Huffman tables in my code and they've got 1099 values each.

I was really hoping that nobody would actually be using the Huffman compression in a 20Mb/s data stream, but I should have known better.

I've got everything working except the compression (so it works for broadcasters who aren't sending the values compressed). I'll get the rest working tomorrow...

Interesting. I just loaded up Elgato EyeTV, and at first glance it looks like they're only decoding the extended channel name for those channels that aren't using the compression. I guess they never included the Huffman tables themselves (an interesting thing to note for a commercial product). I wonder if that means the program guide typically doesn't use the Huffman tables either (or else they would have been forced to include them).

Update: It looks like MythTV already has the code (it's GPL'd and even returns a QString!)

http://www.cuymedia.net/mythtv-0.21/atsc__huffman_8h-source.html

I have brought dishonor to my family's good name...

So I received commit rights to the KDE svn repository last night so I can work on Kaffeine4. When talking to the maintainer about getting commit rights, I said the following in email:

Certainly I would rather work towards committing to the main repository, but I realize that usually takes some time to establish trust that I won't screw up the codebase.

Realizing that although I had commit rights I would continue to submit patches until the maintainer said it was OK to start making use of my commit rights, I started off by submitting this simple patch for something I noticed while debugging an unrelated issue:

--- dvbtab.cpp (revision 856017)
+++ dvbtab.cpp (working copy)
@@ -110,7 +110,8 @@

DvbTab::~DvbTab()
{
- delete dvbStream;
+ if (dvbStream != NULL)
+ delete dvbStream;
}

void DvbTab::configureChannels()
@@ -142,8 +143,10 @@

manager->getMediaWidget()->stop();

- delete dvbStream;
- dvbStream = NULL;
+ if (dvbStream != NULL) {
+ delete dvbStream;
+ dvbStream = NULL;
+ }

if ((liveDevice == NULL) || (liveChannel->source != channel->source)) {
if (liveDevice != NULL) {


Pretty straightfoward? I'm checking that dvbStream isn't NULL before doing the delete. Except, as the maintainer politely pointed out, this is perfectly valid according to the C++ standard. In fact, it's even in the C++ FAQ:

From http://www.faqs.org/faqs/C++-faq/part6/

[16.7] Do I need to check for NULL before delete p?

No!

The C++ language guarantees that delete p will do nothing if p is equal to
NULL. Since you might get the test backwards, and since most testing
methodologies force you to explicitly test every branch point, you should not
put in the redundant if test.

Wrong:

if (p != NULL)
delete p;

Right:

delete p;

Wow. Do I feel like a moron. I knew that gcc wouldn't have an issue if you fed NULL to delete, but I had assumed it was a gcc'ism and other compilers might choke.

Now I consider myself "reasonably technical" when it comes to C/C++, since it's been my full time job for the last ten years. I've contributed to around a dozen different open source projects, wrote a couple of hundred thousand lines of code, and yet I made this rookie mistake and managed to make myself look like an idiot within an hour of being granted svn commit rights to a project.

I hang my head in shame.

Note to self: When I get home tonight, read the C++ FAQ. There looks like there is some good stuff there...

Update: Dan also thought it was illegal to delete NULL. I guess that make me feel a little better.

Monday, September 1, 2008

Labor Day Weekend

Had a three day weekend. Here's the roundup:

Friday night in Philly to meet Victoria.
Saturday morning, we drove to New Jersey
Saturday afternoon with Lauren/Greg/Amelia
Saturday evening with Jen/Jon/Jayden/Suzy
Sunday morning breakfast with Richie/Aggie/Marc/Bonnie/Chrissy/Grandma
Sunday morning with Grandma
Sunday afternoon with Mom
Sunday evening with Victoria's family
Monday morning fixed Victoria's Aunt's computer
Monday afternoon back here in New York City.

TODO for tonight:
  • Get caught up on email
  • Create final i2c dib0700 patch to send to Patrick Boettcher for commit
  • Test to see if Ubuntu actually did fix their ALSA build system
  • Apply for a KDE SVN account
  • Start work for ATSC extended names support for Kaffeine4
  • Eat ice cream