Mac: Unable to load library MHAIOJackdb

jellison70
Posts: 8
Joined: Thu Feb 24, 2022 6:59 pm

Error using mhactl_wrapper>mhactl_wrapper_2 (line 64)

Post by jellison70 » Thu Feb 24, 2022 7:20 pm

I am working through 'The Open Master Hearing (openMHA) v. 4.16.1 Getting Started guide. In section 5 page 11 (Control Frequency Shifter using Octave/Matlab GUI), I get the following upon entering the function mha_query(openmha,'','read:fshift_live.cfg') in the Matlab (R2020a) command window.

Error using mhactl_wrapper>mhactl_wrapper_2 (line 64)
An error occured while sending to MHA server:
[1: '?read:fshift_hilbert_live.cfg'] (mha_parser) (mha_os) Unable to load library "MHAIOJackdb" (MHA_LIBRARY_PATH=/usr/local/lib/openmha/;).
dlopen(/usr/local/lib/openmha/MHAIOJackdb.dylib, 0x0002): Library not loaded: /opt/local/lib/libjack.0.dylib
Referenced from: /usr/local/lib/openmha/MHAIOJackdb.dylib
Reason: tried: '/opt/local/lib/libjack.0.dylib' (no such file), '/usr/lib/libjack.0.dylib' (no such file)
(while parsing "fshift_hilbert_live.cfg" line 4)

Error in mhactl_wrapper (line 42)
r = interface( handle, query );

Error in mha_query (line 17)
s = mhactl_wrapper( handle, [base '?' query] );


Similarly, in section 6, I get the error below when entering mha_query(openmha,'','read:dynamiccompression_live.cfg');

Error using mhactl_wrapper>mhactl_wrapper_2 (line 64)
An error occured while sending to MHA server:
[1: ' ?read:dynamiccompression_live.cfg'] (mha_parser) not able to open file "dynamiccompression_live.cfg" for reading.

Error in mhactl_wrapper (line 42)
r = interface( handle, query );

Error in mha_query (line 17)
s = mhactl_wrapper( handle, [base '?' query] );


Any idea what is going on here? I am on macOS.

Thanks in advance.

JE

hendrikkayser
Posts: 38
Joined: Fri May 10, 2019 7:58 am

Re: Error using mhactl_wrapper>mhactl_wrapper_2 (line 64)

Post by hendrikkayser » Fri Feb 25, 2022 4:40 pm

Hello!
Regarding the jack issue: The jack library is not found at the expected location. How did you install openMHA?

Is your working directory ...examples/01-dynamic-compression when you try to load the dynamiccompressor configuration file?

jellison70
Posts: 8
Joined: Thu Feb 24, 2022 6:59 pm

Re: Error using mhactl_wrapper>mhactl_wrapper_2 (line 64)

Post by jellison70 » Fri Feb 25, 2022 4:57 pm

Regarding the Jack issue, I installed openMHA v 4.16.1 via
https://github.com/HoerTech-gGmbH/openM ... 4.16.1.pkg

And yes, my working directory is examples/01-dynamic-compression for the other error

jellison70
Posts: 8
Joined: Thu Feb 24, 2022 6:59 pm

Re: Error using mhactl_wrapper>mhactl_wrapper_2 (line 64)

Post by jellison70 » Fri Feb 25, 2022 11:48 pm

I have been trying to dig in a bit more. I updated the openMHA to 4.17. This comment refers to section 4.2 of the Getting Started manual. After opening the terminal, starting mha --interactive and ?read:gain_lie_getting_started.cfg I get the following:

mha [1] ?read:gain_live_getting_started.cfg
(mha_parser) (mha_os) Unable to load library "MHAIOJackdb" (MHA_LIBRARY_PATH=/usr/local/lib/openmha/;).
dlopen(/usr/local/lib/openmha/MHAIOJackdb.dylib, 0x0002): Library not loaded: /opt/local/lib/libjack.0.dylib
Referenced from: /usr/local/lib/openmha/MHAIOJackdb.dylib
Reason: tried: '/opt/local/lib/libjack.0.dylib' (no such file), '/usr/lib/libjack.0.dylib' (no such file)
(while parsing "gain_live_getting_started.cfg" line 18)
(MHA:failure)


Strangely, upon navigating to the directory that claims "no such file" from above, all referenced files are present. This doesn't seem to matter if I change those to read or write. I am officially stuck. Any ideas are much appreciated.

Thanks.

JE

tobiasherzke
Posts: 119
Joined: Mon Jun 24, 2019 12:51 pm

Re: Error using mhactl_wrapper>mhactl_wrapper_2 (line 64)

Post by tobiasherzke » Sat Feb 26, 2022 12:18 pm

The Jack audio I/O plugins will only work if the Jack audio server has been installed (and has been started).

This looks like Jack is not installed. Please see macOS installation instructions:
To use the Jack audio plugin, the JackOSX distribution needs to be installed.

jellison70
Posts: 8
Joined: Thu Feb 24, 2022 6:59 pm

Re: Error using mhactl_wrapper>mhactl_wrapper_2 (line 64)

Post by jellison70 » Sat Feb 26, 2022 4:18 pm

Yes, thanks, I have followed the macOS instructions in the supplied link. Also, this still occurs with Jack installed (and started). I have uninstalled, then reinstalled Jack. I am using Intel 64bit Installer: JACK 1.9.20 macOS-intel. However, I still getting the same message.

hendrikkayser
Posts: 38
Joined: Fri May 10, 2019 7:58 am

Re: Error using mhactl_wrapper>mhactl_wrapper_2 (line 64)

Post by hendrikkayser » Sun Feb 27, 2022 10:27 am

For a quick test I have upgraded jack on my macOS Catalina from the 1.9.19 homebrew installation to 1.9.20 using the jackOSX installer. Afterwards I was not able to start the jack server. I did not dig into the problem and this does not explain your issue as the jack server seems to work on your system, but you may want to give it a try with homebrew.
Run in your terminal

Code: Select all

brew install jack
brew link --overwrite jack
to install jack 1.9.19 on your system.

tobiasherzke
Posts: 119
Joined: Mon Jun 24, 2019 12:51 pm

Re: Error using mhactl_wrapper>mhactl_wrapper_2 (line 64)

Post by tobiasherzke » Sun Feb 27, 2022 10:30 am

I see that Hendrik has also posted a response in the meantime. This response does not take Hendrik's response into account, please regard them as independent alternatives.
jellison70 wrote:
Fri Feb 25, 2022 11:48 pm
Reason: tried: '/opt/local/lib/libjack.0.dylib' (no such file), '/usr/lib/libjack.0.dylib' (no such file)

Strangely, upon navigating to the directory that claims "no such file" from above, all referenced files are present.
I'm confused. I think I understand: the files /opt/local/lib/libjack.0.dylib and /usr/lib/libjack.0.dylib do actually exist on your Mac but that you still get the (no such file) "reason".

Please inspect the files from the macOS Terminal (skip the otool command if the otool command cannot be found):

Code: Select all

ls -l /opt/local/lib/libjack.0.dylib
file /opt/local/lib/libjack.0.dylib
otool -L /opt/local/lib/libjack.0.dylib
and if the file is a symbolic link, apply the same analysis also to the file where it points to. And also for /usr/lib/libjack.0.dylib.

Does your Mac have an Intel or an ARM processor?

Finally, please also try if the following solves the problem: It seems that the file libjack.0.dylib has changed its location in recent Jack installations for Mac, our build system is using an older version of Jack, and therefore our Jack IO plugin tries to load libjack from an outdated location:
  • Move /opt/local/lib/libjack.0.dylib out of the way with the macOS Terminal (only needed if it actually exists as file or as symlink):

Code: Select all

sudo mv /opt/local/lib/libjack.0.dylib /opt/local/lib/libjack.0.dylib~
  • Create a symlink that points to the libjack of Jack 1.9.20 with the macOS Terminal:

Code: Select all

sudo mkdir -p /opt/local/lib/
sudo ln -s /usr/local/lib/libjack.0.dylib /opt/local/lib/

tobiasherzke
Posts: 119
Joined: Mon Jun 24, 2019 12:51 pm

Re: Error using mhactl_wrapper>mhactl_wrapper_2 (line 64)

Post by tobiasherzke » Sun Feb 27, 2022 8:41 pm

By the way, when the problem is solved, I want to move this whole conversation to another section of the forum, because it is currently in "Connect openMHA to Matlab", and the problem that you found is not specific to Matlab. I will also try to retitle the thread to something like "Mac: Unable to load library MHAIOJackdb" if the forum software supports title changes so that it may be found more easily by future readers with the same problem. But as said, only when the problem is solved, so let's hope that one of the previous two posts can solve it for you.

jellison70
Posts: 8
Joined: Thu Feb 24, 2022 6:59 pm

Re: Error using mhactl_wrapper>mhactl_wrapper_2 (line 64)

Post by jellison70 » Mon Feb 28, 2022 7:00 pm

RE: Tobiasherzke,

I believe the previous statement I made was misleading and/or incorrect. I apologize. For clarification lib jack.0.dylib[/i] exists in /usr/local/lib/. It is not located in /opt/local/lib/.

When I enter the code provided that references the directory /opt/local/lib/libjack.0.dylib, I get "No such file or directory". This is the same result with /usr/lib/libjack.0.dylib.

The code that references the directory /usr/local/lib/

Code: Select all

ls -l /usr/local/lib/libjack.0.dylib
returns:
-rwxr-xr-x 1 root wheel 2432728 Jan 15 09:18 /usr/local/lib/libjack.0.dylib
The code:

Code: Select all

file /usr/local/lib/libjack.0.dylib
returns:
/usr/local/lib/libjack.0.dylib: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [arm64]
/usr/local/lib/libjack.0.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
/usr/local/lib/libjack.0.dylib (for architecture arm64): Mach-O 64-bit dynamically linked shared library arm64
And finally,

Code: Select all

otool -L /usr/local/lib/libjack.0.dylib
returns
/usr/local/lib/libjack.0.dylib:
/usr/local/lib/libjack.0.1.0.dylib (compatibility version 0.1.0, current version 1.9.20)
/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate (compatibility version 1.0.0, current version 4.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 904.4.0)
My Mac has an Intel processor and macOS Monterey v 12.2.1

The following code:

Code: Select all

sudo mv /opt/local/lib/libjack.0.dylib /opt/local/lib/libjack.0.dylib~

returned "No such file or directory" for the reasons above.

However, the symlink via the code:

Code: Select all

sudo mkdir -p /opt/local/lib/
sudo ln -s /usr/local/lib/libjack.0.dylib /opt/local/lib/
mha --interactive
?read:gain_live_getting_started.cfg
returned "(MHA: success)"

It appears that you may be correct that the libjack.0.dylib has changed location in the recent Jack installation.

Are there other steps I should take to ensure this error doesn't continue?

Thanks so much for your help on this.

JE

Post Reply