[mythtv] [mythtv-commits] Ticket #1356: DTVRecorder::FindKeyframes in 0.19 causes video gltiches in firewire recordings

Jim Westfall jwestfall at surrealistic.net
Sat Mar 4 19:24:33 UTC 2006


Been bugging the firewire driver folks with a patch that cuts cpu usage in 
half.  I have been running it for a few days and it fixes glitches and 
pre-buffer pauses I was seeing on livetv.

You can try it if you want, it should apply to any recent 2.6 kernel.  

jim

Steven Adeff <adeffs.mythtv at gmail.com> wrote [03.04.06]:
> Hey Jim, haven't heard from you on this in a while, I hope your just
> crunching away at ideas, but I figured I'd check to make sure you
> don't need any more from me?
> 
> Thanks!
> --
> Steve
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
-------------- next part --------------
--- linux-orig/drivers/ieee1394/dma.c	2005-10-27 17:02:08.000000000 -0700
+++ linux/drivers/ieee1394/dma.c	2006-03-01 14:32:16.000000000 -0800
@@ -137,12 +137,12 @@
 
 /* find the scatterlist index and remaining offset corresponding to a
    given offset from the beginning of the buffer */
-static inline int dma_region_find(struct dma_region *dma, unsigned long offset, unsigned long *rem)
+static inline int dma_region_find(struct dma_region *dma, unsigned long offset, unsigned int start, unsigned long *rem)
 {
 	int i;
 	unsigned long off = offset;
 
-	for (i = 0; i < dma->n_dma_pages; i++) {
+	for (i = start; i < dma->n_dma_pages; i++) {
 		if (off < sg_dma_len(&dma->sglist[i])) {
 			*rem = off;
 			break;
@@ -160,7 +160,7 @@
 {
 	unsigned long rem = 0;
 
-	struct scatterlist *sg = &dma->sglist[dma_region_find(dma, offset, &rem)];
+	struct scatterlist *sg = &dma->sglist[dma_region_find(dma, offset, 0, &rem)];
 	return sg_dma_address(sg) + rem;
 }
 
@@ -172,8 +172,8 @@
 	if (!len)
 		len = 1;
 
-	first = dma_region_find(dma, offset, &rem);
-	last = dma_region_find(dma, offset + len - 1, &rem);
+	first = dma_region_find(dma, offset, 0, &rem);
+	last = dma_region_find(dma, rem + len - 1, first, &rem);
 
 	pci_dma_sync_sg_for_cpu(dma->dev, &dma->sglist[first], last - first + 1, dma->direction);
 }
@@ -186,8 +186,8 @@
 	if (!len)
 		len = 1;
 
-	first = dma_region_find(dma, offset, &rem);
-	last = dma_region_find(dma, offset + len - 1, &rem);
+	first = dma_region_find(dma, offset, 0, &rem);
+	last = dma_region_find(dma, rem + len - 1, first, &rem);
 
 	pci_dma_sync_sg_for_device(dma->dev, &dma->sglist[first], last - first + 1, dma->direction);
 }


More information about the mythtv-dev mailing list