Xfce Forum

Sub domains
 

You are not logged in.

#1 2021-06-28 16:07:30

Doest
Member
Registered: 2019-08-22
Posts: 5

How to make all video outputs have the same frequency output (Hz)

Hello everyone.

I work within the IT staff in a small study company and we have chosen to adopt to the Xubuntu environment with the XFCE environment for issues of customization, control and security of students and teachers of the same.

The thing is that all the classrooms have a computer with a screen, keyboard, mouse and PC and a projector.

And I have found myself with the problem that screen and projector both must be emitted in the same resolution so that it does not get out of balance...

With this I have generated a small script in sh with the sed command to replace all entries in displays.xml ($HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml), of the known resolutions that are recorded in VGA - DVI - HDMI or DP of the screen and projector and these end up emitting at 1024x768.

The script works and all inputs end up at 1024x768.

pre-res.sh wrote:

sed -i 's/1440x900/1024x768/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/1280x1024/1024x768/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/1280x960/1024x768/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/1360x768/1024x768/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/1280x800/1024x768/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/1152x864/1024x768/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/1280x720/1024x768/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/1152x720/1024x768/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/1024x768/1024x768/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/832x624/1024x768/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/800x600/1024x768/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/640x480/1024x768/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/720x400/1024x768/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml

But I have the problem that if I want to use the same method to output at 60hz and not at 59.0hz or 75hz because it looks blurry or cuts the screen on the left or right.

sed -i 's/120.337005/60.003840/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/120.074667/60.003840/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/120.001629/60.003840/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/119.906704/60.003840/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/119.766506/60.003840/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/119.649519/60.003840/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/75.028582/60.003840/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/74.551266/60.003840/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/72.808802/60.003840/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/72.187572/60.003840/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/70.081663/60.003840/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/66.666667/60.003840/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/60.316541/60.003840/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/60.003840/60.003840/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/59.940476/60.003840/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/59.819516/60.003840/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/59.798991/60.003840/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/59.629027/60.003840/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/59.506178/60.003840/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/56.250000/60.003840/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/50.000000/60.003840/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/30.001110/60.003840/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
sed -i 's/25.000000/60.003840/g' $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml

It seems to go well at first seeing that it changes the screen or projector to 60hz, but something goes wrong and some return to 59.0hz or 75hz and I'm back to where I started.

...

I also tried with

xrandr --output VGA-0 --mode 1024x768 -r 60
xrandr --output HDMI-0 --mode 1024x768 -r 60
xrandr --output DVI-0 --mode 1024x768 -r 60

xrandr --output VGA-1 --mode 1024x768 -r 60
xrandr --output HDMI-1 --mode 1024x768 -r 60
xrandr --output DVI-1 --mode 1024x768 -r 60

---

xrandr --output HDMI-0 --same-as VGA-0
xrandr --output VGA-0 --same-as HDMI-0

---
xrandr -s HDMI-1 1024x768 -r 60
xrandr -s DVI-1 1024x768 -r 60
xrandr -s VGA-1 1024x768 -r 60
xrandr --output HDMI-1 --mode 1024x768 -r 60.0
xrandr --output VGA-1 --mode 1024x768 -r 60.0
xrandr --output DVI-1 --mode 1024x768 -r 60.0

And by script invoking xrandr it does the same as above and it ONLY works if I invoke a command from the terminal myself

Any idea?

Thanks smile

Offline

#2 2021-06-28 22:28:39

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,486

Re: How to make all video outputs have the same frequency output (Hz)

Doest wrote:

And by script invoking xrandr it does the same as above and it ONLY works if I invoke a command from the terminal myself

How else do you run the script that it doesn't work? Via cron? Startup?

Also, which distro and which version of Xfce and xfce4-settings are you using?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2021-06-29 00:34:51

Doest
Member
Registered: 2019-08-22
Posts: 5

Re: How to make all video outputs have the same frequency output (Hz)

ToZ wrote:

How else do you run the script that doesn't work, via cron, startup?

.

On desktop load, I use the Session and Startup tool (xfce4-session-settings) -> App autostart and it loads the sh script hosted in another folder.

If I try to load the script that replaces the numbers at 1024x768 it works fine, but goes wrong if you want to apply the 60.hz.

If I try to load the script that invokes xrandr it seems to do the same as the previous script and doesn't do the same when I ask it to also change the hz.

Now. If I try to tell it through the terminal to apply a specific configuration with xrandr, it seems to do the same as the previous script BUT it does respect my Hz.

ToZ wrote:

Also, what distro and what version of Xfce and xfce4-settings are you using?

.

I have tried running the above via Xubuntu 16.04 (XFCE 4.12) as well as a newer version such as Xubuntu 20.04 (XFCE 4.14~4.16) and the result is the same in both versions

Last edited by Doest (2021-06-29 00:37:23)

Offline

#4 2021-06-29 01:49:03

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,486

Re: How to make all video outputs have the same frequency output (Hz)

Doest wrote:
ToZ wrote:

How else do you run the script that doesn't work, via cron, startup?

.

On desktop load, I use the Session and Startup tool (xfce4-session-settings) -> App autostart and it loads the sh script hosted in another folder.

If I try to load the script that replaces the numbers at 1024x768 it works fine, but goes wrong if you want to apply the 60.hz.

If I try to load the script that invokes xrandr it seems to do the same as the previous script and doesn't do the same when I ask it to also change the hz.

Now. If I try to tell it through the terminal to apply a specific configuration with xrandr, it seems to do the same as the previous script BUT it does respect my Hz.

It might be possible that the script runs before xfce4-settings is finished and may overwrite your settings. Try adding a delay to your script, something like "sleep 5s" at the begging to see if that makes a difference. Slowly increase the sleep value until it works (if it works).

ToZ wrote:

Also, what distro and what version of Xfce and xfce4-settings are you using?

.

I have tried running the above via Xubuntu 16.04 (XFCE 4.12) as well as a newer version such as Xubuntu 20.04 (XFCE 4.14~4.16) and the result is the same in both versions

You might also consider creating a bug report to see if the develop will comment.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2021-06-29 07:30:41

Doest
Member
Registered: 2019-08-22
Posts: 5

Re: How to make all video outputs have the same frequency output (Hz)

ToZ wrote:

It might be possible that the script runs before xfce4-settings is finished and may overwrite your settings. Try adding a delay to your script, something like "sleep 5s" at the begging to see if that makes a difference. Slowly increase the sleep value until it works (if it works).

.

I have tried to put in both scripts the sleep command 5, 10, 15, etc repeatedly or randomly and the desktop loading has no effect because apparently the sleep command does not load.

It is possible that you are right and it has something to do with the options that may bring xfce4-settings to apply its configuration on the displays.xml file.

If I try to run it manually or through the script, sleep does its job roll

ToZ wrote:

You might also consider creating a bug report to see if the develop will comment.

.

Yes. It is also a possibility to see what process/s rule over that file, try to modify it from above and see if a log can be generated.

Still there should be some way to disable the automatic scaling and refresh rate as if I could do with the microphone gain that google chrome applied in online video call platform.

Offline

#6 2021-06-29 11:15:20

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,486

Re: How to make all video outputs have the same frequency output (Hz)

Doest wrote:

It is also a possibility to see what process/s rule over that file, try to modify it from above and see if a log can be generated.

You can run xfce4-settings in debug mode.

Still there should be some way to disable the automatic scaling and refresh rate as if I could do with the microphone gain that google chrome applied in online video call platform.

Not runtime that I know of. You can disable xrandr support (meaning it won't do any display management - xrandr commands like yours will still work) at build time if you build the package using the "--disable-xrandr" parameter.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.011 seconds, 8 queries executed - Memory usage: 582.93 KiB (Peak: 600.21 KiB) ]