I removed the explicit device ID as you recommended, and it works! Here’s the info that’s printed out by SimpleVoiceTriggerDemo() now:
SimpleVoiceTriggerDemo(0.15)
PTB-INFO: Using modified PortAudio V19.6.0-devel, revision unknown
PTB-INFO: New audio device -1 with handle 0 opened as PortAudio stream:
PTB-INFO: For 2 channels Capture: Audio subsystem is Windows WASAPI, Audio device name is Microphone (Yeti Stereo Microphone)
PTB-INFO: Real samplerate 48000.000000 Hz. Input latency 30.000000 msecs, Output latency 0.000000 msecs.
I also removed the .dll file as you mentioned. I think I saw some demo comment referencing it and thought it was better for some reason? Don’t quite remember – doesn’t matter much. Thanks for the tip.
Is there a way (in Matlab or otherwise) to find what IDs are associated with what audio devices? Some googling led me to audiodevinfo
, but it seems that’s only returning me the IDs for MME devices when I do the call audiodevinfo
and look at what’s in ans.input.ID
I have a second, related issue. The timestamps in BasicSoundOutputDemo()
are not working, it seems due to using the MME devices. When I run it with no input parameters, below is what’s written to the command window.
PTB-INFO: Multi-display setup in explicit multi-display mode detected. Using the following mapping:
PTB-INFO: Screen 0 corresponds to the full Windows desktop area. Useful for stereo presentations in stereomode=4 …
PTB-INFO: Screen 1 corresponds to the display area of the monitor with the Windows-internal name \.\DISPLAY1 …
PTB-INFO: Screen 2 corresponds to the display area of the monitor with the Windows-internal name \.\DISPLAY2 …
PTB-INFO: Your version of Matlab 64-Bit is global system DPI aware. On Windows-8 or later, fullscreen onscreen windows will only work
PTB-INFO: properly timing-wise when displayed on displays with the same pixel density as your systems primary display monitor.
PTB-INFO: For your multi-display setup the stimulus display monitor must have a DPI of (96, 96), matching that of
PTB-INFO: your primary display monitor. Ideally you will only display on the primary display in the first place.
PTB-INFO: Displaying on anything with a different DPI will cause mysterious visual timing problems, sync failures etc.
PTB-INFO: Read ‘help RetinaDisplay’ for more info on this topic.
PTB-INFO: Using modified PortAudio V19.6.0-devel, revision unknown
PTB-INFO: New audio device -1 with handle 0 opened as PortAudio stream:
PTB-INFO: For 2 channels Playback: Audio subsystem is MME, Audio device name is Logitech Speakers (High Definit
PTB-INFO: Real samplerate 48000.000000 Hz. Input latency 0.000000 msecs, Output latency 182.000000 msecs.
Audio playback started, press any key for about 1 second to quit.
Audio playback started, press any key for about 1 second to quit.
This is some status output of PsychPortAudio:
Active: 1
State: 2
RequestedStartTime: 0
StartTime: 0
CaptureStartTime: 0
RequestedStopTime: 1.7977e+308
EstimatedStopTime: 0
CurrentStreamTime: 1.0679e+06
ElapsedOutSamples: 58656
PositionSecs: 1.2220
RecordedSecs: 0
ReadSecs: 0
SchedulePosition: 0
XRuns: 0
TotalCalls: 47
TimeFailed: 8
BufferSize: 1248
CPULoad: 0.0013
PredictedLatency: -1.0679e+06
LatencyBias: 0
SampleRate: 48000
OutDeviceIndex: 7
InDeviceIndex: -1
Measured average samplerate Hz: 0.054924
Delta between audio hw clock and host clock: -1067944033.476817 msecs. Ratio 0.000001.
I don’t know the implications of this, but I’ve just discovered that if I change the PsychPortAudio(‘Open’…) call in BasicSoundOutputDemo to use low-latency mode, it uses the WASAPI device instead, and the timestamps work properly. (Specifically, I changed the 4th input argument from 0 to 2). Is there any harm in using low-latency mode all the time?
pahandle = PsychPortAudio('Open', device, [], 2, freq, nrchannels);
So in sum (long post, sorry):
- How can I properly find and refer to WASAPI devices?
- Is there harm in using low-latency mode for audio-only PsychPortAudio calls?