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

OSError: /path_to_file/libaudresample.so: cannot open shared object file: No such file or directory #79

Open
funnyshape opened this issue Mar 30, 2023 · 20 comments

Comments

@funnyshape
Copy link

Hi,

my Issue may or may not be related to #26. When I try to import opensmile, right at the beginning of a python script, this error is thrown:

File "/media/pi1/E04C-9C99/Audio_Pi/SentenceDetect.py", line 11, in
import opensmile
File "/usr/local/lib/python3.9/dist-packages/opensmile/init.py", line 6, in
from opensmile.core.smile import (
File "/usr/local/lib/python3.9/dist-packages/opensmile/core/smile.py", line 10, in
import audinterface
File "/usr/local/lib/python3.9/dist-packages/audinterface/init.py", line 2, in
from audinterface import utils
File "/usr/local/lib/python3.9/dist-packages/audinterface/utils/init.py", line 1, in
from audinterface.core.utils import (
File "/usr/local/lib/python3.9/dist-packages/audinterface/core/utils.py", line 11, in
import audresample
File "/home/pi1/audresample/audresample/init.py", line 2, in
from audresample.core.api import (
File "/home/pi1/audresample/audresample/core/api.py", line 8, in
from audresample.core.lib import lib
File "/home/pi1/audresample/audresample/core/lib.py", line 29, in
lib = ctypes.cdll.LoadLibrary(lib_path)
File "/usr/lib/python3.9/ctypes/init.py", line 452, in LoadLibrary
return self._dlltype(name)
File "/usr/lib/python3.9/ctypes/init.py", line 374, in init
self._handle = _dlopen(self._name, mode)
OSError: /home/pi1/audresample/audresample/core/bin/linux/libaudresample.so: cannot open shared object file: No such file or directory

OS: pi os 64 bit
python version: 3.9.2
gcc( if needed, looking at issue #33): Debian 10.2.1-6

I already tried to set LD_LIBRARY_PATH, but this did not resolve the issue.
Any help would be appreciated!

@hagenw
Copy link
Member

hagenw commented Mar 31, 2023

The place it tries to load libaudresample.so looks strange to me. Did you install the package to a virtual environment?

For example, if I install audresample to a virtual environment called test with:

$ virtualenv --python=python3.9 test
$ source test/bin/activate
$ pip install audresample

I have the needed file and can also import audresample:

$ ls test/lib/python3.9/site-packages/audresample/core/bin/linux/libaudresample.so
test/lib/python3.9/site-packages/audresample/core/bin/linux/libaudresample.so
$ python -c "import audresample; print(audresample.__version__)"
1.2.1

@hagenw
Copy link
Member

hagenw commented Mar 31, 2023

It seems like the following code we use inside audresample is not sufficient to find the correct folder in your case:

https://github.com/audeering/audresample/blob/3cd2bff35a2818698316c466a8d84dc6816014c3/audresample/core/lib.py#L8-L14

@funnyshape
Copy link
Author

Thank you for your answers.
I tried it with and without venv, unfortunately the result is the same.

With ls ... my pi does find the .so file, but I am not even able to import audresample via the import-statement. The Error-Statement is basically the same as above.

Do you think there could be a workaround to find the correct folder?

@frankenjoe
Copy link
Collaborator

Do you think there could be a workaround to find the correct folder?

Did you try to copy it manually to: /home/pi1/audresample/audresample/core/bin/linux/libaudresample.so?

@funnyshape
Copy link
Author

The file is already there, with permissions set to be executable and viewable by everyone.

@frankenjoe
Copy link
Collaborator

The file is already there, with permissions set to be executable and viewable by everyone.

I see, then the problem is not that it cannot find the file, but rather that it cannot load the shared library.

@funnyshape
Copy link
Author

Seems so, but I am somewhat lost why this could be the case.

@hagenw
Copy link
Member

hagenw commented Apr 3, 2023

OS: pi os 64 bit

It seems you are trying to run on a Raspberry Pi, correct?
I think it needs arm64 as architecture, but we support only x86-64 at the moment.

@funnyshape
Copy link
Author

funnyshape commented Apr 3, 2023

Yes, I am using a Raspberry Pi.
Ah okay, so there is the problem. Do you have, by any chance, the plan to change that in the future?

@hagenw
Copy link
Member

hagenw commented Apr 3, 2023

Unfortunately, there is no arm64 runner available on Github (actions/runner-images#5631).

There is the option to create a docker image for arm64 and use the docker image to build the binary, e.g. https://github.com/WebAssembly/wabt/pull/2184/files.
Or alternatively, we can use an internal runner to build the library.
So, yes, it should be possible to add support for it, and we will look into it.

@funnyshape
Copy link
Author

Okay, thank you very much!

@hagenw
Copy link
Member

hagenw commented Apr 3, 2023

Could you maybe use platform (import platform) in Python and report the output of the following two commands from the PI:

  • platform.system()
  • platform.processor()

@funnyshape
Copy link
Author

  • Platform.system: Linux
  • Platform.processor: Does not return anything, I will look into that.

@funnyshape
Copy link
Author

With lscpu I get the following info:
Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
Vendor ID: ARM
Model: 3
Model name: Cortex-A72
Stepping: r0p3

@hagenw
Copy link
Member

hagenw commented Apr 5, 2023

We build a binary on our RaspberryPi which has:

$ uname -m
armv7l

As a test you could copy it to the audresample/core/bin/linux/ and see if this help fixing the audresample import error. opensmile will then still not work for you as there we also need to update the binaries. But it would help if you could test if the new audresample binary works on your RaspberryPi as well.

libaudresample.zip

@funnyshape
Copy link
Author

Thank you!
Unfortunately I get a new error: wrong ELF class: ELFCLASS32

@hagenw
Copy link
Member

hagenw commented May 5, 2023

I guess, I made an error in providing you the ARMv7 binary as you have 64-bit. I attached here a ARMv8 binary that works with 64-bit, could you try again if this works?

linux-armv8.zip

@funnyshape
Copy link
Author

Hi, sorry for the late answer! After inserting the file I get a new Error-Message:

OSError: /home/pi1/.local/lib/python3.9/site-packages/opensmile/core/bin/linux/libSMILEapi.so: cannot open shared object file: No such file or directory

Although the file exists in this place.

@hagenw
Copy link
Member

hagenw commented Jun 30, 2023

Thanks for the feedback. This means audresample does now indeed work on your machine.

The error you are seeing now is due to missing support for ARMv8 in opensmile. We will be able to add it when we have setup the needed scripts to solve #78 during the next months.

@hagenw
Copy link
Member

hagenw commented Oct 19, 2023

With release 2.5.0 of opensmile we should now support Raspberry PI. Could you maybe try to update your installation and try again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants