How to change AudioDevice in Hardware preferences?

Hi! We just bought new external soundcard (Focusright Scarlett Solo) to reduce latencies. PsychoPy never allowed to choose Focusrite Usb Audio as audio device, no matter which audio library was chosen (sound device / pyo). My selection always reset to Realtek Digital Output, which is internal sound card, after clicking on “OK”/ “Apply”. Could someone help us, please?

Hi!
Did you find a solution for this?
I’m working in coder and trying to figure out how to tell psychopy ptb backend to use the focusrite rather than the built in soundcard.

Thanks!

I managed to change audio device in code.

First I got the name of the device by using
from psychopy.sound import backend_ptb as ptb
ptb.getDevices(kind=‘output’)

Then I added the following to my code
perfs.hardware[‘audioLib’] = ‘ptb’
perfs.hardware[‘audioLatencyMode’] = 3
perfs.hardware[‘audioDevice’] = ‘Scarlett Solo USB: Audio (hw:1,0)’

(The last setting comes from the list of devices).

For some reason choosing Scarlett does not work unless I explicitly set the latency mode beforehand.

Did you ever find a solution to this using builder? I’m experiencing the same issue with a different sound card in Pyschopy v2023.2.3.

My temporary solution for this is using the sounddevice library and rolling back to v2022.2.5.

I think the cause of this is the preferences dialog being unable to find the specified audio device so returning to the default value - in 2024.1.0 we’re adding the ability for the :sound: Sound Component to point to a specific speaker which should hopefully solve this.

1 Like