Failed to open PortAudio audio device due to unsupported combination of audio parameters

Hello, today I formatted my PC and reinstalled GNU Octave, as well as Psychtoolbox, I am using the Psychtoolbox 3.0.16. I saw that there is another topic with the same question here: Help with audio: error due to unsupported combination of audio parameters I still have tried to check if there is any instruction in how to fix this issue but in this topic it wasn’t solved.

I am receiving the same message:

PTB-INFO: This is Psychtoolbox-3 for GNU/Linux X11, under GNU/Octave 64-Bit (Version 3.0.16 - Build date: Feb 24 2020).
PTB-INFO: OS support status: Linux 5.11.0-38-generic Supported.
PTB-INFO: Type 'PsychtoolboxVersion' for more detailed version information.
PTB-INFO: Most parts of the Psychtoolbox distribution are licensed to you underterms of the MIT License, with
PTB-INFO: some restrictions. See file 'License.txt' in the Psychtoolbox root folder for the exact licensing conditions.

PTB-INFO: Failed to enable realtime-scheduling [Operation not permitted]!
PTB-INFO: You need to run Matlab or Octave with root-privileges, or run the script PsychLinuxConfiguration once for this to work.
PTB-INFO: See /usr/share/doc/psychtoolbox-3-common/README.Debian to make this work.


PTB-INFO: OpenGL-Renderer is Intel Open Source Technology Center :: Mesa DRI Intel(R) HD Graphics 3000 (SNB GT2) :: 3.0 Mesa 20.0.8
PTB-INFO: VBL startline = 768 , VBL Endline = -1
PTB-INFO: Will try to use OS-Builtin OpenML sync control support for accurate Flip timestamping.
PTB-INFO: Measured monitor refresh interval from VBLsync = 16.714730 ms [59.827469 Hz]. (50 valid samples taken, stddev=0.007110 ms.)
PTB-INFO: Reported monitor refresh interval from operating system = 16.673058 ms [59.977001 Hz].
PTB-INFO: Small deviations between reported values are normal and no reason to worry.
PTB-INFO: Using modified PortAudio V19.6.0-devel, revision 396fe4b6699ae929d3a685b3ef8a7e97396139a4
PTB-INFO: Choosing deviceIndex 0 [HDA Intel PCH: ALC269 Analog (hw:0,0)] as default output audio device.
Expression 'ret' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1812
PTB-ERROR: Desired audio parameters for device -1 unsupported by audio device: Unanticipated host error
PTB-ERROR: This could be, e.g., due to an unsupported combination of audio sample rate, audio channel count/allocation, or audio sample format.
PTB-ERROR: On Linux you may be able to use ALSA audio converter plugins to makethis work.
Error in function Open:         Usage error
Failed to open PortAudio audio device due to unsupported combination of audio parameters.
error: PsychPortAudio: Usage:

pahandle = PsychPortAudio('Open' [, deviceid][, mode][, reqlatencyclass][, freq][, channels][, buffersize][, suggestedLatency][, selectchannels][, specialFlags=0]);
error: called from
    Naderi_test_task_v_main_1203_v_2 at line 159 column 14
>> PsychtoolboxVersion
ans = 3.0.16 - Flavor: Debian package - psychtoolbox-3 (3.0.16.20200130.dfsg1-1)
For more info visit:
http://neuro.debian.net/pkgs/octave-psychtoolbox-3.html

And here below is a excerpt of the code:

.... ....
    InitializePsychSound(1);

    nrchannels = 2;
    freq = 44100;

    repetitions = 1;

    startCue = 0;

    waitForDeviceStart = 1;

    pahandle = PsychPortAudio('Open', [], 1, 1, freq, nrchannels); %ERROR HERE

I always used this same values for frequency and channel numbers or the frequency with 48000 and always worked. Now how could I fix it?

Thanks,

Victor

This is a portaudio limitation of the portaudio library of PTB 3.0.16, which gets triggered - causing a false failure - when running on a Linux kernel of version 5.6 or later, in your case Linux 5.11.

The solution is to update Psychtoolbox to version 3.0.17.1 or later, e…g, from NeuroDebian, or 3.0.18.1 from us. Or upgrading the Linux kernel to 5.13, where the problem is solved. Or downgrade the kernel to Linux 5.4 - the original kernel of Ubuntu 20.04, where the problem is not yet triggered.

But given that PTB 3.0.16 is end of life since quite a while now, the best approach is upgrading PTB.

-mario

Hi Mario,

Sorry for the delay response, I was out some days from here… I have checked at the Psychtoolbox official page at the download instructions I have tried to update Psychtoolbox through this script: Psychtoolbox-3/UpdatePsychtoolbox.m at master · Psychtoolbox-3/Psychtoolbox-3 · GitHub but I got this exception:

>> UpdatePsychtoolbox('/usr/share/octave/site/m/psychtoolbox-3')
warning: addpath: /home/victorbg/.Psychtoolbox/PsychOneliners: No such file or directory
warning: called from
    UpdatePsychtoolbox at line 73 column 1
UpdatePsychtoolbox('/usr/share/octave/site/m/psychtoolbox-3')

About to update your working copy of the OpenGL-based Psychtoolbox-3.
Will execute the following update command:
svn update --accept theirs-full  "/usr/share/octave/site/m/psychtoolbox-3"
sh: 1: svn: not found
Sorry. The update command failed with error code 127:
For reasons and troubleshooting, read the output above and all followup messages!
If the error output above contains the text 'SSL handshake failed: SSL error: tlsv1 alert protocol version'
then your svn command line client is too old. Install a more recent Subversion command line client.
error: Update failed.
error: called from
    UpdatePsychtoolbox at line 237 column 9

About NeuroDebian I figure that it must be missing something because after installed some applications and: sudo apt-get update >> sudo apt-get upgrade I got:

...
E: The repository 'http://neuro.debian.net/debian data InRelease' is not signed.
...
E: The repository 'http://neuro.debian.net/debian focal InRelease' is not signed.
...

Or it would be better to uninstall my PTB and reinstall it again?

Thanks,

Victor

You can only UpdatePsychtoolbox what was downloaded/installed via DownloadPsychtoolbox, not the apt installed versions.

Make sure you followed the installation instructions on the ND page. On further problems, contact them for support.

Probably. Further support from myself will require priority support: help PsychPaidSupportAndServices.