Re: [linux-audio-dev] Low latency and X11 Direct Rendering

2002-06-09 Thread Fernando Pablo Lopez-Lezcano

> I've been running kernel with the DRM patches since January and it has been
> rock solid. However my machines are UP only, so if someone happens to be
> running kernel with the patches on SMP machine I would like to know if it
> works irl.

I've been using them with a Radeon card for about a month in a dual athlon
machine and so far it looks good. I was getting latency hits of about 18
msecs without the dri patches.

[but I'm still getting latency hits of around 8-10 mSecs when using the
3ware scsi raid driver (3w-), I tried to find out what is causing them
but eventually gave up, at least for now]

BTW, thanks a lot for the patch...
-- Fernando




Re: [linux-audio-dev] Low latency and X11 Direct Rendering

2002-06-09 Thread Jussi Laako

Vincent Touquet wrote:
> 
> Do you know if these
> patches will make it into
> the mainline kernel ?

I offered those to Andrew Morton months ago.
I think it's up to him to decide, Andrew?

> I don't know what objections there
> could be to a conditional_reschedule() ?

I have read the DRM driver sources and didn't find any spinlocks being held
at that time.

Very first version of the patch had some hacks to ethernet drivers and those
had some spinlock issues. I have removed the ethernet parts since then
(January 19). I still have some temptation to do some changes to 3com, intel
and realtek ethernet drivers which have bad latency behaviour in some
situations.

I've been running kernel with the DRM patches since January and it has been
rock solid. However my machines are UP only, so if someone happens to be
running kernel with the patches on SMP machine I would like to know if it
works irl.

Original motivation for the patch set was to create kernel that is able to
run my signal analysis software properly under full load. It does heavy DSP
operations with 8-32 channels of audio and also heavy network and graphics
load.


- Jussi Laako

-- 
PGP key fingerprint: 161D 6FED 6A92 39E2 EB5B  39DD A4DE 63EB C216 1E4B
Available at PGP keyservers




Re: [linux-audio-dev] Low latency and X11 Direct Rendering

2002-06-09 Thread Vincent Touquet

Do you know if these
patches will make it into
the mainline kernel ?

I don't know what objections there
could be to a conditional_reschedule() ?

regards
Vincent

On Sun, Jun 09, 2002 at 11:00:53PM +0300, Jussi Laako wrote:
>Yes, I have made some lowlatency additions to Matrox and ATI drivers.
>At least latencies caused by my ATI Radeon dropped from ~100 ms to < 1 ms.
>The -ll version contains full lowlatency + lowlatency DRM.
>
>See http://uworld.dyndns.org/projects/linux/
>   - Jussi Laako



Re: [linux-audio-dev] Low latency and X11 Direct Rendering

2002-06-09 Thread Jussi Laako

Enrique Robledo Arnuncio wrote:
> 
> Running latencytest I have found a quite bad behaviour with the high
> X11 load test when the X server has the DRI module loaded and active.
>
> Is anyone there using DRI and lowlatency-patch at the same time?
> 
> Have you experienced this kind of problems?
> 
> Any known solution? I use OpenGL for real time visualization of audio,
> and it is not nice if I need to disable HW accel!!!

Yes, I have made some lowlatency additions to Matrox and ATI drivers.
At least latencies caused by my ATI Radeon dropped from ~100 ms to < 1 ms.
The -ll version contains full lowlatency + lowlatency DRM.

See http://uworld.dyndns.org/projects/linux/


- Jussi Laako

-- 
PGP key fingerprint: 161D 6FED 6A92 39E2 EB5B  39DD A4DE 63EB C216 1E4B
Available at PGP keyservers




Re: [linux-audio-dev] Low latency and X11 Direct Rendering

2002-06-06 Thread Frank Barknecht

Hi again,
Kristian Peters hat gesagt: // Kristian Peters wrote:

> Just a plain
> 
>   Option  "PciRetry"
> 
> without any "on" or "Off".
Please forget my previous mail. No boolean defaults to TRUE:

XF86Config(5x):
   Boolean options may optionally have a value specified.  When no
   value is specified, the option's value is TRUE. 
ciao,
-- 
 Frank Barknecht   _ __footils.org__



Re: [linux-audio-dev] Low latency and X11 Direct Rendering

2002-06-06 Thread Frank Barknecht

Hi,
Kristian Peters hat gesagt: // Kristian Peters wrote:

> Frank Barknecht <[EMAIL PROTECTED]> wrote:
> > Should this be:
> > Option  "PciRetry" "on"
> > or
> > Option  "PciRetry" "off"
> > ?
> 
> Just a plain
> 
>   Option  "PciRetry"
> 
> without any "on" or "Off".

Maybe it's card dependent. I use the mga-driver with xfree 4.1 and
mga(4) says: 
   
   Option "PciRetry" "boolean"
  Enable or disable PCI retries.  Default: off.

So wouldn't 

Option "PciRetry"

