Bug 342 - Decoding issues probably related to apparently incorrect end-sample numbers
Summary: Decoding issues probably related to apparently incorrect end-sample numbers
Status: RESOLVED FIXED
Alias: None
Product: PulseView
Classification: Unclassified
Component: Protocol decoding (show other bugs)
Version: unreleased development snapshot
Hardware: All All
: Normal normal
Target Milestone: PulseView 0.3.0
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-30 20:06 CEST by Uwe Hermann
Modified: 2015-08-21 18:42 CEST (History)
1 user (show)



Attachments
Test patch (1.37 KB, patch)
2014-03-30 20:07 CEST, Uwe Hermann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Uwe Hermann 2014-03-30 20:06:11 CEST
When loading the file rtc_ds1307_200khz.sr from sigrok-dumps in PulseView and running the I2C decoder on it, it'll (apparently correctly, from a quick glance) decode all the data in that file.

However, using the same file with sigrok-cli only seems to decode a very tiny fraction of the file (and incorrectly too):

$ sigrok-cli -i rtc_ds1307_200khz.sr -P i2c:scl=SCL:sda=SDA
Start
0
0
1
0
1
0
1
1
Write
Address write: 6A
NACK
Start repeat

The expected data at the start of the file would be an address write to 0x68 followed by an ACK, accoding to the PulseView run.

sigrok-cli with the attached srd_test.patch:

$ sigrok-cli -i rtc_ds1307_200khz.sr -P i2c:scl=SCL:sda=SDA | grep count
ss=0, es=24576, count=6144

PulseView with the same patch:

$ pulseview rtc_ds1307_200khz.sr | grep count
ss=0, es=24576, count=4096
ss=4096, es=28672, count=4096
ss=8192, es=32768, count=4096
ss=12288, es=36864, count=4096
ss=16384, es=40960, count=4096
ss=20480, es=45056, count=4096

It seems the end-sample numbers are incorrect (?)

For comparison, another file:

$ sigrok-cli -i tv_matsui_0001_button_mute_hold_3x.sr -P ir_nec:ir='IR Toy IRRX' | grep count
ss=0, es=524288, count=524288
ss=524288, es=1048576, count=524288
ss=1048576, es=1572864, count=524288
ss=1572864, es=2097152, count=524288
ss=2097152, es=2621440, count=524288
ss=2621440, es=3145728, count=524288
ss=3145728, es=3670016, count=524288
ss=3670016, es=4194304, count=524288
ss=4194304, es=4718592, count=524288
ss=4718592, es=5242880, count=524288
ss=5242880, es=5767168, count=524288
ss=5767168, es=6291456, count=524288
ss=6291456, es=6815744, count=524288
ss=6815744, es=6942720, count=126976

$ pulseview tv_matsui_0001_button_mute_hold_3x.sr
ss=0, es=6942720, count=4096
ss=4096, es=6946816, count=4096
ss=8192, es=6950912, count=4096
ss=12288, es=6955008, count=4096
ss=16384, es=6959104, count=4096
ss=20480, es=6963200, count=4096
[....]
ss=6930432, es=13873152, count=4096
ss=6934528, es=13877248, count=4096
ss=6938624, es=13881344, count=4096
Comment 1 Uwe Hermann 2014-03-30 20:07:12 CEST
Created attachment 71 [details]
Test patch
Comment 2 Bert Vermeulen 2014-04-15 00:50:40 CEST
What's special about that capture file is that it uses two channels with a unit size of 4. sigrok-cli passes this unit size to libsigrokdecode correctly, but pulseview does not. I've added some debugging to SRD in commit 170d0e246 that clearly shows this: pulseview passes unitsize 1 to SRD.
Comment 3 Uwe Hermann 2015-08-21 18:42:32 CEST
This has been fixed by now. There were two different issues:

The issue of incorrect end sample numbers was fixed in PV in ba5cd8cb80f12445b95cf1050ac0c9a1451e3ce0.

The issue of incorrect unitsize handling for some files/data has been fixed in libsigrokdecode/sigrok-cli/pulseview, see bug #352.