On Mon, 2010-01-25 at 01:39 -0500, Peter Budny wrote:
> Andy Walls <[email protected]> writes:
> 
> > On Sun, 2010-01-24 at 20:46 -0500, Peter Budny wrote:
> >> I have a PVR-150 that's creating weird video.  To start with, here's a
> >> sample:
> >> 
> >> http://www.cc.gatech.edu/~bigpeteb/test.mpg
> >> 

> 
>  Or maybe some other warnings from the ivtv driver?
> 
> I tried turning on some debugging, as you suggested, and it generated
> only normal-seeming messages (a lot of DMA completed and IRQ completed,
> nothing indicating errors).
> 
> After playing around with some parameters on the module, I see no
> real effects.  I tried doubling the size of all the encoding buffers,
> but I still had the same broken video.
> 
> The only thing that seemed to be out of place was an occasional message
> "ivtv0: warn: encoder VBI: Couldn't find start of buffer within the
> first 256 bytes"

Hmmm.  I'm not too concerned about the VBI stream, but it may be
indiciative of some IRQ or DMA problem.

This message is coming from
linux/driver/media/video/ivtv/ivtv-irq.c:dma_post().

Can you provide the verbose log to me? (an off list email is fine if it
is very large)

The ivtv buffer transfer code is somewhat complex.  I'll have to take
some time this week and look at it closely to learn it myself.  

> >> I'd appreciate any suggestions to try.
> >
> > My first guess would be an IRQ service problem:
> >
> > 1. A device sharing the IRQ line with the CX23416 has a device driver
> > that sometimes errantly claims the CX23416's interrupt as it's own
> > (IRQ_HANDLED).  Or maybe both devices generate a lot of interrupts and
> > hence some end up coincident in time.
> >
> > 2. A device sharing the IRQ line with the CX23416 has an irq handler
> > that sometimes takes a long time to execute and doesn't complete quickly
> > in that situation.  (e.g. The ahci disk controller driver used to have
> > an error path in its irq handler that could take a really long time.)
> >
> > 'cat /proc/interrupts' will show you if any device is sharing the IRQ
> > line with the ivtv driver.
> 
> 'cat /proc/interrupts' indicates, among other things
> 
> 14:    1596863    1597175   IO-APIC-edge      ata_piix
> 15:          0          0   IO-APIC-edge      ata_piix
> 16:    6691638    6689226   IO-APIC-fasteoi   uhci_hcd:usb5, HDA Intel, nvidia
> 19:    6894042    6894148   IO-APIC-fasteoi   ata_piix, uhci_hcd:usb3, ivtv0
> 
> so the disk may be on the same IRQ as the IVTV card.  (Probably so,
> since it's a SATA disk.)

So try to perform a capture and playback without writing to a disk and
also avoiding activity with the devices on usb3 (I think the bus listed
by /sbin/lsusb as Bus 003 corresponds to usb3):

$ ivtv-tune -d /dev/video0 -c 3
$ mplayer /dev/video0

I'm not hopeful for any improvement, but it's easy enough to test.



> Well, I'm not sure how to go about determining which of these is the
> problem.  I have some kernel development experience from classes I've
> taken, but nothing at this level.  If you can walk me through some
> things to try I'll see if they help, and if there's a bug hiding in the
> driver maybe I can help track it down.

I have no good advice yet.  I know the CX23418 DMA process and driver
structure well, but I have to come up to speed on the CX23416 DMA
process before I can make any reasonable suggestions on what to do.

You are certainly welcome to look at the driver for bugs.  If trying to
grok what the driver is doing WRT to data transfers from hardware, I
would suggest looking at these:

linux/Documentation/video4linux/cx2341x/fw-calling.txt
linux/Documentation/video4linux/cx2341x/fw-dma.txt
linux/Documentation/video4linux/cx2341x/fw-encoder-api.txt
linux/Documentation/video4linux/cx2341x/fw-memory.txt

linux/drivers/media/video/ivtv/ivtv-fileops.c:ivtv_start_capture()
linux/drivers/media/video/ivtv/ivtv-streams.c:ivtv_start_v4l2_encode_stream()
linux/drivers/media/video/cx2341x.c:cx2341x_update()

linux/drivers/media/video/ivtv/ivtv-irq.c:ivtv_irq_handler()
linux/drivers/media/video/ivtv/ivtv-irq.c:ivtv_irq_enc_start_cap()
linux/drivers/media/video/ivtv/ivtv-irq.c:stream_enc_dma_append()
linux/drivers/media/video/ivtv/ivtv-irq.c:ivtv_dma_enc_start()
linux/drivers/media/video/ivtv/ivtv-irq.c:ivtv_dma_enc_start_xfer()
linux/drivers/media/video/ivtv/ivtv-irq.c:ivtv_irq_enc_dma_complete()

Regards,
Andy


_______________________________________________
ivtv-users mailing list
[email protected]
http://ivtvdriver.org/mailman/listinfo/ivtv-users

Reply via email to