# Warning about broken audio timestamping?

**URL:** <https://psychtoolbox.discourse.group/t/warning-about-broken-audio-timestamping/4088>\
**Category:** Hardware\
**Tags:** windows, audio\
**Created:** [October 28, 2021, 10:34pm UTC](https://psychtoolbox.discourse.group/t/warning-about-broken-audio-timestamping/4088 "2021-10-28T22:34:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lettyho](https://avatars.discourse-cdn.com/v4/letter/l/f08c70/32.png) [@lettyho](https://psychtoolbox.discourse.group/u/lettyho)\
**Post date:** [October 28, 2021, 10:34pm UTC](https://psychtoolbox.discourse.group/t/warning-about-broken-audio-timestamping/4088/1 "2021-10-28T22:34:56Z")

</div>

`>> PsychtoolboxVersion`  
3.0.18 - Flavor: beta - Corresponds to SVN Revision 12386

I’m on a Windows 10 Pro computer initializing PsychPortAudio with:  
`>> PsychPortAudio('Open', 5, 1, 1, fs, 2);`

I get the following warning

```auto
PTB-INFO: New audio device 5 with handle 10 opened as PortAudio stream:
PTB-INFO: For 2 channels Playback: Audio subsystem is MME, Audio device name is Speakers (Sound Blaster ZxR)
PTB-INFO: Real samplerate 44100.000000 Hz. Input latency 0.000000 msecs, Output latency 101.587302 msecs.
PTB-WARNING:PsychPortAudio('Stop'): Audio device with handle 10 had broken audio timestamping - and therefore timing - during this run. Don't trust the timing!

```

The audio output device is  
`Speakers (Sound Blaster ZxR)`

Any advice would help 🙂

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [October 29, 2021, 1:45am UTC](https://psychtoolbox.discourse.group/t/warning-about-broken-audio-timestamping/4088/2 "2021-10-29T01:45:53Z")

</div>

Your manually chosen audio device with deviceIndex 5 uses the MME sound system, which does not ever have reliable timing. Let the driver choose itself [] or specify a device with reliable timing manually, ie. on Windows that would be one with WASAPI sound system.

-mario

---

<div class="post-metadata">

**Author:** ![lettyho](https://avatars.discourse-cdn.com/v4/letter/l/f08c70/32.png) [@lettyho](https://psychtoolbox.discourse.group/u/lettyho)\
**Post date:** [October 29, 2021, 6:49pm UTC](https://psychtoolbox.discourse.group/t/warning-about-broken-audio-timestamping/4088/3 "2021-10-29T18:49:55Z")

</div>

I’m still getting this error? Sorry if I’m missing something obvious… thanks for the help

```auto
PTB-INFO: Using modified PortAudio V19.7.0-devel, revision unknown
PTB-ERROR: Desired audio parameters for device -1 unsupported by audio device: Invalid sample rate 
PTB-ERROR: Seems the requested audio sample rate 44100.000000 Hz is not supported by this combo of hardware and sound driver.
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 init_psychtoolbox (line 21)
    ptb.pahandle = PsychPortAudio('Open', [], 1, 1, Fs, 2);

```

---

<div class="post-metadata">

**Author:** ![lettyho](https://avatars.discourse-cdn.com/v4/letter/l/f08c70/32.png) [@lettyho](https://psychtoolbox.discourse.group/u/lettyho)\
**Post date:** [October 29, 2021, 6:53pm UTC](https://psychtoolbox.discourse.group/t/warning-about-broken-audio-timestamping/4088/4 "2021-10-29T18:53:32Z")

</div>

Sorry, actually, using the following is working so far:

```auto
PsychPortAudio('Open', [], [], 3, Fs, 2);

```

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [October 29, 2021, 8:55pm UTC](https://psychtoolbox.discourse.group/t/warning-about-broken-audio-timestamping/4088/5 "2021-10-29T20:55:26Z")

</div>

This time, using your soundcard in shared mode didn’t work because your chosen sampling rate Fs wasn’t supported by your setup. Going for the more agressive exclusive soundcard access on Windows apparently allowed chosing the sampling rate of your choice, while preventing all other running applications from using sound.

So the other solution would have been to use a different Fs sample rate.  
Case closed.

---

<div class="post-metadata">

**Author:** ![lettyho](https://avatars.discourse-cdn.com/v4/letter/l/f08c70/32.png) [@lettyho](https://psychtoolbox.discourse.group/u/lettyho)\
**Post date:** [October 29, 2021, 9:20pm UTC](https://psychtoolbox.discourse.group/t/warning-about-broken-audio-timestamping/4088/6 "2021-10-29T21:20:14Z")

</div>

AHhh… that makes sense. Thank you!
