[mythtv-users] Problems with multiple pvr cards

Russ W. Knize rknize at yahoo.com
Thu May 10 19:37:46 UTC 2007


On Thu, 2007-05-10 at 15:14 -0400, Rich West wrote:
> Russ W. Knize wrote:
> >
> > On Thu, 2007-05-10 at 06:24 -0400, Brian L. Walter wrote:
> >   
> >> Russ W. Knize wrote:
> >>     
> >>> I've been having many issues with DMAs lately.  I changed a lot of
> >>> things at once and have rolled back the hardware and I still get them.
> >>> Part of the issue is with ivtv.  There is a bug in 0.10.1 where the
> >>> interrupt handler does some slow PIO to retrieve VBI data.  This ties-up
> >>> the system preventing it from handling other DMAs.  With a PVR-500, two
> >>> NICs, a RAID-5 SATA card, and a PATA card, I was getting DMA errors with
> >>> just one encoder going.  If both encoders go, the system is brought to
> >>> it's knees and will either die or the encoder hardware will lockup.  
> >>>
> >>> Turning off VBI capture in Myth does not seem to stop ivtv from reading
> >>> the data.  I modified the driver to turn off this feature which helped,
> >>> but was not a total solution.  Tuning the PCI latency settings and
> >>> increasing the encoder buffer sizes also helped, but I still get
> >>> occasional issues.
> >>>
> >>> Next I am going to try the 0.10.2 SVN branch.  Downgrading is
> >>> problematic, as I will have to downgrade my kernel as well.
> >>>
> >>> Good luck,
> >>> Russ
> >>>
> >>> On Wed, 2007-05-09 at 17:14 -0700, David Rees wrote:
> >>>   
> >>>       
> >>>> On 5/8/07, Brian L. Walter <blwalter at gmail.com> wrote:
> >>>>     
> >>>>         
> >>>>> However, when Myth goes to record on all 3, I start getting ENC DMA
> >>>>> Errors, anywhere from  immediately to 20-30 minutes.
> >>>>>
> >>>>> I've read that there is an interrupt issue with the 0.10.1, and was
> >>>>> wondering if this is a result of that issue.
> >>>>>       
> >>>>>           
> >>>> FWIW, the latest code in the ivtv 0.10 branch appears to be more
> >>>> stable for me than 0.10.1. Not quite sure why, but you may want to
> >>>> give it a shot.
> >>>>
> >>>> -Dave
> >>>>     
> >>>>         
> >> Dave,
> >>
> >> Misery loves company:)  At least some one else is seeing the same type 
> >> of issue.
> >>
> >> I guess one thing I'm going to have to do is call Asus, as I can't find 
> >> a way to modify the latency on my motherboard.  I use setpci, but, the 
> >> value doesn't 'take'.  And when I emailed them, I got a 'This is too 
> >> hard to respond to in mail, call us'' response...*sigh*.
> >>
> >> I hadn't realized 0.10.2 was in svn.  The last time I tried, I believed 
> >> it was still 0.10.1.
> >>
> >> When you modified the the encoder buffer size, was that in the driver, 
> >> or in myth?
> >>
> >> TIA
> >> Brian
> > The driver.  In /etc/modules:
> >
> > ivtv enc_mpg_buffers=24 enc_vbi_buffers=8
> >
> > Russ
> 
> This leads to the question: Do most people tune the ivtv driver settings
> (for those that use ivtv) or do they leave them alone?  I haven't tuned
> mine since running the 0.10.x series, but I wonder if I would see a
> benefit from doing so..

I found that increasing the mpg buffers as much as possible until the
driver fails to load completely will help eliminate the "All encoder
MPEG stream buffers are full. Dropping data." messages on slower
systems.  By eliminating those, I don't have issues with playback
freezing or acting weird after skipping forward.

DMA issues can be tunes by changing your PIC latency settings.  This
takes some educated guesswork, based on how your system is setup.  You
can do this at runtime...you don't need your BIOS to support it.  I have
a script that is called by /etc/init.d/mythtv-backend before starting
the backend:

---

# Intel Corporation 82371AB/EB/MB PIIX4 IDE
setpci -v -s 00:07.1 latency_timer=40

# Intel Corporation 82371AB/EB/MB PIIX4 USB
setpci -v -s 00:07.1 latency_timer=10

# Intel 82540EM 1000Mb Ethernet controller
setpci -v -s 00:10.0 latency_timer=20

# 3Com 3c905C Ethernet controller
setpci -v -s 00:11.0 latency_timer=20

# Hauppauge PVR-500
setpci -v -s 00:12.0 latency_timer=80
setpci -v -s 02:08.0 latency_timer=80
setpci -v -s 02:09.0 latency_timer=80

# LSI Logic MegaRAID SATA controller
setpci -v -s 00:13.0 latency_timer=40

---

Increasing the latency timer and the buffer sizes allows more data to be
sent over a DMA, which results in fewer interrupts and less PCI bus
overhead.  It also minimizes the effect of the bug in ivtv 0.10.1.

My system is an old 440BX dual P3 850Mhz machine that I have used for
several years.  Prior to that, I had Myth working an an even older dual
P2 333MHz machine.  It worked fine with a $10 eBay frame grabber and the
PVR-250 I added later.  It was the other loads that cause me to upgrade
to the P3.  

All my trouble started when I swapped the dual P3 for a Tiger MPX dual
Athlon machine that I have been using as a workstation for the past few
years.  That's when I upgraded the kernel, ivtv, etc.  I read about the
hardware bug in the PVR-250 and bought a PVR-500, but it didn't fix the
DMA errors...only the card lockups.  I now have a dual Opteron setup on
the way, as this dual P3 motherboard has been having issues at boot time
for a while now.

Russ




More information about the mythtv-users mailing list