No sound output from ASIO

Hi,


I am trying to play sounds by ASIO. Psychtoolbox finds ASIO and uses it as default (or is specified to use ASIO by PsychPortAudio('open') command), but sounds do not come out of headphones connected to a sound card with ASIO. Instead, Microsoft sound mapper can play sounds from the same headphones.



The followings are the information of our system:

OS: Windows 10 version 1607

Matlab: R2017a

Psychtoolbox: 3.0.14

Sound card: Sound Blaster ZxR

Output from sound card: S/PDIF

Headphone amplifier:  Sennheiser HDVD 800

Headphone: HD 800 S



Here is the output of PsychPortAudioTimingTest:


>> PsychPortAudioTimingTest

PTB-DEBUG: PortAudio says: ASIO names[0]:Creative SBZ Series ASIO

PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 name = Creative SBZ Series ASIO

PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 inputChannels       = 6

PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 outputChannels      = 6

PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 bufferMinSize       = 2208

PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 bufferMaxSize       = 2208

PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 bufferPreferredSize = 2208

PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 bufferGranularity   = 0

PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultSampleRate = 44100.000000

PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultLowInputLatency = 0.050068

PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultLowOutputLatency = 0.050068

PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultHighInputLatency = 0.050068

PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultHighOutputLatency = 0.050068

PTB-INFO: Using specially modified PortAudio engine, based on offical version: PortAudio V19-devel WITH-DIM


Will use ASIO enhanced Portaudio driver DLL. See Psychtoolbox/PsychSound/PortAudioLICENSE.txt

for the exact terms of use for this dll.



Disclaimer: "ASIO is a trademark and software of Steinberg Media Technologies GmbH."

Using "ASIO Interface Technology by Steinberg Media Technologies GmbH"


Found at least one ASIO enabled soundcard in your system. Good, will use that in low-latency mode!

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



suggestedLatencySecs =


    0.0150


Choosing a high suggestedLatencySecs setting of 15 msecs to account for shoddy Windows operating system.

For low-latency applications, you may want to tweak this to lower values if your system works better than average timing-wise.

No "latbias" provided. Assuming zero bias. You'll need to determine this via measurement for best results...

PTB-DEBUG: PortAudio says: ASIOCanSampleRate(44100.000000):0

PTB-DEBUG: PortAudio says: ASIOGetSampleRate:44100.000000

PTB-DEBUG: PortAudio says: No Need to change SR

PTB-DEBUG: PortAudio says: Revalidated buffer size constraints are min 2208, max 2208, preferred 2208, granularity 0.

PTB-DEBUG: PortAudio says: PaAsioOpenStream: framesPerHostBuffer :2208

PTB-DEBUG: PortAudio says: asioMessages : 2 , 0 

PTB-DEBUG: PortAudio says: asioMessages : 7 , 0 

PTB-DEBUG: PortAudio says: ASIO Output type:18PTB-DEBUG: PortAudio says: ASIOSTInt32LSB

PTB-DEBUG: PortAudio says: PaAsio : ASIO InputLatency = 2208 (50 ms), added buffProc:0 (0 ms)

PTB-DEBUG: PortAudio says: PaAsio : ASIO OuputLatency = 2208 (50 ms), added buffProc:0 (0 ms)

PTB-INFO: New audio device -1 with handle 0 opened as PortAudio stream:

PTB-INFO: For 2 channels Playback: Audio subsystem is ASIO, Audio device name is Creative SBZ Series ASIO

PTB-INFO: Real samplerate 44100.000000 Hz. Input latency 50.068027 msecs, Output latency 50.068027 msecs.


prelat =


     0



postlat =


     0




PTB-INFO: This is Psychtoolbox-3 for Microsoft Windows, under Matlab 64-Bit (Version 3.0.14 - Build date: Jun  6 2017).

PTB-INFO: Support status on this operating system release: Windows version 10.0 supported and tested to some limited degree.

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: The detected endline of the vertical blank interval is equal or lower than the startline. This indicates

PTB-INFO: that i couldn't detect the duration of the vertical blank interval and won't be able to correct timestamps

PTB-INFO: for it. This will introduce a very small and constant offset (typically << 1 msec). Read 'help BeampositionQueries'

PTB-INFO: for how to correct this, should you really require that last few microseconds of precision.

PTB-INFO: Btw. this can also mean that your systems beamposition queries are slightly broken. It may help timing precision to

PTB-INFO: enable the beamposition workaround, as explained in 'help ConserveVRAMSettings', section 'kPsychUseBeampositionQueryWorkaround'.



PTB-INFO: OpenGL-Renderer is NVIDIA Corporation :: Quadro M2000/PCIe/SSE2 :: 4.5.0 NVIDIA 376.84

PTB-INFO: VBL startline = 1440 , VBL Endline = 1439

PTB-INFO: Measured monitor refresh interval from beamposition = 16.679879 ms [59.952473 Hz].

PTB-INFO: Beamposition queries are supported, but disabled. Using basic timestamping as fallback:

PTB-INFO: Timestamps returned by Screen('Flip') will be therefore less robust and accurate.

PTB-INFO: Measured monitor refresh interval from VBLsync = 16.682553 ms [59.942863 Hz]. (50 valid samples taken, stddev=0.035177 ms.)

PTB-INFO: Reported monitor refresh interval from operating system = 16.949153 ms [59.000000 Hz].

PTB-INFO: Small deviations between reported values are normal and no reason to worry.

PTB-INFO: ==============================================================================================================================

PTB-INFO: WINDOWS DWM DESKTOP COMPOSITOR IS ACTIVE. On this Windows-10 or later system, Psychtoolbox can no longer reliably detect if

PTB-INFO: this will cause trouble for timing and integrity of visual stimuli or not. You might be just fine, or you could be in trouble.

PTB-INFO: Use external measurement equipment and independent procedures to verify reliability of timing if you care about proper timing.

PTB-INFO: ==============================================================================================================================



Waiting 3 video refresh cycles before white-flash.

Predicted Latency: 50.068027 msecs.

Flip delay = 0.042584 secs.  Flipend vs. VBL 0.000049

Delay start vs. played: 0.000945 secs, offset 0.050068

Buffersize 2208, xruns = 0, playpos = 0.050068 secs.

Screen    expects visual onset at 456552.288878 secs.

PortAudio expects audio onset  at 456552.306021 secs.

Expected audio-visual delay    is 17.143514 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Flip delay = 0.042477 secs.  Flipend vs. VBL 0.000045

Delay start vs. played: 0.008212 secs, offset 0.050068

Buffersize 2208, xruns = 0, playpos = 0.050068 secs.

Screen    expects visual onset at 456553.250924 secs.

PortAudio expects audio onset  at 456553.307321 secs.

Expected audio-visual delay    is 56.396833 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Flip delay = 0.042530 secs.  Flipend vs. VBL 0.000045

Delay start vs. played: 0.008170 secs, offset 0.050068

Buffersize 2208, xruns = 0, playpos = 0.050068 secs.

Screen    expects visual onset at 456554.251806 secs.

PortAudio expects audio onset  at 456554.308816 secs.

Expected audio-visual delay    is 57.009282 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Flip delay = 0.042549 secs.  Flipend vs. VBL 0.000047

Delay start vs. played: 0.008246 secs, offset 0.050068

Buffersize 2208, xruns = 0, playpos = 0.050068 secs.

Screen    expects visual onset at 456555.253241 secs.

PortAudio expects audio onset  at 456555.310049 secs.

Expected audio-visual delay    is 56.808383 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Flip delay = 0.042655 secs.  Flipend vs. VBL 0.000053

Delay start vs. played: 0.008094 secs, offset 0.050068

Buffersize 2208, xruns = 0, playpos = 0.050068 secs.

Screen    expects visual onset at 456556.255134 secs.

PortAudio expects audio onset  at 456556.311579 secs.

Expected audio-visual delay    is 56.444132 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Flip delay = 0.042581 secs.  Flipend vs. VBL 0.000046

Delay start vs. played: 0.007662 secs, offset 0.050068

Buffersize 2208, xruns = 0, playpos = 0.050068 secs.

Screen    expects visual onset at 456557.256442 secs.

PortAudio expects audio onset  at 456557.312783 secs.

Expected audio-visual delay    is 56.341244 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Flip delay = 0.042533 secs.  Flipend vs. VBL 0.000264

Delay start vs. played: 0.007933 secs, offset 0.050068

Buffersize 2208, xruns = 0, playpos = 0.050068 secs.

Screen    expects visual onset at 456558.257576 secs.

PortAudio expects audio onset  at 456558.314278 secs.

Expected audio-visual delay    is 56.702082 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Flip delay = 0.042549 secs.  Flipend vs. VBL 0.000052

Delay start vs. played: 0.008197 secs, offset 0.050068

Buffersize 2208, xruns = 0, playpos = 0.050068 secs.

Screen    expects visual onset at 456559.259094 secs.

PortAudio expects audio onset  at 456559.315542 secs.

Expected audio-visual delay    is 56.448520 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Flip delay = 0.042887 secs.  Flipend vs. VBL 0.000047

Delay start vs. played: 0.007789 secs, offset 0.050068

Buffersize 2208, xruns = 0, playpos = 0.050068 secs.

Screen    expects visual onset at 456560.260592 secs.

PortAudio expects audio onset  at 456560.317121 secs.

Expected audio-visual delay    is 56.529465 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Predicted Latency: 50.068027 msecs.

Flip delay = 0.042486 secs.  Flipend vs. VBL 0.000046

Delay start vs. played: 0.008185 secs, offset 0.050068

Buffersize 2208, xruns = 0, playpos = 0.050068 secs.

Screen    expects visual onset at 456561.261553 secs.

PortAudio expects audio onset  at 456561.318400 secs.

Expected audio-visual delay    is 56.846905 msecs.

>> 



Thank you very much for your support in advance.


Masayuki





how many output channels does your soundcard have? maybe you are just not sending the audio to the headphone outputs?

also, it's best to provide some sample code to show how you are using PsychPortAudio...
Hi Mario,

Thank you very much for the immediate reply. Now I connect 'HDVD 800 ASIO Driver' to a PC via USB. It seems that the driver of HDVD 800 includes ASIO, detected as  'HDVD 800 ASIO Driver' by PsychPortAudio.


Here is the output of PsychPortAudioTimingTest. Please give me comments on this because I have no idea how to interpret this.

Masayuki





>> PsychPortAudioTimingTest([],25)
PTB-DEBUG: PortAudio says: ASIO names[0]:Creative SBZ Series ASIO
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 name = Creative SBZ Series ASIO
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 inputChannels       = 6
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 outputChannels      = 6
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 bufferMinSize       = 96
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 bufferMaxSize       = 96
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 bufferPreferredSize = 96
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 bufferGranularity   = 0
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultSampleRate = 44100.000000
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultLowInputLatency = 0.002177
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultLowOutputLatency = 0.002177
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultHighInputLatency = 0.002177
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultHighOutputLatency = 0.002177
PTB-DEBUG: PortAudio says: ASIO names[1]:HDVD 800 ASIO Driver
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 name = HDVD 800 ASIO Driver
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 inputChannels       = 0
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 outputChannels      = 2
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 bufferMinSize       = 864
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 bufferMaxSize       = 864
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 bufferPreferredSize = 864
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 bufferGranularity   = 0
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 defaultSampleRate = 44100.000000
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 defaultLowInputLatency = 0.019592
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 defaultLowOutputLatency = 0.019592
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 defaultHighInputLatency = 0.019592
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 defaultHighOutputLatency = 0.019592
PTB-INFO: Using specially modified PortAudio engine, based on offical version: PortAudio V19-devel WITH-DIM

Will use ASIO enhanced Portaudio driver DLL. See Psychtoolbox/PsychSound/PortAudioLICENSE.txt
for the exact terms of use for this dll.


Disclaimer: "ASIO is a trademark and software of Steinberg Media Technologies GmbH."
Using "ASIO Interface Technology by Steinberg Media Technologies GmbH"

Found at least one ASIO enabled soundcard in your system. Good, will use that in low-latency mode!
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.

Selected the following output device (deviceid=25) according to your spec:
          DeviceIndex: 25
       HostAudioAPIId: 3
     HostAudioAPIName: 'ASIO'
           DeviceName: 'HDVD 800 ASIO Driver'
      NrInputChannels: 0
     NrOutputChannels: 2
      LowInputLatency: 0.0196
     HighInputLatency: 0.0196
     LowOutputLatency: 0.0196
    HighOutputLatency: 0.0196
    DefaultSampleRate: 44100


suggestedLatencySecs =

    0.0150

Choosing a high suggestedLatencySecs setting of 15 msecs to account for shoddy Windows operating system.
For low-latency applications, you may want to tweak this to lower values if your system works better than average timing-wise.
No "latbias" provided. Assuming zero bias. You'll need to determine this via measurement for best results...
PTB-DEBUG: PortAudio says: ASIOCanSampleRate(44100.000000):0
PTB-DEBUG: PortAudio says: ASIOGetSampleRate:48000.000000
PTB-DEBUG: PortAudio says: before ASIOSetSampleRate(44100.000000)
PTB-DEBUG: PortAudio says: after ASIOSetSampleRate(44100.000000)
PTB-DEBUG: PortAudio says: Revalidated buffer size constraints are min 800, max 800, preferred 800, granularity 0.
PTB-DEBUG: PortAudio says: PaAsioOpenStream: framesPerHostBuffer :800
PTB-DEBUG: PortAudio says: asioMessages : 7 , 0 
PTB-DEBUG: PortAudio says: asioMessages : 1 , 2 
PTB-DEBUG: PortAudio says: asioMessages : 2 , 0 
PTB-DEBUG: PortAudio says: asioMessages : 1 , 3 
PTB-DEBUG: PortAudio says: asioMessages : 1 , 4 
PTB-DEBUG: PortAudio says: asioMessages : 1 , 5 
PTB-DEBUG: PortAudio says: asioMessages : 1 , 6 
PTB-DEBUG: PortAudio says: ASIO Output type:18PTB-DEBUG: PortAudio says: ASIOSTInt32LSB
PTB-DEBUG: PortAudio says: PaAsio : ASIO InputLatency = 976 (22 ms), added buffProc:0 (0 ms)
PTB-DEBUG: PortAudio says: PaAsio : ASIO OuputLatency = 1329 (30 ms), added buffProc:0 (0 ms)
PTB-INFO: New audio device 25 with handle 0 opened as PortAudio stream:
PTB-INFO: For 2 channels Playback: Audio subsystem is ASIO, Audio device name is HDVD 800 ASIO Driver
PTB-INFO: Real samplerate 44100.000000 Hz. Input latency 22.131519 msecs, Output latency 30.136054 msecs.

prelat =

     0


postlat =

     0