be the default of "off" anyways, and thus redundant? 
Just wondering. I have it commented out and so it's "off". I'm just not
sure if this is ok...

ciao,
-- 
 Frank Barknecht   _ __footils.org__



Re: [linux-audio-dev] Low latency and X11 Direct Rendering

2002-06-06 Thread Kristian Peters

Frank Barknecht <[EMAIL PROTECTED]> wrote:
> Should this be:
>   Option  "PciRetry" "on"
> or
>   Option  "PciRetry" "off"
> ?

Just a plain

Option  "PciRetry"

without any "on" or "Off".

But another question... That option completely screws my screen and I'm unable to kill 
X. Only the sysrq keys will work..

*Kristian

  :... [snd.science] ...:
 :: _o)
 :: http://www.korseby.net  /\\
 :: http://gsmp.sf.net _\_V
  :.:



Re: [linux-audio-dev] Low latency and X11 Direct Rendering

2002-06-06 Thread Fernando Pablo Lopez-Lezcano
> Running latencytest I have found a quite bad behaviour with the high
> X11 load test when the X server has the DRI module loaded and active.
> 
> Is anyone there using DRI and lowlatency-patch at the same time? 
> 
> Have you experienced this kind of problems?

There are a couple of patches that are part of the Juissi
Lako's patchset that I have used to fix that.  

I wrote on May 30 (linux-audio-user):
> I did find some problems with the dri interface and found a
> patch inside Jussi Laako's patchset ([EMAIL PROTECTED])
> that fixed it (I was testing with latencytest 0.42). See:
>   http://www.pp.song.fi/~visitor/linux/

I'm including the part of the patch that I added to my kernel
as an attachment. 

-- Fernando


linux-drm-lowlat.patch
Description: Binary data


Re: [linux-audio-dev] Low latency and X11 Direct Rendering

2002-06-06 Thread Enrique Robledo Arnuncio

On Wed, Jun 05, 2002 at 09:49:29PM -0700, Andrew Morton wrote:
> (quiet grabbing sounds).

Just for reference, here are the post of the complete patch to
linux-kernel list (and related thread), and a second post with a fixed
version. You may remember those...

http://www.cs.helsinki.fi/linux/linux-kernel/2002-01/1983.html

http://www.cs.helsinki.fi/linux/linux-kernel/2002-02/0017.html

I have only tried the mga_dma.c part of the patch I posted before.

  Enrique.



Re: [linux-audio-dev] Low latency and X11 Direct Rendering

2002-06-06 Thread Frank Barknecht

Andrew Morton hat gesagt: // Andrew Morton wrote:

> You may be getting bitten by this; dunno.  Some xfree drivers
> have an option to not use this (mis)feature.
> 
> Try adding
> 
>   Option  "PciRetry"
> 
> to the "Device" section of your XF86Config file.
Should this be:
Option  "PciRetry" "on"
or
Option  "PciRetry" "off"
?
ciao,
-- 
 Frank Barknecht   _ __footils.org__



Re: [linux-audio-dev] Low latency and X11 Direct Rendering

2002-06-05 Thread Andrew Morton

Enrique Robledo Arnuncio wrote:
> 
> ...
> diff -urN linux-2.4.19-pre7/drivers/char/drm/mga_dma.c
> linux-2.4.19-pre7-jl1-ll/drivers/char/drm/mga_dma.c
> --- linux-2.4.19-pre7/drivers/char/drm/mga_dma.cWed Aug  8 19:42:15 2001
> +++ linux-2.4.19-pre7-jl1-ll/drivers/char/drm/mga_dma.c Mon Apr 29 01:23:18 2002

(quiet grabbing sounds).

Thanks.



Re: [linux-audio-dev] Low latency and X11 Direct Rendering

2002-06-05 Thread Enrique Robledo Arnuncio

On Wed, Jun 05, 2002 at 02:42:18PM -0700, Andrew Morton wrote:
> A number of PCI video cards hang onto the PCI bus
> for outrageous amounts of time.  It gives better
> benchmarks in Windows magazines.
> 
> You may be getting bitten by this; dunno.  Some xfree drivers
> have an option to not use this (mis)feature.
> 

I was starting to fear some kind of hardware problem like this, but
fortunately Matrox seems to be of a different kind...

I have just received a message from Fernando Pablo Lopez-Lezcano
including a patch to the drm driver which fixes it:

BEFORE the patch:

> fragment latency = 1.451247 ms
> cpu latency = 1.160998 ms
>   6.5ms (350)|
> 1MS num_time_samples=44425 num_times_within_1ms=44075 factor=99.212155
> 2MS num_time_samples=44425 num_times_within_2ms=44075 factor=99.212155


AFTER the patch:

> fragment latency = 1.451247 ms
> cpu latency = 1.160998 ms
>   1.7ms (  0)|
> 1MS num_time_samples=45925 num_times_within_1ms=45925 factor=100.00
> 2MS num_time_samples=45925 num_times_within_2ms=45925 factor=100.00

