Skip to contentSkip to conversation

nouveau interrupts firewire ISO streaming

DISCUSSION Adrian Knoth 2 participants 6 messages Feb 2, 2010 – Feb 4, 2010 5 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hi!

After switching from UMS (dated 20090701+c0bf670) to KMS (as of 2010-02-01), almost any X activity causes buffer underruns on my firewire soundcard.

When the X pointer changes from arrow to the vertical text selection bar, firewire streaming is interrupted. Same with scrolling in firefox or hovering over a link, thus changing the pointer to "hand".

Looks like nouveau is disabling interrupts now and then, which leads to stalled firewire ISO streaming. I don't know what nouveau's actually doing, I'm just guessing. ;)

Firewire audio streaming (www.ffado.org) requires precisely timed DMA transfers. If the kernel/controller/scheduler fails to deliver those packets in time, e.g. due to a ressource with high interrupt load, the audio stream is interrupted and you get audible glitches.

I see this behaviour on

06:00.0 VGA compatible controller: nVidia Corporation G71 [GeForce 7300 GS] (rev a1)

with Dual-Head (VGA+DVI).

I've also uploaded kern.log and Xorg log, though I guess they're not really helpful to trace this problem:

http://adi.loris.tv/nouveau-xorg.log

http://adi.loris.tv/nouveau-kern.log

Note that kern.log also includes an Oops at Feb 1 20:22:43, but I'm not really reporting this issue here. ;) (I rmmod'ed nouveau remotely)

Cheerio

PS: I (sometimes) have two mouse cursors. My screen layout is

     xrandr --output DVI-I-1 --right-of VGA-1

and when moving the mouse from the left screen to the right, a static (not moving) cursor stays on the left screen. It changes its appearance simultaneously with the real (moving) cursor on the right screen, that is, if the right pointer is a hand, the left pointer also becomes a hand, a.s.o.

Moving the mouse back to the left screen re-activates movement of the left cursor and no additional cursor is left on the right screen.

But I'm not reporting this issue here, the firewire stuff is more important.

PPS: If you prefer Bugzilla, I can re-report there. I just started with the mailinglist in case the ISO streaming requires some extended discussion.

Signature · 1 line
mail: [email protected]  	http://adi.thur.de	PGP/GPG: key via keyserver

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 6 lines · Adrian Knoth

Hi!

After switching from UMS (dated 20090701+c0bf670) to KMS (as of 2010-02-01), almost any X activity causes buffer underruns on my firewire soundcard.

Quoted 7 lines

When the X pointer changes from arrow to the vertical text selection bar, firewire streaming is interrupted. Same with scrolling in firefox or hovering over a link, thus changing the pointer to "hand".

Looks like nouveau is disabling interrupts now and then, which leads to stalled firewire ISO streaming. I don't know what nouveau's actually doing, I'm just guessing. ;)

I don't think interrupts are disabled for uploading a cursor, more likely is that your firewire driver depends on the big kernel lock. At the moment we still hold that. That said, i don't think nouveau can make any kind of latency garuantees. We do intend to go to a design that doesn't rely on the BKL at some point, but i wouldn't expect that to happen this month.

Quoted 58 lines

Firewire audio streaming (www.ffado.org) requires precisely timed DMA transfers. If the kernel/controller/scheduler fails to deliver those packets in time, e.g.  due to a ressource with high interrupt load, the audio stream is interrupted and you get audible glitches.

I see this behaviour on

06:00.0 VGA compatible controller: nVidia Corporation G71 [GeForce 7300 GS] (rev a1)

with Dual-Head (VGA+DVI).

I've also uploaded kern.log and Xorg log, though I guess they're not really helpful to trace this problem:

  http://adi.loris.tv/nouveau-xorg.log

  http://adi.loris.tv/nouveau-kern.log

Note that kern.log also includes an Oops at Feb  1 20:22:43, but I'm not really reporting this issue here. ;) (I rmmod'ed nouveau remotely)

