Libreelec black screen issues
#1
I seem to have a bizarre issue where some emulators display a blank screen in the x86-64 builds of libreelec but not the coreelec builds I have on most of my devices. It's not even consistent with a single emulator, genesis plus gx works fine for micro machines but not micromachines 2 for example and none of the game boy emulators work on any game I've tried but snes9x works on everything I tried.
Reply
#2
This is strange. We should narrow down to see what is the problem. It could be due to the fact that we have three different renderers: GL, GLES and DMA. All of the systems you mentioned have different renderers. Can you post debug logs where it works and where it doesn't so we can know for sure which renderers are having problems?
RetroPlayer releases: https://github.com/garbear/xbmc/releases

Donations: eigendude.eth
Reply
#3
https://paste.kodi.tv/faruziwave.kodi.

After enabling debug logging, I attempted to load micro machines into GenesisPlus GX which worked.
I then attempted to load micro machines 2 in GenesisPlus GX which had a blank screen.
I then attempted to load Pokemon Blue into Gamebatte which had a blank screen.
Finally I attempted to load Mega Man X into Snes9X which worked.

I hope the log helps narrow down the issue.

edit: Managed to paste to paste.kodi.tv.
Reply
#4
In the log I see:

Genesis Plus GX:
 
Code:
info <general>: RetroPlayer[RENDER]: Configuring format RGB565, nominal 256x192, max 320x240
...
info <general>: RetroPlayer[RENDER]: Renderer configured on first frame
debug <general>: RetroPlayer[RENDER]: Creating renderer for DMA
debug <general>: RetroPlayer[RENDER]: Configuring buffer pool
debug <general>: RetroPlayer[RENDER]: Creating render buffer of size 320x224 for buffer pool
debug <general>: CRenderBufferDMA: using BufferObject type: CDMAHeapBufferObject
debug <general>: EGL Debugging:
                 Error: EGL_BAD_ALLOC
                 Command: eglCreateImageKHR
                 Type: EGL_DEBUG_MSG_CRITICAL_KHR
                 Message: createImageFromDmaBufs failed
debug <general>: CEGLImage::CreateImage - attributes:
                 EGL_WIDTH: 320
                 EGL_HEIGHT: 224
                 EGL_LINUX_DRM_FOURCC_EXT: RG16
                 EGL_DMA_BUF_PLANE0_FD_EXT: 38
                 EGL_DMA_BUF_PLANE0_OFFSET_EXT: 0
                 EGL_DMA_BUF_PLANE0_PITCH_EXT: 640
                
error <general>: CEGLImage::CreateImage - failed to import buffer into EGL image: 0x3003
debug <general>: EGL Debugging:
                 Error: EGL_BAD_PARAMETER
                 Command: eglDestroyImageKHR
                 Type: EGL_DEBUG_MSG_ERROR_KHR
                 Message: _eglDestroyImageCommon

Gambatte:
 
Code:
debug <general>: RetroPlayer[VIDEO]: Creating video stream - format RGB565, nominal 160x144, max 160x144
...
debug <general>: RetroPlayer[RENDER]: Creating render buffer of size 160x144 for buffer pool
debug <general>: CRenderBufferDMA: using BufferObject type: CDMAHeapBufferObject
debug <general>: EGL Debugging:
                 Error: EGL_BAD_ALLOC
                 Command: eglCreateImageKHR
                 Type: EGL_DEBUG_MSG_CRITICAL_KHR
                 Message: createImageFromDmaBufs failed
debug <general>: CEGLImage::CreateImage - attributes:
                 EGL_WIDTH: 160
                 EGL_HEIGHT: 144
                 EGL_LINUX_DRM_FOURCC_EXT: RG16
                 EGL_DMA_BUF_PLANE0_FD_EXT: 33
                 EGL_DMA_BUF_PLANE0_OFFSET_EXT: 0
                 EGL_DMA_BUF_PLANE0_PITCH_EXT: 320

error <general>: CEGLImage::CreateImage - failed to import buffer into EGL image: 0x3003
debug <general>: EGL Debugging:
                 Error: EGL_BAD_PARAMETER
                 Command: eglDestroyImageKHR
                 Type: EGL_DEBUG_MSG_ERROR_KHR
                 Message: _eglDestroyImageCommon

Snes9x:
 
Code:
debug <general>: RetroPlayer[VIDEO]: Creating video stream - format RGB565, nominal 256x224, max 604x478
...
debug <general>: RetroPlayer[RENDER]: Creating render buffer of size 256x224 for buffer pool
debug <general>: CRenderBufferDMA: using BufferObject type: CDMAHeapBufferObject
...
<it works>

I'll dig into it.
RetroPlayer releases: https://github.com/garbear/xbmc/releases

Donations: eigendude.eth
Reply
#5
Thanks for taking a look, very annoying that it only affects the old x86 box I dug out specifically for emulating retro systems 😅
Reply
#6
Yeah, I would expect to see these black screens more on older GPU drivers and GPU hardware.

Can you test with the GL renderer instead of the DMA renderer? It's likely that GL will work correctly. Do we need a setting to select which renderer is used?
RetroPlayer releases: https://github.com/garbear/xbmc/releases

Donations: eigendude.eth
Reply
#7
How do I change which renderer is used?
Reply
#8
By modifying the source. So I'll add the option and get you a round of test builds. Which platform is best?
RetroPlayer releases: https://github.com/garbear/xbmc/releases

Donations: eigendude.eth
Reply
#9
librelec x86 is what I'm currently running on the problematic machine, so updating that to the test build seems most sensible.
Reply
#10
We figured out that the black screen is because the stride is not a multiple of n*256. I'd like to fix the root issue, so I'm not gonna spend time adding a setting to choose rendering options. DMA will always be more performant than GL because it uploads textures asynchronously, so it's not worth crippling speed when the problem can also be fixed correctly.


My current strategy is to change this line to emplace_back() to that a GBM BO is used.
RetroPlayer releases: https://github.com/garbear/xbmc/releases

Donations: eigendude.eth
Reply
#11
I've uploaded a build with the patch I mentioned applied. @OmniBlade Can you give the 2023-07-18 build a try? https://github.com/garbear/xbmc/releases
RetroPlayer releases: https://github.com/garbear/xbmc/releases

Donations: eigendude.eth
Reply
#12
Tried the build and it looks like all the systems I tried are working correctly so this black screen issue looks to be fixed at least for me. A couple of the shaders also work which was nice.

I did hit an issue after a few minutes of play where the UI was lost and I got no signal to my monitor and although I could hear the game continuing and it seems to be recieving input, I could no longer stop it by entering the settings menu. Unclear as to if this is a result of using the shaders or not though, I'd need to do more runs with debug logging enabled I guess and see if I can reproduce it?

edit: https://paste.kodi.tv/emizeyikod.kodi is a debug log from where the issue happened, I disconnect my controller shortly after I lost the screen.

edit2: Looking at the log, it doesn't show anything obvious, but dmesg shows the GPU has stalled, possibly due to shader? I'll disable the shader and see if it happens again.

Edit3: Can confirm that gpu stall only happen when running a shader.
Reply
#13
What is the GPU? Could be a GPU driver issue?
Reply
#14
GPU is a low profile Sapphire R7 250.
Reply
#15
To follow up, I've tested the shader build on a gemini lake based system and had no issues using shaders on its integrated gpu. Also, the blank screen issue was fixed on the old system I was testing on.
Reply

Logout Mark Read Team Forum Stats Members Help
Libreelec black screen issues0