Uneven delay between digital input and sound start #213
Replies: 1 comment
-
|
As a follow-up, it seems that the way I am doing currently does not allow the possibility of having precise sound stimulation. The delay is introduced by triggering the sound from Bonsai (reading a TTL in breakout board digital inputs --> trigger a different sound index according the digital IN Pin activated), and therefore the more you ask Bonsai to do in parallel (acquiring ephys data or a video), the higher will be the jitter. A way of fixing this would be to connect directly the Pico2 to the SoundCard but: 1) the sound card has only 3 digital input ports, limiting the number of sound that can be played; 2) as highlighted here: https://github.com/orgs/harp-tech/discussions/199, I have not been able to use digital inputs 1 and 2. Best, Baptiste |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi HARP community,
I am running a task on Bonsai to trigger sounds using the HARP sound card and amplifier.

Sounds are triggered by sending digital signals from a Pico2 to the ONIX Breakout board and the sound played depends on which digital input port has been activated.
Because I was expecting a delay between the moment at which the Breakout receives the digital signal, and the moment at which the sound card actually plays the sound, I connected the OUT0 port of the sound card to another digital input port of the breakout.
Therefore, for every sounds played by the sound card, I have (i) the digital input received by the breakout from the pico2 and (ii) the actual sound at which the sound card sent the sound.
I was expecting the delay between these 2 digital inputs to be more or less constant across trials, but I noticed it is not, as you can see on the following plot:
The timing difference can be up to ~130ms which is annoying since my sound stimulation goes at 5Hz and that the rhythmicity of my sound stimulation is pretty important.
I am attaching the Bonsai script, in case this is helpful.
[
Bonsai_script_with_sound_stimulation_V5.zip
](url)
Thank you in advance,
Baptiste
Beta Was this translation helpful? Give feedback.
All reactions