Wednesday, April 29, 2009


Had Tuesday off from work. Spent a couple of hours writing code at a coffee house for a nice change in scenery. Issued a PULL request for the HVR-950q regression, and did more xc5000 merge work.

Spent most of yesterday trying to figure out why my Pinnacle 801e successfully found 24 channels in a Kaffeine scan before the xc5000 power management changes, and why it only got 11-14 channels with the new changes. It turns up I uncovered a race condition in the dvb core in the kernel, which caused the tuning request to not be forwarded to the tuner. All you needed was a dumb channel scanner that kept closing the frontend between tuning requests (Kaffeine) and a device where the tuner sleep took hundreds of milliseconds (the Pinnacle 801e, because the xc5000 driver now uses the reset callback to power down the chip).

I'll have to figure out the right fix to detect the dvb_frontend thread is being terminated, instead of assuming that the thread shutdown takes zero time. Either that, or I can just change the 801e driver to hold the pin low for 10ms like it should, and the problem magically disappears (avoiding the race rather than fixing it).