XvShmPutImage() of odd-width source to RGB format makes X server spin
I'm working on some code that uses XvShmPutImage() to quickly put
images on the screen. I've used it with several image sizes (input
and output), image formats, and both PutImage-supporting adaptors
(overlay and blitter), and it all pretty much works...
...with one exception. If the image format is id 0x3 (the 32-bpp,
depth 24, packed RGB format supported by the blitter adaptor), and the
input image width is odd, X hangs.
The client program makes it though its outer loop once, with
XvShmPutImage() and XSync() both returning (although the image does
not show up on the screen). But the second time through the loop,
XSync() does not return. The console hangs -- does not respond to the
keyboard (include vt switching and CTRL-ALT-Backspace) or the mouse
(well, sometimes it responds to mouse movement, but nothing else). I
have to log in remotely to do anything else. top(1) shows X going
flat out. I have to kill X before the console is usable again.
In the attached zip file is some source to reproduce the problem. As
it is, it works fine. But when I change the "#if 0" to "#if 1",
resulting in an odd-width image, I get the trouble described.
The zip file also contains my XFree86Config and XFree86.0.log files.
Other pertinent info:
# cat /etc/redhat-release
Red Hat Linux release 9 (Shrike)
# uname -a
Linux helium 2.4.20-20.9 #1 Mon Aug 18 11:45:58 EDT 2003 i686 i686 i386 GNU/Linux
# lspci | grep -i nvidia
01:08.0 VGA compatible controller: nVidia Corporation NV17 [GeForce4 MX 440] (rev a3)
# nvidia-installer -i
Welcome to the NVIDIA Software Installer for Unix/Linux
The currently installed driver is: 'NVIDIA Accelerated Graphics Driver for Linux-x86' (version: 1.0-4496).
Is this a known problem? Any suggested fixes/workarounds (other than
"don't do that")?
tried but stupid
I tried to compile the source with classic
gcc -O source.c -o executable
/tmp/cc28iACy.o: In function `GetPortId':
/tmp/cc28iACy.o(.text+0x36): undefined reference to `XvQueryAdaptors'
/tmp/cc28iACy.o(.text+0x9f): undefined reference to `XvListImageFormats'
/tmp/cc28iACy.o(.text+0x10e): undefined reference to `XvGrabPort'
/tmp/cc28iACy.o(.text+0x152): undefined reference to `XFree'
/tmp/cc28iACy.o(.text+0x170): undefined reference to `XvFreeAdaptorInfo'
/tmp/cc28iACy.o: In function `main':
/tmp/cc28iACy.o(.text+0x18f): undefined reference to `XOpenDisplay'
/tmp/cc28iACy.o(.text+0x1ee): undefined reference to `XvShmCreateImage'
/tmp/cc28iACy.o(.text+0x23e): undefined reference to `XShmAttach'
/tmp/cc28iACy.o(.text+0x261): undefined reference to `XFree'
/tmp/cc28iACy.o(.text+0x26d): undefined reference to `XCloseDisplay'
/tmp/cc28iACy.o(.text+0x2af): undefined reference to `XCreateSimpleWindow'
/tmp/cc28iACy.o(.text+0x2c1): undefined reference to `XSetWindowBackgroundPixmap'
/tmp/cc28iACy.o(.text+0x2ce): undefined reference to `XMapWindow'
/tmp/cc28iACy.o(.text+0x2df): undefined reference to `XCreateGC'
/tmp/cc28iACy.o(.text+0x358): undefined reference to `XvShmPutImage'
/tmp/cc28iACy.o(.text+0x366): undefined reference to `XSync'
collect2: ld returned 1 exit status
I am guessing this because I need to link in X libraries some how in the gcc command, but config and make files usuialy do this so I am at a loss.
The comment at the beginning of the source file contains the build
command line, copied here for your convenience:
gcc -o XServerSpin XServerSpin.c -Wall -L/usr/X11R6/lib -lXext -lXv -lX11
after using the correct compile command I get a working app and changing the 0->1 means the X goes 95% cpu usage in Top as it does in the well known random hangs.
Have you tried this with the new beta drivers yet ?
Got distracted for a while, but I'm back.
When I was browsing the forum before posting my original message, I saw some
of the posts about random hangs, but I didn't look into them. Since I could
reliably reproduce my problem, it didn't sound random. Oh well.
Thanks for the tip about the beta drivers. But by the time I got back to this,
there were new driver releases out, so I just went with that. Driver version 1.0-5328
seems to fix the problem.
|All times are GMT -5. The time now is 09:25 AM.|
Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright ©1998 - 2014, nV News.