Fernando has posted to the list, but it seems his message is being
delayed.  This is a summary of it:

On Wed, Jun 05, 2002 at 02:25:17PM -0700, Fernando Pablo Lopez-Lezcano wrote: 
> I did find some problems with the dri interface and found a
> patch inside Jussi Laako's patchset ([EMAIL PROTECTED])
> that fixed it (I was testing with latencytest 0.42). See:
>   http://www.pp.song.fi/~visitor/linux/


And below is the part of the patch I have applied (into a 2.4.17 kernel
source).

Thank you all!

   Enrique.

---


diff -urN linux-2.4.19-pre7/drivers/char/drm/mga_dma.c  
linux-2.4.19-pre7-jl1-ll/drivers/char/drm/mga_dma.c
--- linux-2.4.19-pre7/drivers/char/drm/mga_dma.cWed Aug  8 19:42:15 2001
+++ linux-2.4.19-pre7-jl1-ll/drivers/char/drm/mga_dma.c Mon Apr 29 01:23:18 2002
@@ -61,6 +61,7 @@
MGA_WRITE8( MGA_CRTC_INDEX, 0 );
return 0;
}
+   conditional_schedule();
udelay( 1 );
}

@@ -80,6 +81,7 @@
for ( i = 0 ; i < dev_priv->usec_timeout ; i++ ) {
status = MGA_READ( MGA_STATUS ) & MGA_DMA_IDLE_MASK;
if ( status == MGA_ENDPRDMASTS ) return 0;
+   conditional_schedule();
udelay( 1 );
}

@@ -121,6 +123,7 @@
 * How about we clean up after ourselves?
 */
MGA_WRITE( MGA_RST, MGA_SOFTRESET );
+   conditional_schedule(); /* We shouldn't get here anyway... */
udelay( 15 );   /* Wait at least 10 usecs */
MGA_WRITE( MGA_RST, 0 );




Re: [linux-audio-dev] Low latency and X11 Direct Rendering

2002-06-05 Thread Enrique Robledo Arnuncio

On Wed, Jun 05, 2002 at 10:10:56PM +0100, Bob Ham wrote:
> On Wed, 2002-06-05 at 18:40, Enrique Robledo Arnuncio wrote:
> > ** mga driver
> 
> Is that the matrox driver, or the xfree86 driver?  I always use the
> (open source, I might add for all you nvidia owners) matrox drivers. 
> The xfree86 ones just don't cut the mustard.

I am using the XFree86 ones, but are your sure there are so many
important differences? 

>From Matrox driver doc's:

>> The included display drivers are based on the Matrox driver source 
>> included with XFree86. Modifications made by Matrox include the 
>> addition of escape calls to support Matrox PowerDesk, and the 
>> inclusion of the Matrox HAL library, which can be optionally 
>> installed to enable Matrox specific features.

Which basically mean that they have taken the Xfree code, and added
support for they HAL library, which is non free and hides secret parts
of the hardware... and to PowerDesk (which is GPL).

But this seems to be mainly related to Video and MultiHead support. I
will try, anyway...

   Enrique.



Re: [linux-audio-dev] Low latency and X11 Direct Rendering

2002-06-05 Thread Andrew Morton

Enrique Robledo Arnuncio wrote:
> 
> ...
> > fragment latency = 2.902494 ms
> > cpu latency = 2.321995 ms
> >   3.3ms (  0)|
> > 1MS num_time_samples=21477 num_times_within_1ms=21477 factor=100.00
> > 2MS num_time_samples=21477 num_times_within_2ms=21477 factor=100.00
> 
> Or in other words, clean sound, and a beautiful latency graph.
> 
> I have tried a few times, just commenting and uncommenting the 'load
> "dri"' line, and the results are always almost identical.

A number of PCI video cards hang onto the PCI bus
for outrageous amounts of time.  It gives better
benchmarks in Windows magazines.

You may be getting bitten by this; dunno.  Some xfree drivers
have an option to not use this (mis)feature.

Try adding

Option  "PciRetry"

to the "Device" section of your XF86Config file.



Re: [linux-audio-dev] Low latency and X11 Direct Rendering

2002-06-05 Thread Bob Ham

On Wed, 2002-06-05 at 18:40, Enrique Robledo Arnuncio wrote:
> * XFree86 version: 4.1.0.1
> ** mga driver

> * G. Card: Matrox Graphics, Inc. MGA G400 AGP (rev 04)


Is that the matrox driver, or the xfree86 driver?  I always use the
(open source, I might add for all you nvidia owners) matrox drivers. 
The xfree86 ones just don't cut the mustard.

http://www.matrox.com/mga/support/drivers/files/lnx_200.cfm

-- 
Bob Ham: [EMAIL PROTECTED]  http://pkl.net/~node/

My music: http://mp3.com/obelisk_uk
GNU Hurd: http://hurd.gnu.org/