Git Product home page Git Product logo

Comments (10)

kowalej avatar kowalej commented on July 17, 2024 1

Hey I just uncovered this bug myself, the problem is that the calls to pull_sample and pull_chunk_multiplexed do not provide a timeout parameter, therefore they go by the LSL default which is "FOREVER". Therefore the typed_transfer_loop never checks or re-checks the shutdown flag, so the thread doesn't finish properly. Obviously if you actually have data for the inlet to pull, the code won't hang on the pull calls, but for a "dead" stream, it just keeps waiting.

recording.cpp typed_transfer_loop
first_timestamp = last_timestamp = in->pull_sample(chunk);
		timestamps.push_back(first_timestamp);
		file_.write_data_chunk(streamid, timestamps, chunk, in->get_channel_count());

		auto next_pull = Clock::now();
		while (!shutdown_) {
			// get a chunk from the stream
			in->pull_chunk_multiplexed(chunk, &timestamps);
			// for each sample...
			for (double &ts : timestamps) {
// if the time stamp can be deduced from the previous one...

from app-labrecorder.

tstenner avatar tstenner commented on July 17, 2024

Definitely a bug, I was already looking into something related to this but a stream without data is a lot easier to reproduce.

from app-labrecorder.

tstenner avatar tstenner commented on July 17, 2024

Thanks @kowalej, that's exactly what I was looking for. I've commited a fix in fded925 and will upload binaries for that soon

from app-labrecorder.

kowalej avatar kowalej commented on July 17, 2024

@tstenner I just finished doing a PR for the console message stuff and noticed that your commit fded925 has a potential bug.

//recording.cpp Line 377
while(first_timestamp == 0.0)
	first_timestamp = last_timestamp = in->pull_sample(chunk, 4.0); 

Since you are in a while loop and pull_sample keeps returning 0.0, you will get stuck in this loop during shutdown since you don't also check the shutdown state.

It should be:

while (!shutdown_ && first_timestamp == 0.0)
	first_timestamp = last_timestamp = in->pull_sample(chunk, 4.0); 

from app-labrecorder.

tstenner avatar tstenner commented on July 17, 2024

You're right, I fixed it.

from app-labrecorder.

cboulay avatar cboulay commented on July 17, 2024

We're still getting this bug.
Also the status bar kb-written seems to be broken.

from app-labrecorder.

xbbsky avatar xbbsky commented on July 17, 2024

@cboulay I've fixed the status bar kb-written bug:

//mainwindow.cpp line 91 should be
auto fileinfo = QFileInfo(ui->rootEdit->text()+QDir::separator()+recFilename);

from app-labrecorder.

cboulay avatar cboulay commented on July 17, 2024

@xbbsky That didn't do much for me because it turns out that the file size wasn't incrementing. When I reduced the timeout parameter then everything seemed to fall in place. Thanks for your comment on that commit.

from app-labrecorder.

cboulay avatar cboulay commented on July 17, 2024

Maybe there's still some discussion to be had as to what the timeout parameter should be, but the bug as described in this issue is fixed.

from app-labrecorder.

kowalej avatar kowalej commented on July 17, 2024

I also experienced this issue again recently and setting a low value for timeout definitely fixed it. However, I don't really understand why it fixed the issue since the timeout was only a few seconds previously. Also, I may just be crazy but I remember the previous fix (with checking the shutdown parameter) as having resolved this issue for me before the holiday. Now it's a few weeks later and my recent tests weren't shutting down properly. It's like this issue cropped up again out of the blue.

from app-labrecorder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.