PTB-INFO: This is Psychtoolbox-3 for Microsoft Windows, under Matlab 64-Bit (Version 3.0.14 - Build date: Jun  6 2017).
PTB-INFO: Support status on this operating system release: Windows version 10.0 supported and tested to some limited degree.
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-WARNING: Call to PsychAvSetMmMaxThreadCharacteristics() for Vista-MMCSS scheduling failed for threadhandle 00007FFE6FE463E8. Setting thread priority to HIGHEST as a work-around...
PTB-INFO: The detected endline of the vertical blank interval is equal or lower than the startline. This indicates
PTB-INFO: that i couldn't detect the duration of the vertical blank interval and won't be able to correct timestamps
PTB-INFO: for it. This will introduce a very small and constant offset (typically << 1 msec). Read 'help BeampositionQueries'
PTB-INFO: for how to correct this, should you really require that last few microseconds of precision.
PTB-INFO: Btw. this can also mean that your systems beamposition queries are slightly broken. It may help timing precision to
PTB-INFO: enable the beamposition workaround, as explained in 'help ConserveVRAMSettings', section 'kPsychUseBeampositionQueryWorkaround'.
PTB-WARNING: Call to PsychAvSetMmMaxThreadCharacteristics() for Vista-MMCSS scheduling failed for threadhandle 00007FFE6FE463E8. Setting thread priority to HIGHEST as a work-around...


PTB-INFO: OpenGL-Renderer is NVIDIA Corporation :: Quadro M2000/PCIe/SSE2 :: 4.6.0 NVIDIA 388.16
PTB-INFO: VBL startline = 1440 , VBL Endline = 1439
PTB-INFO: Measured monitor refresh interval from beamposition = 16.679790 ms [59.952795 Hz].
PTB-INFO: Beamposition queries are supported, but disabled. Using basic timestamping as fallback:
PTB-INFO: Timestamps returned by Screen('Flip') will be therefore less robust and accurate.
PTB-INFO: Measured monitor refresh interval from VBLsync = 16.683031 ms [59.941146 Hz]. (50 valid samples taken, stddev=0.081691 ms.)
PTB-INFO: Reported monitor refresh interval from operating system = 16.949153 ms [59.000000 Hz].
PTB-INFO: Small deviations between reported values are normal and no reason to worry.
PTB-INFO: ==============================================================================================================================
PTB-INFO: WINDOWS DWM DESKTOP COMPOSITOR IS ACTIVE. On this Windows-10 or later system, Psychtoolbox can no longer reliably detect if
PTB-INFO: this will cause trouble for timing and integrity of visual stimuli or not. You might be just fine, or you could be in trouble.
PTB-INFO: Use external measurement equipment and independent procedures to verify reliability of timing if you care about proper timing.
PTB-INFO: ==============================================================================================================================


Waiting 3 video refresh cycles before white-flash.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042565 secs.  Flipend vs. VBL 0.000049
Delay start vs. played: 0.000528 secs, offset 0.045465
Buffersize 800, xruns = 0, playpos = 0.045465 secs.
Screen    expects visual onset at 15439.279425 secs.
PortAudio expects audio onset  at 15439.283016 secs.
Expected audio-visual delay    is 3.591549 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042547 secs.  Flipend vs. VBL 0.000048
Delay start vs. played: 0.000384 secs, offset 0.044218
Buffersize 800, xruns = 0, playpos = 0.044218 secs.
Screen    expects visual onset at 15440.296821 secs.
PortAudio expects audio onset  at 15440.300275 secs.
Expected audio-visual delay    is 3.453602 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042640 secs.  Flipend vs. VBL 0.000049
Delay start vs. played: 0.000101 secs, offset 0.043583
Buffersize 800, xruns = 0, playpos = 0.043583 secs.
Screen    expects visual onset at 15441.312522 secs.
PortAudio expects audio onset  at 15441.316907 secs.
Expected audio-visual delay    is 4.384466 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042632 secs.  Flipend vs. VBL 0.000048
Delay start vs. played: 0.000070 secs, offset 0.042948
Buffersize 800, xruns = 0, playpos = 0.042948 secs.
Screen    expects visual onset at 15442.328559 secs.
PortAudio expects audio onset  at 15442.333544 secs.
Expected audio-visual delay    is 4.984725 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042623 secs.  Flipend vs. VBL 0.000049
Delay start vs. played: 0.000071 secs, offset 0.042313
Buffersize 800, xruns = 0, playpos = 0.042313 secs.
Screen    expects visual onset at 15443.344613 secs.
PortAudio expects audio onset  at 15443.350183 secs.
Expected audio-visual delay    is 5.569380 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042629 secs.  Flipend vs. VBL 0.000049
Delay start vs. played: 0.000099 secs, offset 0.041678
Buffersize 800, xruns = 0, playpos = 0.041678 secs.
Screen    expects visual onset at 15444.360686 secs.
PortAudio expects audio onset  at 15444.366815 secs.
Expected audio-visual delay    is 6.129654 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.043016 secs.  Flipend vs. VBL 0.000049
Delay start vs. played: 0.000090 secs, offset 0.041020
Buffersize 800, xruns = 0, playpos = 0.041020 secs.
Screen    expects visual onset at 15445.377030 secs.
PortAudio expects audio onset  at 15445.383461 secs.
Expected audio-visual delay    is 6.430515 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042557 secs.  Flipend vs. VBL 0.000057
Delay start vs. played: 0.000126 secs, offset 0.040363
Buffersize 800, xruns = 0, playpos = 0.040363 secs.
Screen    expects visual onset at 15446.392719 secs.
PortAudio expects audio onset  at 15446.400114 secs.
Expected audio-visual delay    is 7.394664 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042574 secs.  Flipend vs. VBL 0.000049
Delay start vs. played: 0.000108 secs, offset 0.039728
Buffersize 800, xruns = 0, playpos = 0.039728 secs.
Screen    expects visual onset at 15447.408688 secs.
PortAudio expects audio onset  at 15447.416738 secs.
Expected audio-visual delay    is 8.049536 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042643 secs.  Flipend vs. VBL 0.000049
Delay start vs. played: 0.000122 secs, offset 0.039093
Buffersize 800, xruns = 0, playpos = 0.039093 secs.
Screen    expects visual onset at 15448.424492 secs.
PortAudio expects audio onset  at 15448.433381 secs.
Expected audio-visual delay    is 8.889704 msecs.

XXXIn PSYCHTOOLBOX@yahoogroups.com, <colliculus@...> wrote :

Hi Mario,

Thank you very much for the immediate reply. Now I connect 'HDVD 800 ASIO Driver' to a PC via USB. It seems that the driver of HDVD 800 includes ASIO, detected as  'HDVD 800 ASIO Driver' by PsychPortAudio.

-> yep, that seems to work.

Here is the output of PsychPortAudioTimingTest. Please give me comments on this because I have no idea how to interpret this.

-> The only weird thing is the rather large output latency of ~ 30 msecs of the headphone amp, whereas before the Soundblaster had a gigantic output latency but now would be down to good 2.1 msecs. I guess that's just the normal MS-Windows configuration mess.

See:

PTB-INFO: Real samplerate 44100.000000 Hz. Input latency 22.131519 msecs, Output latency 30.136054 msecs.

If you want stable sound timing then any requested sound onset/offset time must be at least "output latency" in the future, ie. in your case ~30 msecs.

So in PsychPortAudioTimingTest.m you'd have to set the suggestedLatencySecs parameter to >= 31 msecs for stable timing. It is hard-coded to 15 msecs by default, as that was supposed to be a worst-case scenario on MS-Windows with ASIO hardware. Maybe there is also some kind of proprietary driver settings GUI for your amp that allows to reduce latency. Normally PsychPortAudio can control such stuff itself, but apparently both the ASIO driver for the amp and the one for your soundblaster actively prevent our driver from controlling these settings.

If timing would be stable, these lines...

Expected audio-visual delay    is 3.591549 msecs.

... should show an error of << 1 msec, typically in the low microsecond range.

Anyway, if accurate timing or low latency doesn't matter then you should be good as is.
-mario


Masayuki





