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

Increasing software buffer size results in seg-fault #198

Closed
jthermiz opened this issue Feb 20, 2018 · 5 comments
Closed

Increasing software buffer size results in seg-fault #198

jthermiz opened this issue Feb 20, 2018 · 5 comments

Comments

@jthermiz
Copy link
Contributor

The default software buffer size is 1024 samples. Users can change the software buffer size by clicking on the latency (default is "23ms"). When I try to increase the buffer size to say 2048 samples, open-ephys seg faults. My data source is "file reader". Interestingly, OE doesn't crash when I decrease the buffer size.

I thought that the recent commit titled "Fix destination channel of copying to temp buffer" might have fixed the issue. I implemented the change from this commit to my forked version of OE and it still crashes.

Also, I tried increasing the default buffer size to 1024 by changing line 185 in Audio Node.cpp

filters.add(new Dsp::SmoothedFilterDesign<Dsp::RBJ::Design::LowPass, 1> (1024*2))

but it does not appear to have had an affect on the buffer size.

@jsiegle
Copy link
Member

jsiegle commented Feb 22, 2018

Are you using the File Reader, by chance? For that source node, it seems like the problem is resulting in the hard-coded BUFFER_SIZE constant on line 34 of FileReader.h. If I increase that to 2048, I can bump the audio buffer size up to 2048 without any problems. Higher than that, and it crashes again. Obviously that's just a temporary fix...we need to figure out a way for the FileReader to update its buffer size depending on the audio buffer.

Also, the buffer size is set in the Audio Component (which interfaces with audio hardware), not the Audio Node (which outputs data for audio monitoring). You can change it in line 85 of AudioComponent.cpp, but that didn't fix the problem.

@jthermiz
Copy link
Contributor Author

Ahhh I see. Thanks a lot for the help!

@ethanbb
Copy link
Contributor

ethanbb commented Oct 8, 2018

Is this fixed now? There were some changes to fix issue #217 that I think got rid of that 1024 constant.

@jsiegle
Copy link
Member

jsiegle commented Dec 16, 2020

This bug is still present, if you change the buffer size while acquisition is active. We need to disable the settings interface during acquisition.

@anjaldoshi
Copy link
Member

anjaldoshi commented Dec 18, 2020

Original bug was already fixed by Aarón in commit 5a07d90, but as mentioned by Josh, changing buffer size while acquisition is active results in a crash. Fixed in #396.

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

4 participants