Hello Arno,
Thanks for describing your solution to that problem.
It would be good if sigrok-cli would use as much RAM as possible to not
require such a workaround.
sigrok-cli has no buffering to speak of and when using the default srzip
output format, passes all incoming data to a zip compressor. As
sigrok-cli isn't multithreaded, incoming data isn't picked up and when
the zip compressor takes too long, there's a buffer overrun in the USB
stack and data is lost, which is when the FX2 stops sending data and
sigrok-cli sees less data than expected.
Ideally, sigrok-cli should be multithreaded (like PV is) to avoid this
issue, but so far no one has been willing to work on making that happen,
unfortunately.
All the best,
-Soeren
On 2020-01-10 06:46, wp1163477-aux wp1163477-aux wrote:
Hi,
maybe it's interesting for some of you: sigrok-cli is sometimes not
able to capture data at a high rate for a long time. I needed to sample
a SPDIF signal with a length of 5 seconds. With some margin, I started
sampling, then after a while I started the audio output which lasted
5s. Altogether I wanted to run the analyzer (a simple 24MHz Saleae
clone) for 10s. With pulseview that's not a problem but I got a message
"Device only sent xxxx samples." when using sigrok-cli. The logic
analyzer should be part of a unit test so that I wanted the whole thing
automatted - and running on a Raspberry Pi 4. Pulseview is not good for
automatisation. In the end I came up with the following approach:
* Install a RAM disk
* Use sigrok-cli to produce binary data instead of the standard format.
Option "-O binary" and let the binary output be on the RAM disk, option
"-o /ramdisk/capture".
* Now run sigrok-cli with the desired decoder to analyze the data.
Options "-I binary" and "-i /ramdisk/capture"
* Remove the captured file before starting at #2 again, because the
inherent deletion of the file during file open seems to slow down the
processor.
I am now able to capture for 10s at 24MHz which is good enough for
SPDIF and produces a 240MByte file. However, I needed to modify the
decoder because it requires a samplerate, which can not be given for a
binary file. But the samplerate is not really used for decoding, it's
just to report the bitrate of the signal which can easily be measured
with other means.
It would be good if sigrok-cli would use as much RAM as possible to not
require such a workaround.
Arno
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel