libretro / beetle-psx-libretro

Standalone port/fork of Mednafen PSX to the Libretro API.
GNU General Public License v2.0
307 stars 131 forks source link

[OpenGL] Completely black screen #188

Closed ofry closed 7 years ago

ofry commented 7 years ago

I just get a black screen with opengl now. Vulkan and software working.

Video driver = "gl" HW Shared Context = "on"

Core version 76862abefdde9097561e2b795e75b49247deff17

Video card: ATI Radeon R7 360

OS: Windows 8.1 x64

hizzlekizzle commented 7 years ago

Do you have any shaders enabled?

ofry commented 7 years ago

Yes, stack of GLSL shaders.

But black screen even when video_shader_enable = "false" on retroarch.cfg

hizzlekizzle commented 7 years ago

Ok, HW shared context OFF and shaders are the usual suspects, so something else must be b0rk3n.

inactive123 commented 7 years ago

Did you try turning hw shared context off?

ofry commented 7 years ago

Tried now. No luck :( Still black screen, but game starts (sound exists)

ofry commented 7 years ago

Same with HW shared context on.

fcsperandio commented 7 years ago

Same here. 76862ab RX480, Win10, driver 17.5.1 video_driver = "gl" HW Shared Context = off video_shader_enable = "false"

Vulkan - ok Opengl - black with sound

logos88 commented 7 years ago

I also have this problem Operating System: Arch Linux Processor: 4x Intel® Core™ i5-4570 CPU @ 3.20GHz GPU: Intel® HD Graphics 4600

OpenGL context reset

Building OpenGL state (1x internal res., 16bpp)
^COpenGL context destroy
*** Error in `retroarch': corrupted double-linked list: 0x0000000002f51960 ***
======= Backtrace: =========
/usr/lib/libc.so.6(+0x7254c)[0x7f5eac85f54c]
/usr/lib/libc.so.6(+0x78bfb)[0x7f5eac865bfb]
/usr/lib/libc.so.6(+0x7a6c2)[0x7f5eac8676c2]
/usr/lib/xorg/modules/dri/i965_dri.so(+0x156a60)[0x7f5e9d573a60]
/usr/lib/xorg/modules/dri/i965_dri.so(+0x8ef71)[0x7f5e9d4abf71]
/usr/lib/xorg/modules/dri/i965_dri.so(+0x3f26b3)[0x7f5e9d80f6b3]
/usr/lib/xorg/modules/dri/i965_dri.so(+0x3a4f43)[0x7f5e9d7c1f43]
/usr/lib/libGLX_mesa.so.0(+0x4a1ff)[0x7f5e9e1f41ff]
/usr/lib/libGLX_mesa.so.0(+0x1ade9)[0x7f5e9e1c4de9]
retroarch[0x5187f0]
retroarch[0x45f459]
retroarch[0x521d80]
retroarch[0x45c597]
retroarch[0x461565]
retroarch[0x4221b1]
retroarch[0x41b860]
retroarch[0x4179fe]
/usr/lib/libc.so.6(__libc_start_main+0xea)[0x7f5eac80d43a]
retroarch[0x414cda]
ghost commented 7 years ago

Same on Gentoo with RadeonSI here.

EDIT: Was just a bad BIOS file.

0x4A41 commented 7 years ago

I'm having the same issue.

Vulkan and software, no problem at all. OpenGL, black screen with sound.

mfbruno commented 7 years ago

exactly same thing here, using the RA nightly build 1.6.1 07/24 3:01 and the last core mednafen_psx_hw 07/21 18:07. sound run on background, i can even access the core menu, but got only a black screen. so far none of the fixes recommended worked.

On Windows 10 x64 Radeon RX470

inactive123 commented 7 years ago

Can you retest this again with the latest source and/or core from the buildbot?

mfbruno commented 7 years ago

Persist. Tested with: Retroarch nightly build 1.6.1 07/27 mednafen_psx_hw latest core 07/27

fcsperandio commented 7 years ago

Same thing here. nightly core hw 27/07 RX480, Win10, driver 17.7.2 video_driver = "gl" HW Shared Context = ON and OFF video_shader_enable = "false"

Vulkan - ok Opengl - black with sound

SuperMeatBro commented 7 years ago

Black Screen, no sound with latest build and latest core. Is it possible to get an old version of the core?

inactive123 commented 7 years ago

Do all three of you have AMD cards?

Things work fine here on Nvidia.

SuperMeatBro commented 7 years ago

I have GTX 970. I will try with a fresh start of Retroarch if it does something different

mfbruno commented 7 years ago

Hum, AMD owners is majority apparently... mine is a RX 470

@SuperMeatBro your problem sounds a little different from the rest of us, you're not getting sound too, is that right?

SuperMeatBro commented 7 years ago

Yeah, but i'm trying different bios files, maybe its my problem

SuperMeatBro commented 7 years ago

oK WOW, it was because the bios wasnt named well. i have to erase the "-" in the name file. everything works well

fcsperandio commented 7 years ago

Looks like AMD polaris is very problematic with opengl. Is also with CEMU and others emus.

rz5 commented 7 years ago

@ofry Could you please test the OpenGL renderer? The latest commits fixed two longstanding bugs that made the emulator crash on Windows when fullscreen was toggled or when the internal resolution was changed.

rz5 commented 7 years ago

@fcsperandio I'm on a laptop with an R5 M330 and I'm fairly certain beetle-psx is using it. I get both sound and image out of it. If you're able to build from source, test it out. If not, try fetching a fresh build off the buildbot and please report back.

mfbruno commented 7 years ago

@rz5 just tried the lastet core mednafen_psx_hw 07/27 19:55 and the problem persist.

Also noticed that the sound of the bios in background is kinda bugged, like when we toggle the internal resolution to over the hardware capacity... i don't know how to call that in english, sorry.

ghost commented 7 years ago

I just tested the latest RA/hw core with an older AMD machine (E-350 APU) with HD 6310 (GL 3.3), and the video is working here.

ofry commented 7 years ago

Tested. Same issue.

If I running retroarch_debug.exe with video_shader_enable = "false"

I got many errors in console:

[ERROR] [GL debug (High, API, Error)]: glDrawArrays failed because one or more active vertex attributes reference a vertex buffer that is mapped (GL_INVALID_OPERATION)
[ERROR] [GL debug (High, API, Error)]: glDrawArrays has generated an error (GL_INVALID_OPERATION)
[ERROR] [GL debug (High, API, Error)]: glDrawArrays has generated an error (GL_INVALID_OPERATION)
ofry commented 7 years ago

Core version 09d2a02

ofry commented 7 years ago

Same on c6119d7

fcsperandio commented 7 years ago

Same on c6119d7 Remember, polaris chipset.

0x4A41 commented 7 years ago

Problem persists on 34321f5.

GPU: AMD R9 270 (not Polaris!) Drivers: 17.7.2

inactive123 commented 7 years ago

@hizzlekizzle Does it work on your AMD machine?

phonzeh commented 7 years ago

Same issues here, R9 Fury X (Fiji Chip I believe) I've seen other users with Nvidia 1080's report the same behaviour (for reference https://forums.libretro.com/t/numerous-issues-with-beetle-psx/11232) Black Screen with sound.

Vulkan works amazing though, but I prefer OpenGL.

inactive123 commented 7 years ago

The OpenGL renderer works fine on Nvidia, tested it on Windows 10 (Titan XP).

ofry commented 7 years ago

Still same bug on a6bbea0

inactive123 commented 7 years ago

Somebody with GL knowledge will need to debug it on an AMD GPU. I do not own such a GPU, I own nvidia, on which the renderer works fine.

ofry commented 7 years ago

I have such GPU and MinGW toolchain.

Maybe we can debug it via TeamViewer or such stuff?

My skype is ofryaka

whatwwkd4496 commented 7 years ago

when will this bug will ever be fixed, actually I only wants GL for its texture filtering, if the Vulkan can do texture filtering then I can forget about GL altogether.

ofry commented 7 years ago

Bisect results:

Last good commit: df1262004d35367e0f64ed0b9038ebde9b907d8e First bad commit: 90d7f639475818c48c68c84a54302c0406b4ce8c

rz5 commented 7 years ago

@ofry, good to know, so this means that when simias reduced the OpenGL requirements for the renderer, some drivers/cards started to misbehave.

To everyone having no image with the GL renderer, you can do the following:

Use a recent debug version of RetroArch, built with DEBUG=1 GL_DEBUG=1; Use a recent debug version of beetle-psx, built with DEBUG=1 HAVE_HW=1; Make sure that Logging > Logging Verbosity is on;

This will log info, warnings and errors to the terminal. Paste that log in here to see what's affecting everyone, maybe the people affected by this are all having the same OpenGL error related to glDrawArrays like ofry.

0x4A41 commented 7 years ago

Here's what I got:

[ERROR] [GL debug (High, API, Error)]: glDrawElements has generated an error (GL_INVALID_OPERATION)
[ERROR] [GL debug (High, API, Error)]: glDrawElements has generated an error (GL_INVALID_OPERATION)
[ERROR] [GL debug (High, API, Error)]: glDrawElements failed because one or more active vertex attributes reference a vertex buffer that is mapped (GL_INVALID_OPERATION)
[ERROR] [GL debug (High, API, Error)]: glDrawArrays has generated an error (GL_INVALID_OPERATION)
[ERROR] [GL debug (High, API, Error)]: glDrawArrays has generated an error (GL_INVALID_OPERATION)
[ERROR] [GL debug (High, API, Error)]: glDrawArrays failed because one or more active vertex attributes reference a vertex buffer that is mapped (GL_INVALID_OPERATION)
[libretro ERROR] GL error flag: GL_INVALID_OPERATION [rsx_gl_load_image]

The full log is just a repetition of those lines in varying orders. retroarch-2017.08.16-log0.txt

mfbruno commented 7 years ago

the full log: retroarch-2017.08.16-14.37log.txt

[ERROR] [GL debug (High, API, Error)]: glDrawArrays has generated an error (GL_INVALID_OPERATION) [ERROR] [GL debug (High, API, Error)]: glDrawArrays has generated an error (GL_INVALID_OPERATION) [ERROR] [GL debug (High, API, Error)]: glDrawArrays failed because one or more active vertex attributes reference a vertex buffer that is mapped (GL_INVALID_OPERATION) [ERROR] [GL debug (High, API, Error)]: glDrawArrays has generated an error (GL_INVALID_OPERATION) [ERROR] [GL debug (High, API, Error)]: glDrawArrays has generated an error (GL_INVALID_OPERATION) [ERROR] [GL debug (High, API, Error)]: glDrawArrays failed because one or more active vertex attributes reference a vertex buffer that is mapped (GL_INVALID_OPERATION) [ERROR] [GL debug (High, API, Error)]: glDrawElements has generated an error (GL_INVALID_OPERATION) [WARN] [GL debug (Medium, API, Performance)]: glDrawElements uses input attribute 'VERTEX_ATTRIB[2]' with offset '33' that is not optimally aligned; consider aligning on a 4-byte boundary [WARN] [GL debug (Medium, API, Performance)]: glDrawElements uses input attribute 'VERTEX_ATTRIB[3]' with offset '34' that is not optimally aligned; consider aligning on a 4-byte boundary [WARN] [GL debug (Medium, API, Performance)]: glDrawElements uses input attribute 'VERTEX_ATTRIB[5]' with offset '35' that is not optimally aligned; consider aligning on a 4-byte boundary [ERROR] [GL debug (High, API, Error)]: glDrawElements has generated an error (GL_INVALID_OPERATION) [ERROR] [GL debug (High, API, Error)]: glDrawElements failed because one or more active vertex attributes reference a vertex buffer that is mapped (GL_INVALID_OPERATION) [libretro INFO] Target framebuffer size: 640x239 [INFO] Environ SET_GEOMETRY. [INFO] SET_GEOMETRY: 640x239, aspect: 1.333.

rz5 commented 7 years ago

Weird, the only glDrawArrays call in rsx_lib_gl.cpp is preceded by a glUnmapBuffer call...same for glDrawElements, they all have a glUnmapBuffer call, so the error message complaining about a mapped buffer referenced by active attributes doesn't make sense to me

rz5 commented 7 years ago

I think I found a fix that works on my system, however I don't know how to explain why it works.

The problem seems to be in the sequence of these GL calls: glBindVertexArray(); glBindBuffer(); glUnmapBuffer(); glDrawArrays()/glDrawElements();

All I did was reorder it so the glBindVertexArray calls are AFTER the glBindBuffer/glUnmapBuffer pair. // glBindVertexArray(); glBindBuffer(); glUnmapBuffer(); glBindVertexArray(); glDrawArrays()/glDrawElements();

rz5 commented 7 years ago

@ofry @logos88 @fcsperandio @mfbruno @TheJacuzzi @Traace

I made some changes that worked on my laptop. If you can build from source, try it out. If you can't, wait for the buildbot to spit out a beetle-psx-hw build and update it.

@ofry - If everyone says it's fixed, feel free to close the issue.

0x4A41 commented 7 years ago

Thank you, @rz5! It's working now!

mfbruno commented 7 years ago

fixed! Thanks @rz5

I noticed a strange behavior in Bios screen, but the games i tested are working flawless. Thanks again!

fcsperandio commented 7 years ago

Fixed. Thanks rz5 and testers.

ofry commented 7 years ago

Fixed. Big thanks!

bugparty commented 6 years ago

after rename SCPH-5501.bin to SCPH5501.bin,everything goes fine