Summary: | Many OpenGL screensavers flicker, display imporperly, or seem to operate unaccelerated | ||
---|---|---|---|
Product: | [Unmaintained] kscreensaver | Reporter: | Adam C. Emerson <adam.emerson> |
Component: | screensavers | Assignee: | kscreensaver bugs tracking <kscreensaver-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | corey_s, greg_g, jan, jlp, kaplun, l.lunak, rdieter, steven.aerts, strobert |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Adam C. Emerson
2004-01-30 11:24:47 UTC
I am experiencing the same. It appears that it only happens to OpenGL screensavers from XScreensaver, which hints at some problem with buffering (KDE double buffers the double buffer from XSS again?) Indeed, there is a staircasing effect in the flickery display. Native KDE screensavers like Euphoria work perfectly. I can also verify this. It's happened at least as far back as since kde 3.1. I'm using xfree 4.3.0, and I have dri and opengl/etc all working correctly; I have a radeon video card. The significant majority of opengl screensavers simply perform so bad as to be unusable. However, they all work well when using xscreensaver via gnome or gtk, so this is definitely something specificaly to do with kde. I've seen many other complaints/enquiries about this problem on the gentoo forums. Confirm. This started for me with 3.2.3. XScreensaver uses the proper GL visual, but under KDE it appears to be using a color visual instead. Excessive flicker. Running under FreeBSD 5.2.1, DRI, Radeon 9000, I'll ring in with the same problems... I've been seeing this since 3.1.x days I think. Xscreensavers work great in fluxbox, but are completely horrible in kde. Flicker is awful, it makes me go blind. Other opengl apps flicker badly as well, it isn't just limited to xscreensavers.... chris I have the same problems using KDE 3.3. According to https://www.redhat.com/archives/xfree86-list/2003-June/msg00053.html , KDE "does not request a double-buffered visual for the screensavers"... The problem is with the preview widget, I believe. I made a simple change: --- old/kxsconfig.cpp 2004-09-17 20:15:30.990820536 -0700 +++ kxsconfig.cpp 2004-09-17 20:16:11.628642648 -0700 @@ -42,6 +42,7 @@ #include <qvbox.h> #include <qlabel.h> #include <qfileinfo.h> +#include <qgl.h> #include <kdebug.h> #include <kapplication.h> @@ -168,7 +169,7 @@ mPreviewTimer = new QTimer(this); connect(mPreviewTimer, SIGNAL(timeout()), SLOT(slotNewPreview())); - mPreview = new QWidget(plainPage()); + mPreview = new QGLWidget(plainPage()); mPreview->setFixedSize(250, 200); // mPreview->setBackgroundMode(QWidget::NoBackground); mPreview->setBackgroundColor(Qt::black); And kxsconfig no longer flickers the openGL screensavers. I am not sure what side effects this change has, though, since I basically have no clue what I am doing :) I also used these patches in kdebase/kdesktop/lock: --- old/lockprocess.cc 2004-09-17 21:46:13.000000000 -0700 +++ lockprocess.cc 2004-09-17 21:48:35.709814200 -0700 @@ -87,7 +87,7 @@ // starting screensaver hacks, and password entry. // LockProcess::LockProcess(bool child, bool useBlankOnly) - : QGLWidget(0L, "saver window", WX11BypassWM), + : QGLWidget(0L, "saver window", 0, WX11BypassWM), child_saver(child), mParent(0), mUseBlankOnly(useBlankOnly), --- old/lockprocess.h 2004-09-17 21:45:46.000000000 -0700 +++ lockprocess.h 2004-09-17 21:46:08.145247424 -0700 @@ -17,6 +17,7 @@ #include <qtimer.h> #include <qvaluestack.h> #include <qmessagebox.h> +#include <qgl.h> #include <X11/Xlib.h> Can anyone tell me if this is a bad thing to do? Finally, here're my patches to make the setup dialog in KControl work without flicker: --- old/scrnsave.h 2004-09-17 22:01:04.082044328 -0700 +++ scrnsave.h 2004-09-17 23:22:21.680536648 -0700 @@ -25,11 +25,11 @@ class KProcess; //=========================================================================== -class KSSMonitor : public QXEmbed +class KSSMonitor : public QGLWidget { Q_OBJECT public: - KSSMonitor( QWidget *parent ) : QXEmbed( parent ) {} + KSSMonitor( QWidget *parent ) : QGLWidget (parent, "monitor", 0) {} // we don't want no steenking palette change virtual void setPalette( const QPalette & ) {} @@ -67,11 +67,11 @@ }; //=========================================================================== -class TestWin : public QXEmbed +class TestWin : public QGLWidget { Q_OBJECT public: - TestWin(); + TestWin(); }; //=========================================================================== --- old/scrnsave.cpp 2004-09-17 22:01:04.082044328 -0700 +++ scrnsave.cpp 2004-09-17 23:21:23.469386088 -0700 @@ -121,12 +121,15 @@ //=========================================================================== // TestWin::TestWin() - : QXEmbed(0, 0, WStyle_Customize | WStyle_NoBorder | WX11BypassWM ) + : QGLWidget(0, "test", 0, WX11BypassWM ) { + + setFocusPolicy(StrongFocus); KWin::setState( winId(), NET::StaysOnTop ); } + //=========================================================================== These patches seem to work on FreeBSD 5.2.1 (and radeon dri), xorg-6.7.0, dri-5.0.2, and kde-3.3. The flicker is gone. However I have had ksxcontrol lock up on me twice. It doesn't hang the kernel, but the display is unrecoverable and I have to reboot. I do not know whether this is caused by the fix, because I have not used kscreensaver due to this bug in quite a while. Unwilling to experiment further at this time. kxsconfig, kxsrun, and kdesktop_lock seem to work fine for me. However, my patch for the kcontrol module seems to botch things up... I had everything crash. So I am not using that patch. But, the actual kdesktop locking seems to work properly. One thing is that OpenGL screensavers don't seem to properly grab the desktop image (Like flipscreen3d, or antspotlight). Non-GL screensavers that grab desktop images still work properly, though. Still there in KDE 3.3.1... What about the patches presented in this bug report? I have no yet comitted the patches in the bug report since I have not been able to reproduce the flicker myself so can't verify if they work. If one more person could please try the patches and verify if it works or not I will happily commit them. Thanks. Patch from comment #7 seems to work ok against kde-3.3.1 Patch from comment #8 doesn't apply cleanly (nor compile when seemingly fixed). - : QGLWidget(0L, "saver window", WX11BypassWM), + : QGLWidget(0L, "saver window", 0, WX11BypassWM), I only see a QWidget in the original file. When/if I change it to the + line, I receive the compilation error: $ make /usr/lib/qt-3.3/bin/moc ./lockprocess.h -o lockprocess.moc g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I../../kcheckpass -I../../kdm/kfrontend -I/usr/include/kde -I/usr/lib/qt-3.3/include -I/usr/X11R6/include -DQT_THREAD_SUPPORT-D_REENTRANT -D_FILE_OFFSET_BITS=64 -DNDEBUG -DNO_DEBUG -O2 -O2 -march=i386 -mcpu=i686 -D_GNU_SOURCE -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE-DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -D_GNU_SOURCE -c -o lockprocess.o `test -f 'lockprocess.cc' || echo './'`lockprocess.cc lockprocess.cc: In constructor `LockProcess::LockProcess(bool, bool)': lockprocess.cc:89: error: type `class QGLWidget' is not a direct base of ` LockProcess' I have a machine that's displayed this problem across FC1 -> FC3 and am willing to act as a test bed for any potential patches. ATI Radeon 7000 AGP on AthlonXP, currently running Fedora Core 3. TuxRacer is accelerated in Gnome and KDE. OpenGL screensavers are accelerated in Gnome, but generally not in KDE. I can start by downloading KDE source from KDE.org and compiling, although I'm not sure that's where I should get packages for Fedora. Any pointers to URLs or whatever to help would be greatly appreciated! I'm also willing to download KDE from source and build and test patches, although I'm not familiar with doing so yet. Follow up here, or contact me at tom.witmer (at) comcast.net. Thanks! Can reproduce this problem reliably here. config: - ATI Radeon 7000/VE - FC1 - KDE 3.3.1 (built using backported RPMS from the FC2 ones contrib'd and avaialble from kde.org). I'll try and get some time to try out the patches put in here. I also have this problem. I have nVidia GeForce 6800 and AMD Athlon 64 3000+ and all screensavers work just fine from GNOME but some of them are very very slow in KDE (for example Atlantis). I'm runing KDE 3.2.2. Same problem, about 1.2 fps on most GL screensavers but Euphoria. Not just in the preview app. Radeon 7500 PCI 64MB 512MB DDR System RAM Celeron 2GHz Tested and Tried on: FC2, FC3, Mandrake 10, SuSe 9.2 Screensavers seem to work fine on updated Debian Woody - flicker free and smooth graphics. Latest update to screensavers was 2005-01-17. Questions or trials (I'm willing to run patches or update source) -> dsnell923@linuxmail.org I just compiled and installed KDE 3.4.0 and this bug is still here. Yes, this is also present for me on KDE 3.4.0. I have Radeon 9100 IGP graphics. From reading all the above comments it seems this bug is related to the Radeon graphics chipset. I too am having this problem: KDE 3.3.2 Radeon Mobility 9000. I have a Radeon Mobility 9000, KDE 3.4.0. GLMatrix, for example, flickers when started as a screensaver. It does not flicker when started from command line. Confirm. At work, with an ATI 2000 card and the radeon driver, wild flickering. At home, with a Geforce 4 card and the NVIDIA driver, everything is smooth. Both symptoms on both machines under SuSE 9.1, 9.2 and 9.3 with KDE 3.2, 3.3 and 3.4. I'm willing to test binaries for SuSE 9.3 if anybody compiles any. :-) Jens <jens-bugs.kde.org at spamfreemail de> Yes, seems to be the ATI driver. With the Radeon 9000 and SuSE/KDE 3.1/2 I had a grey bar like flickering, now with Kanotix Debian/KDE 3.3.2/3.4 it is a thin white or colored flickering (on a P IV PC) where the action is (e.g. Flying Toasters) - looks like a duplicate of the moving picture. Some GL-savers don't work at all (just black - Euphory :(, picture flag, Flux, Kpendulum, Krotation). No flickering at all: the Noof saver & Pipes 2. My old PIII with Nvidia Gefore 400 MX has no problems with the OpenGL savers (KDE 3.2.something). I don't know if this is ATI problem. I have a graphics card with nVidia GeForce 6800 GPU and some screensavers are still not accelereated inside KDE, but all work just fine in GNOME. SVN commit 427700 by lunakl: Use a double-buffered visual for OpenGL screensavers. BUG: 73813 M +2 -2 Makefile.am M +9 -0 configure.in.in M +30 -16 lockprocess.cc M +1 -1 lockprocess.h This has not resolved the problem. Tested on kde from trunk, as well as patching 3.4.0. ksxrun and kdesktop_lock work flawlessly. But the flicker is still there when using "test" button from kcontrol, or waiting for screensaver to kick in. Correction on above comment. Kcontrol is still broken, both test and preview window, but the actual screensaver works when it kicks in. So the commit did solve half the problem. Also apparently causes crashes: [20:49] <ruurd> About time to dual license KDE? If your company name is SCO, your annual license fee is $5000000 [20:49] <gregj> |#3 LockProcess::createSaverWindow (this=0xbffff710) [20:49] <gregj> | at /home/gj/kde-sources/kdebase/kdesktop/lock/lockprocess.cc:406 [20:49] <gregj> |#4 0x080541af in LockProcess::startSaver (this=0xbffff710) [20:49] <gregj> | at /home/gj/kde-sources/kdebase/kdesktop/lock/lockprocess.cc:642 [20:49] <gregj> |#5 0x08058c50 in LockProcess::lock (this=0xbffff710) [20:49] <gregj> | at /home/gj/kde-sources/kdebase/kdesktop/lock/lockprocess.cc:250 [20:49] <gregj> |#6 0x0805f6ee in main (argc=2, argv=0xbffffad4) [20:49] <gregj> | at /home/gj/kde-sources/kdebase/kdesktop/lock/main.cc:152 I've applied the patches from #9 again, and have not experienced a crash in two days. This is with FreeBSD 5.4, xorg-6.8.2, dri-6.2.1, and kde-3.4 (release but for patches from #9 and #26). My comment from #10 is thus no longer valid. SVN commit 429332 by lunakl: Fix the last commit - check return value, and also add XFree(). BUG: 73813 M +11 -8 lockprocess.cc --- trunk/KDE/kdebase/kdesktop/lock/lockprocess.cc #429331:429332 @@ -402,14 +402,17 @@ if( mOpenGLVisual ) { int attribs[] = { GLX_RGBA, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, x11Depth(), None }; - XVisualInfo* i = glXChooseVisual( x11Display(), x11Screen(), attribs ); - visual = i->visual; - static Colormap colormap = 0; - if( colormap != 0 ) - XFreeColormap( x11Display(), colormap ); - colormap = XCreateColormap( x11Display(), RootWindow( x11Display(), x11Screen()), visual, AllocNone ); - attrs.colormap = colormap; - flags |= CWColormap; + if( XVisualInfo* i = glXChooseVisual( x11Display(), x11Screen(), attribs )) + { + visual = i->visual; + static Colormap colormap = 0; + if( colormap != 0 ) + XFreeColormap( x11Display(), colormap ); + colormap = XCreateColormap( x11Display(), RootWindow( x11Display(), x11Screen()), visual, AllocNone ); + attrs.colormap = colormap; + flags |= CWColormap; + XFree( i ); + } } #endif Window w = XCreateWindow( x11Display(), RootWindow( x11Display(), x11Screen()), SVN commit 429371 by lunakl: Use double-buffered visual also for the screensaver kcm module. CCBUG: 73813 M +4 -3 Makefile.am A configure.in.in M +3 -3 kssmonitor.h A kswidget.cpp [License: no copyright] A kswidget.h [License: no copyright] M +1 -1 testwin.cpp M +2 -2 testwin.h --- trunk/KDE/kdebase/kcontrol/screensaver/Makefile.am #429370:429371 @@ -1,11 +1,12 @@ -AM_CPPFLAGS = $(all_includes) +AM_CPPFLAGS = $(GLINC) $(all_includes) kde_module_LTLIBRARIES = kcm_screensaver.la -kcm_screensaver_la_SOURCES = advanceddialogimpl.ui scrnsave.cpp testwin.cpp saverlist.cpp saverconfig.cpp advanceddialog.cpp +kcm_screensaver_la_SOURCES = advanceddialogimpl.ui scrnsave.cpp testwin.cpp saverlist.cpp \ + saverconfig.cpp advanceddialog.cpp kswidget.cpp kcm_screensaver_la_LDFLAGS = -module -avoid-version $(all_libraries) -no-undefined -kcm_screensaver_la_LIBADD = $(LIB_KSYCOCA) $(DPMSLIB) +kcm_screensaver_la_LIBADD = $(LIB_KSYCOCA) $(DPMSLIB) $(GLLIB) METASOURCES = AUTO noinst_HEADERS = scrnsave.h --- trunk/KDE/kdebase/kcontrol/screensaver/kssmonitor.h #429370:429371 @@ -1,12 +1,12 @@ #ifndef KSSMONITOR_H #define KSSMONITOR_H -#include <qxembed.h> +#include "kswidget.h" -class KSSMonitor : public QXEmbed +class KSSMonitor : public KSWidget { public: - KSSMonitor( QWidget *parent ) : QXEmbed( parent ) {} + KSSMonitor( QWidget *parent ) : KSWidget( parent ) {} // we don't want no steenking palette change virtual void setPalette( const QPalette & ) {} --- trunk/KDE/kdebase/kcontrol/screensaver/testwin.cpp #429370:429371 @@ -4,7 +4,7 @@ class QXEmbed; TestWin::TestWin() - : QXEmbed(0, 0, WStyle_Customize | WStyle_NoBorder | WX11BypassWM ) + : KSWidget(0, 0, WStyle_Customize | WStyle_NoBorder | WX11BypassWM ) { setFocusPolicy(StrongFocus); KWin::setState( winId(), NET::StaysOnTop ); --- trunk/KDE/kdebase/kcontrol/screensaver/testwin.h #429370:429371 @@ -1,9 +1,9 @@ #ifndef TESTWIN_H #define TESTWIN_H -#include <qxembed.h> +#include "kswidget.h" -class TestWin : public QXEmbed +class TestWin : public KSWidget { Q_OBJECT public: I have the opposite problem of "Additional Comment #28 From David Johnson" above. I am using Kubuntu 5.10, with KDE 3.4.3. When I preview screensavers in the KControl module, either in the preview window or using the Test button, the screensavers work fine. However, when the screensaver actually activates (either by idle time or by using the "Lock Screen" function) there is serious flicker. Please let me know if there is anything else I can do to help resolve this issue. After I upgraded to Xorg 7, lots of things have changed... Was the problem mostly because of bugs in the graphics drivers? (I'm using a Radeon 7000 video card.) But now, other things started happening. Almost all screensavers work perfectly for me... Except for KDE ones. (While before, KDE OpenGL screensavers were the only ones that worked!) The images are shifted half-screen to the left, so the right half of the screen is just black. Also, same happens to FlipScreed3d, though it doesn't look like a KDE screensaver. I remember that with the RC versions of Xorg 7, this happened to other OpenGL screensavers, too (besides other problems like flicker). Now, everything got fixed, except for the KDE screensavers... Although this bug has been marked as fixed, the problem persists for me on Kubuntu 6.06 with KDE 3.5.2. (See my comment #33 above.) Has this been fixed in a newer version of KDE than I have, or is it that the fix doesn't work for me? Any insight would be appreciated. Reopening. SVN commit 595223 by lunakl: GLX_DEPTH_SIZE = size of the depth buffer (Z buffer) GLX_BUFFER_SIZE = size of the color buffer (color depth) BUG: 73813 M +1 -1 kcontrol/screensaver/kswidget.cpp M +1 -1 kdesktop/lock/lockprocess.cc --- branches/KDE/3.5/kdebase/kcontrol/screensaver/kswidget.cpp #595222:595223 @@ -18,7 +18,7 @@ int flags = 0; if( true /*mOpenGLVisual*/ ) { - int attribs[] = { GLX_RGBA, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, x11Depth(), None }; + int attribs[] = { GLX_RGBA, GLX_DOUBLEBUFFER, GLX_BUFFER_SIZE, x11Depth(), None }; if( XVisualInfo* i = glXChooseVisual( x11Display(), x11Screen(), attribs )) { visual = i->visual; --- branches/KDE/3.5/kdebase/kdesktop/lock/lockprocess.cc #595222:595223 @@ -419,7 +419,7 @@ #ifdef HAVE_GLXCHOOSEVISUAL if( mOpenGLVisual ) { - int attribs[] = { GLX_RGBA, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, x11Depth(), None }; + int attribs[] = { GLX_RGBA, GLX_DOUBLEBUFFER, GLX_BUFFER_SIZE, x11Depth(), None }; if( XVisualInfo* i = glXChooseVisual( x11Display(), x11Screen(), attribs )) { visual = i->visual; |