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

Rendering of plugins fails when using dual monitor setup with primary monitor to the right. #89

Closed
mindbeat opened this issue Mar 26, 2021 · 22 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@mindbeat
Copy link

mindbeat commented Mar 26, 2021

Problem description
I noticed that the rendering of the plugins breaks when using a dual monitor setup under Renoise with my primary screen to the right. It works as expected when I set the primary screen to the left.

Feels like a timing issue, cause it works 2 out of 10, with primary to the right, When closing and opening the plugin.
I notice the same behavior in both of my vst2 plugins. And it gets resolved set the primary to the left.

What did you expect to happen?
To render the plugin correctly

What actually happened?
Get a un-rendered window, mirroring the Renoise window.

System information

  • Plugin: Z3TA+2, quadraSID ( The only vsts installed)
  • Plugin type: VST2
  • Host: Renoise 3.3.2
  • Operating system: Linux Mint 20.1
  • Wine version: wine-6.4 (Staging)
  • GPU Nvidia 1060 - nvidia-driver-450
  • Installation method: "Automatic setup"
  • yabridge version: yabridge-3.0.2
  • yabridgectl version 3.0.2

Debug log

In this log, the plugin at first rendered correctly, and then I closed it, and open it 4 more times, and then it did not display correctly, the 4 last times.
yabridge.log

Native plugins works, without this issue.

Else I just want to say thumbs up, for a epic, easy to use modern vst bridge.
Many thanks,
rnsbug

Dennis

@mindbeat mindbeat changed the title Rendering of plugin issue when using dual monitor setup with primary to the right. Rendering of plugin fails when using dual monitor setup with primary monitor to the right. Mar 26, 2021
@mindbeat mindbeat changed the title Rendering of plugin fails when using dual monitor setup with primary monitor to the right. Rendering of plugins fails when using dual monitor setup with primary monitor to the right. Mar 26, 2021
@robbert-vdh robbert-vdh added the bug Something isn't working label Mar 26, 2021
@robbert-vdh
Copy link
Owner

Hi,

I don't have a second display available, so it's a bit difficult for me to debug this at the moment! Everything yabridge is doing should be deterministic, so that 2/10 chance you mentioned where it did work correctly on your second monitor would could indicate that Renoise creates the window on the primary display and then moves it to the secondary display. In the meantime, could you check what happens when you:

  1. Drag the window around? So just pick up the window, move it a few pixels, and then let it go again. And also when dragging the window from your secondary display to your primary display.

  2. Enable xembed support? This uses Wine's own XEmbed support for the embedding instead of yabridge's normal embedding method. The XEmbed implementation is kind of broken (and might also require you to reopen the window at least once to get it to display correctly) hence why it's hidden behind an option, but this avoids the only part of yabridge I could think of that could be causing this issue to happen. To enable this for all plugins (you'll probably want to undo this later), create a file called yabridge.toml next to your plugin's VST2 .dll files (likely in ~/.wine/drive_c/Program\ Files/Steinberg/VstPlugins with the following contents:

    # ~/.wine/drive_c/Program\ Files/Steinberg/VstPlugins/yabridge.toml
    ["*"]
    editor_xembed = true

    When launching Renoise from a terminal and loading the plugin, you should see a config from: line telling you that the above file got loaded, and other options: should include something about xembed support.

@mindbeat
Copy link
Author

Hello buddy,

Thanks for the quick feedback,

When I set the primary to the left, it also works in my right monitor. So that's my solution right now. It works for me :)

  1. Dragging the window does not make any changes. The problem is on both displays with the "primary right" setting.
  2. I tired the editor_xembed = true, and this seems to work, And it renders correctly. But that introduce another issue, now the mouse pointer y is like +50px off, and I have to click a littlebit above when using the plugin.

@robbert-vdh
Copy link
Owner

I've asked around on the Discord to see if there are any other people using multiple displays, maybe that will tell us whether this issue is an isolated case or if it also happens for everyone else. I couldn't get virtual X11 displays working on my desktop, but I'll have to try later if I can get it working on my laptop to see if I can replicate the issue (I also don't have a way to plug my monitor into my laptop). It could also be something related to your particular window manager setup, as a 50px y-offset does sound very odd (with editor_xembed = true Wine itself is responsible for making sure the plugin editor's screen coordinates match up with the window's position, and that works just fine here with Renoise 3.3.1, KDE Plasma and a single display).

@mindbeat
Copy link
Author

Okay thanks.
I just double checked if I got a different behaviour changing the resolution. I'm using two 4K panels. But it did not make any difference.

I only got Cinnamon desktop installed right now, but I can test with some other desktop if you want :)

@mindbeat
Copy link
Author

Okay, so I tested KDE Plasma desktop. It did not have this issue. So probably its related to the window manager Muffin, or the Cinnamon desktop.

Have a nice weekend!

@robbert-vdh
Copy link
Owner

That's actually very good to know! When I get around to checking this out (I'll have to either get virtual X11 displays working on my laptop or I'll have to go out and buy a DisplayPort to USB-C/Thunderbolt 3 adapter) I'll at least know to focus Cinnamon, thanks!

@AquaMorph
Copy link

I have a three monitor setup and normally have the center set to be primary. I tried setting each monitor one by one as primary and open and closing the VST window multiple times as well as moving it between monitors. I didn't have any luck recreating this either. I'll post my system info here in case it is helpful for debugging.

System information

  • Plugin: Valhalla Shimmer
  • Plugin type: VST2
  • Host: Bitwig 3.3.5
  • Operating system: Fedora 33
  • Window Manager: i3-gaps
  • Wine version: wine-6.4 (Staging)
  • GPU: Nvidia 1080 Ti driver 460.56
  • Installation method: manual install
  • yabridge version: yabridge-3.0.2

@robbert-vdh
Copy link
Owner

robbert-vdh commented Apr 3, 2021

Small status update, but I've finally found some time to look into this. It took a bit of effort, but I've been able to replicate this with Renoise 3.3.2 on Cinnamon 4.8.6 when setting my laptop's (unconnected) HDMI-2 output to 1920x1080 and positioning that to the left of the main laptop's internal display, which is set as primary. This also seems to mess up Cinnamon itself, because this also causes the wallpaper to move off to the left, and even though the right display was the primary display new windows would still be created off screen on the 'virtual' HDMI output to the left. So I don't have a solution just yet, but at least I can now recreate this situation.

See below.

@robbert-vdh
Copy link
Owner

Or, well, never mind. The issue I've been seeing here is a pure Wine issue, and it doesn't have anything to do with yabridge. With this screen setup all Wine windows don't render the parts of the window that have not been visible on the leftmost monitor until you move it there. So if I run wine notepad.exe, move Notepad to the right screen, close it, and then run wine notepad.exe again so it opens on the rightmost screen (with the left screen still being virtual in my case), then the window will not render (like in your screenshot) until I move it to the left screen and then move it back. That might be a different issue from what you're seeing, but I'm sadly unable to reproduce that then.

So the issue in your case only happens on Cinnamon, but does it also only happen in Renoise? Have you tried in some other hosts like REAPER, Bitwig, and Carla (use carla-single vst3 ~/.vst3/yabridge/path-to-plugin-directory.vst3)?

@mindbeat
Copy link
Author

mindbeat commented Apr 4, 2021

I tried the same thing with Reaper and was able to reproduce the bug. You are probably right there, because in reaper I see that windows are opens or flicker at top left corner on my left screen, before it opens on my right. Here is a screenshot.
Reaper
Open and close sometimes fix it, and sometimes not, similar to Renoise.
A comment in the wiki for known issues would be enough i guess. I've set my primary to the left, and moved my menu panel, to the right, and don't notice that much difference, cause Cinnamon opens most of my apps in the currently used screen.

@robbert-vdh
Copy link
Owner

robbert-vdh commented Apr 4, 2021

I'll add a note for Cinnamon doing weird things then I guess, thanks! Cinnamon also causes some plugins to flicker when dragging around the windows. Could you test for me what happens when you set your right monitor as primary (so that the same thing that's been happening on your screenshots happens again), then open a terminal on your now primary right monitor, run wine notepad.exe, move that Notepad instance to the right screen, close it, and then run wine notepad.exe again. Does that render correctly?

Because the only issue I could replicate was really a weird interaction between Cinnamon and WIne, but I can't imagine what it would have to do with yabridge and how setting a certain display as primary would affect it.

@mindbeat
Copy link
Author

mindbeat commented Apr 4, 2021

I tried to recreate your example with notepad, but here it does render correctly. Tried it a couple of times.

@robbert-vdh robbert-vdh added the help wanted Extra attention is needed label Apr 4, 2021
@robbert-vdh
Copy link
Owner

It could also be a different issue entirely, and Cinnamon is just messing with the reparenting. Especially since it doesn't seem to happen in KDE Plasma, i3, and some other desktop environments others have tested. There's no reason why it shouldn't work, since with a multi monitor setup in X11 you for all intents and purposes just have a single large screen behind the scenes, and there's no special handling involved there.

robbert-vdh added a commit that referenced this issue Apr 4, 2021
@JonathanTroyer
Copy link

Hey there! I'm having the same issue in Reaper as described above, but with GNOME and X11. However, it seems to be limited to certain plugins, in my case the MeldaProduction plugins.

@robbert-vdh
Copy link
Owner

@JonathanTroyer Interesting. Does this in your case also depend on which display is set as primary? I still don't have a second display to test this with myself. Also, since you mention MeldaProduction plugins, does this also happen when you disable GPU acceleration in the settings? And does it happen consistently, e.g. when you close and reopen the editor (or switch between the generic UI and the editor GUI)?

@JonathanTroyer
Copy link

JonathanTroyer commented May 4, 2021

It does not depend on which display is set as primary. It also does not happen when I use one display.
For Melda plugins, It continues when GPU acceleration is disabled.
It happens constantly.

However, if I float the plugin UI in Reaper and then un-float it, the UI will appear correctly for the rest of the session (regardless of moving things around). Viewing another plugin and then switching back will also fix the view in the same way as floating it. Floating/switching view of the plugin only fixes that plugin. Adding new instances of the same plugin will cause them to be displayed, but sized incorrectly (upon either floating or changing views it will then be sized correctly).

@robbert-vdh
Copy link
Owner

robbert-vdh commented May 4, 2021

@JonathanTroyer Since this is a different issue, could? you create a separate issue for this? There must be something unique about your setup that's causing this, since lots of people use GNOME/X11. Some potentially related factors would your Wine version GNOME version, any additional GNOME extensions and your GPU/Xrandr setup (Intel/AMD/NVIDIA/hybrid graphics). If you happen to have Bitwig installed, does it also happen there? (or in Ardour, but Ardour does its own weird things) And another thing to check (to eliminate some possibilities) would be to check if enabling the option to use Wine's own Xembed implementation changes anything. See above for instructions on how to do that, and make sure to check in the initialization message printed to the terminal if the option's actually active or not.

@robbert-vdh
Copy link
Owner

Is there anyone still around to test a few things here? I still don't have a way to replicate a dual monitor setup here, so maybe we should just try a few things to see what works.

robbert-vdh added a commit that referenced this issue Jun 15, 2021
Under certain DEs/WMs, the window might not render at all when using
multiple displays and the primary display is set to the rightmost
display.

This seems like a reasonably candidate for fixing this.

#89
#104
@robbert-vdh
Copy link
Owner

I made a first blind attempt in 5e30c94.
If anyone's willing to help me test this, could you:

  1. First try to replicate the issue described above with yabridge 3.3.1. So, with a dual monitor setup under Cinnamon (and possibly also some other DEs), set the rightmost display as primary, open Renoise or REAPER (which should now automatically open on the rightmost display), and then try to load a plugin. The plugin's GUI should not be visible. Repeating this with the leftmost display set as primary should work as expected.

  2. If you can replicate this, then great! (in a sense 😅) Now check if that commit I mentioned above fixes it. To do so, grab the latest build from this page (you need to be logged in to download files from GitHub Actions) and replace the existing yabridge files in ~/.local/share. Or if you're on Arch/Manjaro, then you can build a version of yabridge from this branch using the script below. Make sure to rerun yabridgectl sync after replacing the files or installing the new yabridge-git package:

    # On Arch/Manjaro
    git clone https://aur.archlinux.org/yabridge-git.git ~/.cache/yabridge-git
    cd ~/.cache/yabridge-git
    sed -i "s@source=.\+\$@source=('git+https://github.com/robbert-vdh/yabridge#branch=fix/rare-secondary-display-issue')@" PKGBUILD
    makepkg -sic
    
    # You can of course also get rid of `~/.cache/yabridge-git` after installing the package, and don't forget to rerun `yabridgectl sync`

    After updating to this version of yabridge (you can verify that you are indeed using this version by checking the two 'Initializing yabridge' lines in yabridge's output, try repeating the steps from 1). Does the issue still occur?

  3. If it does not, does everything also still work when dragging the window between displays?

Thanks for helping me out here!

robbert-vdh added a commit that referenced this issue Jun 29, 2021
Under certain DEs/WMs, the window might not render at all when using
multiple displays and the primary display is set to the rightmost
display.

This seems like a reasonably candidate for fixing this.

#89
#104
robbert-vdh added a commit that referenced this issue Jul 19, 2021
(cherry picked from 1950206)

Under certain DEs/WMs, the window might not render at all when using
multiple displays and the primary display is set to the rightmost
display.

This seems like a reasonably candidate for fixing this.

#89
#104
robbert-vdh added a commit that referenced this issue Jul 19, 2021
(cherry picked from 1950206)

Under certain DEs/WMs, the window might not render at all when using
multiple displays and the primary display is set to the rightmost
display.

This seems like a reasonably candidate for fixing this.

#89
#104
@robbert-vdh
Copy link
Owner

Since I didn't get any responses, yabridge 3.5.0 contains a potential fix for this. Please let me know if it helps!

@robbert-vdh
Copy link
Owner

Since #104 was fixed by yabridge 3.5.0 and I haven't gotten any response here yet, I'll just assume that this now also works fine. Please reply if it does not!

@mindbeat
Copy link
Author

Sorry for being afk, I've been on vacation without my DAW :) I tried the latest build, and I can confirm that the all VSTs renders correctly now, with my primary monitor set to the right! So Awesome. Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants