Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configurable vrefresh #3560

Closed
totaam opened this issue Jun 22, 2022 · 4 comments
Closed

configurable vrefresh #3560

totaam opened this issue Jun 22, 2022 · 4 comments
Labels
enhancement New feature or request X11

Comments

@totaam
Copy link
Collaborator

totaam commented Jun 22, 2022

Some applications may be querying the virtual screen's virtual outputs (#56) to get the vertical refresh rate in order to synchronize with it.

f37e274 makes it possible to override the default which was 50Hz.
We should:

  • add a command line switch (to set the default on the server, to override detected value on the client)
  • expose the vrefresh per-output in the screen definition
  • use the global vrefresh value if that's not provided
  • perhaps bump the max clock so we can have high resolutions without bumping into the 230MHz clock limit (and expose this somehow so the code knows what limits to use)
@totaam totaam added enhancement New feature or request X11 labels Jun 22, 2022
totaam added a commit that referenced this issue Jun 22, 2022
* use a new capability rather than overloading the old one once more,
* change the monitor data format from #56 to match the GTK names more closely (easier),
* apply client desktop-scaling to monitor data
totaam added a commit that referenced this issue Jun 22, 2022
xsync after calling X11RandR.is_dummy16 rather than at the end
totaam added a commit that referenced this issue Jun 22, 2022
totaam added a commit that referenced this issue Jun 23, 2022
@totaam
Copy link
Collaborator Author

totaam commented Jun 23, 2022

I don't think bumping the max clock was really needed, but in any case:

[ 39929.781] (**) DUMMY(0): Max Clock: 30000000 kHz
[ 39929.781] (II) DUMMY(0): dummy_monitor: Using hsync range of 1.00-30000.00 kHz
[ 39929.781] (II) DUMMY(0): dummy_monitor: Using vrefresh range of 1.00-300.00 Hz
[ 39929.781] (II) DUMMY(0): Clock range:  11.00 to 30000.00 MHz

That should be enough for some time.

@totaam
Copy link
Collaborator Author

totaam commented Jun 23, 2022

The server side is working.
New tasks:

  • set_initial_resolution needs doing...
  • the shadow server's refresh_delay should honour the new refresh-rate command line option

Minor issue: the modeline is being rounded down somewhere:

3840x2160@30  29.00*

We calculate a modeline for refresh-rate: 29998 and correctly name it @30 (rounding to nearest) but somehow xrandr gets 29Hz instead..

@totaam
Copy link
Collaborator Author

totaam commented Jun 24, 2022

Now with support in the client, here are the resolutions that are generated from my 4K60 monitor (technically 59.996Hz) using auto, 50% and 80% for --refresh-rate:

   3840x2160@60  59.00* 
   3840x2160@30  29.00  
   3840x2160@48  47.00  

And since the code is shared, I get the exact same result when using the --refresh-rate switch on the server instead.
Note: using it on both client and server would have a cumulative effect. ie: 50% applied twice is 25%.

totaam added a commit that referenced this issue Jul 6, 2022
totaam added a commit that referenced this issue Jul 7, 2022
also support an extended syntax for the 'resize-display' option:
ie: '4K60' and '1080p30'
@totaam
Copy link
Collaborator Author

totaam commented Jul 7, 2022

The commit above ensures that the refresh-rate specified is honoured when setting the initial resolution and when adding new ones via the control channel.

Note: refresh-rate does not override resize-display:
ie: xpra start --resize-display=4K60 --refresh-rate=30.
In this case, the initial resolution will be 4K at 60Hz, only resolutions added after that will use 30Hz.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request X11
Projects
None yet
Development

No branches or pull requests

1 participant