Bonsai for ephys audio monitor

146 views
Skip to first unread message

Jonathan Newman

unread,
Jul 18, 2018, 4:24:21 PM7/18/18
to Bonsai Users
I'm using bonsai to collect ephys data. I would like to listen to channels on my headphones. Right now I'm using ConvertScale to scale the ephys data and SelectChannels to pull a specificied channel out. I then pass this to AudioPlayback. It makes noise, but its super jumpy and seems to skip. If I put a pure tone test signal into my headstage, I will hear it but its bliping sporadically. I guess this is because the audio card needs to produce samples continuously and propagation of data through the graph is not synchronized to this. This means that there will be times when the audio card needs to produce sound but there is no data to make it. Does that sound right? Is there sometime of FIFO element that could be used to ensure data is ready for the sound card?

Gonçalo Lopes

unread,
Jul 18, 2018, 6:35:24 PM7/18/18
to Jonathan Newman, Bonsai Users
That is strange, we used it exactly like that in the past and it worked fine. Have you set the playback Frequency property to match the Ephys sampling rate? This is important to make sure the sound card is consuming and playing back the data at real-time rates.

Another possibility is that the ephys packets may be too small and you're getting it by request latency. To test for this you could use Buffer to temporarily chunk the data into bigger buffers for playback. Depending on whether any of this works, I'm sure we'll figure out a workaround.

On 18 July 2018 at 21:24, Jonathan Newman <jonathan...@gmail.com> wrote:
I'm using bonsai to collect ephys data. I would like to listen to channels on my headphones. Right now I'm using ConvertScale to scale the ephys data and SelectChannels to pull a specificied channel out. I then pass this to AudioPlayback. It makes noise, but its super jumpy and seems to skip. If I put a pure tone test signal into my headstage, I will hear it but its bliping sporadically. I guess this is because the audio card needs to produce samples continuously and propagation of data through the graph is not synchronized to this. This means that there will be times when the audio card needs to produce sound but there is no data to make it. Does that sound right? Is there sometime of FIFO element that could be used to ensure data is ready for the sound card?

--
You received this message because you are subscribed to the Google Groups "Bonsai Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bonsai-users+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/bonsai-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/bonsai-users/46a28a12-8567-44c4-9f67-3805bbc4ff2a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jonathan Newman

unread,
Jul 18, 2018, 6:45:03 PM7/18/18
to Bonsai Users
Yeap, that was it. I played with the frequency until the blips turned into a solid tone. I was aware of this parameter before -- it turns out this helped me discover a bug in my hardware: its not producing data at the rate I thought it was!


On Wednesday, July 18, 2018 at 6:35:24 PM UTC-4, goncaloclopes wrote:
That is strange, we used it exactly like that in the past and it worked fine. Have you set the playback Frequency property to match the Ephys sampling rate? This is important to make sure the sound card is consuming and playing back the data at real-time rates.

Another possibility is that the ephys packets may be too small and you're getting it by request latency. To test for this you could use Buffer to temporarily chunk the data into bigger buffers for playback. Depending on whether any of this works, I'm sure we'll figure out a workaround.
On 18 July 2018 at 21:24, Jonathan Newman <jonathan...@gmail.com> wrote:
I'm using bonsai to collect ephys data. I would like to listen to channels on my headphones. Right now I'm using ConvertScale to scale the ephys data and SelectChannels to pull a specificied channel out. I then pass this to AudioPlayback. It makes noise, but its super jumpy and seems to skip. If I put a pure tone test signal into my headstage, I will hear it but its bliping sporadically. I guess this is because the audio card needs to produce samples continuously and propagation of data through the graph is not synchronized to this. This means that there will be times when the audio card needs to produce sound but there is no data to make it. Does that sound right? Is there sometime of FIFO element that could be used to ensure data is ready for the sound card?

--
You received this message because you are subscribed to the Google Groups "Bonsai Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bonsai-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages