Linux Mint 7 "Gloria"
One thing I've always hated about new Gnome after switching from openSuse and KDE is the focus prevention. I'm doing Flex development with Eclipse and whenever I run my application, a Firefox window is opened with the Flex compiled Flash file inside. The Compiz focus prevention, however, makes sure that the Firefox window is opened in the background. Also any and all Flash error dialogs (from the debug Flash player) appear only as the flashing taskbar button. It is ridiculous that I need to click on them to bring them forward.
Notoriously, neither Gnome nor Compiz ever mention the Focus Prevention in their setups. KDE 3.5 allowed the focus prevention settings in great detail to be modified via the KDE control center. Now, however, I've dug a bit deeper and I've found a rather simple solution to the problem.
It seems that all the hidden features are still present in Gnome and accessible via an app called gconf-editor. Just search for "prevention" in there (be sure to check the "Search also in key names" checkbox) and you should find a few matches.
Go to the key /apps/compiz/general/screen0/options/focus_prevention_level and change that value to zero to turn off the focus prevention. It's that simple!
Trying to spread knowledge about IT technology, Linux, programming (Java and Adobe Flex) and similar topics.
Saturday, September 26, 2009
Sunday, September 20, 2009
How to make MPlayer from SVN work with Compiz?
Linux Mint 7 "Gloria"
One of the bigger problems when enabling Compiz for all these fancy UI tricks is the sad fact that video display will become, depending on which video output method your video player uses, either flashy, very slow or just totally unusable.
The root cause for this comes from the video output method. Those video output devices that render the graphics directly to the graphics card usually create a lot of flickering, since they effectively overwrite the rendered 3D graphics which in turn then overwrite the video window. The other video output methods think they render into a window become slow, since compiz will then have to copy the window contents to a 3D texture to be rendered by the video card.
With the Ubuntu 9.04 or (in my case) Linux Mint 7 "Gloria" x64 Edition the graphics driver installation is almost too trivial. At my workplace, with the ATI's Radeon X1650 card, the DRI R300 driver was installed automatically and effects were enabled out of the box with Gloria. At home I have ATI's Radeon HD3870 in which case I only had to confirm the installation of ATI's own Linux Catalyst drivers. The 3D effects along with full Compiz Fusion was already installed and ready to be swithced on.
But now became the real problem, how to make sure that watching video would still be possible with Compiz being active? I had heard a long time ago, at the dawn of Compiz, that there was one video player, which was patched to work with Compiz... I searched for it and was glad to find out that the player in question was MPlayer which is what I've always used in the past.
Since the patch is meant to modify source code, I had compile a patched version of MPlayer.
The compilation, however, blew up with some errors. The first error came from a module called IVTV... whatever that was I did not know. I simply disabled it with --disable-ivtv switch for ./configure script. The web told that there was a patch also to fix this, but I didn't care about that. The next error came from the x264 module which is a far worse thing, as this is one of the cornerstones of free MPEG-4 video. The web tells that this incompatibility of MPlayer 1.0rc2 and x264 is based on the fact that the aformentioned MPlayer source is outdated and does not support the much evolved current x264 version anymore. The only solution would be to compile the newest version of MPlayer, which currently is only available via an anonymous Subversion repository.
And here is the catch -- how to enable the fast Compiz video, yet keep x264 support also? The Compiz video patch is for the old MPlayer source, while the newer source supports the new x264?
I decided that the fortune favors the bold and tried to see if the patch could in any way be adopted to the new MPlayer source. The file in question is libvo/vo_xv.c. Of course there were numerous differences between the old and new versions of this file and this level of C code is well beyond my understanding (I generally dislike C).
Then I decided that it's worth a try to include the patched old vo_xv.c file with the rest of the new source code taken from Subversion. I expected it to blow up at ./configure script right away - it did not. I expected it to at least bail out with errors at compilation - it did not. It surely will crash once run - it does not. It works!
Since the following sources do a superb job at explaining at detail what packages you need to install, how to patch the file and how to compile the MPlayer, I will not copy their explanations, but merely add some remarks:
There's only one more glitch which needs to be rooted out. The fullscreen mode of MPlayer uses different screen mode which does not work anymore (reliably anyway). The solution is to turn off the special fullscreen mode by setting the property fstype=none. The only downside is that the Gnome panels remain visible that way.
One of the bigger problems when enabling Compiz for all these fancy UI tricks is the sad fact that video display will become, depending on which video output method your video player uses, either flashy, very slow or just totally unusable.
The root cause for this comes from the video output method. Those video output devices that render the graphics directly to the graphics card usually create a lot of flickering, since they effectively overwrite the rendered 3D graphics which in turn then overwrite the video window. The other video output methods think they render into a window become slow, since compiz will then have to copy the window contents to a 3D texture to be rendered by the video card.
With the Ubuntu 9.04 or (in my case) Linux Mint 7 "Gloria" x64 Edition the graphics driver installation is almost too trivial. At my workplace, with the ATI's Radeon X1650 card, the DRI R300 driver was installed automatically and effects were enabled out of the box with Gloria. At home I have ATI's Radeon HD3870 in which case I only had to confirm the installation of ATI's own Linux Catalyst drivers. The 3D effects along with full Compiz Fusion was already installed and ready to be swithced on.
But now became the real problem, how to make sure that watching video would still be possible with Compiz being active? I had heard a long time ago, at the dawn of Compiz, that there was one video player, which was patched to work with Compiz... I searched for it and was glad to find out that the player in question was MPlayer which is what I've always used in the past.
Since the patch is meant to modify source code, I had compile a patched version of MPlayer.
The compilation, however, blew up with some errors. The first error came from a module called IVTV... whatever that was I did not know. I simply disabled it with --disable-ivtv switch for ./configure script. The web told that there was a patch also to fix this, but I didn't care about that. The next error came from the x264 module which is a far worse thing, as this is one of the cornerstones of free MPEG-4 video. The web tells that this incompatibility of MPlayer 1.0rc2 and x264 is based on the fact that the aformentioned MPlayer source is outdated and does not support the much evolved current x264 version anymore. The only solution would be to compile the newest version of MPlayer, which currently is only available via an anonymous Subversion repository.
And here is the catch -- how to enable the fast Compiz video, yet keep x264 support also? The Compiz video patch is for the old MPlayer source, while the newer source supports the new x264?
I decided that the fortune favors the bold and tried to see if the patch could in any way be adopted to the new MPlayer source. The file in question is libvo/vo_xv.c. Of course there were numerous differences between the old and new versions of this file and this level of C code is well beyond my understanding (I generally dislike C).
Then I decided that it's worth a try to include the patched old vo_xv.c file with the rest of the new source code taken from Subversion. I expected it to blow up at ./configure script right away - it did not. I expected it to at least bail out with errors at compilation - it did not. It surely will crash once run - it does not. It works!
Since the following sources do a superb job at explaining at detail what packages you need to install, how to patch the file and how to compile the MPlayer, I will not copy their explanations, but merely add some remarks:
- A post in Ubuntu forums describing the original 1.0rc2 patching and compilation. Note that the patch file is no longer available from the link in that post (see below).
- A post in SmSpillaz with similar contents, but with a working link to the patch file. You can of course always use your friend Google to find alternate links to this file.
- An MPlayer download page with details how to download the new MPlayer from Subversion.
There's only one more glitch which needs to be rooted out. The fullscreen mode of MPlayer uses different screen mode which does not work anymore (reliably anyway). The solution is to turn off the special fullscreen mode by setting the property fstype=none. The only downside is that the Gnome panels remain visible that way.
Subscribe to:
Posts (Atom)