Dear Mario,
What’s the debug output at PsychPortAudio(‘Verbosity’, 10)?
Please find the output below. There was no extra output when playing or recording sound.
Thank you for the explanation why “default” and “pulse” devices hang. I would not want to use them any longer because I meanwhile noticed that both, playback and capture through these devices (and also “sysdefault”) are always resampled to 16 bit, 48 kHz at hardware level (as reported in /proc/asound/card0/pcm0p/sub0/hw_params) for all sound applications (PortAudio based as well as Alsa based).
However, after some hours of tinkering I now might have found a workaround. If I add a device with fixed pcm format S32_LE in /etc/asound.conf this device appears in Psychtoolbox and can be used without apparent problems at very short latencies as expected.
pcm.device{
format S32_LE
type hw
card 0
device 0
}
Psychtoolbox does still not select this device by default neither for playback nor for capture or duplex mode despite it is apparently the most suitable device. Rather, it is still reported that not any input device was available. Could this be possibly changed somehow? This would make the setup less prone for improper usage.
Still not sure what the actual problem is. My first guess was that it could be related to the PortAudio library as also Audacity does not allow to select the more appropriate devices (“hw” etc.) available in Alsa (aplay, arecord). But not sure.
Thanks a lot for your help! Best
Andreas
PTB-INFO: Trying to suspend potentially running PulseAudio server… … status 0
Expression ‘alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )’ failed in ‘src/hostapi/alsa/pa_linux_alsa.c’, line: 924
Expression ‘alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )’ failed in ‘src/hostapi/alsa/pa_linux_alsa.c’, line: 924
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
Expression ‘alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )’ failed in ‘src/hostapi/alsa/pa_linux_alsa.c’, line: 924
Expression ‘alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )’ failed in ‘src/hostapi/alsa/pa_linux_alsa.c’, line: 924
Expression ‘alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )’ failed in ‘src/hostapi/alsa/pa_linux_alsa.c’, line: 924
Expression ‘alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )’ failed in ‘src/hostapi/alsa/pa_linux_alsa.c’, line: 924
Expression ‘alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )’ failed in ‘src/hostapi/alsa/pa_linux_alsa.c’, line: 924
Expression ‘alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )’ failed in ‘src/hostapi/alsa/pa_linux_alsa.c’, line: 924
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
PTB-DEBUG: PortAudio says: Cannot connect to server socket err = Datei oder Verzeichnis nicht gefunden
PTB-DEBUG: PortAudio says: Cannot connect to server request channel
PTB-DEBUG: PortAudio says: jack server is not running or cannot be
started
PTB-DEBUG: PortAudio says: JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
PTB-DEBUG: PortAudio says: JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
PTB-INFO: Using modified PortAudio V19.6.0-devel, revision 396fe4b6699ae929d3a685b3ef8a7e97396139a4
PTB-INFO: New audio device 0 with handle 0 opened as PortAudio stream:
PTB-INFO: For 2 channels Playback: Audio subsystem is ALSA, Audio device name is sysdefault
PTB-INFO: For 2 channels Capture: Audio subsystem is ALSA, Audio device name is sysdefault
PTB-INFO: Real samplerate 48000.000000 Hz. Input latency 21.333333 msecs, Output latency 21.333333 msecs.
PTB-INFO: Closing handle 0.
PTB-INFO: Trying to resume potentially suspended PulseAudio server… … status 0