Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TTLs not faithfully recorded on linux version #506

Closed
fmarbach opened this issue Mar 8, 2022 · 9 comments
Closed

TTLs not faithfully recorded on linux version #506

fmarbach opened this issue Mar 8, 2022 · 9 comments

Comments

@fmarbach
Copy link

fmarbach commented Mar 8, 2022

I am saving frame TTLs from 4 cameras to the digital input of the open ephys board.
Summary of problem: A single camera works, 2 cameras sort of, 3-4 cameras tend to show frequent gaps across all digital inputs (see plot titled "Timestamps of all channels"). A function generator records very faithfully alone (100hz square wave), but when acquired together with 2 cameras shows gaps as well. In the GUI, TTLs display fine, without gaps. The only thing that helped was switching to a windows machine.
Details:

  • Ubuntu 20.04.4 LTS
  • Open ephys gui v0.5.5.3
  • Data is saved in binary, loaded using the open-ephys/open-ephys-python-tools
  • This did not help: Updating ubuntu, open ephys gui, switching computer, recording to analog input
    image
    image
@jsiegle
Copy link
Member

jsiegle commented Mar 8, 2022

Thanks for the detailed report...we will try to replicate this on our end and will get back to you.

@jsiegle
Copy link
Member

jsiegle commented Mar 10, 2022

Hi @fmarbach, I ran the following test on my Ubuntu machine:

  • Digital inputs 1-4 connected to output channels 1-4 of a Pulse Pal
  • Pulse Pal configured to output 100 Hz, 83 Hz, 66 Hz, and 60 Hz pulses, with 1 ms pulse widths
  • 128 channels of simultaneous headstage data

I had the same observation as you -- there were no gaps in the events displayed in the LFP Viewer, but when I looked at the event data that was written, there were gaps of up to 3 seconds. This was true for both the Binary Format and the Open Ephys Format, so it's not a format-specific problem.

To find the source of the issue, I programmed the File Reader to generate artificial events. Once I reached around 1500 events per buffer (regardless of whether they came from a single channel or multiple channels), the data file no longer contained all of the events.

I was able to fix the problem by increasing the size of the event queue (which passes events from the Record Node to the write thread). This was originally set at 512, which should be able to handle a theoretical event rate of 22 kHz for a 23 ms buffer size. However, it appears that on Linux the event queue is not emptied smoothly, which can lead to overflows, and causing the behavior we both observed.

After changing the event queue size to 10,000 (theoretical event rate of 434 kHz), I performed the same test. This time, there were no dropped events at all in an 8-minute recording.

We will put out a patch release ASAP with this fix. We really appreciate your help with this!

@fmarbach
Copy link
Author

fmarbach commented Mar 10, 2022 via email

@jsiegle
Copy link
Member

jsiegle commented Mar 11, 2022

Here are the test binaries for the patch release: https://openephysgui.jfrog.io/artifactory/Test/linux/open-ephys-v0.5.5.4-linux-beta.zip

Can you try out this version and let us know if it solves the problem?

@fmarbach
Copy link
Author

fmarbach commented Mar 11, 2022 via email

@fmarbach
Copy link
Author

fmarbach commented Mar 16, 2022 via email

@fmarbach
Copy link
Author

fmarbach commented Mar 25, 2022 via email

@jsiegle
Copy link
Member

jsiegle commented Mar 25, 2022

That's great, thanks for testing!

@anjaldoshi anjaldoshi transferred this issue from open-ephys/GUI Apr 25, 2022
@anjaldoshi
Copy link
Member

Closing as it is fixed in v0.5.5.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants