Go Back   nV News Forums > Linux Support Forums > NVIDIA Linux

Newegg Daily Deals

Reply
 
Thread Tools
Old 12-09-03, 11:12 AM   #1
phildumont
Registered User
 
Join Date: Dec 2003
Posts: 3
Default 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")?

Thanks.

phil
Attached Files
File Type: zip xserverspin.zip (8.3 KB, 155 views)
phildumont is offline   Reply With Quote
Old 12-11-03, 04:44 AM   #2
rednuht
GeForce FX5600 (1.0-5336)
 
rednuht's Avatar
 
Join Date: Sep 2003
Location: uk
Posts: 164
Default tried but stupid

I tried to compile the source with classic
gcc -O source.c -o executable

but got

/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.
rednuht is offline   Reply With Quote
Old 12-11-03, 05:43 AM   #3
phildumont
Registered User
 
Join Date: Dec 2003
Posts: 3
Default

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
phildumont is offline   Reply With Quote
Old 12-15-03, 10:28 AM   #4
rednuht
GeForce FX5600 (1.0-5336)
 
rednuht's Avatar
 
Join Date: Sep 2003
Location: uk
Posts: 164
Default opps

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 ?
rednuht is offline   Reply With Quote
Old 01-07-04, 02:22 PM   #5
phildumont
Registered User
 
Join Date: Dec 2003
Posts: 3
Default

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.
phildumont is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:15 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.