Closed ghost closed 2 years ago
The error code is 19 from the jls library. It would be nice if this displayed more info than the error code, but looking at jls/ec.h shows that 19 is JLS_ERROR_BUSY. Looking at threaded_writer.c, this only happens when the file writing cannot keep up with the incoming data rate.
What storage media are you writing to? If it's an SD card, what is the speed rating? It needs to support at least 10 MB/s write, sustained.
Thanks for your quick reply !
I tried both on the Class 10 SD card where the OS is installed and on a USB key formatted in FAT32 plugged on one of the USB3 ports.
Maybe lowering the sampling rate would work ? I'll try it tomorrow.
I have not tried writing to SD cards. I also forgot that JLS v2 requires approximately 16 MB/s (60 GB/hr) at full rate. You do need to ensure you have a large enough storage device. Any storage device that can record 4k video should be able to handle full-rate Joulescope data.
Reducing the sampling rate should definitely help. Let me know what you find!
By measuring using dd
, I get a 66MB/s writing speed on my USB key and it has a 64GB capacity.
For sampling frequencies >= 200kHz I get stream_buffer is behind
warnings every seconds + consistently get the JLS_ERROR_BUSY
error
For sampling frequencies >= 100kHz I only get stream_buffer is behind
warnings every seconds
For lower sampling requencies, I only get the stream_buffer is behind
warning when the JlsWriter is being closed.
Maybe it is related to the Python interpreter IO performances rather than the file system ?
Well, the JLS v2 file format is all native, high-performance C code:
https://github.com/jetperch/jls
That said, the format is definitely optimized for read, not write. The format does require rewriting some headers, and we rely on the OS & filesystem to buffer. I am not familiar with optimizing USB flash drive performance under Linux, but you could possibly investigate RAM filesystem buffering options.
Flash drives are also weird in that they can have significant delays while reclaiming old storage. You could consider an external USB HDD or SSD.
May something here will help:
I will take a look thanks ! For my use case, I will probably just use a low sampling frequency (probably 20kHz) to reduce the amount of data stored anyway.
Sounds good! I will close this issue, but please feel free to open it if you want more assistance.
Hi !
I'm currently working on a script to monitor and store Joulescope data over a long period using a Raspberry Pi. I tested my script on Windows and it works without any issue, but on RPi, after a few minutes I get this exception:
My script looks like this (irrelevant part omitted):
I also tried using a DataRecorder instead of a JlsWriter, but I got a similar issue.
Here are more information about my environment: