Tuesday, October 14, 2008

Pinnacle rocks!

So I've decided: Pinnacle is awesome.

Doug Lung introduced me to the Senior Product Manager for the Pinnacle PCTV product line. After extending them an invitation to improve the Linux support for their products (I already added support for the Pinnacle 800e and 801e without them), they did the following:
  • Sent me a free hardware sample of the new Pinnacle PCTV HD Mini (80e)
  • Assigned an engineer to answer my technical questions (which has already saved me hours that would have been spent reverse engineering)
  • Introduced me to the CEO of Empia, who has provided me with full datasheets for the em2874 for the express purpose of writing a GPL'd Linux driver.
  • Connected me with a contact at Micronas, who provided me with the full drx3933j datasheets and the source code to their reference driver. They even emphasized the need to Micronas for the firmware to be freely redistributable so it can be bundled with the Linux distros.
Complete datasheets including the register maps, reference driver code, freely redistributable microcode, not having to personally shell out the cash to buy the tuner. I really don't think there is more that I could have asked for.

Monday, October 13, 2008

Pinnacle 801e users: please update to trunk

To all those who are using my Pinnacle 801e patch from August 27th, please stop using this patch. All of the changes have been merged into the mainline, including the fix for the thermal bug that is not in the Aug 27th patch.

Just do the following:

hg clone http://linuxtv.org/hg/v4l-dvb
cd v4l-dvb
make
make install
Comments still welcome, of course (either below in the comments section or via email). Just please make sure you're running the latest code before you submit problems.

Thanks.

Friday, October 10, 2008

Pinnacle 801e tuning versus HVR-950

I've been working on my tuning problem every night this week. Frustrated and confused, I decided to approach this from a different perspective. I figured I would get a baseline using my HVR-950 so I could assess how consistent tuning is in my area for various stations. I obviously considered the possibility that the HVR-950 would have problems too, but if it behaved consistently then it would be a good basis for comparison.

I started with looking at tuning speed in general. Here's what I came up with for the HVR-950 using the current v4l-dvb trunk (note, I pruned out duplicate subchannels from this list).

Channel / time to lock (ms)
2-1 / 352
5-1 / 322
7-1 / 320
9-1 / 334
11-1 / 313
25-1 / 321
31-1 / 310
41-1 / 313
68-1 / 318

I got consistent lock against all channels inside of 350ms.

Now compare this against the unmodified v4l-dvb trunk for the Pinnacle 801e:

Channel / time to lock (ms)
2-1 / 3190
5-1 / 3194
7-1 / 3194
9-1 / 3189
11-1 / 3189
25-1 / 3189
31-1 / 3194
41-1 / 3190
68-1 / 3190

So it is consistently locking, but almost an order of magnitude slower.

