-
Notifications
You must be signed in to change notification settings - Fork 1
Add AuxiliaryIO device #83
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
Conversation
- Introduced AuxiliaryIO class to encapsulate both AnalogIO and DigitalIO devices. - Modified DigitalIO to configure sample period based on AnalogIO's sample rate. - Implemented AuxiliaryIOInterface for UI management of both devices. - Refactored OnixSource to initialize AuxiliaryIO instead of individual AnalogIO and DigitalIO. - Adjusted UI components for proper layout and interaction with the new AuxiliaryIO. - Cleaned up unused code and improved overall structure for better maintainability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Behavior looks good with the following notes.
-
The event channels should be mapped to the digital inputs instead of the buttons and first two digital inputs. Its unfortunate but I think its just too random to have this mixture of sources in the event channel selections. I guess we could push the GUI team to make the number of channels actually match the number of digital signals that are coming into an LFP viewer. Or have the option to plot them like a normal LFP channel.
-
We found a huge performance issue while testing on Jon's machine. The CPU usage on two cores is at 100% during acquisition. These cores seem to correspond to those used for plotting the Neuropixels probe configuration outside of acquisition, during which their usage is high to begin with (over 50%). This is a separate issue but needs to be addressed.
A couple of comments looking at the code:
Locks should be used sparsely and with care, as a big lock blocks other threads, and can have a big negative impact in overall performance.
Regarding the bit order for events that @jonnew comments, that is an issue only for visualization on the LFP, right? when saving to disk all TTLs should be accounted for. I agree on both remarks, it should be the inputs and we should push towards the LFP supporting more than 8 lines somehow. |
@aacuevas the reason for the locks is a lack of understanding on my part. I didn't realize that passing the For the bitmasks, that is easy to fix, and makes more sense as well. Thanks for the nitpick! Regarding the events, yes this is only an issue for visualization. Currently I believe that up to 256 TTL bits can be saved per event channel, so we can easily record everything. The visualization only goes up to the first 8 TTL lines, which means we need to make a choice on which 8 to show. I agree that the 8 lines shown should be the digital inputs, however I will state that when we do this, if there is nothing connected to the digital inputs all 8 lines will be pulled high by default, which will greatly clutter the viewer unless the user toggles off all 8 channels. |
- Map digital inputs to TTL channels 0-7 - Map buttons to TTL channels 8-13
- Remove excess GenericScopedLock calls, these are handled internally by the Array - Remove extra calls to port controllers to process frames - Stop acquiring data before clearing individual device arrays to prevent any data being added after clearing the arrays
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Get rid of enable button on Digital Input because its tied to analog input now
- Combined the top level heading in the configuration to Analog & Digital IO
- Change the order of tabs so Aux IO is first and Clock out is last
- AuxiliaryIO is first, and Output Clock is last now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested. Used Analog and digital IO disable and it got rid of stream from lfp viewer. Looks good!
This PR combines the
AnalogIO
andDigitalIO
devices into one composite device (AuxiliaryIO
). This includes adding a new UI tab that inherits the respective UIs from both devices.With these updates, the
DigitalIO
device is now polled at 25 kHz, the same as the sample rate that theAnalogIO
is downsampled to in this plugin. To ensure that events are recorded at the correct timestamps, theAuxiliaryIO
device waits for frames from both devices and then processes the frames simultaneously so that the events fromDigitalIO
are correctly recorded in theAnalogIO
event channel.