Wednesday, August 27, 2008

Wednesday

Put some instructions up for people wanting to try out the Pinnacle driver work without having to wait for the commit (see previous post).

More Kaffeine4 work tonight. Sent Christoph the info he asked for to debug the errors I saw with ATSC scanning. Then I just went ahead and isolated the problem and submitted a patch (the code wasn't checking the Transport Error Indicator field).

Also got a better understanding how the parser works. It turns up it looks like crap because it's generated output based on an XML file. A banner at the top of the file making clear it was generated source could have avoided some confusion.

Started looking at how to get the Extended Channel name working, and sent a request to get some additional files checked in that are missing from source control.

Pinnacle 801e support for those who can't wait for the merge

Update (11-08-2008): Please DO NOT FOLLOW THE STEPS HERE. The changes have been merged into the v4l-dvb codebase (including the fix for the thermal bug). Please go to this site for updated instructions:

http://www.linuxtv.org/wiki/index.php/Pinnacle_PCTV_HD_Pro_Stick_(801e)

Thanks,

Devin
====

I got a couple of comments from people who would like to try out the new Pinnacle PCTV HD 801e support. The changes basically fall into two categories:

* Fixes for the dib0700 i2c code so the xc5000 works
* A device profile for the Pinnacle 801e

The dib0700 i2c fixes affect all devices, so a patch providing these fixes has been sent out for review. Because we don't want to break any existing devices, we couldn't just check it all in. Once those are verified by other maintainers, the plan is to then check in the 801e support.

For those of you who "just want it to work and don't want to wait" for it to be merged, you can get your device to work by downloading the following patch and applying it to the latest v4l-dvb hg.

Here's what you have to do. This assumes you have at some point you have built the v4l-dvb codebase and are confident that you have the kernel headers installed and the other v4l-dvb build prerequisites have been met.

hg clone http://linuxtv.org/hg/v4l-dvb
cd v4l-dvb
wget http://devinheitmueller.com/801e/pinnacle_801e_support.patch
patch -p1 < pinnacle_801e_support.patch
make
wget http://devinheitmueller.com/801e/dvb-usb-dib0700-1.20.fw
wget http://www.steventoth.net/linux/xc5000/HVR-12x0-14x0-17x0_1_25_25271_WHQL.zip
wget http://www.steventoth.net/linux/xc5000/extract.sh
sh extract.sh
make install
cp dvb-fe-xc5000-1.1.fw /lib/firmware
cp dvb-usb-dib0700-1.20.fw /lib/firmware

Then reboot. These instructions were tested on Ubuntu 8.04, building as root. If you're not comfortable with that, run the last three commands with "sudo" in front of them.

If the above steps look too complicated, wait a week or two and it will hopefully be in the main repository by then.

Now for the disclaimers:

  • No guarantees or warranties that the code will work
  • Don't hold me responsible if your PC, Pinnacle tuner, our house catch on fire.
  • This is not a final patch, and the i2c code in particular could potentially interfere with other dib0700 devices (if you have any)
  • There is no analog support yet.
  • Tuning is a little slower than I would like (less than one second but still...). I'm working on this.

Have fun. If you have problems, feel free to comment on this post.

Also, I would be interested to know if the Pinnacle PCTV USB that is not the "Pro" edition also has an 801e USB ID (since I'm using the "Pro"). If any of you have one, let me know.

Tuesday, August 26, 2008

Kaffeine for KDE4

The author of the KDE4 port for Kaffeine asked me to do some testing on the ATSC scanning support (they don't use ATSC in Europe). While it took me a couple of weeks to find the cycles, I finally got KDE4 and the dev environment setup, I built the new version of Kaffeine from source, and what do I find?

My entire ATSC PSIP and scanning implementation from Kaffeine 0.8.7 got scrapped and rewritten from scratch.

Now, I'm a big fan of refactoring, and I recognize that there were a couple of code reuse issues because I wasn't familiarized with the DVB code in Kaffeine. But scrap the entire implementation?

Worse, I took a look at the actual code, and it doesn't excite me. The parser extracts data from arbitrary offsets, it extracts the bare minimum of information required to "work", and apparently the notion of constants is nowhere to be found.

I love little gems like this:

length = (((at(30) & 0x3) << 8) | at(31)) + 32;

Or this:

bool isHidden() const
{
return ((at(26) & 0x10) != 0);
}


Do you know what "26" is? Or why it's being anded with 0x10?

The parser in 0.8.7 at least made a point to document to death where the stuff came from. The parsing was annotated with comments like "// See ATSC A/65C Sec 6.3.1 Table 6.7" so you knew exactly where to look in the spec.

I guess it's a bit hard not to take it personally since I invested a good bit of time in it. Also the new version is obviously a work in progress and perhaps it's premature to judge.

What to do now? I guess I can take the new implementation and improve the quality until it is closer to the 0.8.7 code. I can simply do nothing (it does "work" after all), although I'm going to be pretty screwed if I ever want to add functionality like the program guide support.

Also, I don't want to do any more work on the KDE3 version of Kaffeine if it's all going to be scrapped and rewritten anyway.

The upside is if I want to contribute, it's a target rich environment. The sound doesn't work. It doesn't tune right most of the time. It crashes on exit.

What's up with Google

You don't appreciate how important email is until you can't reach it. I haven't been able to get to Gmail for the last half hour from two different providers. DNS and ping look ok, but no TCP connections.

Now I'm having trouble even reaching www.google.com.

Weird.

Monday, August 25, 2008

Pinnacle PCTV HD Pro 801e Works!

Isolated the final problems with my Linux driver for the Pinnacle 801e. Cleaned up the changes and submitted the patch to Mauro for kernel inclusion.

In the end, I found a bug in xc5000 tuner driver which caused i2c failures to drop silently, a bug in dib0700's i2c implementation that took i2c reads and treated them as writes, I implemented a new i2c API for v1.20 of the Dibcom firmware, and extended the driver to disable master mode at capture startup to work properly with the s5h1411 demodulator.

Not bad for what totaled up to be six or seven night's work over three weeks. Let's just say that's WAY faster than my HVR-950 support.

The only downside is I managed to get everything working before I had a chance to take Steven Toth's suggestion and build my own i2c bus analyzer out of an old printer cable and two diodes.

ATSC seems to be working great. No other dib0700 devices support analog, so this will likely require some infrastructure changes. Part of me wonders whether anybody even cares about analog support. Most people are buying these new devices to take advantage of ATSC or else they would still be using their old capture devices.

On a separate note, I ordered the fiberscope today I need to inspect the ductwork in my building. Will hopefully get to the bottom of the ventilation problem and my bathroom vent will start working.

Sunday, August 24, 2008

Pinnacle PCTV HD Pro i2c now working

After going back and forth with the authors of the dib0700 and xc5000 drivers, it looks like I got the i2c interface working properly. azap is reporting tuner lock, but it looks like there is some issue with the interface between the tuner and the demodulator, since I am not actually getting the video stream (probably an improperly set if_khz).

If I can get the digital side working, I am hoping to deliver patches for xc5000 and dib0700 later this week.

Spent the weekend with Victoria in New York. Went to Central Park on Saturday night. Saw Tropic Thunder this afternoon.

Wednesday, August 20, 2008

Bermuda pictures



By popular demand, here are the pictures from my and Victoria's trip to Bermuda:

http://pics.livejournal.com/devinjh/gallery/00016fkw