NV-CONTROL : XRRates refresh rate TwinView workaround failing?

We have an app that uses twinView. We start machines with an XOrg.conf that sets a twin view config. We then create a meta-modeline, get the ID, and use XRRSizes and XRRRates to find the matching fake modeline, and set that.

It works as intended, and we end up in twin view with an arbitrary metamode as we intend.

But - if we try to redo a new modeline by restarting the app (computer and X still running in previous twinview metamode), we can create the modes and metamode as expected, but when I go to XRRRates, I get actual refresh rates, not IDs.

This is on 331 on Arch Linux, Quadro cards. (App log: GPU: Quadro K5000, Driver: 331.20)

after_app-nvidia-bug-report.log.gz (633 KB)
After-bug-nvidia-bug-report.log.gz (1.84 MB)

Added NV bug reports.

Some new info - if I run my app with nvidia-settings running on a local or remote X connection, the bug doesn’t occur - XRR returns the Nvidia metamode ‘IDs’ instead of refresh rates.

If I run the app without nvidia-settings running, even one time, from then XRR reports real refresh rates, not IDs.

Fun to debug, as you can imagine: as soon as I started to observe the bug closely, it stopped happening!


For anyone that comes looking for a solution down the road…

Driver 302 (amongst other things) added an NV-Control attribute NV_CTRL_CURRENT_METAMODE_ID which you can use to set the metamode you’ve just created or selected.

Also - according to an NV tech who NV support begrudgingly contacted, the refresh == ID workaround is probably abandoned and they showed limited interest in looking at it. Of course, since it’s still there but buggy, it’s the worst of all worlds.


Sorry for the slow response. Our focus has been on adding proper support for RandR 1.2 and higher lately. If you can migrate your application to that, you might be able to work around the problem. Alternatively, you can write to NV_CTRL_STRING_CURRENT_METAMODE to just change the current metamode in-place without mucking about with the XRRRates stuff.

I’ll try to find a moment to see if I can look into this issue since the old way is technically still supported.

Thanks Aaron. The NV_CTRL_CURRENT_METAMODE_ID method works a charm. I already had the code in to make the metamode, or else I’m sure NV_CTRL_STRING_CURRENT_METAMODE would have been the way to go.

It’s good now.


Hi bwheaton, Is it possible to share sample application that demonstrate this issue with reproduction steps in details ?

I wouldn’t have time for quite a while. I’d expect if you took the NV-control sample that sets a metamode, and after the set do an XRRates call, you’d get the bad numbers.

Make sure you do not have Nvidia-settings open at the time - it seems to work around the bug.