It all started when I upgraded to the new Kubuntu 8.10, a.k.a. "Intrepid", which did a bunch of nice things to my laptop - most importantly, it resurrected my beloved suspend-to-RAM that went out of order in Hardy. I couldn't be more grateful for that. Intrepid even made the volume keys work... yay!
Of course, every Kubuntu update has its downsides as well. This time, the Wrath of Shuttleworth manifested as a series of interrelated X.org issues: stuttering videos (which played perfectly fine in Hardy), mouse cursor jumps once I keep the mouse quiet for a few seconds, and a curious lack of autoconfiguration for the VGA output - something that had mysteriously worked since the previous release, so I had not questioned it despite knowing that Xrandr 1.2 was not the most enthusiastically hyped area of KDE development known to mankind.
Not possessing or even requiring a projector or external monitor by myself, I was able to live with this for a month or so. But when I had to borrow a collegue's laptop for a university presentation last Friday - after not getting my own machine to spit out proper signals - the Time of Change had come. (And no, I don't mean a certain KDE release with that codename.) On that day, I was torn between no VGA output at all on the one hand, and resolution mismatch problems on the other hand. Neither did I know how this stuff even works, nor that I could have easily solved all of this with a few simple calls to the xrandr command line utility.
I had to get my VGA output working though, because this Tuesday I would throw a movie night at my place, with a nice projector borrowed from my parents, lighting the White Wall of Moving Pictures. I needed to get rid of both the playback stutter and the projector output uglyness. Step by step, I got to the root of all evil.
First step: Figuring out the bad guy. With Google as my weapon of choice, an Ubuntu forum thread about the playback stutter issue was to be found, strengthening my hopes of not suffering alone. The solution of switching to Fluxbox or GNOME is not one of my favorite plans though, but at least it helped determine that KWin is innocent (by making it work in a Fluxbox session, but not with Compiz in a KDE session). Another thread pointed out the amazing correlation between mouse jumps and video stutter.
So while writing all of this up in a bug report, I remembered a blog entry by nixternal pointing out that the "Detecting RANDR (monitor) changes" kded service (to be found in System Settings) was causing problems for people with external monitors. In a stroke of luck, disabling that service was indeed enough to get rid of both the stutter and the jumps. Terrific.
But I still had to get the connection with my projector to work. So I immersed myself in the skillful use of the xrandr command line utility, and went on a search for the 10-second timer that messed up not only my system but that of countless others as well. Turns out that the "Detecting RANDR (monitor) changes" service is not even a part of KDE proper - it's a semi-private branch of krandr by KWin maintainer Lubos Lunak. The thing that causes my video to stutter, my mouse to jump, but also causes other monitors to flicker or recalibrate: all of that is caused by recurring polling of X, in order to notice when external video outputs are connected. (Certain hardware is not able to notify applications in certain scenarios, so that polling would have been ok if it didn't cause havoc on so many systems.)
Second step: getting it all to work! For my movie night, the combination of disabled kded service and xrandr fuzzing was sufficient to get the film nicely rolling. However, it was a slight disappointment that KDE's own display configuration in System Settings ("Size & Orientation", a.k.a. krandr) failed so ungracefully. When it started up, it automatically switched my laptop screen ("LVDS") to some weird resolution (1360x768, I believe), and not for the Love of God would it enable the projector output ("VGA"). All of this while the seemingly trivial xrandr command line tool achieved those tasks rather nicely.
Needless to say, I wasted another day with diving into the krandr code, and fixing one issue after the other. So the net gain for you, dear reader, will be a System Settings screen configuration tool in KDE 4.2 that Mostly Works (TM). Unthinkable joy shall be your reward for reading this crap all the way down! Congrats for your persistence. Dual-monitor setups? Nope, sorry. But reliable mode switching that doesn't make you go OMG WTF BBQ and doesn't mess up your screens if you merely start it. That is what you'll get.
I also hope that Kubuntu will soon update to the 7-week-old latest revision of that notorious "Detecting RANDR (monitor) changes" service, because that version already (already?) has the 10-second fuck-up timer disabled. I only would have hoped that the merging of unreleased hacks into the default setups of every Kubuntu user out there was not taken so lightly, but hey - I still haven't switched to Fedora or OpenSUSE so it can't be that bad. (...right?)
Third step: getting to know the latest trends. Seems like Plasma in 4.2 will feature a new screen management library called kephal, which is going to replace krandr in the near future. Chances are KDE and Plasma get decent multi-head support soon, but that's not quite my area of expertise - I'm just the occasional janitor, whereas Aike or Aaron have a much better grasp what the future holds for the neverending construction site that is screen management. Personally, I'm looking forward to getting my now-working configuration tool not broken until the next Surge of Technology sweeps through the lands of X.org.
Comments
About RANDR
I reported this here, Lubos has fixed it already.
Yep
I know that it's fixed (since approximately 7 weeks or so, I mentioned it in the blog post already), it's only that Kubuntu still uses the old version that causes havoc on many systems. That means the fix went into upstream about a month before Intrepid was released, which is not such a lot of time for a stabilizing distribution but should have been incorporated still, given the widely-ranging effects of this kded module.
Good to know that it works in OpenSUSE, though :)
Thanks for this...
I have hit these frustrating problems too, so THANKS for digging in to them. I have only just got a decent enough laptop to make it worth giving presentations (which I do a lot in my role) so I am only just discovering these issues.
I have a whole slew of problems from primary/secondary display switching (so I can show videos and not black squares), detecting the external monitor at all!, the flashing in KDE 4, not finding the detect external display service (seems to have vanished!) etc. I might have to install xfce to get some projector stuff going but as you said - I kind of want to show KDE4 off!
Anyway I will keep working at this - I need it to work. I might be able to get a bug report in if I have some non-mission critical time to bug hunt in!
I use a Tosh Satelite with Free ATI drivers (lovely 3d acceleration).
Kevin
This bit me in Mandriva 2009 too
I don´t know if this is related or not, but on Mandriva 2009, it is impossible to get an external monitor working well with the laptop. You cannot choose the appropriate resolution for the external monitor and when you switch the external monitor on, the taskbar disappears from the laptop screen, although it is still shown on the other monitor.
What sucks is that every other part of kde 4.1 is very cool and I wanted to be able to show it to friends, coleagues and students, but it´s hard to do that when you can´t use a projector with it.
Bells and whistles are fine, but we need to get basic stuff like this working reliably if we want to be taken seriously. KDE is shining in every other respect, so here´s to hoping that this stuff will actually work when 4.2 comes out.
Does anybody know of any distribution which has the monitor-out stuff working well with kde 4.1? I stick to KDE but I don´t mind switching distributions if it means that I can finally use an external monitor or projector.
Biting back
> You cannot choose the appropriate resolution for the external monitor
> and when you switch the external monitor on, the taskbar disappears
> from the laptop screen, although it is still shown on the other monitor.
That either means you somehow managed to configure a dual-head (separate screens) setup and Plasma adapts to it by just displaying its panel on one of the screens, or (simpler) that the two screens show the same but your external monitor has a slightly higher resolution so it shows all of the contents while for your laptop the bottom (panel) is cut off.
My fixes are for graphics card drivers with Xrandr 1.2 support (reasonably current Intel and ATI drivers), and I'm not aware that the krandr interface for Xrandr 1.2 makes it possible to enable a monitor without determining its size. Might be some different user interface (?), or maybe something that I'm missing from the equation.
Well, yes, the internal
Well, yes, the internal screen is 1024x600 (medion akoya netbook) and the external one is a 1680x1050 LCD.
What I hoped to see is things scaled proportionately on the external monitor. This is exactly what happens when using Windows XP which came preloaded on the netbook.
In other words, I want to mirror the contents and have them shown in both screens but I want each screen to retain its own resolution. Is that not possible? Because I thought that was exactly the point of external monitors and projectors.
Well, hm, ...
I won't say that screen-cloning in two different resolutions isn't possible because maybe it is, but I have no idea if that is actually the case and if so, how to configure it. Note that such a feature would require the system to actually provide a second, scaled output, which is technically a different desktop to render.
If someone knows whether that's possible or not, please let me know.
kephal
As a sidenote: kephal was moved into kdebase today. I'm just testing it...
nice post
Thanks for a great post, informative, and also well written.
If I should have the same problem its nice to know you been there too, and also fixed it.
Thanks for a intresting reading.
Great work :-)
Now this was a cool blog.
Not just complaining, but you went straight ahead and fixed it !
Great work !
No cool new features, just Make It Work(TM) :-)
Alex
P.S. aren't you the one who said he won't have time for KDE for some time ? So, my diagnosis would be you're infected by KDE too ;-)
Er, oops
I should stay away, but, well, seems I can't. Dammit.
At least I know who to blame! (...the X.org people of course, for coming up with Xrandr 1.2.)
krandrtray
I've found that krandrtray usually works much better than the kcmodule, for some weird reason, you might want to try it ;)
And while you're at it, you might want to try a distro that doesn't fight you :p
Right, krandrtray
On the one hand, you're right. On the other hand, I don't want to start a persistent program (sitting in the system tray) to execute a one-shot operation. That idea is just not comfortable with me.
Plus, I would be able to use xrandr anyways, but other users might not - or might not even know that program. Maybe they don't know krandrtray either, because how should they - who tells them about that thing? Nobody. Like myself, lots and lots of people expect screen management functionality where it belongs, in System Settings.
Essentially, I fixed it because I couldn't stand the thought that you can't setup screen connections in System Settings, and less because I needed it myself. I want KDE to be cool, and now it is. Or stuff.
And lastly, krandrtray uses the same code to query and switch outputs and output modes, so some of the robustness improvements (plus better debug output!) should benefit krandrtray too, I think.