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

NumCalc Manager does not run on Apple Silicon due to soundfilelib incompatibility. #23

Closed
SymphonX opened this issue Jul 8, 2022 · 8 comments

Comments

@SymphonX
Copy link

SymphonX commented Jul 8, 2022

As the title suggests. NumCalc manager won't run on Apple Silicon CPUs due to an issue with the libsndfile dylib (or the python package).

See: bastibe/python-soundfile#310

Please point to this information in the guide as there currently appears to be no way to run the manager on the affected systems. Let's hope an update to python-soundfile will be released soon.

Thanks.

@f-brinkmann
Copy link
Contributor

How is this related to Mesh2HRTF and numcalc_manager? We do not you libsndfile. See requirements:
https://github.com/Any2HRTF/Mesh2HRTF/blob/develop/setup.py

Best, Fabian

@SymphonX
Copy link
Author

SymphonX commented Jul 8, 2022

OK, I see. Sorry if I put this in the wrong section.

Weird thing is that numcalc_manager.py complains about soundfile not being installed (or rather that its dylib cannot be found). No idea what's going on here. But it's happening on two Apple Silicon systems, but not on an Apple Intel install.

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/soundfile.py", line 142, in
raise OSError('sndfile library not found')
OSError: sndfile library not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/maestroso/Desktop/Mesh2HRTF/Mesh2HRTF/mesh2hrtf/NumCalc/numcalc_manager.py", line 24, in
import mesh2hrtf as m2h
File "/Users/maestroso/Desktop/Mesh2HRTF/Mesh2HRTF/mesh2hrtf/init.py", line 7, in
from .Output2HRTF.Python.outputs_to_hrtfs import (
File "/Users/maestroso/Desktop/Mesh2HRTF/Mesh2HRTF/mesh2hrtf/Output2HRTF/Python/outputs_to_hrtfs.py", line 5, in
from . import utils
File "/Users/maestroso/Desktop/Mesh2HRTF/Mesh2HRTF/mesh2hrtf/Output2HRTF/Python/utils.py", line 9, in
import pyfar as pf
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyfar/init.py", line 18, in
from . import io
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyfar/io/init.py", line 1, in
from .io import (read_wav, write_wav, read, write, read_sofa,
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyfar/io/io.py", line 17, in
import soundfile
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/soundfile.py", line 162, in
_snd = _ffi.dlopen(_os.path.join(
OSError: cannot load library '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib': dlopen(/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib, 0x0002): tried: '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib' (no such file)

@SymphonX
Copy link
Author

SymphonX commented Jul 8, 2022

BTW, according to my understanding pyfar, which is used in the project, uses soundfile, hence the error. This line made me suspicious:

File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyfar/io/io.py", line 17, in
import soundfile

Am I correct? Not the most savvy python user here, so forgive my ignorance ;-).

@f-brinkmann
Copy link
Contributor

Thanks for clarifying - that makes sense. The next release seems to be close:
bastibe/python-soundfile#325

We could also make soundfile optional for pyfar, but that might take longer than waiting for the new soundfile release.

@f-brinkmann
Copy link
Contributor

f-brinkmann commented Aug 5, 2022

@SymphonX the work on the new soundfile release seems to take longer than I hoped. We prepared a new relase where soundfile is optional: pyfar/pyfar#334

Can you check if that works for you? You'd have to clone the pyfar repository, switch to the branch and than install pyfar (in a clean environment) using pip install -e . The dot means that the current directory is installed, which means you have to cd into the pyfar git repository.

@mberz
Copy link

mberz commented Aug 5, 2022

You can also try installing libsndfile from conda-forge. At least the miniforge version does support arm64.

@SymphonX
Copy link
Author

SymphonX commented Aug 7, 2022

Can you check if that works for you?

Thanks! I will check but it might take a week or so as I'm currently out of office. Looking forward testing this on the M1 Ultra!

@mberz
Copy link

mberz commented Aug 11, 2022

The most recent version of pyfar (0.4.3) also includes a workaround for broken soundfile Imports due to m1 incompatibilities, beware though that reading and writing *.wav files won't work in this case.

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