janbar / osmin

GPS Navigator On-Road/Off-Road for Android and Linux devices
GNU General Public License v3.0
86 stars 16 forks source link

Rendering issues on Pixel 4A #25

Open hrdl-github opened 2 years ago

hrdl-github commented 2 years ago

When testing osmin 1.8.4 on a Pixel 4a running GrapheneOS I noticed that the rendering is not as sharp as on my laptop. Especially rendered text and railway connections are affected. The copyright notice and scale indicator are rendered just fine. What assumptions does the renderer make? I did not immediately see a way to enable debug output in libosmscout. osmin_1 osmin_2

janbar commented 2 years ago

The copyright notice and scale indicator, as all app buttons are overlays on the map widget. Therefore their renderer is that of the qml engine. The aliasing could differ between the map and those overlays.

Karry commented 2 years ago

Hi @lennonhill, are you using "Tiled rendering" (can be turn on in configuration) or plain rendering? Because with tile rendering tile image may be re-scaled and it is causing such bluring...

hrdl-github commented 2 years ago

I've tried both and I don't really see a difference. I will check the debug log to get information about the detected screen resolution as soon as I've set up a suitable build environment.

janbar commented 2 years ago

I added a patch over libosmscout to quiet debug output. So to enable full debug of osmscout you have to add the following line 81 in MapView.qml (folder controls_509 ou controls_515, depending of qt version you are using):

79        // on azimuth changed
80        compass.polled.connect(function(azimuth, rotation){ mapView.azimuth = azimuth; });
81        mapSettings.debugLevel = 2;
82    }

debugLevel = 2, means debug performance and data. Then you should see in output the dpi etc: Draw: [0.99650 S 16.60925 W - 57.13474 N 20.06398 E] 16x/4 552x1068 127.00000 DPI

hrdl-github commented 2 years ago

Would you mind providing a debug build with this option enabled? I managed to build an apk via act after giving up on getting this to run on Arch Llinux. However, the application quits shortly after launch:

logcat ``` 04-19 17:45:28.854 11345 11368 D osmin : Loading providers from "/storage/emulated/0/Android/data/io.github.janbar.osmin/files/resources/voice-providers.json" 04-19 17:45:28.854 11345 11345 W QtThread: type=1400 audit(0.0:61971): avc: denied { ioctl } for path="socket:[450555]" dev="sockfs" ino=450555 ioctlcmd=0x8927 scontext=u:r:untrusted_app_27:s0:c234,c256,c512,c768 tcontext=u:r:untrusted_app_27:s0:c234,c256,c512,c768 tclass=tcp_socket permissive=0 app=io.github.janbar.osmin 04-19 17:45:28.865 11345 11400 D osmin : Basemap found and loaded from ' "/storage/emulated/0/Android/data/io.github.janbar.osmin/files/resources/world" '... 04-19 17:45:28.919 11345 11368 W osmin : qrc:/controls2/osmin.qml:25:1: module "QtGraphicalEffects" is not installed 04-19 17:45:28.919 11345 11368 W osmin : qrc:/controls2/osmin.qml:24:1: module "Qt.labs.settings" is not installed 04-19 17:45:28.919 11345 11368 W osmin : qrc:/controls2/osmin.qml:22:1: module "QtQuick.Controls.Universal" is not installed 04-19 17:45:28.919 11345 11368 W osmin : qrc:/controls2/osmin.qml:21:1: module "QtQuick.Controls.Material" is not installed 04-19 17:45:28.919 11345 11368 W osmin : qrc:/controls2/osmin.qml:20:1: module "QtQuick.Controls" is not installed 04-19 17:45:28.919 11345 11368 W osmin : qrc:/controls2/osmin.qml:19:1: module "QtQuick.Layouts" is not installed 04-19 17:45:28.919 11345 11368 W osmin : qrc:/controls2/osmin.qml:25:1: module "QtGraphicalEffects" is not installed 04-19 17:45:28.919 11345 11368 W osmin : qrc:/controls2/osmin.qml:24:1: module "Qt.labs.settings" is not installed 04-19 17:45:28.919 11345 11368 W osmin : qrc:/controls2/osmin.qml:22:1: module "QtQuick.Controls.Universal" is not installed 04-19 17:45:28.919 11345 11368 W osmin : qrc:/controls2/osmin.qml:21:1: module "QtQuick.Controls.Material" is not installed 04-19 17:45:28.919 11345 11368 W osmin : qrc:/controls2/osmin.qml:20:1: module "QtQuick.Controls" is not installed 04-19 17:45:28.919 11345 11368 W osmin : qrc:/controls2/osmin.qml:19:1: module "QtQuick.Layouts" is not installed 04-19 17:45:28.919 11345 11368 W osmin : qrc:/controls2/osmin.qml:25:1: module "QtGraphicalEffects" is not installed 04-19 17:45:28.919 11345 11368 W osmin : qrc:/controls2/osmin.qml:24:1: module "Qt.labs.settings" is not installed 04-19 17:45:28.919 11345 11368 W osmin : qrc:/controls2/osmin.qml:22:1: module "QtQuick.Controls.Universal" is not installed 04-19 17:45:28.919 11345 11368 W osmin : qrc:/controls2/osmin.qml:21:1: module "QtQuick.Controls.Material" is not installed 04-19 17:45:28.919 11345 11368 W osmin : qrc:/controls2/osmin.qml:20:1: module "QtQuick.Controls" is not installed 04-19 17:45:28.919 11345 11368 W osmin : qrc:/controls2/osmin.qml:19:1: module "QtQuick.Layouts" is not installed 04-19 17:45:28.919 11345 11368 W osmin : qrc:/controls2/osmin.qml:25:1: module "QtGraphicalEffects" is not installed 04-19 17:45:28.919 11345 11368 W osmin : qrc:/controls2/osmin.qml:24:1: module "Qt.labs.settings" is not installed 04-19 17:45:28.919 11345 11368 W osmin : qrc:/controls2/osmin.qml:22:1: module "QtQuick.Controls.Universal" is not installed 04-19 17:45:28.919 11345 11368 W osmin : qrc:/controls2/osmin.qml:21:1: module "QtQuick.Controls.Material" is not installed 04-19 17:45:28.919 11345 11368 W osmin : qrc:/controls2/osmin.qml:20:1: module "QtQuick.Controls" is not installed 04-19 17:45:28.919 11345 11368 W osmin : qrc:/controls2/osmin.qml:19:1: module "QtQuick.Layouts" is not installed 04-19 17:45:28.919 11345 11368 W osmin : qrc:/controls2/osmin.qml:25:1: module "QtGraphicalEffects" is not installed 04-19 17:45:28.919 11345 11368 W osmin : qrc:/controls2/osmin.qml:24:1: module "Qt.labs.settings" is not installed 04-19 17:45:28.920 11345 11368 W osmin : qrc:/controls2/osmin.qml:22:1: module "QtQuick.Controls.Universal" is not installed 04-19 17:45:28.920 11345 11368 W osmin : qrc:/controls2/osmin.qml:21:1: module "QtQuick.Controls.Material" is not installed 04-19 17:45:28.920 11345 11368 W osmin : qrc:/controls2/osmin.qml:20:1: module "QtQuick.Controls" is not installed 04-19 17:45:28.920 11345 11368 W osmin : qrc:/controls2/osmin.qml:19:1: module "QtQuick.Layouts" is not installed 04-19 17:45:28.920 11345 11368 W osmin : qrc:/controls2/osmin.qml:25:1: module "QtGraphicalEffects" is not installed 04-19 17:45:28.920 11345 11368 W osmin : qrc:/controls2/osmin.qml:24:1: module "Qt.labs.settings" is not installed 04-19 17:45:28.920 11345 11368 W osmin : qrc:/controls2/osmin.qml:22:1: module "QtQuick.Controls.Universal" is not installed 04-19 17:45:28.920 11345 11368 W osmin : qrc:/controls2/osmin.qml:21:1: module "QtQuick.Controls.Material" is not installed 04-19 17:45:28.920 11345 11368 W osmin : qrc:/controls2/osmin.qml:20:1: module "QtQuick.Controls" is not installed 04-19 17:45:28.920 11345 11368 W osmin : qrc:/controls2/osmin.qml:19:1: module "QtQuick.Layouts" is not installed 04-19 17:45:28.976 11380 11380 W System.err: at io.github.janbar.osmin.QtAndroidService.onCreate(QtAndroidService.java:19) 04-19 17:45:28.980 11380 11380 W System.err: at io.github.janbar.osmin.QtAndroidService.onCreate(QtAndroidService.java:19) 04-19 17:45:29.054 1514 1778 I ActivityManager: Deferring FGS notification in legacy app io.github.janbar.osmin/u0a234 : Notification(channel=ForegroundServiceChannel shortcut=null contentView=null vibrate=null sound=null defaults=0x0 flags=0x40 color=0x00000000 vis=PRIVATE) 04-19 17:45:29.277 1514 2952 I ActivityManager: Process io.github.janbar.osmin (pid 11345) has died: cch CRE ```
hrdl-github commented 2 years ago

