Bug 996 - Allow different packing for logic datafeeds (dense packed channels)
Summary: Allow different packing for logic datafeeds (dense packed channels)
Alias: None
Product: libsigrok
Classification: Unclassified
Component: API (show other bugs)
Version: unreleased development snapshot
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Nobody
Depends on:
Reported: 2017-07-21 21:45 CEST by Stefan Brüns
Modified: 2017-07-21 21:51 CEST (History)
1 user (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Brüns 2017-07-21 21:45:52 CEST
Currently, the logic datafeed format is fixed:

- All channels from a sample stored in a single integer
- A sample value corresponds to a single bit in the integer
- The bit index is determined by the physical channel number

The last point is problematic for three reasons:

- The sample size has to be larger than strictly necessary, e.g. recording the 11th channel requires use of 2 byte sample units, although 1 byte may suffice
- It forces repacking for e.g. Hameg HMO Scopes when only using the second POD (channels 9-16), as data for each POD is returned individually.
- It makes channel repacking for e.g. Saleae Logic (Pro) 16 more difficult - the device datastream omits unused channels, doing the same for the datafeed would allow using of bitshuffling instead of individual handling of each bit.

-> Add a format specifier for logic datafeeds, with for now 2 options:
a) CHANNEL_PACKING_PHYSICAL - e.g. bit 9 refers to physical channel 9
b) CHANNEL_PACKING_DENSE - e.g. bit 9 refers to the 9th enabled channel
Comment 1 Marcus Comstedt 2017-07-21 21:51:35 CEST
I don't quite follow how you would avoid individual bit handling for Logic (Pro) 16.  Even if the output format is dense, you would still need to pick one bit out each of n uint16_t:s to produce one sample of n channels.