# PsychportAudio Internal Error: fails to open audio device

**URL:** <https://psychtoolbox.discourse.group/t/psychportaudio-internal-error-fails-to-open-audio-device/4809>\
**Category:** Programming Help\
**Tags:** windows\
**Created:** [January 30, 2023, 5:55pm UTC](https://psychtoolbox.discourse.group/t/psychportaudio-internal-error-fails-to-open-audio-device/4809 "2023-01-30T17:55:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Riccardo](https://avatars.discourse-cdn.com/v4/letter/r/ce7236/32.png) [@Riccardo](https://psychtoolbox.discourse.group/u/Riccardo)\
**Post date:** [January 30, 2023, 5:55pm UTC](https://psychtoolbox.discourse.group/t/psychportaudio-internal-error-fails-to-open-audio-device/4809/1 "2023-01-30T17:55:09Z")

</div>

Hi everyone!

I’m currently using PTB (version 3.0.17.11) running on a ASUS vivobook Laptop (OS: Windows 10, 8gb RAM) to perform some experiments requiring low-latency presentation of both auditory and visual stimuli. I also installed ASIOforALL drivers to boost audio output latency.

Everything worked fine until (after a couple of forced quits from MATLAB due to other circumstances), PsychportAudio stopped working. The error displayed in the command window is the following:

PTB-INFO: Using modified PortAudio V19.6.0-devel, revision unknown  
PTB-ERROR: Failed to open audio device -1. PortAudio reports this error: Invalid device  
INTERNAL PSYCHTOOLBOX ERROR  
error: PsychError\_system  
general description: Error reported by a system call  
specific description: Failed to open PortAudio audio device.  
module name: PsychPortAudio  
subfunction call: Open  
file name: C:\Users\Mario Kleiner\Documents\GitHub\Psychtoolbox3\PsychSourceGL\Source\Common\PsychPortAudio\PsychportAudio.c  
function name: PSYCHPORTAUDIOOpen  
line number: 2877

Error using PsychPortAudio  
See error message printed above.  
Error in Temporal\_Order\_Judgement\_DEF (line 99)  
pahandle = PsychPortAudio(‘Open’, , , 4,sample\_rate,1);

To note, when I change the device id from to 3, it starts working again, but obviously with much less temporal precision. I tried to uninstall and then reinstall the ASIO drivers, but it didn’t work

Is there anyone who has any suggestion to fix the problem?

---

<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:** [January 31, 2023, 8:32pm UTC](https://psychtoolbox.discourse.group/t/psychportaudio-internal-error-fails-to-open-audio-device/4809/2 "2023-01-31T20:32:41Z")

</div>

PTB 3.0.17 is end of life, no longer supported. And ASIO support has been removed longer ago.

For up to 30 minutes paid support, `help PsychPaidSupportAndServices` - our special 99 Euros + tax christmas offer is still active for probably another month.  
-mario
