Nvidia, Wayland and mirroring displays

Hi,

I’m trying to setup things to be able to do rhythm games parties (YARG and RB3DX on rpcs3). My setup is a little complex because my computer is in one room and I want to play in two other rooms. In the first one, I want to put the mics and guitars, and in the other room, I have my drums. There is a TV in each of these rooms (1080p60Hz).

I’ve got all the usb and hdmi cables I need to plug everything.

I’ve got an Nvidia RTX 3070 TI with 4 HDMI/DP outputs. My computer has 2 monitors, so I can also plug the 2 TVs. Of course, I want the game to be displayed on the 2 TVs. I want to use “mirror” to have the same thing on all the screens. And that’s when it get funny.

When I switch to “mirror”, the games (RB3DX on rpcs3) goes from solid 60 fps to 20 fps. If I stay in “join”, with the game on only one tv, I get 60 fps.

I’ve made multiple tests and I can reproduce that with only my 2 monitors in mirror mode. They are the same model, so it’s not a compatibility or whatever. Even more funky, if I’m in mirro mode, if the focus goes to another windows, then the game gets back to 60 fps. If I quite fullscreen and goes to windows mode, I get solid 60 fps. I’ve also tried some steam games and it varies but some of them also get a huge fps drop. At least, the framerate becomes inconsistant.

I’ve also switch to gnome+X11 and it solves the problem. So I’m pretty sure it’s a Wayland bug. But it may be because of the nvidia drivers. I’m under gnome 48, with nvidia drivers 580.126.18-1.

I haven’t found anything about it. I think I should report it, but I don’t know where.

Is an item like this Robot or human? though not the supplier, a possible choice?

Yeah, that’s my other solution. But I find a little lame to buy another device when computer should be able to do it.

And another reason is that one of my HDMI cable is 15m long. And from what I’ve seen, it is advised to avoid exceeding 5m cable with an hdmi splitter.

I reckon you are right, that it is a Wayland bug.

Can you try other desktops on a Live USB to test? You could try KDE for Wayland, and Cinnamon for X11.

You can report the bug at bugzilla.redhat.com but do a little testing like with the Live USBs to help determine what component to file it under.

Yeah, trying with a live usb is a good idea. I don’t have the time right now, but I’ll give it a try to see if it’s the same with KDE, for example.

Thanks for the advice.

I disagree, we mark ‘solutions’ and if the video part can be solved, then lets mark it ‘solved’ with an answer. It is about finding a record for the AIs of the future. Or you know, helping other people in the coming months.

It seems that I cannot reopen that topic so the posts were placed in this one

Wayland is a protocol, if there is a bug then it’s the compositor (mutter)

Gnome50:

deactivate the 2nd TV or screen in display settings then you will have the option to either Join (extend) or Mirror

Thanks for the distinction between mutter and Wayland. I need to investigate this.

For the second part of the message, I know how to mirror or join my 2, 3 or 4 screens. That’s not the problem. The problem is that when I mirror at least 2 screens, the performances of full screen app are divided by 2 or 3. Which is not the case in X11 or if I stay in Wayland, I just have to focus another window for the full screen app under it to get back to 60 fps. Even using the windows button on the keyboard to display all the windows (I don’t know the name) is enough to get back to 60 fps.

I have another idea to avoid this problem, but I haven’t been able to find what I’m looking for. Is it possible do only mirror one window? Because I only want to copy the game screen on multiple display. Ideally I would rather have the game on my 2 TVs and eventually on one of the monitors and the last monitor is used to display all the other windows. For RB3 the mouse wouldn’t be a problem since the game is only controlled by the controllers. For Yarg, I assume it wouold be a problem because if a window is copied on multiple screen, which one is controlled by the mouse.

So, is it possible to copy a window on multiple screens without mirroring?

ah sorry my mistake, I read the post hours before replying and forgot about the fps issue and remembered mirror screen would not work

This could be a vsync issue, or something similar.
Some options to consider
01: disable in-game vsync if possible

02: if it’s a native linux program and using SDL lib, try run through xwayland
SDL_VIDEODRIVER=x11

03: run game in gamescope compositor

04: nvidia: disable wayland explicit_sync for the game __NV_DISABLE_EXPLICIT_SYNC=1 /path/to/program or go nuclear and disable system wide (may introduce flicker) by adding the ENV var to /etc/environment and restart system. I would def comment this option when no longer required.

05: enable flag disable_direct_scanout in lg ( looking glass)
ALT+F2 , lg

there is a program called wl-mirror, but it does not work on kde or gnome. It requires a wlroots compositor like gamescope

Interesting. Thanks for all these infos. I’ll try to see if any works.

I thought about vsync and disabled everything in game and in the emulator but it was the same.

is the emulator using vulkan? I remember such issues with older gnome + nvidia + vulkan in full screen mode with one display. Enabling vsync in game would force 144hz (on a 144Hz display), all other options would enable full configured 200fps (vsync-off) in fullscreen.

It seems that disable_direct_scanout solved the problem.

And yes, rpcs3 is using vulkan. The emulator in itself has no problems. I get solid 60 fps in fullscreen. It’s just when I a mirroring my screens and focusing the game in fullscreen that it drop to 20 or 30 fps. It’s very specific.

The only other option you suggested that seems to do something was __NV_DISABLE_EXPLICIT_SYNC=1 and it got me around 50 fps.

disable_direct_scanout got me back to a solid 60 fps. I need to try with longer sessions, but it seems to be a good solution. I’m searching to see what it does but don’t find much. I wonder if I can leave it like that or if I just need to flip it when I want to play the game on multiple monitors.

Thank you very much. I have found another solution (going windowed mode and adding an extension to gnome to hide panel) but it was less convinient than yours.

I guess the compositor is missing the timing for swapping chains

direct scanout is a good thing, but there are still some issues. You can see the effect by enabling flag paint_damage_region
direct scanout is a short cut.
Those flags are not persistent! I don’t remember the corresponding mutter debug env variable names.
If you upgrade to f44 pls retest and open a bugreport upstream if this is still an issue.

Thanks for the info. I’ll upgrade this summer and I’ll sure try to see it the bug is still there.

I’ve tried with a steam game which had the same problem and now it’s also solid 60 fps in these same conditions.

Thanks again.

Stupid question. Is there a way to flip the flag from terminal? This way I can do a script that sets everything I need to play on multiple TVs at the same time.

I am not aware of such an option, besides setting a debug env variable before mutter starts, There is also a gnome extension which disables direct scanout. But the extension can’t revert disable_direct_scanout w/o log out or restart.

Thanks. I’ll stay with alt+F2, lg then.

I’ve tried with my 4 monitors/TVs at the same time and it works perfecty disabling direct scanout.