Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

stream_outlet's chunk_size argument has been ignored since 1.16.0

Open Beginner friendly
#327 0 comments 0 reactions 0 assignees View on GitHub

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

bug

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sccn/liblsl

All issues in sccn/liblsl

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.