Windowed fast blitting with XFree86 3.x

Hello.

I need to draw animation in a window on X11 screen ( AVI player, DivX
format ). It has about 25-30 frames per second, so it has to be drawn very
quickly - I can’t afford to wait more than 5-10 ms. With LibSDL typical
times are 20-30 ms for 38428832 ( on Celeron 500 ). I tried to use XShm
extensions directly, but with no significant success. Times seem to be
directly proportional to image area, so, for example, 640*480 films become
completely unplayable. It seems that X server performs some kind of heavy
work ( conversion? ) with images…
Is it possible to solve this problem somehow? I’ve spent some time to
find an answer to this question and now almost sure that the answer is ‘no’.
However, I want to hear that from specialist…

Thank you, Eugene

Hello.

I need to draw animation in a window on X11 screen ( AVI player, DivX
format ). It has about 25-30 frames per second, so it has to be drawn very
quickly - I can’t afford to wait more than 5-10 ms. With LibSDL typical
times are 20-30 ms for 38428832 ( on Celeron 500 ). I tried to use XShm
extensions directly, but with no significant success. Times seem to be
directly proportional to image area, so, for example, 640*480 films become
completely unplayable. It seems that X server performs some kind of heavy
work ( conversion? ) with images…
Is it possible to solve this problem somehow? I’ve spent some time to
find an answer to this question and now almost sure that the answer is ‘no’.
However, I want to hear that from specialist…

XFree86 4.0 is significantly faster than XFree86 3.5 at this.

Also make sure that the SDL display is at the same depth as the X server so
it doesn’t do any conversion. Use the SDL_ANYFORMAT flag when setting the
video mode to ensure you get the fastest mode, and check the returned format.

If you’re outputting to YUV colorspace, try using YUV video overlays in
SDL 1.1.3 (CVS). SDL will use the XVideo extension for acceleration when
available.

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

I need to draw animation in a window on X11 screen ( AVI player, DivX
format ). It has about 25-30 frames per second, so it has to be drawn very
quickly - I can’t afford to wait more than 5-10 ms. With LibSDL typical
times are 20-30 ms for 38428832 ( on Celeron 500 ). I tried to use XShm
extensions directly, but with no significant success.

SDL uses the MIT-SHM extension, so you should get the same results. With
PC hardware and current X servers being what they are, I doubt you will be
able to do much better. The Xvideo extension that Sam mentioned could help
a great deal, though.

XFree86 4.0 is significantly faster than XFree86 3.5 at this.

I would hope so, but I haven’t seen any numbers yet. Can people please post
their output of

x11perf -shmput500

in, say, 16bpp (or whatever they have at hand), with their video hardware
and X server used. One data point:

S3 Trio64, 100 MHz Pentium (6-7 year old machine): 63.7/s (16bpp, XFree 3.2)

For your application, this translates to

63.7 * (50050016)/(38428832) = 72 fps, or about 14 ms/frame.

I would hope so, but I haven’t seen any numbers yet. Can people please post
their output of

x11perf -shmput500

My box is a Celeron 300a at 450Mhz. I’ve got a Voodoo 3 2000 and am
at 1152x864x16bpp.

% x11perf -shmput500
x11perf - X11 performance program, version 1.5
The XFree86 Project, Inc server version 4000 on :0.0
from amiga.plush.net
Sun Jun 4 18:03:31 2000

Sync time adjustment is 0.1008 msecs.

1200 reps @ 4.1262 msec ( 242.0/sec): ShmPutImage 500x500 square
1200 reps @ 4.1037 msec ( 244.0/sec): ShmPutImage 500x500 square
1200 reps @ 4.1040 msec ( 244.0/sec): ShmPutImage 500x500 square
1200 reps @ 4.1052 msec ( 244.0/sec): ShmPutImage 500x500 square
1200 reps @ 4.1046 msec ( 244.0/sec): ShmPutImage 500x500 square
6000 trep @ 4.1087 msec ( 243.0/sec): ShmPutImage 500x500 square

As root:

x11perf -shmput500

x11perf - X11 performance program, version 1.5
The XFree86 Project, Inc server version 4000 on :0.0
from amiga.plush.net
Sun Jun 4 18:05:58 2000

Sync time adjustment is 0.0999 msecs.

1600 reps @ 4.1129 msec ( 243.0/sec): ShmPutImage 500x500 square
1600 reps @ 4.1039 msec ( 244.0/sec): ShmPutImage 500x500 square
1600 reps @ 5.0656 msec ( 197.0/sec): ShmPutImage 500x500 square
[root at amiga kendrick]# x11perf -shmput500
x11perf - X11 performance program, version 1.5
The XFree86 Project, Inc server version 4000 on :0.0
from amiga.plush.net
Sun Jun 4 18:06:35 2000

Sync time adjustment is 0.1002 msecs.

1600 reps @ 4.1088 msec ( 243.0/sec): ShmPutImage 500x500 square
1600 reps @ 4.1039 msec ( 244.0/sec): ShmPutImage 500x500 square
1600 reps @ 4.1043 msec ( 244.0/sec): ShmPutImage 500x500 square
1600 reps @ 4.1035 msec ( 244.0/sec): ShmPutImage 500x500 square
1600 reps @ 4.1065 msec ( 244.0/sec): ShmPutImage 500x500 square
8000 trep @ 4.1054 msec ( 244.0/sec): ShmPutImage 500x500 sqaure

-bill!

I would hope so, but I haven’t seen any numbers yet. Can people please post
their output of

x11perf -shmput500

Actually, can you send them privately to Mattias? f91-men at nada.kth.se

He’ll post the collected results.

Thanks,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software