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:

1. Install a RAM disk
2. 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".
3. Now run sigrok-cli with the desired decoder to analyze the data. Options "-I 
binary" and "-i /ramdisk/capture"
4. 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

Reply via email to