I tried to do the same test for the Pinnacle 801e with my changes, and found that the tuning time was to unpredictable to accurately measure. I was times seeing in the areas of 350ms, 500ms, 1500ms, 2500ms, 3500ms, and tuning failure for even a single channel (the cap is
5000ms for Kaffeine so it's possible that we would have achieved tuning lock after that).

Then I started looking at w_scan performance:

HVR-950 - 27 stations found, time: 3:58
Pinnacle 801e (first run) - 16 stations found, time 9:05
Pinnacle 801e (second run) - 18 stations found, time 9:02
Pinnacle 801e with my changes (first run) - 13 stations found, time 3:09
Pinnacle 801e with my changes (second run) - 25 stations found, time 3:12
Pinnacle 801e with my changes (third run) - 26 stations found, time 3:09

The HVR-950 consistently finds all 27 stations in four minutes. The Pinnacle driver is all over the map regardless of my changes. My changes make the w_scan timing more consistent with the HVR-950, but it does not appear to have an affect on the quality of the tuning results.

In summary, I see four possibilities:
1. My Pinnacle hardware is defective
2. There is something wrong with the xc5000 driver
3. There is something wrong with the s5h1411 driver
4. There is something wrong with my intergration of the xc5000/x5h1411 for the Pinnacle 801e.

Anyway I look at it, this is pretty frustrating.

Tuesday, October 7, 2008

More work on Pinnacle 801e tuning speed

Since I got all the changes pushed for the Pinnacle 801e, over the weekend I went back and started looking at the various xc5000 cleanup work I had pending.

Learned to use quilt on Saturday afternoon (thanks mkrufky!). Prepared a series of patches breaking down the individual changes. Submitted for comments.

Sunday night, discovered that there is some sort of timing bug where I only get successful lock around 50% of the time with my changes. Crap. I don't think it's my changes, but the changes exacerbate the issue.

Spent the last couple of nights debugging the issue. I still don't have it nailed down, but I did figure out that because of DVB-T inversion support, failed tuning attempts get repeated even though you can't adjust the inversion. With that fix, a run of w_scan went from 9:20 down to 6:11. Nice. Combined with my other xc5000 fixes, it brought the time down to 3:11. That's basically three times faster.

Will continue to debug tonight. I'm *so* close. I just need to figure out the timing and I can push in half a dozen patches and move on to other stuff.

Update:Yeah, I just hit the submit button and realized I had pretty much already described much of this in the previous post. Doh.

Sunday, October 5, 2008

Weekend

Today, Victoria, Jen, Jon, and Jayden went to the Bronx zoo. It was alot of fun, but what a PITA it was to get there (subway work on both the 2 and 5 lines). Will post the pictures the same time I get the D.C. photos up from last week.

Submitted a cleaned up batch of xc5000 fixes to Mkrufky. These changes aren't essential, but clean up the i2c code a bit and address a couple of edge cases in the exception handling. Also should make the tuning on the Pinnacle 801e significantly faster.

I seem to have run into a problem though. The tuning fixes I have for the Pinnacle 801e appear to make tuning *so* fast that it seems to have exposed some sort of timing bug in the xc5000/s5h1411 combination. Ugh. I hate timing bugs.

Also, I discovered that both the s5h1409 and s5h1411 driver do not set the spectral inversion properly in the dvb set_params() callback. Most people won't notice or care, but I did because I was trying to track down the intermittent problem I am seeing achieving tuning lock.

And without the s5h1411 datasheet, deciphering the status register is kind of a pain.

I also need to get my latest batch of Kaffeine4 fixes submitted for merge, and see if I can find someone to let me sit in their living for a few hours with a laptop so I can debug why QAM scanning doesn't work in Kaffeine.

Wednesday, October 1, 2008

HVR-950 tuner power consumption

One thing that had always bothered me was how my em28xx based devices are always drawing full power when plugged in, even if the device is not capturing.

It turns out that like the xc5000 driver, the xc3028 driver also had the sleep function commented out.

I can only assume that this was done when loading the firmware took more than ten seconds (I submitted a fix when I was doing the original HVR-950 work months ago that brought it down to ~1200ms).

Putting in the sleep brought power consumption from 520ma down to 185ma at idle (and it properly reloads the firmware when it comes back online)

Will submit a patch after my xc5000 changes get pushed in. I also need to test it with my other em28xx based devices, as well as with a couple of other applications.

I was in the press?!?

Funny story:

So a few days ago somebody sent a question to the linux-dvb mailing list, asking about support for the Pinnacle PCTV Mini stick.

http://marc.info/?l=linux-dvb&m=122219266311519&w=2

Since I did the Pinnacle 800e and Pinnacle 801e support, I replied to the post. What caught my attention was the person used the sentence "Here is the info Pinnacle gave me regarding the devices in the Mini-Stick..." I could hear the sound in my head - "Ding-ding-ding" - somebody with an engineering-level contact at Pinnacle.

So I emailed the person off list to see if he provide the info for his contact. It turns out, Doug is a reporter for the trade publication TV Technology Magazine.

I emailed the Pinnacle contact, and CC'd Doug as a courtesy, introducing myself and asking if they were interested in seeing the Pinnacle Mini Stick supported under Linux.

I figured I should look to see if any of the chipsets are already supported under Linux. So I put "DRX3933J" into Google, and what do I find?

DTV Tuner Briefs: Updates on Pinnacle, Dish, Xceive
http://www.tvtechnology.com/article/67766

Holy crap. It's an article by the reporter saying that I would write the driver if Pinnacle made available the hardware and datasheets.