stream_outlet's chunk_size argument has been ignored since 1.16.0
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cpp
- Domain
- networking
Research direction
The bug is in the constructor initializer list of src/stream_outlet_impl.cpp, where chunk_size_ is set from info.calc_transport_buf_samples(...) and then passed to tcp_server. Add a separate member for the send buffer capacity, and pass the constructor's chunk_size argument to tcp_server instead. Done when a test that pushes with pushthrough=false shows the inlet receiving samples after chunk_size pushes.
Written by the indexing model from the issue text.
Description
Problem. Since 0b35dba3 (first in v1.16.0, "Add support for more precision on buffer lengths"), stream_outlet_impl's constructor ignores its chunk_size parameter:
// src/stream_outlet_impl.cpp
chunk_size_(info.calc_transport_buf_samples(requested_bufsize, flags)), // buffer size in samples
send_buffer_(std::make_shared<send_buffer>(chunk_size_)),
...
tcp_server_ = std::make_shared<tcp_server>(..., chunk_size_, ...); // used as the chunk size
chunk_size_ now holds the buffer size in samples (e.g. 360 s × rate), and that value is passed to tcp_server as the chunk size. Before 0b35dba3 it was chunk_size_(chunk_size).
Effect. The chunk_size given to lsl_create_outlet / stream_outlet(info, chunk_size, ...) has no effect. With the inlet's max_chunklen at 0, samples pushed with pushthrough=false are only sent when a later push uses pushthrough or the (huge) "chunk" fills, instead of every chunk_size samples. Most code is unaffected because push_sample defaults to pushthrough=true.
Fix. Keep a separate member for the buffer size (send buffer capacity) and pass the constructor's chunk_size to tcp_server. Add a test that pushes with pushthrough=false and a chunk size, and checks the inlet receives samples after chunk_size pushes.
- Dominant language
- C++
- Stars
- 179
- Forks
- 90
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 27
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sccn/liblsl
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 Half a day Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
FriendsofECCE/ECCE#336 · 1 comment ·
-
Real literal with a 'd' exponent and a kind suffix (1.0d0_4) is accepted; the suffix is ignoredOpenerror not reported low priority semantics
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
bitcoin-core/gui-qml#1030 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day