>> PsychPortAudioTimingTest([],25)
PTB-DEBUG: PortAudio says: ASIO names[0]:Creative SBZ Series ASIO
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 name = Creative SBZ Series ASIO
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 inputChannels       = 6
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 outputChannels      = 6
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 bufferMinSize       = 96
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 bufferMaxSize       = 96
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 bufferPreferredSize = 96
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 bufferGranularity   = 0
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultSampleRate = 44100.000000
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultLowInputLatency = 0.002177
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultLowOutputLatency = 0.002177
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultHighInputLatency = 0.002177
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultHighOutputLatency = 0.002177
PTB-DEBUG: PortAudio says: ASIO names[1]:HDVD 800 ASIO Driver
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 name = HDVD 800 ASIO Driver
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 inputChannels       = 0
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 outputChannels      = 2
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 bufferMinSize       = 864
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 bufferMaxSize       = 864
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 bufferPreferredSize = 864
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 bufferGranularity   = 0
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 defaultSampleRate = 44100.000000
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 defaultLowInputLatency = 0.019592
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 defaultLowOutputLatency = 0.019592
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 defaultHighInputLatency = 0.019592
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 defaultHighOutputLatency = 0.019592
PTB-INFO: Using specially modified PortAudio engine, based on offical version: PortAudio V19-devel WITH-DIM

Will use ASIO enhanced Portaudio driver DLL. See Psychtoolbox/PsychSound/PortAudioLICENSE.txt
for the exact terms of use for this dll.


Disclaimer: "ASIO is a trademark and software of Steinberg Media Technologies GmbH."
Using "ASIO Interface Technology by Steinberg Media Technologies GmbH"

Found at least one ASIO enabled soundcard in your system. Good, will use that in low-latency mode!
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.

Selected the following output device (deviceid=25) according to your spec:
          DeviceIndex: 25
       HostAudioAPIId: 3
     HostAudioAPIName: 'ASIO'
           DeviceName: 'HDVD 800 ASIO Driver'
      NrInputChannels: 0
     NrOutputChannels: 2
      LowInputLatency: 0.0196
     HighInputLatency: 0.0196
     LowOutputLatency: 0.0196
    HighOutputLatency: 0.0196
    DefaultSampleRate: 44100


suggestedLatencySecs =

    0.0150

Choosing a high suggestedLatencySecs setting of 15 msecs to account for shoddy Windows operating system.
For low-latency applications, you may want to tweak this to lower values if your system works better than average timing-wise.
No "latbias" provided. Assuming zero bias. You'll need to determine this via measurement for best results...
PTB-DEBUG: PortAudio says: ASIOCanSampleRate(44100.000000):0
PTB-DEBUG: PortAudio says: ASIOGetSampleRate:48000.000000
PTB-DEBUG: PortAudio says: before ASIOSetSampleRate(44100.000000)
PTB-DEBUG: PortAudio says: after ASIOSetSampleRate(44100.000000)
PTB-DEBUG: PortAudio says: Revalidated buffer size constraints are min 800, max 800, preferred 800, granularity 0.
PTB-DEBUG: PortAudio says: PaAsioOpenStream: framesPerHostBuffer :800
PTB-DEBUG: PortAudio says: asioMessages : 7 , 0 
PTB-DEBUG: PortAudio says: asioMessages : 1 , 2 
PTB-DEBUG: PortAudio says: asioMessages : 2 , 0 
PTB-DEBUG: PortAudio says: asioMessages : 1 , 3 
PTB-DEBUG: PortAudio says: asioMessages : 1 , 4 
PTB-DEBUG: PortAudio says: asioMessages : 1 , 5 
PTB-DEBUG: PortAudio says: asioMessages : 1 , 6 
PTB-DEBUG: PortAudio says: ASIO Output type:18PTB-DEBUG: PortAudio says: ASIOSTInt32LSB
PTB-DEBUG: PortAudio says: PaAsio : ASIO InputLatency = 976 (22 ms), added buffProc:0 (0 ms)
PTB-DEBUG: PortAudio says: PaAsio : ASIO OuputLatency = 1329 (30 ms), added buffProc:0 (0 ms)
PTB-INFO: New audio device 25 with handle 0 opened as PortAudio stream:
PTB-INFO: For 2 channels Playback: Audio subsystem is ASIO, Audio device name is HDVD 800 ASIO Driver
PTB-INFO: Real samplerate 44100.000000 Hz. Input latency 22.131519 msecs, Output latency 30.136054 msecs.

prelat =

     0


postlat =

     0



PTB-INFO: This is Psychtoolbox-3 for Microsoft Windows, under Matlab 64-Bit (Version 3.0.14 - Build date: Jun  6 2017).
PTB-INFO: Support status on this operating system release: Windows version 10.0 supported and tested to some limited degree.
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-WARNING: Call to PsychAvSetMmMaxThreadCharacteristics() for Vista-MMCSS scheduling failed for threadhandle 00007FFE6FE463E8. Setting thread priority to HIGHEST as a work-around...
PTB-INFO: The detected endline of the vertical blank interval is equal or lower than the startline. This indicates
PTB-INFO: that i couldn't detect the duration of the vertical blank interval and won't be able to correct timestamps
PTB-INFO: for it. This will introduce a very small and constant offset (typically << 1 msec). Read 'help BeampositionQueries'
PTB-INFO: for how to correct this, should you really require that last few microseconds of precision.
PTB-INFO: Btw. this can also mean that your systems beamposition queries are slightly broken. It may help timing precision to
PTB-INFO: enable the beamposition workaround, as explained in 'help ConserveVRAMSettings', section 'kPsychUseBeampositionQueryWorkaround'.
PTB-WARNING: Call to PsychAvSetMmMaxThreadCharacteristics() for Vista-MMCSS scheduling failed for threadhandle 00007FFE6FE463E8. Setting thread priority to HIGHEST as a work-around...


PTB-INFO: OpenGL-Renderer is NVIDIA Corporation :: Quadro M2000/PCIe/SSE2 :: 4.6.0 NVIDIA 388.16
PTB-INFO: VBL startline = 1440 , VBL Endline = 1439
PTB-INFO: Measured monitor refresh interval from beamposition = 16.679790 ms [59.952795 Hz].
PTB-INFO: Beamposition queries are supported, but disabled. Using basic timestamping as fallback:
PTB-INFO: Timestamps returned by Screen('Flip') will be therefore less robust and accurate.
PTB-INFO: Measured monitor refresh interval from VBLsync = 16.683031 ms [59.941146 Hz]. (50 valid samples taken, stddev=0.081691 ms.)
PTB-INFO: Reported monitor refresh interval from operating system = 16.949153 ms [59.000000 Hz].
PTB-INFO: Small deviations between reported values are normal and no reason to worry.
PTB-INFO: ==============================================================================================================================
PTB-INFO: WINDOWS DWM DESKTOP COMPOSITOR IS ACTIVE. On this Windows-10 or later system, Psychtoolbox can no longer reliably detect if
PTB-INFO: this will cause trouble for timing and integrity of visual stimuli or not. You might be just fine, or you could be in trouble.
PTB-INFO: Use external measurement equipment and independent procedures to verify reliability of timing if you care about proper timing.
PTB-INFO: ==============================================================================================================================


Waiting 3 video refresh cycles before white-flash.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042565 secs.  Flipend vs. VBL 0.000049
Delay start vs. played: 0.000528 secs, offset 0.045465
Buffersize 800, xruns = 0, playpos = 0.045465 secs.
Screen    expects visual onset at 15439.279425 secs.
PortAudio expects audio onset  at 15439.283016 secs.
Expected audio-visual delay    is 3.591549 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042547 secs.  Flipend vs. VBL 0.000048
Delay start vs. played: 0.000384 secs, offset 0.044218
Buffersize 800, xruns = 0, playpos = 0.044218 secs.
Screen    expects visual onset at 15440.296821 secs.
PortAudio expects audio onset  at 15440.300275 secs.
Expected audio-visual delay    is 3.453602 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042640 secs.  Flipend vs. VBL 0.000049
Delay start vs. played: 0.000101 secs, offset 0.043583
Buffersize 800, xruns = 0, playpos = 0.043583 secs.
Screen    expects visual onset at 15441.312522 secs.
PortAudio expects audio onset  at 15441.316907 secs.
Expected audio-visual delay    is 4.384466 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042632 secs.  Flipend vs. VBL 0.000048
Delay start vs. played: 0.000070 secs, offset 0.042948
Buffersize 800, xruns = 0, playpos = 0.042948 secs.
Screen    expects visual onset at 15442.328559 secs.
PortAudio expects audio onset  at 15442.333544 secs.
Expected audio-visual delay    is 4.984725 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042623 secs.  Flipend vs. VBL 0.000049
Delay start vs. played: 0.000071 secs, offset 0.042313
Buffersize 800, xruns = 0, playpos = 0.042313 secs.
Screen    expects visual onset at 15443.344613 secs.
PortAudio expects audio onset  at 15443.350183 secs.
Expected audio-visual delay    is 5.569380 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042629 secs.  Flipend vs. VBL 0.000049
Delay start vs. played: 0.000099 secs, offset 0.041678
Buffersize 800, xruns = 0, playpos = 0.041678 secs.
Screen    expects visual onset at 15444.360686 secs.
PortAudio expects audio onset  at 15444.366815 secs.
Expected audio-visual delay    is 6.129654 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.043016 secs.  Flipend vs. VBL 0.000049
Delay start vs. played: 0.000090 secs, offset 0.041020
Buffersize 800, xruns = 0, playpos = 0.041020 secs.
Screen    expects visual onset at 15445.377030 secs.
PortAudio expects audio onset  at 15445.383461 secs.
Expected audio-visual delay    is 6.430515 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042557 secs.  Flipend vs. VBL 0.000057
Delay start vs. played: 0.000126 secs, offset 0.040363
Buffersize 800, xruns = 0, playpos = 0.040363 secs.
Screen    expects visual onset at 15446.392719 secs.
PortAudio expects audio onset  at 15446.400114 secs.
Expected audio-visual delay    is 7.394664 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042574 secs.  Flipend vs. VBL 0.000049
Delay start vs. played: 0.000108 secs, offset 0.039728
Buffersize 800, xruns = 0, playpos = 0.039728 secs.
Screen    expects visual onset at 15447.408688 secs.
PortAudio expects audio onset  at 15447.416738 secs.
Expected audio-visual delay    is 8.049536 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042643 secs.  Flipend vs. VBL 0.000049
Delay start vs. played: 0.000122 secs, offset 0.039093
Buffersize 800, xruns = 0, playpos = 0.039093 secs.
Screen    expects visual onset at 15448.424492 secs.
PortAudio expects audio onset  at 15448.433381 secs.
Expected audio-visual delay    is 8.889704 msecs.

XXXIn PSYCHTOOLBOX@yahoogroups.com, <colliculus@...> wrote :

Hi Mario,

Thank you very much for your reply.

I need accurate timing for sound output. The delay is not a problem as long as it is constant. But "Expected audio-visual delay" varies still from 0.9 ms to 14 ms after suggestedLatencySecs is set to 0.031 in PsychPortAudioTimingTest.

Would it be still possible to fix this problem?

-> The output also shows that visual timing is broken on your setup, so it is actually not possible to determine if the varying audio-visual delay is an audio problem, visual problem or a mixture of both.

Broken visual timing and/or timestamping is quite common on Windows-10 multi-display setups, or on HiDPI displays, or on mixed normal + HiDPI multi-display setups. Maybe try with only one display active if you can get rid of the various errors and warnings.

If it would be an audio timing problem then i don't think there's anything that could be done. Settings seem to be correct, with generous timing headroom for your amp, from PTB's side now, so any timing problem would be likely related to bugs or limitations of your amp/amp ASIO driver/Windows OS.

In the end you always have to verify correct audio timing or audio-visual timing with some external hardware if you need msec level precision, as software based consistency checks can't detect all types of trouble. Iow. if this test provides too much variability then something is definitely broken in audio or visual, but if it reports close to perfect results, you'd still need to verify. I use a Datapixx device (and PsychPortAudioDatapixxTimingTest), using a photo-diode + microphone + 2-channel scope (or 2nd soundcard as scope replacement) + PsychPortAudioTimingTest is another way to verify.

-mario


Here is the output of PsychPortAudioTimingTest >

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-DEBUG: PortAudio says: ASIO names[0]:Creative SBZ Series ASIO
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 name = Creative SBZ Series ASIO
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 inputChannels       = 6
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 outputChannels      = 6
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 bufferMinSize       = 96
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 bufferMaxSize       = 96
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 bufferPreferredSize = 96
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 bufferGranularity   = 0
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultSampleRate = 44100.000000
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultLowInputLatency = 0.002177
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultLowOutputLatency = 0.002177
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultHighInputLatency = 0.002177
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultHighOutputLatency = 0.002177
PTB-DEBUG: PortAudio says: ASIO names[1]:HDVD 800 ASIO Driver
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 name = HDVD 800 ASIO Driver
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 inputChannels       = 0
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 outputChannels      = 2
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 bufferMinSize       = 800
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 bufferMaxSize       = 800
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 bufferPreferredSize = 800
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 bufferGranularity   = 0
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 defaultSampleRate = 44100.000000
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 defaultLowInputLatency = 0.018141
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 defaultLowOutputLatency = 0.018141
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 defaultHighInputLatency = 0.018141
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 defaultHighOutputLatency = 0.018141
PTB-INFO: Using specially modified PortAudio engine, based on offical version: PortAudio V19-devel WITH-DIM

Will use ASIO enhanced Portaudio driver DLL. See Psychtoolbox/PsychSound/PortAudioLICENSE.txt
for the exact terms of use for this dll.


Disclaimer: "ASIO is a trademark and software of Steinberg Media Technologies GmbH."
Using "ASIO Interface Technology by Steinberg Media Technologies GmbH"

Found at least one ASIO enabled soundcard in your system. Good, will use that in low-latency mode!
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.

Selected the following output device (deviceid=25) according to your spec:
          DeviceIndex: 25
       HostAudioAPIId: 3
     HostAudioAPIName: 'ASIO'
           DeviceName: 'HDVD 800 ASIO Driver'
      NrInputChannels: 0
     NrOutputChannels: 2
      LowInputLatency: 0.0181
     HighInputLatency: 0.0181
     LowOutputLatency: 0.0181
    HighOutputLatency: 0.0181
    DefaultSampleRate: 44100


suggestedLatencySecs =

    0.0310

Choosing a high suggestedLatencySecs setting of 15 msecs to account for shoddy Windows operating system.
For low-latency applications, you may want to tweak this to lower values if your system works better than average timing-wise.
No "latbias" provided. Assuming zero bias. You'll need to determine this via measurement for best results...
PTB-DEBUG: PortAudio says: ASIOCanSampleRate(44100.000000):0
PTB-DEBUG: PortAudio says: ASIOGetSampleRate:44100.000000
PTB-DEBUG: PortAudio says: No Need to change SR
PTB-DEBUG: PortAudio says: Revalidated buffer size constraints are min 800, max 800, preferred 800, granularity 0.
PTB-DEBUG: PortAudio says: PaAsioOpenStream: framesPerHostBuffer :800
PTB-DEBUG: PortAudio says: asioMessages : 7 , 0 
PTB-DEBUG: PortAudio says: asioMessages : 1 , 2 
PTB-DEBUG: PortAudio says: asioMessages : 2 , 0 
PTB-DEBUG: PortAudio says: asioMessages : 1 , 3 
PTB-DEBUG: PortAudio says: asioMessages : 1 , 4 
PTB-DEBUG: PortAudio says: asioMessages : 1 , 5 
PTB-DEBUG: PortAudio says: asioMessages : 1 , 6 
PTB-DEBUG: PortAudio says: ASIO Output type:18PTB-DEBUG: PortAudio says: ASIOSTInt32LSB
PTB-DEBUG: PortAudio says: PaAsio : ASIO InputLatency = 976 (22 ms), added buffProc:0 (0 ms)
PTB-DEBUG: PortAudio says: PaAsio : ASIO OuputLatency = 1329 (30 ms), added buffProc:0 (0 ms)
PTB-INFO: New audio device 25 with handle 0 opened as PortAudio stream:
PTB-INFO: For 2 channels Playback: Audio subsystem is ASIO, Audio device name is HDVD 800 ASIO Driver
PTB-INFO: Real samplerate 44100.000000 Hz. Input latency 22.131519 msecs, Output latency 30.136054 msecs.

