Bug 1337 - inaccurate timing of annotations, robustness could get improved
Summary: inaccurate timing of annotations, robustness could get improved
Status: CONFIRMED
Alias: None
Product: libsigrokdecode
Classification: Unclassified
Component: PD: uart (show other bugs)
Version: unreleased development snapshot
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-01 15:51 CET by Gerhard Sittig
Modified: 2022-04-20 08:17 CEST (History)
0 users



Attachments
UART PD output, overlapping frames (42.82 KB, image/png)
2018-12-01 15:51 CET, Gerhard Sittig
Details
improved robustness for invalid input streams (47.16 KB, image/png)
2018-12-01 16:08 CET, Gerhard Sittig
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gerhard Sittig 2018-12-01 15:51:37 CET
Created attachment 496 [details]
UART PD output, overlapping frames

The UART protocol decoder is usable for correct input streams.  A minor nit 
that kept bothering me is the inaccurate ss/es calculation which results in 
overlapping annotations and slightly ambiguous decoder output (there are 
periods of time which claim that two bits of a UART frame would be active 
at the same time).  This is assumed to be due to floating point rounding of 
fractional sample counts, and partly due to redundant (re-)calculations of 
sample positions.

Another issue is that robustness of the decoder for unexpected or incorrect 
input streams could get improved:
- The START of new UART frames "gets detected" in the middle of a previous 
  frame's STOP bit time.
- Subsequent START bits get detected and overlap when input data jitters or 
  the input stream's bit rate does not match the current setting.
- One might consider adding an "oversampling" option, which on one hand could 
  result in different output than the current implementation for unclean input, 
  but also could result in more reliable data extraction for the same kind of 
  unclean input (users should decide which they prefer, hiding issues or 
  highlighting them).
- Code paths in the current implementation can skip data extraction and their 
  presentation when error paths abort inspection before that step.  Users may 
  prefer to always see extracted data, and have it amended with error markers 
  where appropriate.
- Parity error annotations carry fixed and potentially wrong data values.
Comment 1 Gerhard Sittig 2018-12-01 16:08:14 CET
Created attachment 497 [details]
improved robustness for invalid input streams

This screenshot demonstrates what the decoder output could look like for 
invalid input data.  The implementation is WorkInProgress(TM), and shall 
become publicly available soon.
Comment 2 Gerhard Sittig 2022-04-20 08:17:01 CEST
This bug 1337 report unfortunately mixes the issues of annotation positions 
and robustness in the presence of invalid input. See also bug 1634 which is 
specific to the imprecise position of annotations. It also appears that 
upper layer decoders see different ss/es values than what is used in the 
lower layer UART decoder. So that annotations don't align across layers.