Comparing the release apk (1.8.5) and my apk (https://github.com/janbar/osmin/commit/6b95edbfc6833bd0267ac60fa7d8170cc9324126), it's obvious that some of the shared libraries are missing. When are these supposed to be added? Are they present in your debug builds? I use cmake 3.16 instead of cmake 3.23 and there is also a chance that some of my environment variables differ or are unset.

diff ``` 1a2 > ./assets/android_rcc_bundle.rcc 43d43 < ./assets/resources/stylesheets/contour_lines.ost 46,47d45 < ./assets/resources/stylesheets/max_speeds.ost < ./assets/resources/stylesheets/motorways.ost 338d335 < ./classes2.dex 377a375,400 > ./lib/arm64-v8a/libqml_QtGraphicalEffects_private_qtgraphicaleffectsprivate_arm64-v8a.so > ./lib/arm64-v8a/libqml_QtGraphicalEffects_qtgraphicaleffectsplugin_arm64-v8a.so > ./lib/arm64-v8a/libqml_Qt_labs_folderlistmodel_qmlfolderlistmodelplugin_arm64-v8a.so > ./lib/arm64-v8a/libqml_Qt_labs_settings_qmlsettingsplugin_arm64-v8a.so > ./lib/arm64-v8a/libqml_QtPositioning_declarative_positioning_arm64-v8a.so > ./lib/arm64-v8a/libqml_QtQml_Models.2_modelsplugin_arm64-v8a.so > ./lib/arm64-v8a/libqml_QtQml_qmlplugin_arm64-v8a.so > ./lib/arm64-v8a/libqml_QtQml_RemoteObjects_qtqmlremoteobjects_arm64-v8a.so > ./lib/arm64-v8a/libqml_QtQml_StateMachine_qtqmlstatemachine_arm64-v8a.so > ./lib/arm64-v8a/libqml_QtQml_WorkerScript.2_workerscriptplugin_arm64-v8a.so > ./lib/arm64-v8a/libqml_QtQuick.2_qtquick2plugin_arm64-v8a.so > ./lib/arm64-v8a/libqml_QtQuick_Controls.2_Fusion_qtquickcontrols2fusionstyleplugin_arm64-v8a.so > ./lib/arm64-v8a/libqml_QtQuick_Controls.2_Imagine_qtquickcontrols2imaginestyleplugin_arm64-v8a.so > ./lib/arm64-v8a/libqml_QtQuick_Controls.2_Material_qtquickcontrols2materialstyleplugin_arm64-v8a.so > ./lib/arm64-v8a/libqml_QtQuick_Controls.2_qtquickcontrols2plugin_arm64-v8a.so > ./lib/arm64-v8a/libqml_QtQuick_Controls.2_Universal_qtquickcontrols2universalstyleplugin_arm64-v8a.so > ./lib/arm64-v8a/libqml_QtQuick_Controls_qtquickcontrolsplugin_arm64-v8a.so > ./lib/arm64-v8a/libqml_QtQuick_Controls_Styles_Android_qtquickcontrolsandroidstyleplugin_arm64-v8a.so > ./lib/arm64-v8a/libqml_QtQuick_Controls_Styles_Flat_qtquickextrasflatplugin_arm64-v8a.so > ./lib/arm64-v8a/libqml_QtQuick_Dialogs_dialogplugin_arm64-v8a.so > ./lib/arm64-v8a/libqml_QtQuick_Dialogs_Private_dialogsprivateplugin_arm64-v8a.so > ./lib/arm64-v8a/libqml_QtQuick_Extras_qtquickextrasplugin_arm64-v8a.so > ./lib/arm64-v8a/libqml_QtQuick_Layouts_qquicklayoutsplugin_arm64-v8a.so > ./lib/arm64-v8a/libqml_QtQuick_PrivateWidgets_widgetsplugin_arm64-v8a.so > ./lib/arm64-v8a/libqml_QtQuick_Templates.2_qtquicktemplates2plugin_arm64-v8a.so > ./lib/arm64-v8a/libqml_QtQuick_Window.2_windowplugin_arm64-v8a.so 384a408 > ./lib/arm64-v8a/libQt5PositioningQuick_arm64-v8a.so 386a411 > ./lib/arm64-v8a/libQt5QmlWorkerScript_arm64-v8a.so 396,397c421,422 < ./META-INF/CERT.RSA < ./META-INF/CERT.SF --- > ./META-INF/KEY0.RSA > ./META-INF/KEY0.SF ```
janbar commented 2 years ago

I have no idea how to build an apk for GrapheneOS. The package should contains all binaries and qml modules too.

Edit: Is a Android package you are using ? If yes then I could provide to you a signed apk with the right debug level flag.

janbar commented 2 years ago

I uploaded the APK 1.8.5 with debug level: https://github.com/janbar/osmin/releases/download/1.8.5/osmin-arm64-v8a-DEBUG-signed.apk

hrdl-github commented 2 years ago

Yes, GrapheneOS also Android-based. Thanks uploading your build. I gave it a try but did not get the expected output via logcat. I get the debug-level "Skip database ..." messages, but nothing more when panning or zooming on the map.

hrdl-github commented 2 years ago

I witness the same behaviour (suboptimal rendering and lack of Draw ... debug messages with the debug build) on another LineageOS 18.1 device.

janbar commented 2 years ago

I checked the logcat, and all debug messages are dropped for a signed build. So we have to build a debug build without signature. In the repository you will find the script "android/linux-build-arm64-qt515.sh" to do it as follows:

hrdl-github commented 2 years ago

I'm still experiencing the same issue, i.e. the application crashes and I see warnings about some modules (e.g. QtQuick.Layouts; see logcat above) not being installed. The files indicated as missing in the diff above are still missing. I don't know much about Qt development, so I don't know when those modules would be added or which component in the build process would add / register them. My best guess is that there is minor discrepancy between our build environments that causes mine to silently produce faulty builds.

janbar commented 2 years ago

I uploaded the debug APK: https://github.com/janbar/osmin/releases/download/1.8.6/osmin-arm64-FOR_DEBUG_ONLY.apk The relase is 1.8.6 without patch to quiet osmscout debug messages. To instal it you will have to uninstall first the installed APK which is signed.

hrdl-github commented 2 years ago

Thanks for the effort. The log out put is more verbose now, but I am still missing the Draw: ... DPI outputs. I will try to compile one of the older versions using NDK 18 once I find the time. I suspect that for some reason the packaging goes wrong in my build environment, even though I don't see any relevant difference between your build log and mine.

hrdl-github commented 1 year ago

Is https://github.com/janbar/osmin/commit/73f3df925ab8fb5692daf56b96b809c4bd13eda8 relevant to the debug output I was missing? If so I would try this if you happen to have another debug build.

janbar commented 1 year ago

Hi @hrdl-github , I released the latest android app with a debug logging option. Apk is available at "https://github.com/janbar/osmin/releases/download/1.9.6/osmin-arm64-v8a-with-debug-option-signed.apk". To enable debug logging you have to: