Bug 749 - Last sample not decoded?
Summary: Last sample not decoded?
Status: RESOLVED DUPLICATE of bug 292
Alias: None
Product: PulseView
Classification: Unclassified
Component: Protocol decoding (show other bugs)
Version: unreleased development snapshot
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-07 13:20 CET by Soeren Apel
Modified: 2017-10-16 08:12 CEST (History)
2 users (show)



Attachments
Error case (51.14 KB, image/png)
2016-02-07 13:20 CET, Soeren Apel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Soeren Apel 2016-02-07 13:20:31 CET
Created attachment 227 [details]
Error case

When using demo to create 100 samples it becomes clear that the last state change doesn't create an annotation when it should (see screenshot). Not sure whether this is a PV or libsigrokdecode issue but it needs fixing either way.
Comment 1 Uwe Hermann 2016-02-07 16:30:50 CET
I think this is a generic issue with the way decoders are written, there's a similar bug open for the parallel PD.

The PD needs to know the start/end samplenumbers to be able to emit annotations. For many PDs the end sample number of an annotation is an edge on some pin, so annotations usually go from edge X to edge X+1 or such.

The PD cannot know how long the stream from the LA/file will be (live), so it has to wait until edge X+1 appears in the data to be able to emit the last annotation (from edge X to edge X+1). In the example above there is no such edge though, the file/stream just ends and the PD doesn't know about that. As far as the PD is concerned another packet with more logic data could come in at any time.

So the "last annotation doesn't appear" issue is not easily fixable. The only way to do that would be to have some kind of "stream ends now" notification for srd/PV/PDs, but even then the PD would have to make an assumption of whether the sample *after* the last sample it has seen (high/low state of all pins), in order to be able to decide whether or not it has to emit a specific annotation still.
Comment 2 Gerhard Sittig 2017-06-24 20:04:59 CEST
is this a duplicate of bug 292, which is specifically reported for 'parallel'?
Comment 3 Soeren Apel 2017-10-16 08:12:03 CEST

*** This bug has been marked as a duplicate of bug 292 ***