Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[voskstt] Fix load on linux arm #13556

Merged
merged 5 commits into from Oct 18, 2022
Merged

Conversation

GiviMAD
Copy link
Member

@GiviMAD GiviMAD commented Oct 16, 2022

Try to fix error on armv7.

Signed-off-by: Miguel Álvarez miguelwork92@gmail.com

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
@lolodomo
Copy link
Contributor

lolodomo commented Oct 17, 2022

After an update of the bundle, a clean of .cache/JNA folder and a restart of openHAB, the exception is no more present, the bundle is active but I have this warning:

09:10:31.660 [WARN ] [voice.voskstt.internal.VoskSTTService] - Missing native dependency: /home/xxx/.cache/JNA/temp/jna511182918146398935.tmp: undefined symbol: __atomic_load_8

@lolodomo lolodomo added the bug An unexpected problem or unintended behavior of an add-on label Oct 17, 2022
@GiviMAD
Copy link
Member Author

GiviMAD commented Oct 17, 2022

Hi @lolodomo, a little update from my side.
I was able to replicate the issue using the docker armv7l image, also I was able to workaround it by setting this env var "LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libatomic.so.1" apart from install libatomic1.
As a reference I found the workaround here piwheels/packages#59

Not sure if something can be done in the binding to load this shared library using java before the first call to vosk or if is better to report the issue in the vosk repo. I'm afraid I have not enough knowledge about c :S

I will do more investigation later or tomorrow about how it can be fixed. Let me know if you have any advise or if you can confirm that workaround works for you.

@GiviMAD
Copy link
Member Author

GiviMAD commented Oct 17, 2022

Do not test the workaround, I was able to load the library from the binding, I'll update the pr!

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
@GiviMAD GiviMAD changed the title WIP [voskstt] redownload armv7 vosk native lib [voskstt] Fix load on linux arm Oct 17, 2022
@GiviMAD
Copy link
Member Author

GiviMAD commented Oct 17, 2022

This last version works fine for me, only requirement is have libatomic installed.

@lolodomo
Copy link
Contributor

Please update README to mention the prerequisite and how to install the missing library.

@GiviMAD
Copy link
Member Author

GiviMAD commented Oct 17, 2022

Please update README to mention the prerequisite and how to install the missing library.

Ok I'll add a "supported platforms" section with this information.
Section already exists I will add this information in there.

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
@GiviMAD GiviMAD requested a review from lolodomo October 17, 2022 18:26
Copy link
Contributor

@lolodomo lolodomo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to update the library finally?

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
@GiviMAD
Copy link
Member Author

GiviMAD commented Oct 17, 2022

No need to update the library finally?

No I checked it agains and outdated branch, the binary was correctly downloaded. Once I merge master to this branch that change was the same, also the call to 'LibVosk.setLogLevel(LogLevel.WARNINGS);' was missed in this branch, that is why it failed different earlier. The problem was always the missing libatomic library. Sorry for the whole confusion.

@GiviMAD GiviMAD requested a review from lolodomo October 17, 2022 19:15
Copy link
Contributor

@lolodomo lolodomo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lolodomo lolodomo merged commit 4bba6ef into openhab:main Oct 18, 2022
@lolodomo lolodomo added this to the 3.4 milestone Oct 18, 2022
@lolodomo
Copy link
Contributor

After installing snapshot 3143, I can tell you that I have no warning/error in logs at startup.
I did not install libatomic.
That being said, I can't tell you if the service is working or not (not tested).

@GiviMAD
Copy link
Member Author

GiviMAD commented Oct 24, 2022

After installing snapshot 3143, I can tell you that I have no warning/error in logs at startup.
I did not install libatomic.
That being said, I can't tell you if the service is working or not (not tested).

Thank you for the confirmation, in my tests I enabled the model load and it works without errors, so I think it will work well.
Probably libatomic is already installed in raspbian, you can check if the library is present using the path:

ls /usr/lib/arm-linux-gnueabihf/libatomic.so.1

@lolodomo
Copy link
Contributor

Confirmed, the file already exists in my system (RPI3).

andan67 pushed a commit to andan67/openhab-addons that referenced this pull request Nov 6, 2022
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
andrasU pushed a commit to andrasU/openhab-addons that referenced this pull request Nov 12, 2022
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
borazslo pushed a commit to borazslo/openhab-mideaac-addon that referenced this pull request Jan 8, 2023
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
psmedley pushed a commit to psmedley/openhab-addons that referenced this pull request Feb 23, 2023
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
nemerdaud pushed a commit to nemerdaud/openhab-addons that referenced this pull request Feb 28, 2023
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants