For the curious, we have started to use GPU hardware acceleration for graphics in the latest Vangelis updates.
I’m opening this thread to comment about this subject. I’m totally new to modern OpenGL and some of you probably can give some advice about it. If not, we can learn something together for sure.
At the moment we are using the ModernGL library in the Audio File widget to display the waveform. Just a tiny step to start learning.
The true reasons for taking this step is a long history that i will tell, but not now. Lunch time! Stay tuned
After migrating to trixie, we realized that some UI widgets had stopped to work reliably.
The tkinter main thread got blocked in bizarre ways and the widget behaviour was sluggish.
The affected widgets were:
widget_filter
widget_audio_file
widget_audio_player
The root cause seemed to be buried in the deep of the new kernel DRM architecture, that has been deployed to best suite “modern graphic approach”. Older architectures and libraries, like X11 and tkinter have been affected in bizarre ways, being very hard to trace and reproduce the exact causes of the issues.
I spent many hours trying to understand and trace the issues, also trying to get some attention from RBPi engineers, etc. But reality is that X11 and tkinter are not a priority for the RBPi team. They consider these technologies as obsolete and the solution they propose is moving to Wayland and replacing tkinter by a modern framework with a modern approach to computer graphics.
Finally, we got the widget_filter to work again with the tkinter canvas, but not the widget_audio_file.
OK! I tried wayland, but this didn’t solve the issues. In wayland, Tkinter kept behaving badly in new and more bizarre ways, so, i decided to try a different approach: migrating the conflicting widgets to a modern OpenGL canvas.
This solution has some advantages:
We don’t need to move away from tkinter (yet)
We can migrate, one-by-one, the conflicting widgets without going into a massive refactorization
We start taking profit from the RBPi’s GPU that has been totally unused for zynthian. This would allow to improve graphics without adding CPU overload. Better UX without worsting performance.
Good!
And that’s all! So currently, we have unified the 2 “wave” widgets and have a new “widget_audio_file” that works in an accelerated OpenGL canvas. Just the first step.
We hope to migrate all graphic widgets along the next months, and next the launcher, mixer, etc.
Currently not in a hurry, because everything seems to work, but we are not relaxed because it’s clear that we can’t trust tkinter in the future and we need to move away from it.
Thanks for the update. So maybe it’s a “if live gives you lemons make lemonade with it” thing. Meaning that it’s a good thing in the end. Thank you for your great work.