Hello. Please help with using ASIO in PsychoPy…
OS (e.g. Win10): Windows 10
PsychoPy version (e.g. 1.84.x): 2021.1.2
Standard Standalone? (y/n) If not then what?: y
What are you trying to achieve?: Low latency audio playback via ASIO (RME Fireface UCX interface) with simultaneous event triggers (via parallel port)
What did you try to make it work?: Combinations of PYO or PTB with ASIO as driver.
What specifically went wrong when you tried that?:
Include pasted full error message if possible. “That didn’t work” is not enough information.
PYO with ASIO just crashes Python without any error or info (other than the Windows “Python stopped working” window). PTB with ASIO seems to have an issue with PortAudio and a mismatch of settings e.g., trying to use a sample rate of 20000:
PTB-ERROR: Desired audio parameters for device -1 unsupported by audio device: Invalid sample rate
PTB-ERROR: Seems the requested audio sample rate 20000.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.
PsychPortAudio:Open: Usage:
pahandle = PsychPortAudio('Open' [, deviceid][, mode][, reqlatencyclass][, freq][, channels][, buffersize][, suggestedLatency][, selectchannels][, specialFlags=0]);
PTB-ERROR: Desired audio parameters for device -1 unsupported by audio device: Invalid sample rate
PTB-ERROR: Seems the requested audio sample rate 20000.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.
PsychPortAudio:Open: Usage:
pahandle = PsychPortAudio('Open' [, deviceid][, mode][, reqlatencyclass][, freq][, channels][, buffersize][, suggestedLatency][, selectchannels][, specialFlags=0]);
Traceback (most recent call last):
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py", line 231, in __init__
channels=channels,
File "C:\Program Files\PsychoPy3\lib\site-packages\psychtoolbox\audio.py", line 107, in __init__
flags)
Exception: Failed to open PortAudio audio device due to unsupported combination of audio parameters.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\LabUser\Documents\OB\toneRepetition_lastrun.py", line 107, in <module>
name='AM_tone')
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py", line 334, in __init__
hamming=self.hamming)
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py", line 428, in setSound
_SoundBase.setSound(self, value, secs, octave, hamming, log)
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\_base.py", line 195, in setSound
self._setSndFromFile(p)
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py", line 461, in _setSndFromFile
self._setSndFromArray(sndArr)
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py", line 500, in _setSndFromArray
self.track = audio.Slave(self.stream.handle, data=self.sndArr,
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py", line 582, in stream
blockSize=self.blockSize)
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py", line 143, in getStream
blockSize=blockSize)
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py", line 189, in _getStream
device=defaultOutput)
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py", line 252, in __init__
channels=channels,
File "C:\Program Files\PsychoPy3\lib\site-packages\psychtoolbox\audio.py", line 107, in __init__
flags)
Exception: Failed to open PortAudio audio device due to unsupported combination of audio parameters.
##### Experiment ended. #####
I should also note that audio can be used with this interface when enabled as the Windows sound device and, therefore, using sounddevice or PYO and Primary Sound i.e., not the low latency ASIO driver.
The RME Fireface UCX was purchased especially because of RME’s drivers being (arguably) the best in the industry and being able to operate at very low sample/buffer sizes as well as high sample rates (if needed). ASIO4ALL is not an option due to stability issues and the fact that it would never perform as well as the dedicated/native drivers from RME. Perhaps PYO just needs to be manually coded to be set up properly and if so, please assist with how to do this.
Thanks in advance for any/all help!