[sugar] [Fwd: Re: Fast Screenshot without blocking X events]

Bernardo Innocenti bernie
Wed Oct 17 03:58:48 EDT 2007

For those of you complaining that taking screenshots
was slow... it seems there's not much we can do even
with Composite and the latest X server.

-------- Original Message --------
Subject: Re: Fast Screenshot without blocking X events
Date: Wed, 17 Oct 2007 09:34:53 +0200
From: Michel D?nzer <michel at tungstengraphics.com>
Organization: Tungsten Graphics
To: GORIN Guillaume <guillaume.gorin at c-s.fr>
CC: xorg at lists.freedesktop.org
References: <6d1b4786.47866d1b at c-s.fr>

On Tue, 2007-10-16 at 11:00 +0200, GORIN Guillaume wrote: 
> -I don't want that all events on X are waiting in a stack, or something
> like this. Actually when capturing (using XGetImage) i can't continue to
> move window. It's why I suppose there is a stack of X events, that wait
> while capturing. Is it true? (If someone can tell me where to find
> informations about that. Xorg Wiki didn't help me).

Yes, as the X server is mostly single threaded, event processing is
probably delayed while a request such as GetImage is being processed.

> I'm able to take screenshot in 3200x1200 in the framebuffer, but it
> takes 2.8 seconds. It's too long for me. I suppose there is a stream
> from X to the framebuffer, it's why reading is too long.

No, CPU reads from video RAM can actually be that slow, especially with
AGP. It's possible to accelerate this using the GPU though.

> My questions are:
> -How X use the framebuffer /dev/fb0 when activated?

The nvidia driver doesn't use it at all to the best of my knowledge.

> -Can I take screenshot without blocking X events?

If XGetImage is inadequate, the only alternative I can think of that
might be better is glReadPixels.

> -Where can I get the picture of the screen before X send it to my
> geforce? (Is it possible?)

Probably not, at least not without modifying the driver.

Hope this helps,

Earthling Michel D?nzer           |          http://tungstengraphics.com
Libre software enthusiast         |          Debian, X and DRI developer

xorg mailing list
xorg at lists.freedesktop.org
 |___|   Bernardo Innocenti - http://www.codewiz.org/
  \___\  One Laptop Per Child - http://www.laptop.org/

More information about the Sugar-devel mailing list