Visualizations not working in 19.3?

This probably wants fixing upstream. I am sure there is a CMake option that can be leveraged to set the correct values accordingly.

Is there a similar way to fix the Matrix visualisations?

This is not an issue of OSMC.
Same issue on LibreElec

Yes at all.
Same procedure on the main.cpp file of the addon

This is the matrix addon v19.0.1 fixed (for pi 3B+) : https://drive.google.com/uc?id=1LBGG-mdQYwHvm70NtUO5HJQlJi6Nczxn

Thanks man, that’s amazing. Any chance you could share the fixed Shadertoy addon please?

1 Like

Yes of course :wink:
Shadertoy visualization v19.1.2 fixed (for pi3B+) : https://drive.google.com/uc?id=1sU-FOktfFosEvFBuIKOEB7a7VwbRvMGt

Working great, thanks again.

I’ve looked into this some more and I believe that this is an issue with OpenGL ES 2.0 vs. ES 3.x. Afaik, Raspberry devices below Rpi4 don’t support ES3 but only ES2. However, ES3 headers are present on the OSMC system and CMake simply looks for the presence of such headers to enable ES3 for the builds. Furthermore, when calling glTexImage2D(), GL_RED is only valid in ES3 but not in ES2. Thus, glTexImage2D() using GL_RED fails and returns GL_INVALID_VALUE when checked with glGetError(). It seems there are issues with the CMake build environment as well as the addon itself.

I can fix this then – but can you post your build output here?

I’ve PM’d you build logs from Jenkins.

Sam

Steps executed in OSMC on RPi2:

sudo apt-get install git, cmake, zip, libgles2-mesa-dev
git clone --depth 1 --branch 19.3-Matrix https://github.com/xbmc/xbmc.git
git clone --depth 1 --branch 19.1.2-Matrix https://github.com/xbmc/visualization.shadertoy.git
cd visualization.shadertoy && mkdir build && cd build
cmake -DADDONS_TO_BUILD=visualization.shadertoy -DADDON_SRC_PREFIX=../.. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../../xbmc/kodi-build/addons -DPACKAGE_ZIP=1 -DAPP_RENDER_SYSTEM=gles ../../xbmc/cmake/addons
make

Here are the cmake and make build outputs.

I think if ES3 would not be detected as being available it could actually work w/o changes to the code (not sure about the APP_RENDER_SYSTEM=gles define used). In gl2.h there is no GL_RED defined so the shadertoy would define this as GL_LUMINANCE which is the way it is supposed to work with ES2.

Edit: Forgot that I had some additional output message from FindOpenGLES.cmake active so anything with ‘>>> …’ is added on my local system, e.g. ‘>>> GLES=3’

This is probably MESA related. We use the same MESA package for both Pi 2/3 and Pi 4.

I’ll see if I can think of a solution that doesn’t require separating the packages out.

Thanks for your patience. I’ve taken a look at this.

It looks like we can enforce some compatibility by removing the GLESv3 headers. This might cause some performance penalty on Raspberry Pi 4 – but I suspect it won’t be significant.

I’ve produced new versions of MESA which no longer carry GLES3 headers, and built Kodi and binary add-ons against them. I’d appreciate it if you could provide some feedback.

To test this update:

  1. Login via the command line
  2. Run the following command to add the staging repository:
    echo 'deb http://apt.osmc.tv buster-devel main' | sudo tee /etc/apt/sources.list.d/osmc-devel.list
  3. Run the following commands to update: sudo apt-get update && sudo apt-get dist-upgrade && reboot
  4. Your system should have have received the update.

Please see if the issue is resolved.

I also recommend you remove /etc/apt/sources.list.d/osmc-devel.list after updating.

I’d also recommend you deactivate the staging repository. You can do so with the following command:
sudo rm /etc/apt/sources.list.d/osmc-devel.list.

Please note that we will automatically disable this update channel after 14 days on your device in case you forget to do so to ensure that your system reverts to the stable update channel.

Thanks

Sam

1 Like

Hi,
very good job !
I confirm that this solve the issue on all visualizations
Many thanks !

1 Like

Thanks for confirming.

Visualizations seems to work fine now. I also did a quick scan of the Kodi repo and it looks like only the game addon C api contains some reference to GLES v3 as a possible option. Not sure if there are any game addons that would really use it.