gonetz / GLideN64

A new generation, open-source graphics plugin for N64 emulators.
Other
771 stars 179 forks source link

[Mupen64Plus] Full screen / full screen toggle issues with mupen64plus-ui-console #1961

Open orbea opened 5 years ago

orbea commented 5 years ago

OS: Slackware64-current GLideN64: https://github.com/gonetz/GLideN64/commit/a5fc0689ac41815281e7121275334887179d25c9 mupen64plus: https://github.com/mupen64plus/mupen64plus-core/commit/ef15526ecdcde8f984a6162f9b874aa87108a3d4

When using GLiden64 with mupen64plus there are a variety of full screen issues.

https://github.com/gonetz/GLideN64/blob/a5fc0689ac41815281e7121275334887179d25c9/src/DisplayWindow.cpp#L106

1

This can be avoided by commenting the lines excluding break; here.

https://github.com/gonetz/GLideN64/blob/a5fc0689ac41815281e7121275334887179d25c9/src/Graphics/OpenGLContext/mupen64plus/mupen64plus_DisplayWindow.cpp#L144

The above two --fullscreen issues can be worked around (Fixed?) with this diff.

diff --git a/src/DisplayWindow.cpp b/src/DisplayWindow.cpp
index d26e19fa..591c46b4 100644
--- a/src/DisplayWindow.cpp
+++ b/src/DisplayWindow.cpp
@@ -112,8 +114,10 @@ bool DisplayWindow::resizeWindow()
        if (!m_bResizeWindow)
                return false;
        m_drawer._destroyData();
-       if (!_resizeWindow())
-               _start();
+       if (!m_bFullscreen) {
+               if (!_resizeWindow())
+                       _start();
+       }
        updateScale();
        m_drawer._initData();
        m_bResizeWindow = false;

2

This all started with the graphics refactor a while ago, as evidenced by the previous issue this used to be worse. https://github.com/gonetz/GLideN64/issues/1487

orbea commented 5 years ago

It seems the only time the full screen toggle correctly works is when starting with --windowed, toggling full screen and then toggling it again to make it windowed again.

orbea commented 5 years ago

@gonetz When you have a chance could you please help solve these problems? It would be a lot easier to spend time debugging GLideN64 if this is fixed.

gonetz commented 5 years ago

Hello,

I'd like to help. I'm not familiar with Slackware, so today I installed Ubuntu 18.04 on my PC. I installed sdl2.0, mupen64plus core and latest build of m64p for Linux. All drivers are default. I use Radeon card, but attempt to install amdgpu-pro drivers caused black screen, so I removed them. So, I run I mupen64plus-gui, set 960x720 as window resolution and run a rom. It started in window, ok. I switched it to fullscreen with alt+enter - no problems. I switched back to window - no problems again. I switched back and forth several times without any issue. 4:3 aspect works ok in fullscreen as well as widescreen hack. I set "fullscreen" in video options and rom started fullscreen. Switch to window works fine too in this case. Conclusion: mupen64plus works on Ubuntu 18.04 as good as on Windows 10 for me.

Actually, this is rather expected behavior. Plugin does not work with hardware directly. OpenGL content provided by emulator core. So, in theory, the plugin should work the same on all OS.

I see one way to solve the issue. You may put a lot of LOG messages to all places related to video context initialization and give me a patch with changes and your logs. I'll build it and run on my PC. Then we will compare our logs. May be that way we will find, what goes wrong.

Maybe not an issue, but when starting with --fullscreen it will show INIT NOISE TEXTURES. PLEASE WAIT... in the middle of the screen

It is not an issue. Plugin really shows this message in the middle of the screen.

loganmc10 commented 5 years ago

A lot of this is the responsibility of the frontend, @orbea what mupen64plus frontend are you using?

orbea commented 5 years ago

@loganmc10 I neglected to mention that I use the mupen64plus-ui-console (https://github.com/mupen64plus/mupen64plus-ui-console) frontend. I was under the impression this is a GLideN64 bug because I recall the other plugins not having this issue, but now that I have actually checked again the only one this works with is angrylion-plus.. Additionally the full screen toggle does not work with z64, glide64 or glide64mk2 at all while I can reproduce an issue similar to the second one with --windowed. As for rice, I lose the window with --fullscreen...

I suspect some if not all of these issues are not in GLideN64, sorry for the noise. I'll have to bug the mupen64plus devs about the console frontend to see which ones should be fixed there.

@gonetz Thanks for the time and I'm going to leave this open until its determined that nothing can be done here, feel free to close it sooner if you think that is the case.

gonetz commented 5 years ago

Ok. Please keep us informed.

Mastergatto commented 5 years ago

@orbea : Any news on this? I have similar issues also with SDL based interface, and not limited to this plugin, but also with others.

orbea commented 5 years ago

No, I haven't gotten around to trying to debug it further yet.

Mastergatto commented 5 years ago

@gonetz Sorry, but I have to disagree with the current title as this issue happens on ArchLinux too.

orbea commented 5 years ago

This is not specific to Slackware.

gonetz commented 5 years ago

It is not Linux-specific either, because the problem does not present on Ubuntu. Title should be informative for me. "issues on Slackware64" tells me that the issue is out of my competence and I may skip it for now. Without that hint I need to open it first to recall that I have nothing to do there.

orbea commented 5 years ago

Maybe its related to something else? Xorg? Even the DE or window manager? I am using a minimal tiling wm called spectrwm. I just strongly think this is not specific to any distro.

@Mastergatto How about you?

Mastergatto commented 5 years ago

I use GNOME 3.30 with Wayland on ArchLinux, running on AMD GPU with Mesa drivers.

orbea commented 5 years ago

So my guess that its, xorg, DE or wm related seems less likely, maybe its mesa or even a gallium issue? I have experienced both with nouveau and radeonsi.

@gonetz Just curious, what video driver do you use with ubuntu?

loganmc10 commented 5 years ago

I'm pretty sure the difference is because @gonetz is testing with mupen64plus-gui and you guys are testing with ui-console. The bug should be titled something like "full screen toggle issues with mupen64plus-ui-console"

gonetz commented 5 years ago

@gonetz Just curious, what video driver do you use with ubuntu?

Default one. Previous versions of Ubuntu had proprietary (or something like this) drivers from vendors, which you had to install to get hardware work properly. With Ubuntu 18 it is not necessary.

@gonetz is testing with mupen64plus-gui

True. I tested with your build of m64p.

Mastergatto commented 5 years ago

I have just tried m64p, its fullscreen toggle works without issues. Maybe it's an issue with SDL then, as I have the same problem with my frontend that uses it just like the ui-console.

orbea commented 5 years ago

@Mastergatto What SDL version are you using? I have SDL-2.0.9 here.

Mastergatto commented 5 years ago

Same here.

zlice commented 2 years ago

On Void Linux with single monitor setup.

This used to work on Gentoo years back. Then again I swear there used to be a different GTK frontend I used.

From below, I think it is a mix of plugin and UI behavior. Not entirely sure how fullscreen works between mupen/sdl/frontend. Assuming there are fullscreen callbacks from the GlideN64 commits I was looking at.

Rice

m64py

command line

Glide64

m64py

command line