Cheerio

PS: I (sometimes) have two mouse cursors. My screen layout is

    xrandr --output DVI-I-1 --right-of VGA-1

and when moving the mouse from the left screen to the right, a static (not moving) cursor stays on the left screen. It changes its appearance simultaneously with the real (moving) cursor on the right screen, that is, if the right pointer is a hand, the left pointer also becomes a hand, a.s.o.

Moving the mouse back to the left screen re-activates movement of the left cursor and no additional cursor is left on the right screen.

But I'm not reporting this issue here, the firewire stuff is more important.

PPS: If you prefer Bugzilla, I can re-report there. I just started with the mailinglist in case the ISO streaming requires some extended discussion.

--
mail: [email protected]       http://adi.thur.de      PGP/GPG: key via keyserver
_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): 6d4bc9fc1002020535m37223f74o60d081a85990586e-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#4 lore raw

On Tue, Feb 02, 2010 at 02:35:04PM +0100, Maarten Maathuis wrote:

Hi!

Quoted 9 lines
Quoted 7 lines

When the X pointer changes from arrow to the vertical text selection bar, firewire streaming is interrupted. Same with scrolling in firefox or hovering over a link, thus changing the pointer to "hand".

Looks like nouveau is disabling interrupts now and then, which leads to stalled firewire ISO streaming. I don't know what nouveau's actually doing, I'm just guessing. ;)

I don't think interrupts are disabled for uploading a cursor, more likely is that your firewire driver depends on the big kernel lock.

No, the firewire subsystem doesn't use BKL:

adi@hex:/usr/src/linux-2.6.33-rc6/drivers/firewire$ grep lock_kernel *
adi@hex:/usr/src/linux-2.6.33-rc6/drivers/firewire$ echo $?
1

But I don't know what happens to a BKL-free subsystem when another subsystem calls lock_kernel.

Quoted 1 line

At the moment we still hold that.

I only found lock_kernel() in drm_drv.c and drm_fops.c, so I guess it's drm_ioctl, given that BKL is the culprit.

I just removed the BKL around the func call, surprisingly, my system still worked with some minor image corruption, but it's exactly the same issue wrt firewire. So it might not be the BKL.

What about DMA or PFIFO interrupts? I only read "interrupt" here, I don't know if they are local to the GPU or also reach other parts of the system. And uploading a cursor couldn't cause long DMA transfers, at least I guess.

Cheerio

Signature · 1 line
mail: [email protected]  	http://adi.thur.de	PGP/GPG: key via keyserver

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 34 lines · Adrian Knoth

On Tue, Feb 02, 2010 at 02:35:04PM +0100, Maarten Maathuis wrote:

Hi!

Quoted 9 lines
Quoted 7 lines

When the X pointer changes from arrow to the vertical text selection bar, firewire streaming is interrupted. Same with scrolling in firefox or hovering over a link, thus changing the pointer to "hand".

Looks like nouveau is disabling interrupts now and then, which leads to stalled firewire ISO streaming. I don't know what nouveau's actually doing, I'm just guessing. ;)

I don't think interrupts are disabled for uploading a cursor, more likely is that your firewire driver depends on the big kernel lock.

No, the firewire subsystem doesn't use BKL:

adi@hex:/usr/src/linux-2.6.33-rc6/drivers/firewire$ grep lock_kernel *
adi@hex:/usr/src/linux-2.6.33-rc6/drivers/firewire$ echo $?
1

But I don't know what happens to a BKL-free subsystem when another subsystem calls lock_kernel.

Quoted 1 line

At the moment we still hold that.

I only found lock_kernel() in drm_drv.c and drm_fops.c, so I guess it's drm_ioctl, given that BKL is the culprit.

I just removed the BKL around the func call, surprisingly, my system still worked with some minor image corruption, but it's exactly the same issue wrt firewire. So it might not be the BKL.

Quoted 4 lines

What about DMA or PFIFO interrupts? I only read "interrupt" here, I don't know if they are local to the GPU or also reach other parts of the system. And uploading a cursor couldn't cause long DMA transfers, at least I guess.

It's mostly cpu copying the cursor. Now that i think of it, we keep a
copy of the cursor inside the kernel, so no need to make the userspace
side vram too. As a quick test you could try changing VRAM to GART
here http://cgit.freedesktop.org/nouveau/xf86-video-nouveau/tree/src/drmmode_display.c#n641.
Assuming you don't have an agp system, otherwise you will still be
reading from uncached memory anyway. libdrm doesn't seem prepared yet
to allocate system bo's (the kernel seems to be).

Quoted 7 lines

Cheerio

--
mail: [email protected]       http://adi.thur.de      PGP/GPG: key via keyserver

A message that is not in the archive (sent off-list or not yet received): 6d4bc9fc1002040319y6edccf50tfc9be6c30e8df0c6-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#8 lore raw

On Thu, Feb 04, 2010 at 12:19:14PM +0100, Maarten Maathuis wrote:

Hi!

Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

When the X pointer changes from arrow to the vertical text selection bar, firewire streaming is interrupted. Same with scrolling in firefox or hovering over a link, thus changing the pointer to "hand".

It's mostly cpu copying the cursor. Now that i think of it, we keep a
copy of the cursor inside the kernel, so no need to make the userspace
side vram too. As a quick test you could try changing VRAM to GART
here http://cgit.freedesktop.org/nouveau/xf86-video-nouveau/tree/src/drmmode_display.c#n641.

Changing to GART fixes the cursor issue. Hovering over a link now no longer stalls my audio streams.

Is there something similar I could try to fix scrolling or even raising a window, thus changing the colour of the title bar? Both still interrupt audio.

Quoted 1 line

Assuming you don't have an agp system, otherwise you will still be

PCIe.

Cheerio

Signature · 1 line
mail: [email protected]  	http://adi.thur.de	PGP/GPG: key via keyserver

A message that is not in the archive (sent off-list or not yet received): [email protected]

#10 lore raw
Quoted 13 lines · Adrian Knoth

On Thu, Feb 04, 2010 at 12:19:14PM +0100, Maarten Maathuis wrote:

Hi!

Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

When the X pointer changes from arrow to the vertical text selection bar, firewire streaming is interrupted. Same with scrolling in firefox or hovering over a link, thus changing the pointer to "hand".

It's mostly cpu copying the cursor. Now that i think of it, we keep a
copy of the cursor inside the kernel, so no need to make the userspace
side vram too. As a quick test you could try changing VRAM to GART
here http://cgit.freedesktop.org/nouveau/xf86-video-nouveau/tree/src/drmmode_display.c#n641.

Quoted 6 lines

Changing to GART fixes the cursor issue. Hovering over a link now no longer stalls my audio streams.

Is there something similar I could try to fix scrolling or even raising a window, thus changing the colour of the title bar? Both still interrupt audio.

Sounds like your situation is sensitive to accessing gpu memory somehow, but this is just a guess. The cursor was a very special isolated case, this is a more generic problem.

Change this to "if 1" to get some information of when cpu rendering
happens. http://cgit.freedesktop.org/nouveau/xf86-video-nouveau/tree/src/nouveau_local.h#n33

You could also add some verbosity to
http://cgit.freedesktop.org/nouveau/xf86-video-nouveau/tree/src/nouveau_exa.c#n291
and http://cgit.freedesktop.org/nouveau/xf86-video-nouveau/tree/src/nouveau_exa.c#n302,
which would capture everything.

Quoted 11 lines
Quoted 2 lines

Assuming you don't have an agp system, otherwise you will still be

PCIe.

Cheerio

--
mail: [email protected]       http://adi.thur.de      PGP/GPG: key via keyserver