Internal PortAudio Error

Hi all, longtime user and I’ve been running into a brand new error after trying to install PTB onto my laptop. The toolbox did install correctly, i.e. I can open and close a Window, but I cannot get sound to play. In fact, I cannot get InitializePsychSound to run, as it is unable to use PsychPortAudio(‘GetDevices’). It spits the following error when I run both InitializePsychSound and PsychPortAudio(‘GetDevices’):

PTB-ERROR: Portaudio initialization failed with following port audio error: Internal PortAudio error
error: PsychError_system
general description: Error reported by a system call
specific description: Failed to initialize PortAudio subsystem.
module name: PsychPortAudio
subfunction call: GetDevices
file name: C:\Users\Mario Kleiner\Documents\GitHub\Psychtoolbox-3\PsychSourceGL\Source\Common\PsychPortAudio\PsychPortAudio.c
function name: PsychPortAudioInitialize
line number: 2064

As part of my troubleshooting, I have looked into PortAudio and tried to compile a new version through their tutorial: Notes_about_building_PortAudio_with_MinGW · PortAudio/portaudio Wiki · GitHub

This entailed installing and running MinGW, as well as MSYS. When I open bash and run bin/pa_devs, I see that I have 6 available devices, all dependent on MME as the API. I know this is the worst possible API for PsychToolbox but this laptop is a temporary solution to a COVID-induced problem, so I do not plan on collecting high precision data with the device.

Here is the output of PsychtoolboxVersion:
‘3.0.17 - Flavor: beta - Corresponds to SVN Revision 11605
For more info visit:
GitHub - Psychtoolbox-3/Psychtoolbox-3: Psychophysics Toolbox Version 3 (PTB-3) is a free set of Matlab and GNU Octave functions for vision and neuroscience research.

Some of my personal brainstorming: the hardware on my laptop is great (i.e. 16 GB ram, NVIDIA graphics card), but the drivers are a mess since I’ve had it since 2013 and have re-installed Windows a few times. So it’s not impossible that my sound drivers are missing/malformed. Currently running Windows 10, version 10.0.19041 Build 19041. My sound drivers include the following: “High Definition Audio Device”, “NVIDIA High Definition Audio”, and “NVIDIA Virtual Audio Device”. I have used Device Manager and the built-in NVIDIA driver manager to see if there are any updates for my drivers and have not seen any issues.

Has anyone had this much trouble with PsychPortAudio before?

Matthew Heard
Graduate Student – University of Texas Dallas

No. This type of error wasn’t ever encountered to my knowledge. It suggests something broken on your operating system. Maybe a reinstall of Windows or the sound drivers is appropriate.

What you tried suggests that MME is sort-of maybe working? The error suggests that audio backend init goes wrong, probably in the WASAPI backend, judging from the error code. If your sound drivers/os are broken enough that WASAPI won’t work, that would explain it. MME seems to be the only supported backend for building portaudio libraries under MinGW.

You could try if your self-built portaudio DLL works as a stop-gap, by copying it into the Psychtoolbox main folder as portaudio_x64.dll, so our InitializePsychsound() picks it up. For that it must be a 64-Bit library though.

That NVidia stuff probably refers to the gpu’s builtin sound chip for outputtting audio over HDMI or DisplayPort connected displays, not or regular sound output via onboard sound chip.


Thanks for the assistance and apologies for the delayed response. Eventually I gave up on running PTB on the laptop in question–it was already 8 years old and it was well past time to put it out to pasture.


My main laptop will turn 11 in a few months and still works very well under Linux, with only 4 GB RAM and a spinning disc drive. Maybe you just gained the low risk opportunity with your spare old laptop to give installing modern Ubuntu Linux a try and see how much better PTB related things can be with a good operating system? NVidia graphics is suboptimal, but the NVidia gpu in a laptop from 2013, probably a Kepler gpu (GeForce 600 and some GeForce 700) may be just old enough to still work well at good performance with the standard open-source nouveau driver – no need for NVidia’s proprietary troublemaker. My 2010 machine has a GeForce 320M which works excellent with the open-source driver.