Dear Mario,
thanks again for the time you have invested in this. Only today we got the chance work on the setup again.
For completeness, attached to this you’ll find output of the verbose PsychPortAudioTimingTest. I also wanted to attach the alsa-info, but it’s too long and I got this:
An error occurred: Body is limited to 32000 characters; you entered 84098
Let me know if you have a work around to post a txt-file here or if I should send it by email.
The first run of PsychPortAudioTimingTest ran without trouble but for the second run (maybe unrelated, but headphones were attached) we received the reported error messages again. So, yes, the script also showed a sometimes-working behavior, but it always failed upon the first beep or completed all beeps without trouble.
Your workaround following “Audio device sharing for interop with PsychPortAudio” for Snd works - so you’re right, the problem seems to be related to Eyelink using Beeper to frequently open and close the device - keeping it open solved the issue completely. Thus, we did not try anymore turning off sounds in EyelinkInitDefaults, plus our RAs like the beeping sounds. Also, we don’t need PsychPortAudio because we can, luckily, use our Datapixx for presenting sound stimuli.
That said, Ubuntu 22.04 proved extremely buggy with a few other features. For instance, we could not get Matlab’s VideoReader (which we desperately need) to run, as somehow gstreamer plugins were broken. After exhausting the time that could be spent on debugging, we installed Ubuntu 20.04 on the machine - which solved all the issues presented above, even when not using the workaround you proposed. Interestingly though, the jack-related messages in the terminal remained, but crashes during calibration were completely avoided. We are aware that 20.04 will not be around forever and might therefore not be the ideal solution to go with, but for now we have to prioritize having a working setup capable of collecting data.
Thanks so much once more for your help, and please let us know if we can still provide some info useful to solving these issues.
Cheers,
Martin.
############################## RUN 1 ################################
>> PsychPortAudio('Verbosity', 10); PsychPortAudioTimingTest
Will test accuracy of scheduled sound onset, i.e. how well the driver manages to
emit sound at exactly the specified "when" deadline. Sound should start in exact
sync with display black-white transition (or at least very close - < 1 msec off).
The remaining bias can be corrected by providing the bias as "latbias" parameter
to this script. Variance of sound onset between trials should be very low, much
smaller than 1 millisecond on a well working system.
Will use auto-selected default output device. This is the system default output
device in "normal" (=reliable but high latency) mode. In low-latency mode its the
device with the lowest inherent latency on your system (as determined by some internal
heuristic). If you are not satisfied with the results you may query the available devices
yourself via a call to devs = PsychPortAudio('GetDevices'); and provide the device index
of a suitable device
No "latbias" provided. Assuming zero bias. You'll need to determine this via measurement for best results...
PTB-INFO: Trying to suspend potentially running PulseAudio server... ... status 0
PTB-INFO: Using modified PortAudio V19.7.0-devel, revision 147dd722548358763a8b649b3e4b41dfffbcfbb6
PTB-INFO: Choosing deviceIndex 0 [HDA Intel PCH: ALC3861 Analog (hw:0,0)] as default output audio device.
PTB-INFO: New audio device -1 with handle 0 opened as PortAudio stream:
PTB-INFO: For 2 channels Playback: Audio subsystem is ALSA, Audio device name is HDA Intel PCH: ALC3861 Analog (hw:0,0)
PTB-INFO: Real samplerate 44100.000000 Hz. Input latency 0.000000 msecs, Output latency 9.977324 msecs.
prelat =
0
postlat =
0
PTB-INFO: This is Psychtoolbox-3 for GNU/Linux X11, under Matlab 64-Bit (Version 3.0.18 - Build date: Jun 27 2022).
PTB-INFO: OS support status: Linux 5.19.0-35-generic Supported.
PTB-INFO: Type 'PsychtoolboxVersion' for more detailed version information.
PTB-INFO: Most parts of the Psychtoolbox distribution are licensed to you under terms 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: For information about paid support, support memberships and other commercial services, please type
PTB-INFO: 'PsychPaidSupportAndServices'.
PTB-INFO: OpenGL-Renderer is AMD :: AMD Radeon RX 6600 XT (navi23, LLVM 15.0.6, DRM 3.47, 5.19.0-35-generic) :: 4.6 (Compatibility Profile) Mesa 22.2.5
PTB-INFO: VBL startline = 1080 , VBL Endline = -1
PTB-INFO: Measured monitor refresh interval from VBLsync = 8.336120 ms [119.959890 Hz]. (50 valid samples taken, stddev=0.000463 ms.)
PTB-INFO: Reported monitor refresh interval from operating system = 8.336251 ms [119.958000 Hz].
PTB-INFO: Small deviations between reported values are normal and no reason to worry.
Waiting 4 video refresh cycles before white-flash.
Predicted Latency: 9.283781 msecs.
Flip delay = 0.033345 secs. Flipend vs. VBL 0.000346
Delay start vs. played: 0.000512 secs, offset 0.012880
Buffersize 110, xruns = 0, playpos = 0.012880 secs.
Screen expects visual onset at 1678698035.404530 secs.
PortAudio expects audio onset at 1678698035.404529 secs.
Expected audio-visual delay is therefore -0.000477 msecs.
Predicted Latency: 9.901047 msecs.
Flip delay = 0.033344 secs. Flipend vs. VBL 0.000379
Delay start vs. played: 0.000315 secs, offset 0.012630
Buffersize 110, xruns = 0, playpos = 0.012630 secs.
Screen expects visual onset at 1678698036.454889 secs.
PortAudio expects audio onset at 1678698036.454889 secs.
Expected audio-visual delay is therefore 0.000715 msecs.
Predicted Latency: 9.692907 msecs.
Flip delay = 0.033345 secs. Flipend vs. VBL 0.000309
Delay start vs. played: 0.000238 secs, offset 0.012358
Buffersize 110, xruns = 0, playpos = 0.012358 secs.
Screen expects visual onset at 1678698037.505250 secs.
PortAudio expects audio onset at 1678698037.505249 secs.
Expected audio-visual delay is therefore -0.000954 msecs.
Predicted Latency: 9.485722 msecs.
Flip delay = 0.033345 secs. Flipend vs. VBL 0.000271
Delay start vs. played: 0.000231 secs, offset 0.009615
Buffersize 110, xruns = 0, playpos = 0.009615 secs.
Screen expects visual onset at 1678698038.555610 secs.
PortAudio expects audio onset at 1678698038.555609 secs.
Expected audio-visual delay is therefore -0.000715 msecs.
Predicted Latency: 9.802341 msecs.
Flip delay = 0.033345 secs. Flipend vs. VBL 0.000323
Delay start vs. played: 0.001338 secs, offset 0.014308
Buffersize 110, xruns = 0, playpos = 0.014308 secs.
Screen expects visual onset at 1678698039.605971 secs.
PortAudio expects audio onset at 1678698039.605970 secs.
Expected audio-visual delay is therefore -0.000238 msecs.
Predicted Latency: 7.353783 msecs.
Flip delay = 0.033345 secs. Flipend vs. VBL 0.000236
Delay start vs. played: 0.000307 secs, offset 0.011587
Buffersize 110, xruns = 0, playpos = 0.011587 secs.
Screen expects visual onset at 1678698040.656332 secs.
PortAudio expects audio onset at 1678698040.656332 secs.
Expected audio-visual delay is therefore 0.000000 msecs.
Predicted Latency: 7.398844 msecs.
Flip delay = 0.033345 secs. Flipend vs. VBL 0.000370
Delay start vs. played: 0.000140 secs, offset 0.011315
Buffersize 110, xruns = 0, playpos = 0.011315 secs.
Screen expects visual onset at 1678698041.706694 secs.
PortAudio expects audio onset at 1678698041.706693 secs.
Expected audio-visual delay is therefore -0.000477 msecs.
Predicted Latency: 7.287264 msecs.
Flip delay = 0.033344 secs. Flipend vs. VBL 0.000288
Delay start vs. played: 0.000142 secs, offset 0.008571
Buffersize 110, xruns = 0, playpos = 0.008571 secs.
Screen expects visual onset at 1678698042.757055 secs.
PortAudio expects audio onset at 1678698042.757055 secs.
Expected audio-visual delay is therefore 0.000238 msecs.
Predicted Latency: 9.284258 msecs.
Flip delay = 0.033345 secs. Flipend vs. VBL 0.000405
Delay start vs. played: 0.000140 secs, offset 0.010794
Buffersize 110, xruns = 0, playpos = 0.010794 secs.
Screen expects visual onset at 1678698043.807418 secs.
PortAudio expects audio onset at 1678698043.807417 secs.
Expected audio-visual delay is therefore -0.000238 msecs.
Predicted Latency: 9.987593 msecs.
Flip delay = 0.033345 secs. Flipend vs. VBL 0.000200
Delay start vs. played: 0.000140 secs, offset 0.010544
Buffersize 110, xruns = 0, playpos = 0.010544 secs.
Screen expects visual onset at 1678698044.857780 secs.
PortAudio expects audio onset at 1678698044.857780 secs.
Expected audio-visual delay is therefore 0.000000 msecs.
PTB-INFO: Closing handle 0.
PTB-INFO: Trying to resume potentially suspended PulseAudio server... ... status 0
Summary:
AV Error: -0.000477 msecs.
AV Error: 0.000715 msecs.
AV Error: -0.000954 msecs.
AV Error: -0.000715 msecs.
AV Error: -0.000238 msecs.
AV Error: 0.000000 msecs.
AV Error: -0.000477 msecs.
AV Error: 0.000238 msecs.
AV Error: -0.000238 msecs.
AV Error: 0.000000 msecs.
TS Error: msecs.
#################### ATTACHED HEADPHONES, RUN 2 #############################
>> PsychPortAudio('Verbosity', 10); PsychPortAudioTimingTest
Will test accuracy of scheduled sound onset, i.e. how well the driver manages to
emit sound at exactly the specified "when" deadline. Sound should start in exact
sync with display black-white transition (or at least very close - < 1 msec off).
The remaining bias can be corrected by providing the bias as "latbias" parameter
to this script. Variance of sound onset between trials should be very low, much
smaller than 1 millisecond on a well working system.
Will use auto-selected default output device. This is the system default output
device in "normal" (=reliable but high latency) mode. In low-latency mode its the
device with the lowest inherent latency on your system (as determined by some internal
heuristic). If you are not satisfied with the results you may query the available devices
yourself via a call to devs = PsychPortAudio('GetDevices'); and provide the device index
of a suitable device
No "latbias" provided. Assuming zero bias. You'll need to determine this via measurement for best results...
PTB-INFO: Trying to suspend potentially running PulseAudio server... ... status 0
PTB-INFO: Using modified PortAudio V19.7.0-devel, revision 147dd722548358763a8b649b3e4b41dfffbcfbb6
PTB-INFO: Choosing deviceIndex 0 [HDA Intel PCH: ALC3861 Analog (hw:0,0)] as default output audio device.
PTB-ERROR: Desired audio parameters for device -1 unsupported by audio device: Illegal combination of I/O devices
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 make this work.
Error in function Open: Usage error
Failed to open PortAudio audio device due to unsupported combination of audio parameters.
Error using PsychPortAudio
Usage:
pahandle = PsychPortAudio('Open' [, deviceid][, mode][, reqlatencyclass][, freq][, channels][, buffersize][, suggestedLatency][,
selectchannels][, specialFlags=0]);
Error in PsychPortAudioTimingTest (line 161)
pahandle = PsychPortAudio('Open', deviceid, [], reqlatencyclass, freq, 2, buffersize, suggestedLatencySecs);
################################### Output from Terminal #############################
locallab@helmholtz:~$ ptb3-matlab
Gtk-Message: 09:59:21.060: Failed to load module "canberra-gtk-module"
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_route.c:877:(find_matching_chmap) Found no matching channel map
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_route.c:877:(find_matching_chmap) Found no matching channel map
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_route.c:877:(find_matching_chmap) Found no matching channel map
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'