prelat =

     0


postlat =

     0



PTB-INFO: This is Psychtoolbox-3 for Microsoft Windows, under Matlab 64-Bit (Version 3.0.14 - Build date: Jun  6 2017).
PTB-INFO: Support status on this operating system release: Windows version 10.0 supported and tested to some limited degree.
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: The detected endline of the vertical blank interval is equal or lower than the startline. This indicates
PTB-INFO: that i couldn't detect the duration of the vertical blank interval and won't be able to correct timestamps
PTB-INFO: for it. This will introduce a very small and constant offset (typically << 1 msec). Read 'help BeampositionQueries'
PTB-INFO: for how to correct this, should you really require that last few microseconds of precision.
PTB-INFO: Btw. this can also mean that your systems beamposition queries are slightly broken. It may help timing precision to
PTB-INFO: enable the beamposition workaround, as explained in 'help ConserveVRAMSettings', section 'kPsychUseBeampositionQueryWorkaround'.


PTB-INFO: OpenGL-Renderer is NVIDIA Corporation :: Quadro M2000/PCIe/SSE2 :: 4.6.0 NVIDIA 388.16
PTB-INFO: VBL startline = 1440 , VBL Endline = 1439
PTB-INFO: Measured monitor refresh interval from beamposition = 16.680009 ms [59.952008 Hz].
PTB-INFO: Will use beamposition query for accurate Flip time stamping.
PTB-INFO: Measured monitor refresh interval from VBLsync = 16.682534 ms [59.942933 Hz]. (50 valid samples taken, stddev=0.036682 ms.)
PTB-INFO: Reported monitor refresh interval from operating system = 16.949153 ms [59.000000 Hz].
PTB-INFO: Small deviations between reported values are normal and no reason to worry.
PTB-INFO: ==============================================================================================================================
PTB-INFO: WINDOWS DWM DESKTOP COMPOSITOR IS ACTIVE. On this Windows-10 or later system, Psychtoolbox can no longer reliably detect if
PTB-INFO: this will cause trouble for timing and integrity of visual stimuli or not. You might be just fine, or you could be in trouble.
PTB-INFO: Use external measurement equipment and independent procedures to verify reliability of timing if you care about proper timing.
PTB-INFO: ==============================================================================================================================


Waiting 5 video refresh cycles before white-flash.


PTB-ERROR: Screen('Flip'); beamposition timestamping computed an *impossible stimulus onset value* of 353299.402491 secs, which would indicate that
PTB-ERROR: stimulus onset happened *before* it was actually requested! (Earliest theoretically possible 353299.412784 secs).

PTB-ERROR: Some more diagnostic values (only for experts): rawTimestamp = 353299.413620, scanline = 960
PTB-ERROR: Some more diagnostic values (only for experts): line_pre_swaprequest = 886, line_post_swaprequest = 941, time_post_swaprequest = 353299.413407
PTB-ERROR: Some more diagnostic values (only for experts): preflip_vblcount = 1546, preflip_vbltimestamp = 353299.432011
PTB-ERROR: Some more diagnostic values (only for experts): postflip_vblcount = 0, postflip_vbltimestamp = -1.000000, vbltimestampquery_retrycount = 0

PTB-ERROR: This error can be due to either of the following causes (No way to discriminate):
PTB-ERROR: Either something is broken in your systems beamposition timestamping. I've disabled high precision
PTB-ERROR: timestamping for now. Returned timestamps will be less robust and accurate, but if that was the culprit it should be fixed.

PTB-ERROR: An equally likely cause would be that Synchronization of stimulus onset (buffer swap) to the
PTB-ERROR: vertical blank interval VBL is not working properly.
PTB-ERROR: Please run the script PerceptualVBLSyncTest to check this. With non-working sync to VBL, all stimulus timing
PTB-ERROR: becomes quite futile. Also read 'help SyncTrouble' !
Predicted Latency: 30.136054 msecs.
Flip delay = 0.075949 secs.  Flipend vs. VBL 0.000053
Delay start vs. played: 0.000186 secs, offset 0.032766
Buffersize 800, xruns = 0, playpos = 0.032766 secs.
Screen    expects visual onset at 353299.478440 secs.
PortAudio expects audio onset  at 353299.482031 secs.
Expected audio-visual delay    is 3.591169 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.075923 secs.  Flipend vs. VBL 0.000049
Delay start vs. played: 0.000158 secs, offset 0.030907
Buffersize 800, xruns = 0, playpos = 0.030907 secs.
Screen    expects visual onset at 353300.514829 secs.
PortAudio expects audio onset  at 353300.515906 secs.
Expected audio-visual delay    is 1.076343 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.075923 secs.  Flipend vs. VBL 0.000050
Delay start vs. played: 0.000154 secs, offset 0.014762
Buffersize 800, xruns = 0, playpos = 0.014762 secs.
Screen    expects visual onset at 353301.550555 secs.
PortAudio expects audio onset  at 353301.565905 secs.
Expected audio-visual delay    is 15.350527 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.075917 secs.  Flipend vs. VBL 0.000050
Delay start vs. played: 0.000153 secs, offset 0.018934
Buffersize 800, xruns = 0, playpos = 0.018934 secs.
Screen    expects visual onset at 353302.602632 secs.
PortAudio expects audio onset  at 353302.615864 secs.
Expected audio-visual delay    is 13.231823 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.075961 secs.  Flipend vs. VBL 0.000055
Delay start vs. played: 0.000905 secs, offset 0.021088
Buffersize 800, xruns = 0, playpos = 0.021088 secs.
Screen    expects visual onset at 353303.655009 secs.
PortAudio expects audio onset  at 353303.665831 secs.
Expected audio-visual delay    is 10.822011 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.076096 secs.  Flipend vs. VBL 0.000054
Delay start vs. played: 0.000099 secs, offset 0.023628
Buffersize 800, xruns = 0, playpos = 0.023628 secs.
Screen    expects visual onset at 353304.707724 secs.
PortAudio expects audio onset  at 353304.715188 secs.
Expected audio-visual delay    is 7.463585 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.076098 secs.  Flipend vs. VBL 0.000051
Delay start vs. played: 0.000100 secs, offset 0.025034
Buffersize 800, xruns = 0, playpos = 0.025034 secs.
Screen    expects visual onset at 353305.758596 secs.
PortAudio expects audio onset  at 353305.765784 secs.
Expected audio-visual delay    is 7.188275 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.075913 secs.  Flipend vs. VBL 0.000050
Delay start vs. played: 0.000100 secs, offset 0.027075
Buffersize 800, xruns = 0, playpos = 0.027075 secs.
Screen    expects visual onset at 353306.810366 secs.
PortAudio expects audio onset  at 353306.815731 secs.
Expected audio-visual delay    is 5.365439 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.075916 secs.  Flipend vs. VBL 0.000050
Delay start vs. played: 0.000111 secs, offset 0.029093
Buffersize 800, xruns = 0, playpos = 0.029093 secs.
Screen    expects visual onset at 353307.862302 secs.
PortAudio expects audio onset  at 353307.865705 secs.
Expected audio-visual delay    is 3.402285 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.075973 secs.  Flipend vs. VBL 0.000054
Delay start vs. played: 0.000103 secs, offset 0.031814
Buffersize 800, xruns = 0, playpos = 0.031814 secs.
Screen    expects visual onset at 353308.898474 secs.
PortAudio expects audio onset  at 353308.898995 secs.
Expected audio-visual delay    is 0.520945 msecs.





