OpenCPN/plugins

Android Bug: Fails when installed. Due to rendered graphics, remove unused Texfonts

Closed this issue · 8 comments

Yes, this morning I was trying the android version and when installing a message pops up

The following plugin has encountered errors during startup.
This plugin will be uninstalled. Reinstall after updating the catalog.

I am wondering what the blockage might be. I don't think there are many external files that are written to, so we probably aren't violating the new Android enforced file system.

Thanks Dave.

Additional info:

Watchdog pi does not start on Android 11, Samsung Galaxy Tab A.
Actual Opencpn app restarts and de-activates the pi.

data/user/0/org.opencpn.opencpn/manPlug/libwatchdog_pi.so
16:39:59.862 MESSAGE plugin_loader.cpp:336 Checking plugin compatibility: /data/user/0/org.opencpn.opencpn/manPlug/libwatchdog_pi.so
16:39:59.862 MESSAGE plugin_loader.cpp:1209 PluginLoader: Loading PlugIn: /data/user/0/org.opencpn.opencpn/manPlug/libwatchdog_pi.so
16:39:59.863 ERROR dlunix.cpp:162 dlopen failed: cannot locate symbol "glBegin" referenced by "/data/data/org.opencpn.opencpn/manPlug/libwatchdog_pi.so"...
16:39:59.863 MESSAGE plugin_loader.cpp:1254 Ignoring blacklisted plugin libwatchdog_pi
16:39:59.864 MESSAGE plugin_loader.cpp:1264 PluginLoader: Cannot load library: /data/user/0/org.opencpn.opencpn/manPlug/libwatchdog_pi.so

Did never try previous versions.

Greetings
Peter

Dave, I have Samsung A51 5G Cell phone running Android 13 Kernal 4.19
Internal Storage 128GB
RAM 6GB

Dave fixed this problem with a PR to watchdog
Correct Android Plugin Load rgleason/watchdog_pi#53
This PR has several parts

Disable rendered graphics effects on Android.
rgleason/watchdog_pi@af5766b

which in src/wdd.cpp

#ifdef ocpnUSE_GL   <--removes
#if defined(ocpnUSE_GL) && not defined(USE_ANDROID_GLES2)   <--Adds

Remove unused TexFont class, and all references.
rgleason/watchdog_pi@af5766b

which
makes changes in CMakeLists.txt and src/wdd.cpp and include/wdd.h

Including commenting out
TexFont m_texfont;

@bdbcat Dave,
Use of TexFont has been a big stumbling block for all of the plugins, and I do not understand it.
Different files have different versions of TexFont.cpp and TexFont.h and Jon has these files in Textplugin under ocpninclude and ocpnsrc which leads to even more confusion. Which version is required, which one is not?
Furthermore Jon's version has ifdefs for android etc.
I often have trouble with a plugin initially getting it building around TexFont!!!
Whether to include the path in CMakeLists.txt or not? Often Windows will NOT build if it is not included.
Yet it appears that Android fails if it is included.
Also what actually happens if TexFont is removed? Do we loose control over font size etc?

Since you have a PR "Remove unused TexFont class, and all references."
Can you explain this to me further?
Is TexFont used or not in all of the TP plugins?

I hope this will help me going forward with other plugins.
Last night I actually was trying to resolve issues with TexFont for AutoTrackRaymarine under the "new" branch, which is building everything, but Windows and Android now, largely due to TexFont handling.

I would really like to get this problem cleaned up and resolved in all the plugins.
Is there a better way to handle this as it could affect many plugins? (and I am not sure I could do so many edits successfully)

PS Unfortunately, we had to abandon the cruise due to bad weather for the next 2 days.

This Android TexFont and Graphics rendering issue seems to be fixed largely in a file wdd.cpp and with one change in CMakeLists.txt.

For other plugins would I be able to fix this problem by copying this wdd.cpp (after a compare?) over the existing one and changing the line in CMakeLists.txt?

bdbcat commented

Turns out that watchdog does not use TexFont at all. So fully safe to remove.
But that is not true in the general case.

Here is what we really need to do:

  1. For the present, just do what is required to fix each plugin, as bugs are encountered.
  2. Longer term, we should settle on a "Plugin DC", probably copied or derived from Jon's ODraw Pi, seems the best candidate.
  3. Add this new Plugin DC to all plugins that require graphical screen output, by adding to the "opencpn-libs" submodule.
  4. Modify all plugins to use opencpn-libs submodule. Some do already, most of the old ones do not.

As you can see, simple copy/paste will not get us there. Requires a bit more work and thought.
So, step one: Post bugs to specific plugins that have trouble building/loading problems.
I will help with this.

Thanks, I have pushed your changes to plugins now.
Hopefully this thread will be a reminder for this TexFont & Graphics Issue