Suggestion of inclusion of compton compositor

I have the AMD/ATI Bonaire Radeon R7 200 GPU on my rig. This works well with Marco, but has persistently been a bit buggy with Compiz. I am pretty sure the Compiz issues I have experienced are related to my card and not due to Compiz itself, due to reading of others’ similar issues with Compiz and this card. However, given that Marco does not use the GPU for compositing, it is slightly less effective at eliminating screen tearing than Compiz. Consequently, I searched for a simple GPU hardware compositor that worked well with my AMD card and it turned out to be Compton. Basically it involves leaving Marco enabled as the windows manger with compositing turned off and having Compton running alongside to handle the hardware compositing instead.

Though there are many subtle switches available for Compton, I run it with the following command:

compton -c -m 0.8

This gives full hardware compositing with panel and menu shadowing and menu transparency. The menu transparency can be turned up or down by altering the value from 0 to 1. But, I find 0.8 is a nice level.

All of the above being the case, I was wondering if it could be parcelled up into Mate Tweak as an optional feature to use in conjunction with Marco for those users using AMD cards.

4 Likes

It looks like Compton is on the road map, it’s just a matter of when it’s integrated to MATE Tweak:
https://bitbucket.org/ubuntu-mate/mate-tweak/issues/9/compton-integration

excellent news lah7!

Compton is on the roadmap and I’ve even had a failed attempt at adding it to MATE Tweak. Compton is not a window manager, it is just a compositor, therefore integrating into MATE Tweak requires some thought because Compton needs to run alongside Marco, but not the other window managers such as Compiz.

I’ve looked at the Linux Mint implementation and, in my opinion, is not intuitive. So, I need to drink some more tea and have a good think…

I had a good hard think and have now had a good idea about how to implement this in a much more elegant way. I’ve created a new window manager, which is in fact a simple wrapper for both Marco and Compton and called marco-compton.

The wrapper forces Marco to not use it’s built-in compositor and then launches Compton. Compton currently uses the glx backend only and is nicely tuned for optimal performance and includes shadow exclusions to ensure is behaves nicely with some quirky applications. By default is it hard coded to integrate with MATE but the configuration can be overridden should the defaults not be to your tastes. Create a regular compton config in ~/.config but make sure it named marco-compton.conf to distinguish from normal compton.

You can find the current version of the script here:

@stevecook172001 I’d really appreciate it if you could test the little wrapper and let me know if screen tearing is fixed on your system? Just copy the code above to a file, make it executable and run it. The next step is to add support for the wrapper to MATE Tweak so marco-compton can be switched to in the same way Marco, Metacity and Compiz currently work.

I hope to have all this finalised an completed for Alpha 2, so feedback greatly appreciated :slight_smile:

Hi Martin.

It didn’t work. Instead, it immediately locked my machine and required a hard reboot. I tested it twice to be sure, but it did it both times.

To clarify. I have Compton already installed. Currently, I run Compton in the following way:

I have Marco as the windows manager with compositing disabled. I then run the following command to use Compton:

compton -c -m 0.8

As preparation for using your script, I left Marco enabled (but without compositing) and killed my currently running instance of Compton. Then ran the script.

Hmm, that’s very odd. What GPU and drivers do you have?

AMD/ATI Bonaire Radeon R7200 GPU using the propriety driver

If you are up for it, please take the revised version of the script from today and try removing some of the options to see if you can identify why this does not work. My first idea is to change the backend from glx to xrender and see how it goes. I don’t have any Radeon hardware current enough to run the proprietary drivers :cry:

No problem Martin. I’ll do it tomorrow.

1 Like

OK, I’ve pretty much finished the new version of MATE Tweak. Not released yet.

I’ve tested the Compton integration on Intel IGP and nvidia (proprietary drivers). It all works fine, although MATE Tweak does check the GLX capabilities before presenting a Compton composited option in the pick list.

@stevecook172001 Would it be easier if I just make a pre-release .deb of the new MATE Tweak available for you to test? That said, I’m still concerned that one of the options I’m using to invoke Compton might be the cause of the lock up you’re experiencing so I might still need some help getting to the bottom of that.

Looks like fglrx from late 2013 and early 2014 had bugs in the VSync implementation. I’ve seen reports that the Compton glx backend doesn’t work correctly until drivers from mid-2014.

