[mythtv] Megablocks patch for pcHDTV bttv (HD-2000) driver

Kyle Rose krose+mythtv at krose.org
Wed Jan 12 19:21:17 EST 2005


I wanted to try a longer buffer in the bttv driver, so I grabbed the
data sheet from Conexant's site and had a look. Unfortunately, they
don't make it easy: it appears that 256K is as long a buffer as one
can determinstically support with the given microcode, because there
are only 4 bits for the status field in communication from the RISC
processor to the interrupt handler, and each block is limited to 16384
bytes due to other field limitations in the audio DMA status
words. (As pfile noted in a post on the pcHDTV forum, the HD-2000 uses
the audio DMA system in the bt878 to transfer digital video to main
memory.)

Well, it turns out one can *kind* of support larger buffers by
estimating where the RISC processor is currently writing: you can do
this by reading the RISC processor's program counter. I wrote a first
pass at a patch that does just this: buffers above 256K will be
divided into "megablocks" of 16 blocks of 16K each. At a high level,
the irq handler will attempt to make a guess as to the current
megablock based on the PC, and adjust dma_block to be that megablock *
16 + the block reported in the status field.

http://www.krose.org/~krose/static/bttv-megablocks-pcHDTV-1.6-krose1.diff.bz2

It would be helpful to know if this helps others seeing the same
symptoms I encountered. This patch as-is applies against the
kernel-2.6.x driver only, though it can probably be applied to the
kernel-2.4.x with a little work.

Cheers,
Kyle


More information about the mythtv-dev mailing list