Making ogle work after mplayer has fucked your X server

7 August 2008
Tags for this page: 200808 howto software
[Site traffic Strip-O-Meter]

Click to censor the Strip-O-Meter.

When I run mplayer to view a video file, it does something to the X server so that if I subsequently run ogle to view a DVD, ogle appears to run normally except that the video appears as just a black window (or black screen in full-screen mode). This anticompetitive behaviour seems sub-optimal. Stopping and restarting the X server returns it to a state in which ogle can run, but that requires killing all the clients, and is not something I want to do regularly. Web searches for this problem found other people experiencing it, asking about it, and receiving such helpful advice as this gem from a Gentoo mailing list:

Isn't ogle unsupported? I suppose it has to do with Xv, but I don't know really.

Anyway, I'm pretty sure ogle is unsupported.

Well! It's certainly a good thing we cleared that up, isn't it? Also nice that I now have a convenient link to point to whenever people ask me why I don't use Gentoo.

On further investigation I managed to find some other materials that were actually helpful (mostly from the BSD people, whose solutions didn't work for me but gave me the necessary clues), and I present the answer here for the benefit of others who may be looking.

  • You need a program called "xvattr". It is available from the Ogle distribution site.
  • After running mplayer, do xvattr -a XV_AUTOPAINT_COLORKEY -v 1 to un-fuck the X server.

In more detail: your main CPU (or, perhaps more relevantly, the normal data flow from the main CPU through X) is not well-optimized for video decoding, so you want to do it in special hardware if you can. Ogle uses the special hardware for DVD playback. Xv is the part of your X server that drives the special hardware. The way the special hardware interfaces with the normal-X graphics on your screen involves (in some configurations) a horrible kludge wherein the CPU tells part of the screen to be pure blue ("the colour of a television tuned to an empty channel") and then that signals the video card to insert the DVD-video signal from the special hardware in that part of the screen. XV_AUTOPAINT_COLORKEY is some kind of config setting related to the kludge. It is on by default, ogle expects it to be on, but mplayer turns it off. We can debate whether it is ogle's fault for not turning it on, or mplayer's fault for turning it off and leaving it off. Both programs seem to be developed by European hacker teams of the type who just laugh at any complaints submitted by English-speaking end-users from the unhip side of the Atlantic.

Comments

kiwano from 76.65.29.68 at Fri, 08 Aug 2008 15:19:38 +0000:
i thought the colour that xv ordinarily uses for hardware windows is #010203

Matt from 129.97.79.144 at Fri, 08 Aug 2008 15:36:45 +0000:
Maybe it is. I thought blue (looks like #0000FF) because that's the colour that appears sometimes on my screen during window-dragging when the connection between the window and the video overlay seems to be temporarily broken. But if #010203 is the key colour, that would look like black, and it could explain why the ogle window appears black when it's been messed up by mplayer.

Cernael san from 82.209.147.48 at Mon, 18 Aug 2008 12:46:38 +0000:
#010203 is closer to the colour I always imagined in that passage.

Anyway, "The sky was the colour of the Bluescreen of Death" doesn't have the same...poetic effect?

Matt from 67.158.74.7 at Tue, 19 Aug 2008 23:53:00 +0000:
I'm quite sure that at the time Neuromancer was written, a television tuned to an empty channel would normally display "snow" - a random mixture of black and white pixels. The technology has advanced a bit since then, though.

New comments are disabled, pending transition to new site code.
Copyright 2008 Matthew Skala
Updates to this site: [RSS syndication file]