Issue with PsychoPy and Creative Live A3 Sound Card (48 kHz Sample Rate Error)

Hi,
I’m encountering an issue when running an experiment in PsychoPy with my Creative Live A3 sound card. The error message I’m getting is as follows:


PTB-ERROR: Desired audio parameters for device 9 seem to be unsupported by audio device: Invalid sample rate.

Traceback:

vbnet

Copy code

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]);

Additionally, I’m seeing a fallback error in PsychoPy when trying to use this audio device:

rust

Copy code

Could not find exact match for specified parameters (index=9, sampleRateHz=48000, channels=None), falling back to best approximation (index=9, sampleRateHz=48000, channels=4).

The experiment ends with an exit code 1, and the following traceback is displayed:

arduino

Copy code

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.

I’ve checked the Windows sound settings and the Creative Live A3 driver software, and 48 kHz is listed as supported. However, PsychoPy still fails to open the device with the desired parameters.

I’ve also tried adjusting the settings, but the error persists. Could you help me figure out what might be going wrong or suggest any possible fixes?

Thanks in advance for your assistance!

Best regards,

Hello again, just a quick update: I have two microphone components, and when I disable them, the experiment works without any errors. I also double-checked all the files (48kHz, 24-bit). So, I believe the error is related to the microphone component. Any help, please?

If it’s related to the microphone component then you need to figure out what the settings are on the microphone itself. Check the Windows settings for the microphone, and failing that look at the Windows hardware manager and see if you can get more information about the microphones from there.

hi @jonathan.kominsky , in the Sound settings on Windows, the frequency is set to 48kHz. The sound card software control panel also shows 48kHz. What else could I check that might be causing the issue?

For the microphone specifically? Or is it not differentiating between the sound input and output? In the latter case that might just represent the output settings, not the input settings.

Hi @jonathan.kominsky ,
yes the mic component in sound settings , its 48khz ,
my laptop is dell windows 11, and sound card is creative live a3 , and mic is Rode PodMic,

OK, then this is not as simple as I had hoped. Something clearly doesn’t agree with windows that this microphone can support 48kHz.

From other posts on the forum that have gotten similar errors, the solution is usually to update the sound driver, but if you’ve already done that then this is something else.

I have a couple of suggestions that you can try, mostly to see if we can pin down the exact issue.

  • Can you create a new experiment that ONLY has the microphone (and not the other sound objects) and see if it produces the same error? Basically, try to isolate whether the microphone just isn’t working well or if it’s because you have both microphone and sound.

  • If it still crashes in that experiment with just the mic, can you try changing the sampling rate to something lower, like 44100 or 24000, and see if it works any better? Just to check if it really is something about the sample rate or if this is covering for a different issue.

If it works with the microphones alone, then something is weird with it trying to do sound input and output at the same time, and I’m not sure why. If it’s the sample rate, then you could try changing the sample rate of all the audio files to something that works with the microphone. You could also try a different microphone, if you have one available. If none of that works, it’s something more foundational with PTB sound, and I’m not sure how best to fix it. There seem to be some issues in general with PTB sound and Windows 11, but I don’t think there’s a consistent way of solving them yet.

Hi @jonathan.kominsky
Thanks for your suggestions! I followed your advice to troubleshoot the issue, but I’m still encountering crashes. Here’s what I tried:

  1. I created a demo experiment with only the microphone and excluded other sound objects, but the error persisted.
  2. I tested different sampling rates, including 48 kHz and 44.1 kHz, but the crashes continued in both cases.
  3. I swapped out the microphone for another one to rule out compatibility issues, but the problem remained the same.

I’ve noticed that the issue seems tied to the sound card. When I use the Creative Live! A3, the system crashes, but it works perfectly when I switch to the Focusrite Scarlett 2i2 USB. One key difference is that the Scarlett supports 2-channel audio in its settings, while the Creative card defaults to 4 channels with no option to change it.

Could the 4-channel configuration of the Creative Live! A3 be causing the crashes? If so, is there any way to work around this limitation? Thanks again for your help!

I don’t know if it’s the channels specifically but it does seem like this particular sound card is the source of the problem. Unfortunately I really don’t have a good enough understanding of PTB-sound to figure out exactly what’s going on.

@TParsons or @jon might have more insight

I don’t know anything about that card, but I can tell you that in the 2025.1 release of PsychoPy we’ve reworked the logic of connecting to sounds cards and I hope it will help issues like this.

To date, we’ve asked the user what sample rate they would like to use and, if none is provided we’ve defaulted to the first sampling rate encountered. So in essence we try to optimise the sampling rate to the sound in PsychoPy<=2024.2. That has the advantage of meaning that the user rarely needs to resample any sound files but has the disadvantages that:

  • the audio card might complain about the sampling rate that has been implicitly or explicitly selected
  • it typically requires exclusive low-latency mode (mode 2) and that means any other apps get kicked off the device, or there’s a battle over the card

In 2025.1 the new strategy is to optimise the sampling rate to the sound card, taking whatever it reports as its default and then adapting the sounds to fit that preference of the card. From this we expect:

  • fewer card connection issues
  • no need to be in exclusive mode
  • BUT also more sounds will probably need resampling, so we’ve added automatic resampling of sounds on the CPU at load-time

If you want to try this out in advance of the main release (expected early Feb) then let me know and I can send you a google link to a preview (beta) release

Hello @Jon
Thank you for your response! Honestly, I’m not entirely sure where the exact issue with the sound card is coming from, but I truly appreciate your detailed explanation. The changes planned for the 2025.1 release sound promising, especially the new approach to optimizing the sampling rate to the sound card.

If possible, I would appreciate it if you could send me the link to try out the beta release. Would you prefer that I send you a private message with my email address, or is there another method you’d recommend?

Thanks again for your help!

Hi there,

OK, there would be two things of interest here.

  1. I think it would be good to know what your sound card reports and what happens when we try to connect. To test that, could you download the attached script and run it (from PsychoPy Coder view) and let us know the outputs
    test_sound_settings.py (5.3 KB)
  2. You can test the current daily build of the 2025.1.0 release from here:
    StandalonePsychoPy-2025.1.0dev156-win64_2025-01-14_13-22_3.8.exe - Google Drive

Note that the download from google drive will complain that googledrive cannot itself virus scan the file before downloading but a) that doesn’t stop you scanning it yourself and b) the file is code-signed by us at Open Science Tools like a normal release, so you can be sure that this is genuinely from us (you can check the signature in the Properties of the file)