Good SD test (h2testw) not always the full story

Doc_d

New Member
Joined
Jan 6, 2020
Messages
20
Reaction score
11
Location
Michigan
Country
United States
I installed a Viofo Pro Duo in my truck and my Wife's Jeep recently. I bought two Samsung 256GB Evo Select SD cards. The camera in my truck has been working perfectly. The camera in my Wife's jeep has will randomly start beeping in odd patterns. Then it'll work for a while. I tried reformatting the card, resetting the camera, etc. It would work for a while then act up again. When I look at the files there are quite a few that don't contain the right amount of data / length of video. And there is a gap in time at the end of that short file and the start of the next file.

From reading here I decided to run h2testw on the SD card. I did not format it first because I wanted to test it in the same condition it was in since it was recently acting up. The test passed and also reported a good write speed. I forget the exact speed but let's just say it was 82.8 MB/s. But luckily I was watching it very closely while it was testing. I saw a number of times were a single write took very long, like 2 seconds. An error didn't occur, it just took much longer than it should have for a write. And if 99.9% of the blocks wrote at full speed the 0.1% wrote very slow it wouldn't impact the average write speed for the entire test very much. But it certainly cause a camera problems. I was luckily I happened to be watching a noticed it.

I wish h2testw would track how many blocks wrote under a certain threshold speed. I'm sure when the dashcam runs into one of those blocks that takes like 2 seconds to write, ultimately what happens in the RAM buffer holding the frames not written to the card yet gets over written. The camera detects the problem and probably beeps to indicate it, closes the current file and starts a new file.

Anyway I just wanted to share that just because h2testw reports a clean test doesn't mean that certain blocks did not take very long to write which will likely reek havoc with your dash cam. Are there any other utilities available that might detect both errors and the write speed dropping very low for certain blocks?

Doc
 
Last edited:
Would CrystalDiskMark indicate if 0.1% of the block writes were very slow and 99.9% of them were fast? Reporting the total speed isn't helpful in detecting "slow blocks".

Doc
 
Based on the screen shots I see it just reports total speed for various tests. That's my point. Just because h2testw doesn't report any errors or something like CrystalDiskMark shows the average write speed across the entire card is good doesn't mean you don't have some blocks scattered across the card that for some reason write slow. And if you do, expect some weird behavior from your camera.

Doc
 
h2testw just shows the card is real, doesn't tell you if it's good or not, CrystalDiskMark has a few different tests which will normally show speed problems if they exist
 
As a professional software developer of 31 years I'm going to respectfully disagree. This particular card is using 64KB blocks. Let's say this card should write at 90MB/s. At 90MB/s it should take 711 microseconds to write a block. Let's say 0.1% of the blocks take abnormally longer. Let's say 5 times longer or 3.555 milliseconds. And let's assume those badly behaving, slow writing blocks are fairly evenly distributed across the card.

CrystalDiskMark's is just doing some very basic sequential reads, sequential write, random read and random write tests in various different sizes. If in a 1GB test 99.9% of the blocks write in 711 microseconds and 0.1% of the blocks write in 3.555 milliseconds the total test run would be 11.153813 seconds for a total throughput of 89.7 (rounded) MB/s instead of the expected 90 MB/s.

That certainly wouldn't raise any red flags. And from that simple metric you cannot know if every block is taking 712 microseconds or if 99% of the blocks are taking 711 microseconds and 0.1% of the blocks are taking 3.555 milliseconds (much longer).

When a camera runs into these blocks that take much longer to write, they will lose data and depending on how well the firmware is written to deal with a very slow write it could result in anything from lost video, corrupted files or a camera that locks up.

I emailed the developer of h2testw asking if he could report the average, max and min write speeds for each write operation instead of just the average. That would give a good indication if this problem existed on a card. Your average might be 89 MB/s but if you saw a min of 12 MB/s you'd have an idea that there was still a problem that would likely cause a dash cam problems. Unfortunately I received an automated response stating he no longer works for that company. This has me toying with the idea of writing a simple little utility that writes every block on SD card and builds a histogram of write times for each block to try and detect this issue.

Doc
 
Writing a program would probably be the better option, not aware of any consumer grade options that do it this way
 
As a professional software developer of 31 years I'm going to respectfully disagree. This particular card is using 64KB blocks. Let's say this card should write at 90MB/s. At 90MB/s it should take 711 microseconds to write a block. Let's say 0.1% of the blocks take abnormally longer. Let's say 5 times longer or 3.555 milliseconds. And let's assume those badly behaving, slow writing blocks are fairly evenly distributed across the card.

CrystalDiskMark's is just doing some very basic sequential reads, sequential write, random read and random write tests in various different sizes. If in a 1GB test 99.9% of the blocks write in 711 microseconds and 0.1% of the blocks write in 3.555 milliseconds the total test run would be 11.153813 seconds for a total throughput of 89.7 (rounded) MB/s instead of the expected 90 MB/s.

That certainly wouldn't raise any red flags. And from that simple metric you cannot know if every block is taking 712 microseconds or if 99% of the blocks are taking 711 microseconds and 0.1% of the blocks are taking 3.555 milliseconds (much longer).

When a camera runs into these blocks that take much longer to write, they will lose data and depending on how well the firmware is written to deal with a very slow write it could result in anything from lost video, corrupted files or a camera that locks up.

I emailed the developer of h2testw asking if he could report the average, max and min write speeds for each write operation instead of just the average. That would give a good indication if this problem existed on a card. Your average might be 89 MB/s but if you saw a min of 12 MB/s you'd have an idea that there was still a problem that would likely cause a dash cam problems. Unfortunately I received an automated response stating he no longer works for that company. This has me toying with the idea of writing a simple little utility that writes every block on SD card and builds a histogram of write times for each block to try and detect this issue.

Doc


My solution is to get a PC to write a whole card full of miscellaneous files (mixture of pictures, videos, word, excel, pdf and so on) and just watch the progress on the computer screen.
 

Attachments

  • 0000000000000000000000000000000000000000000000000000000000000000000000000000 Kingston random h...png
    0000000000000000000000000000000000000000000000000000000000000000000000000000 Kingston random h...png
    20.6 KB · Views: 11
Have you tried swapping the cards between your two cameras?
Just to confirm that it is the card causing the issue...
 
Based on the screen shots I see it just reports total speed for various tests. That's my point. Just because h2testw doesn't report any errors or something like CrystalDiskMark shows the average write speed across the entire card is good doesn't mean you don't have some blocks scattered across the card that for some reason write slow. And if you do, expect some weird behavior from your camera.

Doc

That might explain why I was having random beeps on my A129 despite the card passing the tests (just tested with h2testw and CrystalDiskMark)
 
A comprehensive read-write test program which denotes the extremes it finds would be nice, especially as freeware :) but cards can degrade with use, so a sector which tests OK now might drop below acceptable during your next drive :( So it would be a nice diagnostic tool, but not really a good solution to the overall problem.

Maybe we're pushing too hard against the limits of current technology with large write speed requirements in a SOC device which we want to be user-friendly, small, robust and reliable in use, and economical all at the same time. Maybe the chip-makers can come up with better solutions and support with their SDK's if the capability is there.

Or maybe we need to move toward a different approach with dashcams which precludes this problem without becoming too expensive or too cumbersome in the process ;)

Phil
 
Have you tried swapping the cards between your two cameras?
Just to confirm that it is the card causing the issue...

Sorry I should have stated that in the original post. Yes I did swap cards between the cameras and the issue follows the card. And just to clarify both cards are brand new and both cards technically pass all the testing I've tried. But I definitely see that occasionally some of the writes hang for much longer than they should and then finally complete successfully on this particular card. I'll return the card for a replacement since it's brand new.

I've read a ton of threads about random and weird issues with dash cams using SD cards that technically test out OK. I was just trying to call out that just because your card doesn't report errors that you could have an issue similar to this that could be causing problems.

My solution is to get a PC to write a whole card full of miscellaneous files (mixture of pictures, videos, word, excel, pdf and so on) and just watch the progress on the computer screen.

While tedious, especially on a 256GB or 512 GB card, that's an excellent suggestion to detect this issue. It's similar to what I effectively did closely watching h2testw write to the card but the advantage of your suggestion is it's a little easier and intuitive to watch that throughput graph.

Doc
 
A comprehensive read-write test program which denotes the extremes it finds would be nice, especially as freeware :) but cards can degrade with use, so a sector which tests OK now might drop below acceptable during your next drive :( So it would be a nice diagnostic tool, but not really a good solution to the overall problem.

Maybe we're pushing too hard against the limits of current technology with large write speed requirements in a SOC device which we want to be user-friendly, small, robust and reliable in use, and economical all at the same time. Maybe the chip-makers can come up with better solutions and support with their SDK's if the capability is there.

Or maybe we need to move toward a different approach with dashcams which precludes this problem without becoming too expensive or too cumbersome in the process ;)

Phil


At very least it would certainly be nice if the dash cams notified you when any writes become so slow that data is lost from their frame buffer. The Viofo A129 actually handles it pretty well. It closes the current file, beeps, and starts a new file. But the camera knows the reason it had to do this was because of a slow write. So some type of notification of that would have been nice. Perhaps just a screen icon that flashes for 30 seconds or perhaps even naming the file with _SLOWWRITE (or whatever) at the end so you know why some data was lost and the file sizes aren't the right length. The result for us was maybe a couple minutes of irregular beeping, an hour of no beeping, then a few random beeps, then another hour of no beeping and then constant but irregular beeping for 20 minutes, etc. So it wasn't very apparent what was going on even though the camera knew exactly what was going on. But I give Viofo credit for not just corrupting the file or locking up which I suspect some other dash cams would do under the same circumstances.

Doc
 
I'd rather have non-anomalous operation to eliminate a problem rather than self-correction. The self-correction is good, but it's simply better to eliminate the need. Woe unto to the poor slob who needs any of the data which might get lost as the cam is in the process of "fixing" itself :cry:

There has long been some small discussion of using another memory format for dashcams instead of Micro SD cards. Maybe it's time to reopen that avenue of thought as we do seem to be reaching their operational limits with our increased resolutions and the high-bitrate writing that it needs.

With the rise of "remote" cams where the control unit is placed elsewhere, it's size is no longer as severely limited as it is when you're trying to fit the whole system on the windshield, so really we could even jump to desktop sized SSD's without too much ado. Whatever it is, something is going to have to happen if Micro SD cards cannot be improved enough to be functionally viable for us, and based on the little I know about them they do seem to have reached the limits of our current technology with nothing promising enough betterment in the near future to meet our foreseeable needs.

Phil
 
When you say write speed 90MB/s you really mean 90Mbps (~11MB/s) right?
 
This might work on sd cards, it shows the slowest speed and also also the access time, not sure if that's reading or writing though

 
...Then it'll work for a while. I tried reformatting the card, resetting the camera, etc. It would work for a while then act up again. When I look at the files there are quite a few that don't contain the right amount of data / length of video. And there is a gap in time at the end of that short file and the start of the next file...
I'm certain your eventual conclusion regarding the write speed of the card is the root cause of your symptoms.

I had a similar issue with an SG camera that would intermittently create 'short' files with gaps between them (see this post - https://dashcamtalk.com/forum/threads/sg9663dr-update.33839/page-16#post-480310). After much gnashing of teeth and tearing out hair (which I can ill afford to do) I found the card I was using was writing data at 1.8MB/s versus the rated speed of 90MB/s (this post - https://dashcamtalk.com/forum/threads/sg9663dr-update.33839/page-17#post-483703).

Eventually 'fixed' the card and the camera resumed functioning as it should.
 
->

While searching for suitable memory cards for my most recent dashcam purchases I found this:
(I've found Samsung cards to be among the best in dashcams but haven't tried one of those mentioned below and I have no connection to Samsung)



Samsung PRO Endurance

  • The PRO Endurance is specially built for maximum compatibility with the demanding specs of a wide variety of surveillance & security cams, dash cams, and body cams
  • The PRO Endurance memory card provides the longest lasting performance and exceptional reliability, both critical for today’s continuous recording devices
  • A single PRO Endurance card lasts as long as 25 EVO Plus cards, eliminating the need for frequent replacements and reducing reliability concerns
  • As the industry’s only endurance card to support both 4K and FHD video, the PRO Endurance is the optimal card for today’s 4K and high definition monitoring devices
  • Capable in harsh real-world conditions, it is resistant to magnets, X-rays, water and an extensive range of temperatures
 
Back
Top