So, @stevecook172001 try the xrender backend (software) or the glx backend but with vysnc set to none :slight_smile:

Hi Martin

Carried out the suggestions, but still locking or not working at all.

Fiddled about a bit myself and found the following to work:

marco --no-composite --replace &
killall compton
sleep 1
compton -c -m 0.8

Obviously, the last line is my own preferred setting of Compton (shadows plus transparencies)

The above script works irrespective of whatever windows manager/compositor is currently in use. I put in the sleep command because, without it, Compton was not loading half the time. But, with it, it loads every time.

The only thing that is not right is that in Mate Tweak, the listed windows manager (for example, Compiz) is not updating itself in the drop down list, although it has definitely been replaced by my script being run.

So, I have three scripts now that seem to be working to switch between windows managers/compositors:

Marco replace

killall compton
marco --no-composite --replace &

Marco-Compton replace

marco --no-composite --replace &
killall compton
sleep 1
compton -c -m 0.8

Compiz-replace

killall compton
compiz --replace &

I don’t know if these are persistent though, beyond a given session

Okay, I realize this is just for me cos it is a bit hacky, but I thought I would share what I have done Martin.

I have created an initially empty file I have called “windows-manager.sh” in a folder called “my-bash-scripts” in my home folder. I have set the file as executable. I have then included this initially empty file in my start-up applications list.

I have also created 3 other bash scripts and also put them in the “my-bash-scripts” folder. Each of which is listed below:

marco-replace.sh

cat /dev/null > /home/stephen/my-bash-scripts/windows-manager.sh
echo “killall compton” >> /home/stephen/my-bash-scripts/windows-manager.sh
echo “marco --no-composite --replace &” >> /home/stephen/my-bash-scripts/windows-manager.sh
cd /home/stephen/my-bash-scripts
./windows-manager.sh

marco-compton-replace.sh

cat /dev/null > /home/stephen/my-bash-scripts/windows-manager.sh
echo “marco --no-composite --replace &” >> /home/stephen/my-bash-scripts/windows-manager.sh
echo “killall compton” >> /home/stephen/my-bash-scripts/windows-manager.sh
echo “sleep 1” >> /home/stephen/my-bash-scripts/windows-manager.sh
echo “compton -c -m 0.8” >> /home/stephen/my-bash-scripts/windows-manager.sh
cd /home/stephen/my-bash-scripts
./windows-manager.sh

compiz-replace.sh

cat /dev/null > /home/stephen/my-bash-scripts/windows-manager.sh
echo “killall compton” >> /home/stephen/my-bash-scripts/windows-manager.sh
echo “compiz --replace &” >> /home/stephen/my-bash-scripts/windows-manager.sh
cd /home/stephen/my-bash-scripts
./windows-manager.sh

So, what each of these 3 scripts does is, firstly, erase the contents of the windows-manager.sh file, then replace the contents with the commands to use a given windows manager/compositor. Then execute the windows-manager.sh file.

The advantage of doing it this way being that the windows-manager.sh file will auto-start with those newly inserted contents the next time I log in. They will only subsequently change again if I decide to change the windows manager/compositor at a later date using one of the 3 scripts.

1 Like

@stevecook172001 compton -c -m 0.8 doesn’t specify and backend nor a vsync mode. Could you please use my script to try the xrender backend and different vsync modes?

Could you explain exactly how (in the script you provided) to do that Martin, in case, when I did it last time, I did it wrong. sorry to be a numpty.

I am assuming you mean these first two lines:

BACKEND=“glx”
VSYNC=“opengl-swc”

What, precisely, do you want me to replace them with?

okay, just changing the first line to xrender works

It’s this bit of your recent post that I don’t quite understand

glx backend but with vysnc set to none

Do you want me to comment out the second line, or put “none” in there or have it as “”?

OK, change the VSYNC line to:

VSYNC=none

And try that with the glx and xrender backends. Now, the most important point. Are you using Ubuntu MATE 14.04 to test this? If so, that’s a bit of a bummer for me, because my understanding in the fglrx drivers have improved since 14.04 and “should” work now with the glx backend.

Can anyone help test this on 15.10 or, better yet, 16.04 alpha?