solum icon indicating copy to clipboard operation
solum copied to clipboard

no symbols exported in libsolum_android.so

Open virgileMaon opened this issue 1 year ago • 40 comments

Hello,

We are trying to build a Qt android app embeding libsolum_android.so, but the compiler does not find any symbol, like solumFwVersion or solumInit. Symbols does not seems to be exported.

Is there a way to use solum in a native c++ android app?

Thank you Virgile Dupuis Deski

virgileMaon avatar Apr 25 '24 10:04 virgileMaon

I made the same experience when calling solumInit in the Ubuntu 22.04 compiled lib - compiler also doesn't find it.

joriswa avatar Apr 25 '24 11:04 joriswa

Android has it's own API separate from the desktop, you should follow the example outlined here: https://github.com/clariusdev/solum/tree/master/examples/solum_android

clariusk avatar Apr 25 '24 15:04 clariusk

We are using Qt to develop our android application with c++. What I understand, and correct me if I'm wrong, your android example use the libs include in solum-debug.aar. More precisely, the example uses the Solum.java class which itself dynamically loads the solum_android.so library. And Solum.java talks to solum_android.so via JNI code.

If I use solum-debug.aar as you do in the example I will have to write JNI code to talk to java code which itself will talk to c or c++ in JNI.

Is it possible to offer a libsolum.so version for arm64-v8a?

Thank you Virgile Dupuis Deski

virgileMaon avatar Apr 26 '24 09:04 virgileMaon

Hi @virgileMaon you are correct, you would have do C++ (your app) -> Java (Solum.java) -> C++ (solum_android.so) -> Java (Solum.java) -> C++ (your app). I will look at providing the C++ lib directly for Android.

julien-l avatar May 23 '24 02:05 julien-l

Hi @julien-l,

When do you think we could test a new package featuring C++ endpoints?

Thank you, David

daudrain avatar May 27 '24 15:05 daudrain

I am thinking to provide libs this week. Which Android platform are you targeting in priority? aarch64/armv8, armv7-a, i686, x86_64?

julien-l avatar May 27 '24 15:05 julien-l

Hi @julien-l

We are targeting arm64-v8a

Thank you. Virgile

virgileMaon avatar May 27 '24 17:05 virgileMaon

Hello I published a pre-release https://github.com/clariusdev/solum/releases/tag/v11.4.0-dev with an attempt at libsolum.so for Android arm64-v8a. It was built against Qt 6.7.1.

I used this lib to build the provided solum_console example -> build ok.

It ran with the following shared libs:

  • libQt6Core_arm64-v8a.so
  • libQt6Gui_arm64-v8a.so
  • libQt6OpenGL_arm64-v8a.so
  • libQt6StateMachine_arm64-v8a.so
  • libc++_shared.so

However it crashed soon after when instantiating QCoreApplication, not sure why, I have not been able to debug. If you create your own Qt application instance before calling solumInit(), then Solum will not attempt to instantiate QCoreApplication.

julien-l avatar May 28 '24 20:05 julien-l

Please note, we will not be publishing any firmware for 11.4 currently, the software is currently unstable, even on the SDK side, we can not make guarantees on stability, please just use this as a way to test compilation

clariusk avatar May 28 '24 20:05 clariusk

Hi,

I can make a solumInit in my QApplication, with no crash :). But the solumFwVersion (for V1, HD, HD3) returns me "unknown", while the java version returned right infos. Do you know why?

Thank you, I'll continue to test.

virgileMaon avatar Jun 05 '24 13:06 virgileMaon

Hi,

I built the solum_qt example on android linked with the libsolum 11.4 you provided. From the gui on the tablet, I can connect the probe with wifi, and update certificate. However, once this is achieved the button "run" still disabled because I didn't pass in imagingState callback. In the callback setConnected the CusConnection is ProbeConnected and not SwUpdateRequired as I would have expected. I notice I pass in imagingState if I disconnect the probe from wifi. Forthemore, the firmware version at start still be "unknown"

Do you think you can provide firmware compatible with libsolum 11.4 so that we can continue our investigations? For the moment the results are encouraging and we would like to go as far as viewing the images from the probe.

thank you in advance

virgileMaon avatar Jun 13 '24 16:06 virgileMaon

I cannot provide a FW 11.4 for now because it is not stable, it might brick the probe. I will try to provide arm64-v8a binaries for v11.3.0 that was released in pilot.

julien-l avatar Jun 17 '24 11:06 julien-l

Thank you @julien-l

daudrain avatar Jun 17 '24 15:06 daudrain

Here is another test build: https://github.com/clariusdev/solum/releases/tag/v11.3.0-dev

Notes:

  • it is based on FW 11.3.0 so you should not need to update your probe
  • it uses Qt 6.5.5
  • with debug symbols

Let me know how it goes.

julien-l avatar Jun 18 '24 10:06 julien-l

Hi @julien-l We managed to compile the qt_example with the 11.3.0 version you released. The connection seems to work, but I get an error when I try to start imaging: "Error: Failed to load workflow: Could not load scripts: Operation failed (Exception occurred: invalid message response for command set script (6467°) ...)". I suspect it's because the probe firmware is still version 11.2.0. But the required firmware version is still "unknown". How do I download the required firmware? Thanks

FabriceBertDeski avatar Jun 18 '24 16:06 FabriceBertDeski

Yes the probe's FW version has to match that of Solum. You have 2 ways to update:

julien-l avatar Jun 18 '24 16:06 julien-l

I wanted to manually update the probe with Solum, but I can't get the required firmware version as solumFwVersion returns "unknown". So I can't make the right call to download the probes firmware. Is it normal that this function returns unknown?

FabriceBertDeski avatar Jun 18 '24 16:06 FabriceBertDeski

The FW version is "11.3.0-573+670db68186", I will need to rebuild and re-upload the binaries with the correct FW info.

julien-l avatar Jun 18 '24 16:06 julien-l

Thanks @julien-l I managed to download the right firmware! Will it work if you don't rebuild with the right FW informations?

FabriceBertDeski avatar Jun 18 '24 16:06 FabriceBertDeski

You should be able to connect without the FW info, it will just prevent your FW download workflow. I just updated the binaries on GH release.

julien-l avatar Jun 18 '24 16:06 julien-l

Thanks @julien-l for the new version! We've managed to use the Solum qt example on Android and get the ultrasound image displayed. We updated the probe using the Clarius Ultrasound app as we had a problem updating the firmware using Solum, we need to try again.

FabriceBertDeski avatar Jun 19 '24 15:06 FabriceBertDeski

Good to hear, so you confirm the Solum C++ library for Android is usable? If so, I will commit the changes in our repo to deploy it with the next release.

julien-l avatar Jun 20 '24 12:06 julien-l

Yes, everything seems to be working. The only issue I would add is about updating the software with Solum (Id had to perform a hard reset as the probe led was fixed orange), maybe I did something wrong. One last thing, the Solum library seems to be very large (about 800Mo), I don't think we will be able to embed it in an aab package. Is this size due to the debug symbols?

FabriceBertDeski avatar Jun 21 '24 07:06 FabriceBertDeski

the Solum library seems to be very large (about 800Mo)

Due to debug symbols yes.

The next release will have the Solum C++ library for Android. I will close the ticket now.

julien-l avatar Jun 21 '24 12:06 julien-l

@julien-l We are trying to automatically connect to the probe's Wi-Fi network. When we call the solumConnect method, the connection always fails with the following error message "Error connecting: failed to connect to the probe at 192.168.1.1:5000 (networkID 0)". In fact, our network ID isn't 0 because the Wi-Fi connection was made by the application. Is there a way to specify the network ID with the Solum C API (the Android Java API seems to have a way to pass the network ID to the connect function)? Or a way to bypass it?

FabriceBertDeski avatar Jun 24 '24 15:06 FabriceBertDeski

Correct, you need to specify the network ID but the C++ lib does not allow it, I will update it. The workaround for now is to manually connect your phone/tablet to the probe's Wi-Fi.

julien-l avatar Jun 24 '24 16:06 julien-l

I just added a new zip under https://github.com/clariusdev/solum/releases/tag/v11.3.0-dev with an updated connection function taking a struct of input parameters that includes the network ID:

int long long networkID = ...;
CusConnectionParams params { "192.168.1.1", 5000, networkID };
solumConnectWithParams(&params);

See solum.h for the new type and function. Let me know if it works for you, if yes I will include it in the next release.

julien-l avatar Jun 24 '24 20:06 julien-l

thank you very much for your response

virgileMaon avatar Jun 24 '24 20:06 virgileMaon

We've tested your new version and if we call solumConnectWithParams with the right network handle, the connection works! Thanks for your quick response and version, it really helps us move forward!

FabriceBertDeski avatar Jun 25 '24 12:06 FabriceBertDeski

Avec plaisir! I will include that change in the next release. Thanks for the feedback.

julien-l avatar Jun 25 '24 14:06 julien-l