python-can icon indicating copy to clipboard operation
python-can copied to clipboard

Replay candump: `MessageSync` (python-can) and `canplayer` (can-utils) behave slightly differently

Open yomannnn opened this issue 2 years ago • 2 comments

Hi,

Observation:

Regarding the skip parameter MessageSync (python-can) and canplayer (can-utils) behave slightly differently.

canplayer -s 1 -I candump.log skip gaps in timestamps > 1 second if skip gap is detected the subsequent CAN msg is sent instantly

however

MessageSync(reader,timestamps=True, skip=1) skip gaps in timestamps > 1 second if skip gap is detected the subsequent CAN msg is sent only after 1sec

As a result there is an additional gap of 1sec if I compare both traces.

Expected behavior

canplayer and python-can replay stored canlogs exactly the same

Additional context

I'm not really sure whether this is a bug or a feature. However I decided to share my experience as I spent quite some time to find the root cause of my problem. Many thanks ...

yomannnn avatar Aug 17 '23 16:08 yomannnn

I don't really consider this a bug, since we do not actually promise to imitate the behavior of canplayer. That said, you're welcome to provide a pull request to change this.

zariiii9003 avatar Aug 18 '23 11:08 zariiii9003

I also had to read the issue once again. What is the intention for MessageSync(reader,timestamps=True, skip=1) then ?

If it should be really "skip gaps in timestamps > 1 second" these gaps should be squashed to zero which would lead to an immediate processing of the frame following the gap.

So what would be the benefit to wait for another second before processing the frame after the gap then?

hartkopp avatar Aug 18 '23 16:08 hartkopp