sccn / lsl_archived

Multi-modal time-synched data transmission over local network
242 stars 134 forks source link

Add configuration parameter for consumer_queue::pop_sample sleep time #294

Closed tstenner closed 5 years ago

tstenner commented 6 years ago

At the moment, consumer_queue::pop_sample tries to retrieve a sample from the buffer every millisecond, which is too much for apps that should not tax the system too much and don't need the samples as soon as they come in (especially LabRecorder).

Adding a configuration parameter (queue_sleep_time) that sets the desired sleep time wouldn't change anything about the current behaviour, be backwards compatible and cause no changes to ABI and API.

dmedine commented 6 years ago

I've actually never experienced any slowdown from LabRecorder. Some of the data acquisition servers (e.g. BioSemi.exe) eat a lot of CPU because they grab device data in a tight loop. A sleep call and real time priority (high priority on Windows) should be added there.

On 05/03/2018 12:58 PM, Tristan Stenner wrote:

At the moment, |consumer_queue::pop_sample| tries to retrieve a sample from the buffer every millisecond, which is too much for apps that should not tax the system too much and don't need the samples as soon as they come in (especially LabRecorder).

Adding a configuration parameter (|queue_sleep_time|) that sets the desired sleep time wouldn't change anything about the current behaviour, be backwards compatible and cause no changes to ABI and API.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sccn/labstreaminglayer/issues/294, or mute the thread https://github.com/notifications/unsubscribe-auth/ADch7paBXDDh9EIzM5R4kZx4HuML_agbks5tuuLAgaJpZM4Tw3-o.

tstenner commented 6 years ago

I've had LabRecorder almost fully utilizing one core on a slightly older i5 with 4 streams (~5MB/s in total), with the acquisition servers using 5-10% each, but that's a different problem. I'll try to collect some more data to illustrate the problem.

dmedine commented 6 years ago

Are you doing this in Linux?

On 05/04/2018 12:01 PM, Tristan Stenner wrote:

I've had LabRecorder almost fully utilizing one core on a slightly older i5 with 4 streams (~5MB/s in total), with the acquisition servers using 5-10% each, but that's a different problem. I'll try to collect some more data to illustrate the problem.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sccn/labstreaminglayer/issues/294#issuecomment-386556318, or mute the thread https://github.com/notifications/unsubscribe-auth/ADch7oQHbSqQjB5dos4Qz6Ff7CyfZE0Bks5tvCbegaJpZM4Tw3-o.

tstenner commented 6 years ago

That was on Windows 7, back in August

dmedine commented 6 years ago

Hmmm. Like I said, I've never experienced anything like this before and we used to do massive data collection on Windows 7 back at SCCN. I look forward to seeing more!

On 05/04/2018 01:13 PM, Tristan Stenner wrote:

That was on Windows 7, back in August

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sccn/labstreaminglayer/issues/294#issuecomment-386570354, or mute the thread https://github.com/notifications/unsubscribe-auth/ADch7oHn_qPel-7ZCK1poe3lyeXHgW3Sks5tvDfggaJpZM4Tw3-o.