Masayuki






















---In PSYCHTOOLBOX@yahoogroups.com, <mario.kleiner@...> wrote :

XXXIn PSYCHTOOLBOX@yahoogroups.com, <colliculus@...> wrote :

Hi Mario,

Thank you very much for the immediate reply. Now I connect 'HDVD 800 ASIO Driver' to a PC via USB. It seems that the driver of HDVD 800 includes ASIO, detected as  'HDVD 800 ASIO Driver' by PsychPortAudio.

-> yep, that seems to work.

Here is the output of PsychPortAudioTimingTest. Please give me comments on this because I have no idea how to interpret this.

-> The only weird thing is the rather large output latency of ~ 30 msecs of the headphone amp, whereas before the Soundblaster had a gigantic output latency but now would be down to good 2.1 msecs. I guess that's just the normal MS-Windows configuration mess.

See:

PTB-INFO: Real samplerate 44100.000000 Hz. Input latency 22.131519 msecs, Output latency 30.136054 msecs.

If you want stable sound timing then any requested sound onset/offset time must be at least "output latency" in the future, ie. in your case ~30 msecs.

So in PsychPortAudioTimingTest.m you'd have to set the suggestedLatencySecs parameter to >= 31 msecs for stable timing. It is hard-coded to 15 msecs by default, as that was supposed to be a worst-case scenario on MS-Windows with ASIO hardware. Maybe there is also some kind of proprietary driver settings GUI for your amp that allows to reduce latency. Normally PsychPortAudio can control such stuff itself, but apparently both the ASIO driver for the amp and the one for your soundblaster actively prevent our driver from controlling these settings.

If timing would be stable, these lines...

Expected audio-visual delay    is 3.591549 msecs.

... should show an error of << 1 msec, typically in the low microsecond range.

Anyway, if accurate timing or low latency doesn't matter then you should be good as is.
-mario


Masayuki





>> PsychPortAudioTimingTest([],25)
PTB-DEBUG: PortAudio says: ASIO names[0]:Creative SBZ Series ASIO
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 name = Creative SBZ Series ASIO
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 inputChannels       = 6
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 outputChannels      = 6
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 bufferMinSize       = 96
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 bufferMaxSize       = 96
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 bufferPreferredSize = 96
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 bufferGranularity   = 0
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultSampleRate = 44100.000000
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultLowInputLatency = 0.002177
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultLowOutputLatency = 0.002177
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultHighInputLatency = 0.002177
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultHighOutputLatency = 0.002177
PTB-DEBUG: PortAudio says: ASIO names[1]:HDVD 800 ASIO Driver
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 name = HDVD 800 ASIO Driver
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 inputChannels       = 0
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 outputChannels      = 2
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 bufferMinSize       = 864
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 bufferMaxSize       = 864
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 bufferPreferredSize = 864
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 bufferGranularity   = 0
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 defaultSampleRate = 44100.000000
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 defaultLowInputLatency = 0.019592
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 defaultLowOutputLatency = 0.019592
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 defaultHighInputLatency = 0.019592
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:1 defaultHighOutputLatency = 0.019592
PTB-INFO: Using specially modified PortAudio engine, based on offical version: PortAudio V19-devel WITH-DIM

Will use ASIO enhanced Portaudio driver DLL. See Psychtoolbox/PsychSound/PortAudioLICENSE.txt
for the exact terms of use for this dll.


Disclaimer: "ASIO is a trademark and software of Steinberg Media Technologies GmbH."
Using "ASIO Interface Technology by Steinberg Media Technologies GmbH"

Found at least one ASIO enabled soundcard in your system. Good, will use that in low-latency mode!
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.

Selected the following output device (deviceid=25) according to your spec:
          DeviceIndex: 25
       HostAudioAPIId: 3
     HostAudioAPIName: 'ASIO'
           DeviceName: 'HDVD 800 ASIO Driver'
      NrInputChannels: 0
     NrOutputChannels: 2
      LowInputLatency: 0.0196
     HighInputLatency: 0.0196
     LowOutputLatency: 0.0196
    HighOutputLatency: 0.0196
    DefaultSampleRate: 44100


suggestedLatencySecs =

    0.0150

Choosing a high suggestedLatencySecs setting of 15 msecs to account for shoddy Windows operating system.
For low-latency applications, you may want to tweak this to lower values if your system works better than average timing-wise.
No "latbias" provided. Assuming zero bias. You'll need to determine this via measurement for best results...
PTB-DEBUG: PortAudio says: ASIOCanSampleRate(44100.000000):0
PTB-DEBUG: PortAudio says: ASIOGetSampleRate:48000.000000
PTB-DEBUG: PortAudio says: before ASIOSetSampleRate(44100.000000)
PTB-DEBUG: PortAudio says: after ASIOSetSampleRate(44100.000000)
PTB-DEBUG: PortAudio says: Revalidated buffer size constraints are min 800, max 800, preferred 800, granularity 0.
PTB-DEBUG: PortAudio says: PaAsioOpenStream: framesPerHostBuffer :800
PTB-DEBUG: PortAudio says: asioMessages : 7 , 0 
PTB-DEBUG: PortAudio says: asioMessages : 1 , 2 
PTB-DEBUG: PortAudio says: asioMessages : 2 , 0 
PTB-DEBUG: PortAudio says: asioMessages : 1 , 3 
PTB-DEBUG: PortAudio says: asioMessages : 1 , 4 
PTB-DEBUG: PortAudio says: asioMessages : 1 , 5 
PTB-DEBUG: PortAudio says: asioMessages : 1 , 6 
PTB-DEBUG: PortAudio says: ASIO Output type:18PTB-DEBUG: PortAudio says: ASIOSTInt32LSB
PTB-DEBUG: PortAudio says: PaAsio : ASIO InputLatency = 976 (22 ms), added buffProc:0 (0 ms)
PTB-DEBUG: PortAudio says: PaAsio : ASIO OuputLatency = 1329 (30 ms), added buffProc:0 (0 ms)
PTB-INFO: New audio device 25 with handle 0 opened as PortAudio stream:
PTB-INFO: For 2 channels Playback: Audio subsystem is ASIO, Audio device name is HDVD 800 ASIO Driver
PTB-INFO: Real samplerate 44100.000000 Hz. Input latency 22.131519 msecs, Output latency 30.136054 msecs.

prelat =

     0


postlat =

     0



PTB-INFO: This is Psychtoolbox-3 for Microsoft Windows, under Matlab 64-Bit (Version 3.0.14 - Build date: Jun  6 2017).
PTB-INFO: Support status on this operating system release: Windows version 10.0 supported and tested to some limited degree.
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-WARNING: Call to PsychAvSetMmMaxThreadCharacteristics() for Vista-MMCSS scheduling failed for threadhandle 00007FFE6FE463E8. Setting thread priority to HIGHEST as a work-around...
PTB-INFO: The detected endline of the vertical blank interval is equal or lower than the startline. This indicates
PTB-INFO: that i couldn't detect the duration of the vertical blank interval and won't be able to correct timestamps
PTB-INFO: for it. This will introduce a very small and constant offset (typically << 1 msec). Read 'help BeampositionQueries'
PTB-INFO: for how to correct this, should you really require that last few microseconds of precision.
PTB-INFO: Btw. this can also mean that your systems beamposition queries are slightly broken. It may help timing precision to
PTB-INFO: enable the beamposition workaround, as explained in 'help ConserveVRAMSettings', section 'kPsychUseBeampositionQueryWorkaround'.
PTB-WARNING: Call to PsychAvSetMmMaxThreadCharacteristics() for Vista-MMCSS scheduling failed for threadhandle 00007FFE6FE463E8. Setting thread priority to HIGHEST as a work-around...


