Bug 1566 - srzip input sends all data for one channel before any data for another channel
Summary: srzip input sends all data for one channel before any data for another channel
Status: CONFIRMED
Alias: None
Product: libsigrok
Classification: Unclassified
Component: Other (show other bugs)
Version: unreleased development snapshot
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-28 21:42 CEST by Gerhard Sittig
Modified: 2020-06-28 21:42 CEST (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gerhard Sittig 2020-06-28 21:42:34 CEST
The current implementation of the session_driver.c code appears to read 
srzip input strictly by channel, providing all data for an individual 
channel before any data for another channel is sent. Which is fine for 
display or dump purposes, but may cause trouble for output modules like 
VCD and CSV which need to defer the output of sample data for a sample 
number until all data for that time was seen. Which translates to: must 
store _all_ data that happens to be in the srzip input file during the 
"merge sort" of the channels' samples.

This is not a blocker with the current mainline implementation. But will 
become a limiting element when mixed signal support for VCD gets added, or 
when CSV output gets fixed to handle analog data or mixed signal input.

Here is debug output from a development version to illustrate the situation:

$ sigrok-cli -i m2m-1.sr -O vcd -o m2m-2.vcd
sr: output/vcd: STATS: rcvd logic, snum 0, count 2000000
sr: output/vcd: STATS: rcvd analog A0, snum 0, count 1048560
sr: output/vcd: STATS: rcvd analog A0, snum 1048560, count 951440
sr: output/vcd: STATS: rcvd analog A1, snum 0, count 1048560
sr: output/vcd: STATS: rcvd analog A1, snum 1048560, count 951440
sr: output/vcd: STATS: rcvd analog A2, snum 0, count 1048560
sr: output/vcd: STATS: rcvd analog A2, snum 1048560, count 951440
sr: output/vcd: STATS: rcvd analog A3, snum 0, count 1048560
sr: output/vcd: STATS: rcvd analog A3, snum 1048560, count 951440
sr: output/vcd: STATS: rcvd analog A4, snum 0, count 1048560
sr: output/vcd: STATS: dumped, count 1048560, upto 1048560
sr: output/vcd: STATS: rcvd analog A4, snum 1048560, count 951440
sr: output/vcd: STATS: dumped, count 951440, upto 2000000
sr: output/vcd: STATS: rcvd df end
sr: output/vcd: STATS: dumped, count 1, upto 2000001