I got bored with the cubie truck since it's basically working perfectly and really fast.
So.. I got it working, with hardware
acceleration on the raspberry pi. Unfortunately the driver is a bit lacking, so can only render opengl in full screen
. I then keep using x for input (keyboard and mouse) This works, but there is no toolbar or chart piano or any other dialog windows etc... Using top, I can see opencpn
only gets about 25% of the cpu, and xorg and other stuff uses the rest, so this can't be a very ideal. Perhaps running in wayland would give better results, or playing around with it could help a lot. In any case, it's running about 3 times faster than before without any hardware
acceleration. I think it could be around 10 times faster with more playing around which would make it quite usable.
Since I have no display, I don't _really_ know what is going on, but I have generally an idea. My setup is a bit contrived, and I am relying on I have two utilities, one that can grab screenshots, and also using x11vnc (which is not helping performance any) to control it for keyboard and mouse input.
It is not possible to see the toolbar or chart piano, or anything else for that matter that is not on the main canvas
. I think the easiest way around this is with a simple hot-key which toggles opengl, so when you need to use the tool bar, or configure or use a plugin etc, you can, but switch back for viewing the charts
. Then the chart piano (and eventually toolbar and context menus) should be implemented to render to the main canvas
. I don't really have too much time to deal with raspberry pi, and without a display to plug
into it, I doubt I will get too serious about this one, but I can say it is working.
For anyone who wants to try, first ensure you have libGLESv1_CM.so installed and working. Then you can install glxinfo and glxgears with
apt-get install mesa-utils
Then build glshim
git clone github.com/seandepagnier/glshim
cmake .. -DBCMHOST=1
sudo cp lib/libGL* /usr/lib
Now, in .bashrc add this line to the bottom:
restart the shell or manually type this line, and run glxgears. You should get 60fps (limited only by refresh rate I believe)
You may have to move libGL* files from /usr/lib/arm-linux-gnueabihf to somewhere else
Once glxgears is working (glxinfo should work too)
you can compile glues
git clone github.com/ssvb/glues.git
cp libGLU.so.1 /usr/lib/libGLU.so
Now you can compile opencpn
, use optimum branch
git clone -b optimum github.com/seandepagnier/OpenCPN
See instructions for building opencpn (and apt-get any packages needed)
It must detect opengles when running cmake. To get this, you must have /usr/include/GLES/gl.h, if you don't you can copy it from somewhere else.
Finally run opencpn, but you might have to switch between two ways of running.
To configure and verify it is works:
then you can switch on opengl mode if all is well. If there is some failure, then run with -no_opengl to compare.
To generate the compressed cache (etc1 compression
is working great) it is a little tricky because you must navigate the setup without being able to see it. I think for this one, run x11vnc on the raspberry, connect from another computer, and then you can rebuild
the chart database while opengl and texture compression
caching are all enabled. At this point it should be able to run quite fast.