PTB-INFO: OpenGL-Renderer is NVIDIA Corporation :: Quadro M2000/PCIe/SSE2 :: 4.6.0 NVIDIA 388.16
PTB-INFO: VBL startline = 1440 , VBL Endline = 1439
PTB-INFO: Measured monitor refresh interval from beamposition = 16.679790 ms [59.952795 Hz].
PTB-INFO: Beamposition queries are supported, but disabled. Using basic timestamping as fallback:
PTB-INFO: Timestamps returned by Screen('Flip') will be therefore less robust and accurate.
PTB-INFO: Measured monitor refresh interval from VBLsync = 16.683031 ms [59.941146 Hz]. (50 valid samples taken, stddev=0.081691 ms.)
PTB-INFO: Reported monitor refresh interval from operating system = 16.949153 ms [59.000000 Hz].
PTB-INFO: Small deviations between reported values are normal and no reason to worry.
PTB-INFO: ==============================================================================================================================
PTB-INFO: WINDOWS DWM DESKTOP COMPOSITOR IS ACTIVE. On this Windows-10 or later system, Psychtoolbox can no longer reliably detect if
PTB-INFO: this will cause trouble for timing and integrity of visual stimuli or not. You might be just fine, or you could be in trouble.
PTB-INFO: Use external measurement equipment and independent procedures to verify reliability of timing if you care about proper timing.
PTB-INFO: ==============================================================================================================================


Waiting 3 video refresh cycles before white-flash.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042565 secs.  Flipend vs. VBL 0.000049
Delay start vs. played: 0.000528 secs, offset 0.045465
Buffersize 800, xruns = 0, playpos = 0.045465 secs.
Screen    expects visual onset at 15439.279425 secs.
PortAudio expects audio onset  at 15439.283016 secs.
Expected audio-visual delay    is 3.591549 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042547 secs.  Flipend vs. VBL 0.000048
Delay start vs. played: 0.000384 secs, offset 0.044218
Buffersize 800, xruns = 0, playpos = 0.044218 secs.
Screen    expects visual onset at 15440.296821 secs.
PortAudio expects audio onset  at 15440.300275 secs.
Expected audio-visual delay    is 3.453602 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042640 secs.  Flipend vs. VBL 0.000049
Delay start vs. played: 0.000101 secs, offset 0.043583
Buffersize 800, xruns = 0, playpos = 0.043583 secs.
Screen    expects visual onset at 15441.312522 secs.
PortAudio expects audio onset  at 15441.316907 secs.
Expected audio-visual delay    is 4.384466 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042632 secs.  Flipend vs. VBL 0.000048
Delay start vs. played: 0.000070 secs, offset 0.042948
Buffersize 800, xruns = 0, playpos = 0.042948 secs.
Screen    expects visual onset at 15442.328559 secs.
PortAudio expects audio onset  at 15442.333544 secs.
Expected audio-visual delay    is 4.984725 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042623 secs.  Flipend vs. VBL 0.000049
Delay start vs. played: 0.000071 secs, offset 0.042313
Buffersize 800, xruns = 0, playpos = 0.042313 secs.
Screen    expects visual onset at 15443.344613 secs.
PortAudio expects audio onset  at 15443.350183 secs.
Expected audio-visual delay    is 5.569380 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042629 secs.  Flipend vs. VBL 0.000049
Delay start vs. played: 0.000099 secs, offset 0.041678
Buffersize 800, xruns = 0, playpos = 0.041678 secs.
Screen    expects visual onset at 15444.360686 secs.
PortAudio expects audio onset  at 15444.366815 secs.
Expected audio-visual delay    is 6.129654 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.043016 secs.  Flipend vs. VBL 0.000049
Delay start vs. played: 0.000090 secs, offset 0.041020
Buffersize 800, xruns = 0, playpos = 0.041020 secs.
Screen    expects visual onset at 15445.377030 secs.
PortAudio expects audio onset  at 15445.383461 secs.
Expected audio-visual delay    is 6.430515 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042557 secs.  Flipend vs. VBL 0.000057
Delay start vs. played: 0.000126 secs, offset 0.040363
Buffersize 800, xruns = 0, playpos = 0.040363 secs.
Screen    expects visual onset at 15446.392719 secs.
PortAudio expects audio onset  at 15446.400114 secs.
Expected audio-visual delay    is 7.394664 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042574 secs.  Flipend vs. VBL 0.000049
Delay start vs. played: 0.000108 secs, offset 0.039728
Buffersize 800, xruns = 0, playpos = 0.039728 secs.
Screen    expects visual onset at 15447.408688 secs.
PortAudio expects audio onset  at 15447.416738 secs.
Expected audio-visual delay    is 8.049536 msecs.
Predicted Latency: 30.136054 msecs.
Flip delay = 0.042643 secs.  Flipend vs. VBL 0.000049
Delay start vs. played: 0.000122 secs, offset 0.039093
Buffersize 800, xruns = 0, playpos = 0.039093 secs.
Screen    expects visual onset at 15448.424492 secs.
PortAudio expects audio onset  at 15448.433381 secs.
Expected audio-visual delay    is 8.889704 msecs.

I have a similar problem, no error, but I can not hear the sound…

> InitializePsychSound(1); 
> pahandle = PsychPortAudio('Open', [], [], 1, 48000, 2);
> PsychPortAudio('Volume', pahandle, 0.5); 
> [sound, ~] = audioread('MYWAVFILE');
> buffer=PsychPortAudio('CreateBuffer' , pahandle,  sound');
> PsychPortAudio('FillBuffer', pahandle, buffer);
> PsychPortAudio('Start', pahandle, 10, 0, 0, inf, 0);
Found at least one ASIO enabled soundcard in your system. Good, will use that in low-latency mode!
PTB-INFO: New audio device -1 with handle 0 opened as PortAudio stream:
PTB-INFO: For 2 channels Playback: Audio subsystem is ASIO, Audio device name is ASIO4ALL v2
PTB-INFO: Real samplerate 48000.000000 Hz. Input latency 9.916667 msecs, Output latency 9.916667 msecs.

I run PsychPortAudioDataPixxTimingTest

PTB-DEBUG: PortAudio says: ASIO names[0]:ASIO4ALL v2
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 name = ASIO4ALL v2
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 inputChannels       = 2
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 outputChannels      = 8
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 bufferMinSize       = 64
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 bufferMaxSize       = 2048
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 bufferPreferredSize = 512
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 bufferGranularity   = 8
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultSampleRate = 44100.000000
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultLowInputLatency = 0.011610
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultLowOutputLatency = 0.011610
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultHighInputLatency = 0.034830
PTB-DEBUG: PortAudio says: PaAsio_Initialize: drv:0 defaultHighOutputLatency = 0.034830
PTB-INFO: Using specially modified PortAudio engine, based on offical version: PortAudio V19-devel WITH-DIM


Selected the following output device (deviceid=1) according to your spec:
          DeviceIndex: 1
       HostAudioAPIId: 2
     HostAudioAPIName: 'MME'
           DeviceName: 'Microphone (Realtek High Defini'
      NrInputChannels: 2
     NrOutputChannels: 0
      LowInputLatency: 0.2000
     HighInputLatency: 0.4000
     LowOutputLatency: 0.2000
    HighOutputLatency: 0.4000
    DefaultSampleRate: 44100

ASIO support has been dropped from PTB a long time ago, see bottom of:

Also, whatever PTB version you are using is no longer supported.

Upgrading to the latest 3.0.18 and ideally to Linux is recommended for likely better results.
-mario