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

Incrrect playback time, shifted by 1 row #844

Open
michcior2 opened this issue Sep 12, 2024 · 3 comments
Open

Incrrect playback time, shifted by 1 row #844

michcior2 opened this issue Sep 12, 2024 · 3 comments
Labels

Comments

@michcior2
Copy link

michcior2 commented Sep 12, 2024

When player is playing log file with "Use original frame timing from captured file", it incorrectly uses timestamps. Takes 1 row ahead.
See screenshot. Left is the player, right is just log load. Same CSV file. No meter what is in the file. It is always like that.
Linux, not verified on windows/mac

obraz

@michcior2
Copy link
Author

michcior2 commented Sep 12, 2024

So, it looks like there is also a problem with speed.
Too short time between frames, when there are very short time gaps before frames, the player has more then one frame to play in the one timer trigger event. The frame is then lost and time stamp gets shifted.

So a dirty fix:
In the function void FramePlaybackObject::timerTriggered() disable "while" which suppose to handle this cases, simple "break" fixes but still the last frame from the log is not sent.

//qDebug() << playbackLastTimeStamp; //qDebug() << "El: " << elapsed; while (peekPosition(true) <= playbackLastTimeStamp) { updatePosition(true); break; }

@michcior2
Copy link
Author

Another dirty fix.
The main problem of this bug, seams to get fixed when:
Function:
quint64 FramePlaybackObject::peekPosition(bool forward)
{
int peekCurrentPosition = currentPosition;
if (forward)
{
if (peekCurrentPosition < (currentSeqItem->data.count())){
//peekCurrentPosition++; //still in same file so keep going
}
else //hit the end of the current file
{
return 0xFFFFFFFFFFFFFFFFull;
}
}
else
{
if (peekCurrentPosition > 0) peekCurrentPosition--;
else //hit the beginning of the current sequence
{
return 0xFFFFFFFFFFFFFFFFull;
}
}
CANFrame *thisFrame = &currentSeqItem->data[peekCurrentPosition];
return thisFrame->timeStamp().microSeconds();
}

  1. disable //peekCurrentPosition++; this fixes issue with playbeck time shifted by 1 row
  2. remove "-1" from codition: f (peekCurrentPosition < (currentSeqItem->data.count())) this fixes not sending the last position from the loaded log file.

Obviously, these are dirty fixes and, since I have no idea about overall picture, they need to be wisely re-implemented by the authors.

@collin80
Copy link
Owner

Yes, I've noticed that it seems like it works one off so it's a little bit messed up. Certainly I do need to get that fixed.

@collin80 collin80 added the bug label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants