latency issues in kernel

New Message About this list Date view Thread view Subject view Author view Attachment view

From: Jeremy Hall (jhall_at_UU.NET)
Date: 01/05/03 07:12 EST


From: jhall@UU.NET (Jeremy Hall)
Message-Id: <QQnwia18296.200301051212@neserve0.corp.us.uu.net>
Subject: [ardour-dev] latency issues in kernel
Date: Sun, 5 Jan 2003 07:12:33 -0500 (EST)


Hi,

crossposting due to possible interest

Note the discussion on PCI latency.  (I include the whole mail for
completeness)

I looked at the RME9652 in my lspci -vvv but it does not have min and max
values.  Paul, what is the min and max for this card and why does it not
show up in lspci -vvv?

I want to make sure I am not dropping bits.

_J

 -- 
I do not get viruses because I do not use MS software.
If you use Outlook then please do not put my email address in your
address-book so that WHEN you get a virus it won't use my address in the
From field.


Received: from imr2.ash.ops.us.uu.net by neserve0.corp.us.uu.net with ESMTP 
	(peer crosschecked as: localhost [127.0.0.1])
	id QQnvtn23766
	for <jhall@neserve0.corp.us.uu.net>; Wed, 1 Jan 2003 08:51:40 -0500 (EST)
Received: from cmr2.ash.ops.us.uu.net by imr2.ash.ops.us.uu.net with ESMTP 
	(peer crosschecked as: cmr2.ash.ops.us.uu.net [198.5.241.40])
	id QQnvtn08325
	for <jhall@uu.net>; Wed, 1 Jan 2003 13:49:46 GMT
Received: from cmr2.ash.ops.us.uu.net by cmr2.ash.ops.us.uu.net with ESMTP 
	(peer crosschecked as: localhost [127.0.0.1])
	id QQnvtn06793
	for <jhall@uu.net>; Wed, 1 Jan 2003 13:49:46 GMT
Received: from chambertin.convergence.de by cmr2.ash.ops.us.uu.net with ESMTP 
	(peer crosschecked as: chambertin.convergence.de [212.84.236.2])
	id QQnvtn06786
	for <jhall@uu.net>; Wed, 1 Jan 2003 13:49:45 GMT
Received: from chambertin.convergence.de ([212.84.236.2] helo=chambertin)
	by chambertin.convergence.de with  esmtp (Exim 3.33 #2 )
	id 18TjFe-0000K5-00; Wed, 01 Jan 2003 14:49:42 +0100
Received: with LISTAR (v0.129a; list linux-dvb); Wed, 01 Jan 2003 14:46:22 +0100 (CET)
Received: from jive.softhome.net ([66.54.152.27])
	by chambertin.convergence.de with  smtp (Exim 3.33 #2 )
	id 18TjCP-0008SW-00
	for <linux-dvb@linuxtv.org>; Wed, 01 Jan 2003 14:46:22 +0100
Received: (qmail 1798 invoked by uid 417); 1 Jan 2003 13:46:20 -0000
Received: from shunt-smtp-out-0 (HELO softhome.net) (172.16.3.12)
  by shunt-smtp-out-0 with SMTP; 1 Jan 2003 13:46:20 -0000
Received: from emard ([195.29.129.62])
  (AUTH: PLAIN emard@softhome.net)
  by softhome.net with esmtp; Wed, 01 Jan 2003 06:46:18 -0700
Received: from emard by emard with local (Exim 3.35 #1 (Debian))
	id 18Tj8b-0000gP-00; Wed, 01 Jan 2003 14:42:25 +0100
Date: Wed, 1 Jan 2003 14:42:25 +0100
From: Emard <emard@softhome.net>
To: Roberto Deza <rdeza@unav.es>
Cc: linux-dvb@linuxtv.org
Subject: [linux-dvb] Re: DVB-S into Budget modification
Message-ID: <20030101134225.GA2195@emard>
Reply-To: emard@softhome.net
References: <3.0.1.16.20021227184744.4a1fd458@213.165.64.20> <3.0.1.32.20021223112420.01826790@cumbre.cti.unav.es> <20021220173722.GA17796@convergence.de> <3E02CC38.1010800@web.de> <20021220143509.GA17061@convergence.de> <3E034EA2.3030201@web.de> <20021220173722.GA17796@convergence.de> <3.0.1.32.20021223112420.01826790@cumbre.cti.unav.es> <3.0.1.16.20021227184744.4a1fd458@213.165.64.20> <3.0.1.16.20021231151642.31574cbe@213.165.64.20>
Content-Disposition: inline
In-Reply-To: <3.0.1.16.20021231151642.31574cbe@213.165.64.20>
User-Agent: Mutt/1.3.28i
Sender: Emard <emard@UU.NET>
X-listar-version: Listar v0.129a
Sender: linux-dvb-bounce@linuxtv.org
Errors-to: linux-dvb-bounce@linuxtv.org
X-original-sender: emard@softhome.net
Precedence: bulk
X-list: linux-dvb
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit


I'm happy that your system shows some better performance, after all
the new year is here to achieve some improvement.

BTW I started manual applying your ttf-ps modification patch to the 
latest convergence driver sources from CVS. Are you still using the
old driver sources? IMHO newer sources are more stable.

About Latency and stability:

When you get improvement in PCI latency, here is short description
how did I calculate right latency for each PCI card and other PCI
devices integrated on the mainboard:

Frist do lspci -vvv, spot every line like:
        Latency: 80 (2500ns min, 2500ns max), cache line size 08

You see, for this device having 2500ns min latency I've choosen latency 80.
Simple calculation leads to this:
2500 / 33 = 75.757575 => 80
choose first higher latency integer divisible by 8, therefore we get 80.

Why 128 For DVB cards:
        Latency: 128 (3750ns min, 9500ns max)
3750 / 33 = 113.636363636364 => 128

Do that for all the PCI devices lspci can find.
For other PCI devices having uspecified min/max latency, set latency 48. 

Latency is maximum number of PCI clock cycles that the card is allowed
to hold the PCI bus. When long transfer is exceeding latency time, card is 
forced to postpone the part of transfer and if it has low or no internal 
buffer it may loose data and packets. Depending on the driver this may 
lead to unpredictable results. Some drivers+cards like network cards are
resistant to such conditions, but seems that DVB isn't.

min latency in ns is card's required minimum time to transfer a complete packet.
max latency in ns is card's maximum allowed time other PCI devices can hold
the PCI bus before the card will drop or loose data. 

If sum of all latencies * 33ns in your system is greater that some card's
max latency, this card may have problems. In our case sum of all your
PCI latencies (48 + 128 + 80 etc) * 33ns should not exceed 9500 ns 
otherwise DVB card will be deemed to loose data if all other PCI devices 
become active in the same moment. I know it's a very tight requirement,
almost impossible to achieve in PC with all PCI slots occupied.

> After your comment, I've removed the NIC and set the PCI Latency to 128;
> then loaded the (modified) DVB drivers; again, there isn't any shared IRQ;
> the surprise is that VDR now works!!! and is possible to interact 
> with it; playing old records works fine and while recording, the image/
> sound is OK, but the new records don't play well (starting from top of
> screen are three areas, the first from the record, the second a big 
> "mesh of artifacts" and the third is the old and unmodified picture; seems
> as all PES packets are invalid somewhere and its "expasion" abort,

Maybe more precise pci tuning will enlarge the first, correct looking
part of the screen.

> without complet any frame). Thinking on HD performance, I tested it with
> 'hdparm -tT /dev/hda' and the results was about a 20% lower (HD read at
> ~10 MB/sec); a few seconds after the test end, I got the "normal" Kernel

This performace is normal and is a result of narrowing of the pci bandwidth
for HD due to DVB activity.

> Panic (by first time, the crash happened after about 10 minutes!!!).
> 
> For the next attempt, I've added the NIC at the same PCI slot (no shared
> IRQ's) and forgot to change the PCI Latency; again, VDR works with my 

Actually I have seen that I can cope with shared IRQ's (DVB+USB+NIC)
on the same IRQ, only not (DVB+DVB) on the same. I checked interrupt
sharing with very heavy system load and worked for me.

> Well, without understand anything :-(, now that the system sometimes
> works, seems that are more problems to solve.

> >Therefore, disabling onboard ARM of DVB-S completely and using just your 
> >hardware modification one can get cleaner card behaviour free of strange
> >firmware and also cleaner driver structure. Then DVB-S would work in Budget 
> >only mode and should be much more stable.
> 
> But we want also the "transfer mode" and OSD !, to have the good image/
> sound that have the premium cards!; that's, have the best of both cards, 
> on one :-).

Of course, option to disable ARM would be of good just during development
phase, to have something stable (with faster CPU, one can use mplayer to view, 
quality is excellent). and then continue development towards stabilization 
of OSD.


-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
ardour-dev mailing list
ardour-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ardour-dev

New Message About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.5 : 01/05/03 07:19 EST