# PsychPortAudio('Start', ...) returns timestamp with large offset

**URL:** <https://psychtoolbox.discourse.group/t/psychportaudio-start-returns-timestamp-with-large-offset/5756>\
**Category:** Bugs & Features\
**Created:** [August 27, 2025, 2:06pm UTC](https://psychtoolbox.discourse.group/t/psychportaudio-start-returns-timestamp-with-large-offset/5756 "2025-08-27T14:06:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![skjerns](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@skjerns](https://psychtoolbox.discourse.group/u/skjerns)\
**Post date:** [August 27, 2025, 2:06pm UTC](https://psychtoolbox.discourse.group/t/psychportaudio-start-returns-timestamp-with-large-offset/5756/1 "2025-08-27T14:06:08Z")

</div>

We’re using a loop to play several audio stimuli with`lastStim = PsychPortAudio('Start', handle, 1, 0, 1);`. However, the first value returned by the function is offset by a very large number, e.g. it has an offset of `lastStim - GetSec = -1126107` which is around 13 days.

All subsequent calls to the function return correct `lastStim` times which are in line with `GetSec` values.

According to ChatGPT, it can happen that the AudioDevice will return the computer boot time on first access and only synchronize on subsequent calls.

Is this behaviour expected? How can we prevent that (it weirdly enough doesnt always happen and only on some machines!)?

---

<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:** [August 28, 2025, 6:45pm UTC](https://psychtoolbox.discourse.group/t/psychportaudio-start-returns-timestamp-with-large-offset/5756/2 "2025-08-28T18:45:42Z")

</div>

What Psychtoolbox version, operating system/version, Matlab/Octave version, sound card etc.?  
Minimal code to demonstrate the issue? Full output of PsychPortAudio in the Matlab/Octave console?

What value is actually returned in `lastStim` in these cases? A value of zero would be returned if

The behaviour is not expected, assuming you did everything else right. But it sounds like some OS or audio device driver bug.
