Failed to open PortAudio audio device" Error on Windows 11

OS: Windows 11
PsychoPy version: last version 2024.2.5
Standard Standalone? (y/n): Yes

What are you trying to achieve?:
Run an experiment in PsychoPy Builder with two microphone components and audio files sampled at 48 kHz.

What did you try to make it work?:

  1. Ensured that all audio files are sampled at 48 kHz to match my sound card’s settings.
  2. Verified the sound card being used is a Creative Live! A3.
  3. Attempted to run the experiment with default audio settings in PsychoPy.

What specifically went wrong when you tried that?:
The experiment fails to initialize the audio device, producing the following error:

vbnet

Copy code

PTB-ERROR: Desired audio parameters for device 9 seem to be unsupported by audio device: Invalid sample rate
...
Exception: Failed to open PortAudio audio device due to unsupported combination of audio parameters. Prevalidation failure.

Additional context: The sound card and system are configured for 48 kHz, but PsychoPy appears to reject this configuration.
here is also the error message im getting :
Running: C:\Users\remy1\Desktop\tasks\task1\Task1_A-SSS-F_lastrun.py
PTB-ERROR: Desired audio parameters for device 9 seem to be unsupported by audio device: Invalid sample rate

Traceback (most recent call last):
PTB-ERROR: Seems the requested audio sample rate 48000.000000 Hz is not supported by this combo of hardware and sound driver. Error in function Open: Usage error Failed to open PortAudio audio device due to unsupported combination of audio parameters. Prevalidation failure.

PsychPortAudio:Open: Usage:
pahandle = PsychPortAudio(‘Open’ [, deviceid][, mode][, reqlatencyclass][, freq][, channels][, buffersize][, suggestedLatency][, selectchannels][, specialFlags=0]);

Traceback (most recent call last):
File “C:\Users\remy1\Desktop\tasks\task1\Task1_A-SSS-F_lastrun.py”, line 3405, in
setupDevices(expInfo=expInfo, thisExp=thisExp, win=win)
File “C:\Users\remy1\Desktop\tasks\task1\Task1_A-SSS-F_lastrun.py”, line 303, in setupDevices
deviceManager.addDevice(
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\hardware\manager.py”, line 253, in addDevice
raise ManagedDeviceError(
psychopy.hardware.manager.ManagedDeviceError: Failed to open PortAudio audio device due to unsupported combination of audio parameters. Prevalidation failure.

Exception ignored in: <function Stream.del at 0x00000253915BC160>
Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\site-packages\psychtoolbox\audio.py”, line 236, in del
self.close()
File “C:\Program Files\PsychoPy\lib\site-packages\psychtoolbox\audio.py”, line 146, in close
raise err
File “C:\Program Files\PsychoPy\lib\site-packages\psychtoolbox\audio.py”, line 139, in close
PsychPortAudio(‘Close’, self.handle)
AttributeError: ‘Stream’ object has no attribute ‘handle’

I have had issues with trying to record mono from a microphone component. Check the sample rates and number of channels for the microphones as well as checking the sample rates for the audio components.

Does the audio work if you disable the microphone components?

Hello @wakecarter
The experiment works if I disable the mix component. I checked the sample rate of the microphone (48 kHz DVD quality in PsychoPy) and confirmed it matches the sound card settings on the laptop (48 kHz). Regarding the number of channels, my sound card only supports 4 channels, i dont have another option to choose.