Created attachment 306 [details] notes and test data for raw_analog input David C. Wiens reported to the ML (2017-05-25) that the raw_analog input yields unexpected waveforms in Pulseview ("mix of mostly sawtooth and vertical lines"). Reproduction shows that sigrok-cli does not present expected values either, the libsigrok input module appears to lose precision which might be an issue in addition to the waveform display in the GUI. See the attachment for (how to generate) test input data, how to invoke the CLI tool for reproduction, and how to potentially adjust the input module's source. Haven't looked into the GUI waveform presentation and whether it deserves a separate report for the Pulseview component.
Fixed on this branch: https://github.com/martinling/libsigrok/commits/analog-fixes The key issue was that raw_analog was setting the 'digits' field of sr_analog_encoding to zero, meaning that the values after the decimal point were not significant. The analog output module also needed fixing, because it didn't know how to select a sufficient number of decimal digits to display a given number of binary ones. Finally, sr_analog_si_prefix_friendly() had a bug too, which is why you were getting SI prefixes in the output for unitless data. Output is now as expected: CH1: 0.000 CH2: 0.125 CH1: 0.250 CH2: 0.375 CH1: 0.500 CH2: 0.625 CH1: 0.750 CH2: 0.875 CH1: -1.000 CH2: -0.875 CH1: -0.750 CH2: -0.625 CH1: -0.500 CH2: -0.375 CH1: -0.250 CH2: -0.125
Thanks a lot! Fixed in: 5e5fde6e2c3aabfc61bcd35a53ab0d401b2176ba cd1e7fd20dde8475ab766425c352f8ad4247747c 56bcbbffd059b0049e530481e2842a5ac48fd447 (hashes changed as I mentioned the bug number in the commit msg)