Yabause / yabause

Yabause is a Sega Saturn emulator.
http://yabause.org
352 stars 195 forks source link

0.9.15 GNU/Linux Qt5 No Video #349

Open IlyaIndigo opened 7 years ago

IlyaIndigo commented 7 years ago

In version 0.9.15 does not display the video (black screen with sound) in Software Video Interface. In OpenGL Video Interface when you try to run an emulator or falls with an error segmentation (OpenGL.txt nouveau Gallium 0.4 on NV67 2.1 Mesa 12.0.1), or displays a message box with the message "Can not Initialized Yabause" (Intel Ironlake Mobile 2.1 Mesa 12.0.1). If necessary, I can make a list of supporting OpenGL-extensions of the two graphics cards. When using SH2 Dynamic Recompiler when attempting to run the emulator falls with an error segmentation. The stdout nothing useful, except:

libpng warning: iCCP: known incorrect sRGB profile
ALSA lib pcm.c:8251:(snd_pcm_recover) underrun occurred
Ошибка сегментирования (core dumped)

Version 0.9.14 Software Video Interface, and OpenGL Video Interface work. True to OpenGL Video Interface displays the extra bandwidth and artifacts. SH2 Dynamic Recompiler also works and does not lead to the segmentation error.

OpenSUSE Tumbleweed | GCC 6.2 | Qt 5.6.1 | Mesa 12.0.1

Command for build: v=0.9.15 && n=yabause && d=$n-$v && f=$d.tar.gz && cd /tmp && wget https://download.tuxfamily.org/$n/releases/$v/$f && tar xf $f && cd ./$d && F="-march=native -msse3 -O3 -fomit-frame-pointer -pipe -DNDEBUG" && cmake -LA -DCMAKE_C_FLAGS_RELEASE="$F" -DCMAKE_CXX_FLAGS_RELEASE="$F" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DYAB_PORTS=qt && make -j4 && sudo make install && cd .. && rm -rf $d $f

Test ISO: Legend of Oasis (U)

Attachments: make.txt OpenGL.txt yabause.ini.txt

Guillaumito commented 7 years ago

That looks like an OpenGL problem, try adding -DYAB_WANT_OPENGL=OFF in your "Command for build".

IlyaIndigo commented 7 years ago

-DYAB_WANT_OPENGL=OFF With this key work Software Video Interface, but very slow. FPS 20/60.. Fixed aspect ratio 4:3 don't effect on full screen. Frame skip limiter work incorect. Integer pixel scalling on full screen work incorrect. SH2 Dinamic recompiler still crashed.

On 0.9.14 FPS 35/60 and correct work frame skip limiter, but invert blue and red color in software interface. In OpenGL Interface.correct colors, but slower and many trash and artifacts on video.

rdanbrook commented 7 years ago

@IlyaIndigo, what are your system specs? Often times if you can't support modern OpenGL, you also can't emulate the Saturn at full speed anyway.

IlyaIndigo commented 7 years ago

what are your system specs?

Turion X2 1.7 GHz | 4GB | NVIDIA 7000M (OpenGL)

modern OpenGL

Modern openGL is Vulkan. In yubause system requires i don't find minimal support version of openGL or requirement extensions. For example mednafen perfect work with my openGL 2.1, provide hq4x, autoipsharper and correct ratio on full screen and use of this gives better image quality without leading to a visible slowdown.

full speed

Me don't need full speed, me need gameble speed, which was in 0.9.14 width correct work frame skjp limiter. In 0.9.15 skip frame limiter durrin skip frame shutdown video surface (black square for output video).

rdanbrook commented 7 years ago

You have a card that maxes out at OpenGL 2.1, the code in Yabause is minimum 3.2.

"Modern OpenGL" is not Vulkan, Vulkan is a new API altogether. Modern OpenGL refers to the "core profile" vs the "compatibility profile".

spbond commented 7 years ago

I am experiencing the same issue in Kubuntu 16.04. I am using a Radeon HD 7950, and glxinfo says:

OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD TAHITI (DRM 2.43.0, LLVM 3.8.0)
OpenGL core profile version string: 4.1 (Core Profile) Mesa 11.2.0
OpenGL core profile shading language version string: 4.10
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL version string: 3.0 Mesa 11.2.0
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 11.2.0
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00

Attempting to load a game using OpenGL produces the following error in the log window:

Fail to YglProgramInit

Cannot initialize Video

Using the software renderer produces a black screen with working sound.

Version 0.9.14 works with both the software renderer and OpenGL.

spbond commented 7 years ago

When I build yabause without OpenGL, the software renderer works, although not as well as version 0.9.14.

IlyaIndigo commented 7 years ago

But it should not be! Switching between the Software and OpenGL renderers, should be carried out in user menu, and not in the build configuration options.

Guillaumito commented 7 years ago

Yeah, that's how it works... you can switch between Software and OpenGL renderers without recompiling... but both renderers are using OpenGL to display their final output on the screen.

When compiling without OpenGL, the port (Qt, gtk, ...) takes care of copying the Software renderer buffer.

It used to be fine, as "old" OpenGL was just supported everywhere, but it's a problem with "modern" OpenGL. I'm working on something to change that.

IlyaIndigo commented 7 years ago

Thank you for your response and explanation.

spbond commented 7 years ago

What I don't understand is why OpenGL is not working when my core profile version is 4.1. I have read that the core profile has to be requested at context creation. Is there a possibility this is not happening?

OKB-99 commented 7 years ago

I had had the same problem(black screen with sound) in 0.9.15 and I've solved.

When I installed it by RPM (Because I'm using a RedHat like distro), he included Qt4, furthermore Qt5 in all of my RPM repositories was old (The version of Qt5 for yabause-0.9.15 Should be >= 5.7).

So I tried to download the latest yabause from GIT and built it with Qt5.8 from http://download.qt.io/archive/qt/5.8/5.8.0/single/ , and now it works.

The cmake params are cmake -DCMAKE_PREFIX_PATH=${QT5_DIR}\ -DYAB_PORTS=qt\ -DCMAKE_BUILD_TYPE=Release\ -DCMAKE_CXX_FLAGS="--std=c++11"\ -DOPENAL_LIBRARY=${OPENAL_LIBRARY}\ -DOPENAL_INCLUDE_DIR=${OPENAL_INCLUDE_DIR} ../yabause

P.S. Without OPENAL params, there was NO sound.

lukateras commented 6 years ago
$ glxinfo | grep OpenGL
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile 
OpenGL core profile version string: 4.5 (Core Profile) Mesa 17.1.9
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 17.1.9
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 17.1.9
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
OpenGL ES profile extensions:

On MacBook Air Mid-2013. Please support older OpenGL versions, requiring 3.2 is way too out there, there are quite a few integrated Intel HD graphics chipsets that are capable of emulating Saturn at full speed that don't have OpenGL 3.2

Also, software rendering is broken, no one should have to choose to disable OpenGL at compile-time in order to use software rendering. If it uses OpenGL for rendering anyway, what purpose does it have other than slowing down emulation?

lukateras commented 6 years ago

By the way, when I build Yabause 0.9.15 with disabled OpenGL and try to run a game, it just segfaults. Yabause 0.9.14 runs fine.

raelgc commented 6 years ago

@yegortimoshenko Just out of curiosity: why Qt5.8? It works with 5.9.1?

lukateras commented 6 years ago

@raelgc I've compiled Yabause with Qt 5.9, not Qt 5.8.

raelgc commented 6 years ago

Oh, my bad, it was @OKB-99, sorry.

OKB-99 commented 6 years ago

@yegortimoshenko @spbond As your output of $ glxinfo | grep OpenGL, the shading language version:1.30 is too old. So try $export MESA_GL_VERSION_OVERRIDE=3.0 and then check it again.

BTW after updating to OpenGL shading language version string: 3.30 by the above export, I could success compiling with OpenGL, and now I can select the OpenGL option on the settings pannel.

OKB-99 commented 6 years ago

@raelgc I succeeded compiling with Qt5.9.*, but the Yabause was not stable on my pc...

raelgc commented 6 years ago

@OKB-99, thanks, export MESA_GL_VERSION_OVERRIDE=3.0 made OpenGL works for me!