How to read the sdtest histogram

Looks like some cool info, but what does it represent?

I get the feeling the serial monitor isn’t doing the graphical layout any justice.

23:45:32.910 ->                                                                                                    .
23:45:32.910 ->                                                                                                    :
23:45:32.910 ->                                                                                                    :
23:45:32.910 ->                                                                                                    :
23:45:32.910 ->                                                                                                    :
23:45:32.910 ->                                                                                                    :
23:45:32.910 ->                                                                                                    :
23:45:32.910 ->                                                                                                    :
23:45:32.910 ->                                                                                                    :
23:45:32.910 ->                                                                                                    :
23:45:32.910 ->                                                                                                    :
23:45:32.910 -> x100us              1                   2                   3                   4                   5
23:45:32.910 -> 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
23:45:32.910 -> Time to read blocks: Average speed: 954.71 kb/s, 10.82 simultaneous audio streams.
23:45:32.910 ->           .                                                                                         
23:45:32.910 ->           :                                                                                         
23:45:32.910 ->           :                                                                                         
23:45:32.910 ->           :                                                                                         
23:45:32.910 ->           :                                                                                         
23:45:32.910 ->           :                                                                                         
23:45:32.910 ->           :                                                                                         
23:45:32.910 ->           :                                                                                         
23:45:32.910 ->           :                                                                                         
23:45:32.910 ->           :                                                                                         
23:45:32.910 ->         ..:....     .     ..                                                                        
23:45:32.910 -> x100us              1                   2                   3                   4                   5
23:45:32.910 -> 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
23:45:32.910 -> Battery voltage: 4.04
23:45:32.910 -> Unmounting SD Card.

Here’s what it means: slow

Seriously though, these are normalized histograms. You could think of it as a very large connect-4 game; 22 rows x 101 rows. Each row corresponds, to a 50-microsecond range of values. Every time we measure something, we throw a token into the corresponding row.

In the first histogram, the “measure something” is each time we open a file.
In the second histogram, the “measure something” is reading a block (512 bytes).

The first histogram is not very interesting, because everything is in the last bucket, which just means that it’s too large to show well.

The second histogram is more interesting. That shows that in almost all cases, reading a block took 500us. In a few instances it’s a little more or a little less. In some cases it’s 1000us, which is normal, because every now and then the filesystem code has to read two blocks to return 512 bytes of data.

In a small number of cases, it takes 1300 or 1350 us to read 512 bytes, which may be an indication of a problem.

I created this because the average isn’t all that helpful. An SD card can have a good speed on average, yet take a very long time to read some blocks, which would cause audio underflows when reading those blocks.

1 Like

Understood. Great, thanks for the explanation.