# problem loading PsychPortAudio driver on mac

**URL:** <https://psychtoolbox.discourse.group/t/problem-loading-psychportaudio-driver-on-mac/1917>\
**Category:** Uncategorized\
**Created:** [March 18, 2012, 10:19pm UTC](https://psychtoolbox.discourse.group/t/problem-loading-psychportaudio-driver-on-mac/1917 "2012-03-18T22:19:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [March 18, 2012, 10:19pm UTC](https://psychtoolbox.discourse.group/t/problem-loading-psychportaudio-driver-on-mac/1917/1 "2012-03-18T22:19:15Z")

</div>

Hi,  
I am running matlab R2010a on macOSX 10.6.8 and every time I try to use the InitializePsychSound command, I get the following error:  
  
In place of the expected mex file this placeholder file was executed:  
  
 PsychPortAudio  
  
This mex file seems to be missing or inaccessible on your Matlab path or it is dysfunctional:  
  
 PsychPortAudio.mexmaci  
  
Another reason could be insufficient access permissions or   
some missing 3rd party libraries on your system.  
  
Failed to load PsychPortAudio driver!  
  
The most likely cause is that the helper library libportaudio.0.0.19.dylib is not  
stored in one of the library directories. This is the case at first use of the new  
sound driver.  
  
A copy of this file can be found in /Applications/Psychtoolbox/PsychSound/libportaudio.0.0.19.dylib   
You need to copy that file into one of the following directories, then retry:  
If you have administrator permissions, copy it to (at your option): /usr/local/lib  
or /usr/lib -- you may need to create that directories first.  
  
If you are a normal user, you can also create a subdirectory lib/ in your home folder  
then copy the file there. E.g., your user name is lisa, then copy the file into  
/Users/lisa/lib/   
  
Please try this steps, then restart your script.  
  
The exact error message of the linker was: Error using ==\> AssertMex at 210  
Missing or dysfunctional Psychtoolbox Mex file for this operating system. Read the help text above carefully!!  
  
??? Error using ==\> InitializePsychSound at 140  
Failed to load PsychPortAudio driver.  
  
I followed the instructions exactly and copied the helper library file into /usr/lib and also tried reinstalling both matlab and psychtoolbox but it still keeps giving me this same error. Any ideas?   
  
Thanks so much,  
Laura

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [March 19, 2012, 2:17am UTC](https://psychtoolbox.discourse.group/t/problem-loading-psychportaudio-driver-on-mac/1917/2 "2012-03-19T02:17:24Z")

</div>

What is the output of:  
  
which PsychPortAudio  
  
and of  
  
d = PsychPortAudio('GetDevices')  
  
-mario  
  

> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "lauralevin45" \<lauralevin45@...\> wrote:  
> \>  
> \> Hi,  
> \> I am running matlab R2010a on macOSX 10.6.8 and every time I try to use the InitializePsychSound command, I get the following error:  
> \>   
> \> In place of the expected mex file this placeholder file was executed:  
> \>   
> \> PsychPortAudio  
> \>   
> \> This mex file seems to be missing or inaccessible on your Matlab path or it is dysfunctional:  
> \>   
> \> PsychPortAudio.mexmaci  
> \>   
> \> Another reason could be insufficient access permissions or   
> \> some missing 3rd party libraries on your system.  
> \>   
> \> Failed to load PsychPortAudio driver!  
> \>   
> \> The most likely cause is that the helper library libportaudio.0.0.19.dylib is not  
> \> stored in one of the library directories. This is the case at first use of the new  
> \> sound driver.  
> \>   
> \> A copy of this file can be found in /Applications/Psychtoolbox/PsychSound/libportaudio.0.0.19.dylib   
> \> You need to copy that file into one of the following directories, then retry:  
> \> If you have administrator permissions, copy it to (at your option): /usr/local/lib  
> \> or /usr/lib -- you may need to create that directories first.  
> \>   
> \> If you are a normal user, you can also create a subdirectory lib/ in your home folder  
> \> then copy the file there. E.g., your user name is lisa, then copy the file into  
> \> /Users/lisa/lib/   
> \>   
> \> Please try this steps, then restart your script.  
> \>   
> \> The exact error message of the linker was: Error using ==\> AssertMex at 210  
> \> Missing or dysfunctional Psychtoolbox Mex file for this operating system. Read the help text above carefully!!  
> \>   
> \> ??? Error using ==\> InitializePsychSound at 140  
> \> Failed to load PsychPortAudio driver.  
> \>   
> \> I followed the instructions exactly and copied the helper library file into /usr/lib and also tried reinstalling both matlab and psychtoolbox but it still keeps giving me this same error. Any ideas?   
> \>   
> \> Thanks so much,  
> \> Laura  
> \>

---

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [March 19, 2012, 3:38am UTC](https://psychtoolbox.discourse.group/t/problem-loading-psychportaudio-driver-on-mac/1917/3 "2012-03-19T03:38:05Z")

</div>

the output of which PsychPortAudio is:  
  
/Users/lauralevin/Documents/MATLAB/PsychPortAudio.m  
  
the output of d = PsychPortAudio('GetDevices') is:  
  
In place of the expected mex file this placeholder file was executed:  
  
 PsychPortAudio  
  
This mex file seems to be missing or inaccessible on your Matlab path or it is dysfunctional:  
  
 PsychPortAudio.mexmaci  
  
Another reason could be insufficient access permissions or   
some missing 3rd party libraries on your system.  
  
??? Error using ==\> AssertMex at 210  
Missing or dysfunctional Psychtoolbox Mex file for this operating system. Read the help text above  
carefully!!  
  
Error in ==\> PsychPortAudio at 68  
AssertMex('PsychPortAudio.m');  
  

> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Mario" \<mario.kleiner@...\> wrote:  
> \>  
> \> What is the output of:  
> \>   
> \> which PsychPortAudio  
> \>   
> \> and of  
> \>   
> \> d = PsychPortAudio('GetDevices')  
> \>   
> \> -mario  
> \>   
> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "lauralevin45" \<lauralevin45@\> wrote:  
> \> \>  
> \> \> Hi,  
> \> \> I am running matlab R2010a on macOSX 10.6.8 and every time I try to use the InitializePsychSound command, I get the following error:  
> \> \>   
> \> \> In place of the expected mex file this placeholder file was executed:  
> \> \>   
> \> \> PsychPortAudio  
> \> \>   
> \> \> This mex file seems to be missing or inaccessible on your Matlab path or it is dysfunctional:  
> \> \>   
> \> \> PsychPortAudio.mexmaci  
> \> \>   
> \> \> Another reason could be insufficient access permissions or   
> \> \> some missing 3rd party libraries on your system.  
> \> \>   
> \> \> Failed to load PsychPortAudio driver!  
> \> \>   
> \> \> The most likely cause is that the helper library libportaudio.0.0.19.dylib is not  
> \> \> stored in one of the library directories. This is the case at first use of the new  
> \> \> sound driver.  
> \> \>   
> \> \> A copy of this file can be found in /Applications/Psychtoolbox/PsychSound/libportaudio.0.0.19.dylib   
> \> \> You need to copy that file into one of the following directories, then retry:  
> \> \> If you have administrator permissions, copy it to (at your option): /usr/local/lib  
> \> \> or /usr/lib -- you may need to create that directories first.  
> \> \>   
> \> \> If you are a normal user, you can also create a subdirectory lib/ in your home folder  
> \> \> then copy the file there. E.g., your user name is lisa, then copy the file into  
> \> \> /Users/lisa/lib/   
> \> \>   
> \> \> Please try this steps, then restart your script.  
> \> \>   
> \> \> The exact error message of the linker was: Error using ==\> AssertMex at 210  
> \> \> Missing or dysfunctional Psychtoolbox Mex file for this operating system. Read the help text above carefully!!  
> \> \>   
> \> \> ??? Error using ==\> InitializePsychSound at 140  
> \> \> Failed to load PsychPortAudio driver.  
> \> \>   
> \> \> I followed the instructions exactly and copied the helper library file into /usr/lib and also tried reinstalling both matlab and psychtoolbox but it still keeps giving me this same error. Any ideas?   
> \> \>   
> \> \> Thanks so much,  
> \> \> Laura  
> \> \>  
> \>

---

<div class="post-metadata">

**Author:** ![dcnieho](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@dcnieho](https://psychtoolbox.discourse.group/u/dcnieho)\
**Post date:** [March 19, 2012, 12:47pm UTC](https://psychtoolbox.discourse.group/t/problem-loading-psychportaudio-driver-on-mac/1917/4 "2012-03-19T12:47:27Z")

</div>

Dear Laura,  
  

> On Mon, Mar 19, 2012 at 11:38, lauralevin45 \<[lauralevin45@...](mailto:lauralevin45@...)\> wrote:  
> 
> > the output of which PsychPortAudio is:  
> >   
> > /Users/lauralevin/Documents/MATLAB/PsychPortAudio.m  
> >   
> > the output of d = PsychPortAudio('GetDevices') is:
> 
>   
>  
> 
> That is a problem. This is a location that is not part of the Psychtoolbox installation. Could you remove/rename this file and try again? Do you know how it got there?
>  
>  
> 
> Best,
> 
> Dee
