Raspbian Stretch + VC4 + Qt5 = total mess
Posted: Sun Apr 22, 2018 12:56 pm
First and foremost: if you use my image as it is and don't need/plan any customization, you can just ignore the rest of this post.
I was pretty happy of the results achieved on Raspbian Jessie. Good boot time, small footprint, a single Qt build that did everything we needed (EGLFS without Xorg, XCB with Xorg)
Then Stretch came...and ruined (almost) everything
As you might already know, QLC+ relies entirely on the Qt framework, so it is essential to have a flawless Qt. And here we go.
Short story: Qt on Stretch is broken, and at present I'm not able to provide a solution to run QLC+ on Xorg.
Long story:
When I started to port QLC+ back in 2013 there was only the Raspberry Pi 1 on the market.
I have 15+ years of embedded development experience, so I know every bit counts on limited devices, therefore I decided to go straight to the point by opting for EGLFS, a way to render graphics on a OpenGL surface.
I didn't even consider running QLC+ on a Xorg desktop enviroment (like on a regular Linux PC) cause that would have meant to wait minutes before seeing any DMX running.
Being QLC+ a desktop application though, my goal was to show up the interface in as less time as possible. And I did it.
More Raspberries were made, and the usability of QLC+ on Xorg started to become interesting, for example on a Raspberry Pi 3.
As you probably know, the RPi is based on a Broadcom chipset, which has a graphics processor called VideoCore IV (VC4).
The libraries used to control VC4 was provided by Broadcom as close source, even though they did the job, either with EGLFS or Xorg.
At some point, the Raspberry Pi foundation decided they wanted an open source solution, so Broadcom hired a person (Eric Anholt) to do the job, without knowing nothing about the close source one. (weird ? yes, but it happens kinda frequently cause of intellectual properties)
So Anholt (who is a damn good developer, btw) integrated VC4 on Mesa 3D, and the driver is now stable and production ready.
So, the RPi geniuses, started to make a mess on Stretch. They kept the close source driver (in /opt/vc) and they renamed the OpenGL libraries by prefixing them with 'brcm' (e.g. libbrcmGLESv2.so), therefore breaking all the softwares out there relying on VC4, including Qt.
Then, they added Mesa and created even more mess, since there are header files with the same name (and different code) in /usr/include and in /opt/vc/include.
Not considering the fact that Mesa depends on Xorg, so the EGLFS usage case QLC+ relies upon got broken.
I spent a ridiculous amount of time trying to find the proper combination of libraries. I built Qt like 10 times, either by cross compiling or with the Raspberry itself (which takes HOURS)
Today I did the last test, and I gave up.
To make things even more ridiculous, on Stretch you can install Qt 5.7.1. Great, you think ! No ! Launch QLC+ with those libraries and there will be no icons all over the UI. Why ? Because the RPi geniuses had to customize the DE (their damn Pixel), and Qt doesn't know what to do with it.
I tried all the possible flags and read all the possible discussions, and I had to give up on that too.
I am quite upset about this situation.
I submitted the topic to the Qt bug tracking system, and they closed it the same day, pointing the finger to the Raspberry guys.
I will try to open a discussion with the RPi guys too, but at the moment, the only thing I have is an image working only on EGLFS.
Forget QLC+ on Xorg, until this situation is resolved by someone.
The only good news is that I've been able to keep the boot time low, and the image works on all Raspberries, including 3B+.
I'm sorry if some of you will be disappointed, but I tried my best, I swear, and I failed.
I was pretty happy of the results achieved on Raspbian Jessie. Good boot time, small footprint, a single Qt build that did everything we needed (EGLFS without Xorg, XCB with Xorg)
Then Stretch came...and ruined (almost) everything
As you might already know, QLC+ relies entirely on the Qt framework, so it is essential to have a flawless Qt. And here we go.
Short story: Qt on Stretch is broken, and at present I'm not able to provide a solution to run QLC+ on Xorg.
Long story:
When I started to port QLC+ back in 2013 there was only the Raspberry Pi 1 on the market.
I have 15+ years of embedded development experience, so I know every bit counts on limited devices, therefore I decided to go straight to the point by opting for EGLFS, a way to render graphics on a OpenGL surface.
I didn't even consider running QLC+ on a Xorg desktop enviroment (like on a regular Linux PC) cause that would have meant to wait minutes before seeing any DMX running.
Being QLC+ a desktop application though, my goal was to show up the interface in as less time as possible. And I did it.
More Raspberries were made, and the usability of QLC+ on Xorg started to become interesting, for example on a Raspberry Pi 3.
As you probably know, the RPi is based on a Broadcom chipset, which has a graphics processor called VideoCore IV (VC4).
The libraries used to control VC4 was provided by Broadcom as close source, even though they did the job, either with EGLFS or Xorg.
At some point, the Raspberry Pi foundation decided they wanted an open source solution, so Broadcom hired a person (Eric Anholt) to do the job, without knowing nothing about the close source one. (weird ? yes, but it happens kinda frequently cause of intellectual properties)
So Anholt (who is a damn good developer, btw) integrated VC4 on Mesa 3D, and the driver is now stable and production ready.
So, the RPi geniuses, started to make a mess on Stretch. They kept the close source driver (in /opt/vc) and they renamed the OpenGL libraries by prefixing them with 'brcm' (e.g. libbrcmGLESv2.so), therefore breaking all the softwares out there relying on VC4, including Qt.
Then, they added Mesa and created even more mess, since there are header files with the same name (and different code) in /usr/include and in /opt/vc/include.
Not considering the fact that Mesa depends on Xorg, so the EGLFS usage case QLC+ relies upon got broken.
I spent a ridiculous amount of time trying to find the proper combination of libraries. I built Qt like 10 times, either by cross compiling or with the Raspberry itself (which takes HOURS)
Today I did the last test, and I gave up.
To make things even more ridiculous, on Stretch you can install Qt 5.7.1. Great, you think ! No ! Launch QLC+ with those libraries and there will be no icons all over the UI. Why ? Because the RPi geniuses had to customize the DE (their damn Pixel), and Qt doesn't know what to do with it.
I tried all the possible flags and read all the possible discussions, and I had to give up on that too.
I am quite upset about this situation.
I submitted the topic to the Qt bug tracking system, and they closed it the same day, pointing the finger to the Raspberry guys.
I will try to open a discussion with the RPi guys too, but at the moment, the only thing I have is an image working only on EGLFS.
Forget QLC+ on Xorg, until this situation is resolved by someone.
The only good news is that I've been able to keep the boot time low, and the image works on all Raspberries, including 3B+.
I'm sorry if some of you will be disappointed, but I tried my best, I swear, and I failed.