Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

MASTER THREAD: USB drives that work with Sentry and TeslaCam

This site may earn commission on affiliate links.
Have been using the Samsung MUF-256AB/AM FIT Plus 256GB - 300MB/s USB 3.1 Flash Drive which was working just fine until the v10 update. Now I get the same messages as everyone else that it's unable to write.
https://www.amazon.com/gp/product/B07D7Q41PM?ref_=pe_1811570_136791410_E_Asin_Title

I tried reformatting the drive and plugging it back in to my M3 to have it re-create all the folders but the alert popped up again.

Do we think micro SD cards would be a better solution?
 
  • Informative
Reactions: VQTRVA
...Do we think micro SD cards would be a better solution?

I am no expert but logically, I would think the direct connection is better than plugging through a MicroSD to USB converter.

Maybe it's time to switch to Solid State Drive:

$89.97 Samsung T5 Portable SSD - 500GB - USB 3.1 External SSD (MU-PA500B/AM)
(in a boxy hard drive form)

$71.49 SanDisk SDCZ880-256G-G46 Extreme PRO 256GB USB 3.1 Solid State Flash Drive
(in a USB stick form)

I guess it's a matter of trials of errors to keep spending the money to see which one your Tesla would finally cooperate.
 
I am no expert but logically, I would think the direct connection is better than plugging through a MicroSD to USB converter.

Maybe it's time to switch to Solid State Drive:

$89.97 Samsung T5 Portable SSD - 500GB - USB 3.1 External SSD (MU-PA500B/AM)
(in a boxy hard drive form)

$71.49 SanDisk SDCZ880-256G-G46 Extreme PRO 256GB USB 3.1 Solid State Flash Drive
(in a USB stick form)

I guess it's a matter of trials of errors to keep spending the money to see which one your Tesla would finally cooperate.
Samsung T5 has been solid. Left it at the airport last week and this week. It’s overwriting old files just fine and no errors.
 
Or until Tesla fixes the SW issue.

To be fair to Tesla I dont think you can really blame them for this. There are two parameters that can make a drive fail, neither of which are controlled by Tesla. The first is sustained write speed. Most flash drive makers WAY overstate this; you are better off measuring this yourself. If you dont have a fast enough drive, then it will fail fast and the car will tell you.

The second parameter is worst-case latency, and is far harder to quantify. Basically, flash drives have internal housekeeping they have to do from time to time (including thermal throttling). This can result in the drive "pausing" data writes for some period of time. During this time the car has to buffer the incoming video in memory until the drive starts accepting writes again. These drive pauses are all over the place; some drives use lots of short pauses, others use fewer but longer pauses. But regardless, if the internal videos buffers in the car fill up while the drive is paused, then video is going to get lost, since the car has no place to store it. It's this second (and very unpredictable) parameter that makes so many drives fail, since often it will not show up initially (for example, until the drive has to handle wear leveling and/or block reclamation).

Ideally, Tesla would run some sort of test on a drive to validate it, but this test cannot easily detect pause issues, since the car has no way to know how to trigger such a pause, or how long it would have to test the drive before such a pause occurred (it might be weeks).

Those with long-ish memories may recall hard drives had a similar problem years ago. At that time they would occasionally pause to do thermal recalibration (as they heated up from a power-up). This was fine until people started streaming video, which needed sustained read performance, and the pauses would glitch the video. Makers worked around this with a new generation of drives that did continuous thermal adjustments to avoid the long pauses.
 
  • Like
Reactions: BBone and V__2
To be fair to Tesla I don't think you can really blame them for this.
Except
  1. There has been a notable surge of this issue with the V10 SW update
  2. It has happened with all types of devices (thumb drives, SD/Micro SD with USB adapters, and to a lesser extent SSDs) from a wide range of manufacturers.
  3. Tesla has communicated NO specification recommendations for what works best or "minimum requirements" (at least that I have ever seen)
Go back through this thread and read the posts from @Knightshade - he has done an excellent job of spelling out a lot of good info on this.
 
  • Like
Reactions: VQTRVA
Except
  1. There has been a notable surge of this issue with the V10 SW update
Go back through this thread and read the posts from @Knightshade - he has done an excellent job of spelling out a lot of good info on this.

And did you notice the change in V10 features? They added real-facing camera. More cameras = more video = higher data rate. So yes, the car is more sensitized to the issues I raised.

I'm not being apologist here; Tesla can and should do a better job with requirements. But it's not a software but that will be fixed, ever. And even if they DID specify worst case latency, what would you do with it? Ever seen specs on worst-case latency on a drive???
 
And did you notice the change in V10 features? They added real-facing camera. More cameras = more video = higher data rate. So yes, the car is more sensitized to the issues I raised.

Not really, no.

The 4th camera too it from 1.5 MB/s up to... 2 MB/s of data being written.

Which is still 3-5 times slower than the typical cheap USB stick writes sustained... and ~30 times slower than higher end ones (that also still have problems reported) can do sustained writes.

This isn't a 4 camera 4k UHD recording system here.


I'm not being apologist here; Tesla can and should do a better job with requirements. But it's not a software but that will be fixed, ever.

Why not?

There's been numerous camera-related SW bugs since launch of dashcam they have fixed- no reason to think they won't eventually fix the latest ones... (and probably introduce new ones along the way too).


And even if they DID specify worst case latency, what would you do with it? Ever seen specs on worst-case latency on a drive???

USB UserBenchmarks - 639 USB Flash Drives Compared

That's almost 650 different USB storage devices benchmarked.

If you stick to 64GB or larger (which is the minimum size you should be using at this point, and 128 or 256 would be a lot better) the lowest sustained write speeds are almost 10MB/s

Or about 5 times quicker than the Teslacam feature is actually writing.


Again- the fact that folks are having these issues across a slew of hardware- including some folks with the same hardware both having and not having the issue... and often having or not having it between software updates- all tells you this is not a hardware problem.






I am all for it but what I am to do while waiting?

Leaving the video feature nonfunction and miss recording some possible important events while waiting for a software fix?

Is there any hint that Tesla has any intention of fixing it?


I suppose you can keep dropping money on random storage devices and hope whatever one works today still works next week.

I'm using a Samsung Fit Plus. Which has had 0 issues since Dashcam launch over a year ago. Including up through V10.

But others have had issues with that device. And others haven't.


Same for basically every device anybody has mentioned, going back to the start of the feature fall of last year.
 
  • Disagree
  • Informative
Reactions: V__2 and VQTRVA
I am all for it but what I am to do while waiting?

Leaving the video feature nonfunction and miss recording some possible important events while waiting for a software fix?

Is there any hint that Tesla has any intention of fixing it?
My personal approach is that I picked up a 256 GB thumb drive from Costco for $32 and I use that. I check from time-to-time to make sure it is still recording and then keep going. If it ever fails, I toss it and get another one. I would rather take the risk with this less expensive drive than the $90 T5 (which I considered but passed on). YMMV

I wish I could tell you what (if anything) Tesla is doing about it. I am suspect about whether it is a high priority for them since their #1 agenda item at the moment is becoming consistently profitable.
 
  • Like
Reactions: VQTRVA
Not really, no.

The 4th camera too it from 1.5 MB/s up to... 2 MB/s of data being written.

Which is still 3-5 times slower than the typical cheap USB stick writes sustained... and ~30 times slower than higher end ones (that also still have problems reported) can do sustained writes.

This isn't a 4 camera 4k UHD recording system here.

USB UserBenchmarks - 639 USB Flash Drives Compared

That's almost 650 different USB storage devices benchmarked.

Same for basically every device anybody has mentioned, going back to the start of the feature fall of last year.

As I noted, the review you referenced discusses sustained write speed, not worst-case latency, which are totally different things, as I explained in my earlier post. And imho it's latency that is the root cause of these issues, not sustained speed.

To re-state: the car has some amount of elasticity in writing to the drive in the form of a buffer. This buffer takes incoming video from the cameras, holds it in memory, and then writes it from that buffer to the drive. Overall, the drive can suck up data from this buffer much faster than the cameras generate it. This is because the drive has a sustained write speed that exceeds the rate of data being generated by the cameras. So far so good.

But drives (all of them) do not write at the sustained speed all the time. In fact, they have burst write speeds that are far far higher than the sustained rate, coupled with pauses where they may not do any writes at all. These fast bursts and pauses average out to the specified (or measured) sustained write speed. The pauses can be caused by several things:

-- Demand on the USB bus from other devices (internal to the car, not plugging in by the user).
-- Thread starvation in the OS for the writer thread (or similar, depending on the OS and buffering mechanisms in use).
-- Internal house-keeping in the drive, including block erase, thermal stress, and wear leveling.

In the worst case these pauses can all align in a perfect storm, creating a longer than usual pause in writing. When this happens, the internal buffer that is holding camera data may fill up (aka overflow). At this point camera data is lost, since there is nowhere to store the data while the drive is paused (I'm not going to discuss dynamic buffer sizing here as that gets WAY off the point). Note that this has nothing to do with sustained write rate; the drive could be 100x faster than cameras sustained, but if it pauses too long the buffer will overflow based PURELY on the data rate from the cameras and the size of the internal buffer.

This is why adding another camera in V10 does alter things; it makes the system more sensitive to worst-case pauses, and so drives that USED to work suddenly stop working, even though the sustained rate is apparently fine on paper.
 
It's also worth noting that the data rate from the cameras has a pretty big standard deviation as a result of compression, with data rates varying by 2x or more. Since the compression ratio depends on video content, the susceptibility of a drive to overflow is dependent on the video being recorded, which (I assert) is why there is so much variability in users experience. This also means DashCam would tend, statistically, to be more prone to overflow problems than Sentry mode, since DashCam is more often in-motion, while Sentry is more often static (parked car), which would typically yield better compression with both H.264 and H.265 (on HW3).
 
the car has some amount of elasticity in writing to the drive in the form of a buffer. This buffer takes incoming video from the cameras, holds it in memory, and then writes it from that buffer to the drive. Overall, the drive can suck up data from this buffer much faster than the cameras generate it.
How do you know the car has a buffer? One of my theories is that it either doesn't use one, or that if it does it's really poorly implemented I.E. much too small. If the car had a properly implemented write buffer, you could throw any old drive on there and it would work.
 
As I noted, the review you referenced discusses sustained write speed, not worst-case latency, which are totally different things

Yes, they are.

Latency isn't write speed at all for example.... you seem to kinda be throwing around words you maybe don't understand?

Latency in flash memory is measured in microseconds- it's irrelevant here. Typical write performance latency for flash is like 0.0002 seconds.


, as I explained in my earlier post. And imho it's latency that is the root cause of these issues, not sustained speed.

You keep using that word.

I do not think it means what you think it means.


To re-state: the car has some amount of elasticity in writing to the drive in the form of a buffer. This buffer takes incoming video from the cameras, holds it in memory, and then writes it from that buffer to the drive. Overall, the drive can suck up data from this buffer much faster than the cameras generate it. This is because the drive has a sustained write speed that exceeds the rate of data being generated by the cameras. So far so good.


ok....


But drives (all of them) do not write at the sustained speed all the time. In fact, they have burst write speeds that are far far higher than the sustained rate, coupled with pauses where they may not do any writes at all. These fast bursts and pauses average out to the specified (or measured) sustained write speed. The pauses can be caused by several things:

-- Demand on the USB bus from other devices (internal to the car, not plugging in by the user).

Probably not, no...

Even a USB2.0 bus can carry ~60MB per second of data. All 4 cameras combined are ~2MB/s. 1/30th the bandwidth available.

I'm unaware of any evidence the car is using USB internally anyway for...well...practically anything....let alone something that could ever eat 60MB/s of bandwidth at once... What do you think it'd use it for that could do anything close to that?


-- Internal house-keeping in the drive, including block erase, thermal stress, and wear leveling.

Also probably not- if that was slowing the drive down a ton during routine writes it'd always be doing so and show up in benchmarks resulting in significantly lower write speeds than we see.


-- Thread starvation in the OS for the writer thread (or similar, depending on the OS and buffering mechanisms in use).

starvation is where a thread is unable to gain regular access to shared resources and is unable to make progress... what resource do you suggest it's unable to regularly access? Not the drive surely, Linux support for USB2 is extremely mature by now.

Still, if Teslas own code for the cameras and recording is crap enough you're maybe finally on to something.


Of course it's the exact type of something I've been suggesting all along.... that this is a software issue that Tesla can fix with better code.

More importantly you haven't really presented any reason anything in the system would pause that is the drive

Only the computer writing data.

More on that below.


In the worst case these pauses can all align in a perfect storm, creating a longer than usual pause in writing. When this happens, the internal buffer that is holding camera data may fill up (aka overflow). At this point camera data is lost, since there is nowhere to store the data while the drive is paused

Not the drive- the drive as we've established is WAY faster than needed to write whatever you want- basically at any time.

So if it's the write buffer in the computer overflowing and losing data due to pauses and bad code in the computer... then...

The storage device doesn't really make a difference.

It could happen with any HW... even HW that worked fine on a different SW version.

Which... huh...kinda matches exactly the idea it's a software problem



How do you know the car has a buffer? One of my theories is that it either doesn't use one, or that if it does it's really poorly implemented I.E. much too small. If the car had a properly implemented write buffer, you could throw any old drive on there and it would work.


See? THIS guy gets it.



It's also worth noting that the data rate from the cameras has a pretty big standard deviation as a result of compression, with data rates varying by 2x or more.

You appear to be confusing the video compression rate of the video and the actual file size being written...

Each video file is roughly the same size, about 30MB... and contains a minute of video.

There's 4 files created per minute (one for each camera)

Meaning the maximum amount of data it can possible need to record to the storage in 60 seconds is 30MBx4... 120MB.

Or an average of 2MB per second as discussed.




I
Since the compression ratio depends on video content, the susceptibility of a drive to overflow is dependent on the video being recorded, which (I assert) is why there is so much variability in users experience. This also means DashCam would tend, statistically, to be more prone to overflow problems than Sentry mode, since DashCam is more often in-motion, while Sentry is more often static (parked car), which would typically yield better compression with both H.264 and H.265 (on HW3).

So you've got a lot wrong here...

First- HW3 and HW2.5 use the same video compression and have for a while now.

Second- it's the internal buffer that'd overflow- not the external storage drive

Third- Sentry doesn't record anything. Ever. Only dashcam records. And it's always doing so (if turned on, awake, and able to anyway). The only thing Sentry does regarding video is when the car goes into alert mode, it moves (not copies- that matters quite a bit) the last 10 minutes of dashcam recording from Recent to Saved.

So basically that whole paragraph there was nonsense.
 
How do you know the car has a buffer? One of my theories is that it either doesn't use one, or that if it does it's really poorly implemented I.E. much too small. If the car had a properly implemented write buffer, you could throw any old drive on there and it would work.

The short answer is I dont. But it would have to have at the least some kind of ping-pong buffer to handle USB processing. And given the bad behavior of most USB flash drives I dont think ANY of them would work if there wasn't some amount of buffer. I'm not familiar enough with the hardware to make a guess as to how much memory Tesla could allocate to buffers, but I would hazard a guess it's "just enough" as there are a LOT of other demands on the system that are probably higher priority.
 
@Knightshade ok, I'll explain again, as I'm patient. I'd also appreciate if you skip the ad hominem attacks, they are rarely constructive in my experience.

The term "latency" is a general term commonly used to mean a delay before a requested operation is actually performed. There are many kinds of latencies. Hard disks, for example, have both seek latency and rotational latency. Flash of course does not suffer from either of these, and so it's internal latency is often very low, measured, as you state, in microseconds. However, it is not ALWAYS that low, for the reasons I've already stated. The internal controllers on flash have to handle a variety of tasks, some of which are quite slow (block erase for example), and, in cheaper drives, these operations are serialized with host read/write requests. That means SOME write operations are delayed for a significant time period before they are completed. This means that, while the majority of writes do indeed have microsecond latency, a small number have a much greater delay. This is what I was referring to when I discussed worst case latency. Note the phrase "worst case" here .. not typical, not average, WORST.

Now let's talk about sustained write speed. What does this mean? It means that. if you measure write speed over some sufficiently long period of time, it will average to a value that indicates the speed the drive can sustain indefinitely (or at least until it wears out) It says nothing at all about the moment-to-moment actual transfer rate of the drive. The drive MIGHT be writing continually at the measured sustained rate, or it MIGHT be writing at double the sustained rate for 5 seconds, then pausing for 5 seconds (not saying this is a real world example). Both drives have the same sustained rate, but one has a worst-case latency of zero, while the other has a worst case latency of 5 seconds. So, same sustained write speed, but very different latencies. Real drives of course are somewhere between these extremes, and typically the SSD drives have the lowest worst-case latencies, the cheaper USB flash drives the highest.

So why does this matter? Because the cameras are generating a continuous byte stream of data, non-stop, without pause. This is why a buffer is needed; it acts as an elastic temporary holding pen for the data, so that video data can be poured in continually, and then sucked out in blocks if and when the flash drive is ready for it. This buffer must be sized so that it can store all the camera data when the drive hits the worst case latency (actually it would typically be double this if a ping-pong model is used). If it isn't big enough, data loss will occur, which is basically what this entire thread is about .. data loss of DashCam/Sentry.

Now, I'm going to speculate here. I'm guessing that Tesla are not keen on using a big buffer for DashCam. Why? Because the computers have finite resources, and there are a LOT of other contenders for those resources, many (most?) of which are higher priority than the DashCam (autopilot anyone?). So they probably took an ad-hoc approach of figuring out a buffer size that worked with a decent flash drive and left it at that. Which means, the slower cheaper drives are going to overflow that buffer at some point and BANG .. DashCam failure.

What is the fix for this? Make the buffer bigger? How much? Double it. Maybe that makes some of those cheap drives work, but not all. Quadruple it? At some point, you are going to have to decide if "Making DashCam work with cheap crappy USB drives" is more important than "map scrolling is smooth" and "new AP features". And I know where I would vote.

What is probably at fault here ISNT Tesla fixing the system to work with every possible drive. What they SHOULD have done, imho, is test with some of the better flash drive brands, then publish a recommended/tested drive list. But that's just my opinion.

As to your other points...

— Yes, I think I do know what sustained speed and worst-case latency mean. I've defined them above.

— Your sustained speed metrics, as I’ve shown twice now, are irrelevant here. Sustained speed isn't the issue.

— I’m not aware of internal USB use either, but I’d suspect SOME devices are on USB (many devices (e.g. audio) on a mainboard use USB interfaces even though its only via internal signal traces). And yes, I agree that they won’t use all the bandwidth, but drives usually use bulk transfers which are very low bus priority. I dont regard this as a major source of latency, but as I stated we are looking at a perfect storm type model here where each small item adds up.

— You argument about internal house-keeping showing up in sustained write speeds is incorrect, as I have shown. In fact, by definition, sustained write speeds will take into account those house-keeping tasks. See my discussion above about sustained being average over time.

— Thread starvation in this case refers to a thread being starved of CPU resource, that is, unable to run. Given the real-time nature of other critical threads I would speculate this is certainly possible, though again its a small contributing factor. As with the buffer size, Tesla will, I suspect, prioritize driving systems over DashCam (in fact, they had better!).

— This isn’t an argument about software vs hardware. Argument 1 says the software need to buffer enough to support ANY drive. Argument 2 says the drives should not have latency worse than a certain acceptable value. Who is right? Where do you draw the line? As I stated above, the real problem isn’t finger pointing, its that Tesla should have created a demarcation by testing known-compatible devices and then making this list available to customers.

— As for video compression rate, again you confuse average with instantaneous. Let’s say Tesla decide to make the buffer big enough for ½ second of video. How much space is that? You would argue that at 2MB/sec, you need 1MB of buffer. But the compression rate for a video stream varies WILDLY with the content .. still video compresses WAY better than average, fast moving video FAR worse. To the tune of 4x worse compression in many cases. So if you want to be sure to capture video when you have a segment of poorly compressed data, then you will need not 1MB of buffer but 4MB. Otherwise you risk buffer overflow again and, worse, it depends on the actual content of the video being recorded, which makes things VERY sensitive to circumstances.

— I was unaware that HW2.5 now uses H.265. However, so what?

— I dont get your point about Sentry mode. First you say it DOESNT record anything, then you say it MOVES the data (not copies) .. “move” here usually means changing a files location from one folder to another on a drive, which would seem to imply that the video WAS already on the drive to begin with, which contradicts your argument that it wasn’t written? eh?

As I said at the start, ad hominem attacks are rarely useful. Shouting “nonsense” with a refutation that is itself nonsense (in the technical sense of the word) seems to me poor judgement.

The purpose of my original post was to add some speculative insight into a possible root cause of the issues people are having, in the hope that it can assist others in further investigations. I do not have access to the inner workings of the Tesla software stack, hence these are speculations. I do, however, have decades of experience with real-time software and hardware .. I'm not saying that means I'm right, far from it, I'm almost certainly wrong in some of the details, but I think my speculations do align with all the observations posted here.

(My apologies to others in this thread for this absurdly long post.)
 
The term "latency" is a general term commonly used to mean a delay before a requested operation is actually performed. There are many kinds of latencies

Sure- but the one you actually brought up was, specifically, about USB drives.

Whose latency is so slow as to be irrelevant and measured in microseconds as I explained.


If you meant latency of some other part of the system you should have said that.


THAT said you then failed to cite any evidence there's a latency problem anywhere in the system.


. Hard disks, for example, have both seek latency and rotational latency. Flash of course does not suffer from either of these, and so it's internal latency is often very low, measured, as you state, in microseconds. However, it is not ALWAYS that low, for the reasons I've already stated. The internal controllers on flash have to handle a variety of tasks, some of which are quite slow (block erase for example), and, in cheaper drives, these operations are serialized with host read/write requests.

Those operations are serialized on all drives.

You get that the S in USB is serial right?

The reason drives have a queue depth is to sort and handle requests in order- not all at the same time.

(note NVME drives on a PCIe bus are potentially a different story- but everything in your Tesla is hanging off a USB port and connected on the computer end to a USB controller)

But again, due to incredibly low latency and high speed operation, ANY flash drive can handle a LOT of operations per second


That means SOME write operations are delayed for a significant time period before they are completed. This means that, while the majority of writes do indeed have microsecond latency, a small number have a much greater delay.

<citation needed>


So why does this matter? Because the cameras are generating a continuous byte stream of data, non-stop, without pause. This is why a buffer is needed; it acts as an elastic temporary holding pen for the data, so that video data can be poured in continually, and then sucked out in blocks if and when the flash drive is ready for it. This buffer must be sized so that it can store all the camera data when the drive hits the worst case latency (actually it would typically be double this if a ping-pong model is used). If it isn't big enough, data loss will occur, which is basically what this entire thread is about .. data loss of DashCam/Sentry.

I mean- it's not though. It's about a "too slow" message for drives appearing on the screen, not lost data...and on drives that are objectively not too slow- and further which work fine for some people but not others...not buffer overflow messages. In

There's been many previous problems with the cameras.... including 0 byte files, corrupted/green/garbled video, etc...most of which have gone away with no change in hardware, but a change in software.

Just as THIS problem appeared with a change in SW, not hardware.

Because, again, it's a software problem.


Now, I'm going to speculate here. I'm guessing that Tesla are not keen on using a big buffer for DashCam. Why? Because the computers have finite resources, and there are a LOT of other contenders for those resources, many (most?) of which are higher priority than the DashCam (autopilot anyone?). So they probably took an ad-hoc approach of figuring out a buffer size that worked with a decent flash drive and left it at that. Which means, the slower cheaper drives are going to overflow that buffer at some point and BANG .. DashCam failure.

You realize this idea contradicts your earlier one right?

You were explaining why it'd happen more often when parked.

Which is...when AP is not actually doing anything


What is the fix for this? Make the buffer bigger? How much? Double it. Maybe that makes some of those cheap drives work, but not all.

Given no drives were getting the message in earlier versions of V9.... and only a few in later versions....and the # seems to vary between v10 versions too... it seems like either:

They shrank the buffer somewhere.

or

your buffer theory holds no water.


What is probably at fault here ISNT Tesla fixing the system to work with every possible drive. What they SHOULD have done, imho, is test with some of the better flash drive brands, then publish a recommended/tested drive list. But that's just my opinion.

Except, again, we even have folks having these issues with very high end flash memory.

Just as there's been folks with actual SSDs that've had issues all along to varying degrees.

Because it's a SW problem, not HW.



As to your other points...

— Yes, I think I do know what sustained speed and worst-case latency mean. I've defined them above.

You hand waived them above.

I'd love a citation of a flash drive that actually takes multiple seconds to pause and complete any single file IO operation though.


— Your sustained speed metrics, as I’ve shown twice now, are irrelevant here.

Stating and showing with evidence are not the same thing.


— I’m not aware of internal USB use either, but I’d suspect SOME devices are on USB (many devices (e.g. audio) on a mainboard use USB interfaces even though its only via internal signal traces).

Which would be, at MOST 1-2 MB/s.... so again nothing using even 5% of the bus.

— You argument about internal house-keeping showing up in sustained write speeds is incorrect, as I have shown.

Again- no you haven't.

Repeating a claim you've not offered any evidence of isn't "showing"

please show me any evidence of flash drives whose internal housekeeping causes it to pause write operations for multiple full seconds.



— Thread starvation in this case refers to a thread being starved of CPU resource, that is, unable to run. Given the real-time nature of other critical threads I would speculate this is certainly possible, though again its a small contributing factor. As with the buffer size, Tesla will, I suspect, prioritize driving systems over DashCam (in fact, they had better!).

Again this contradicts your earlier claims about sentry being "worse" since it's not using any of those critical things when parked.


— As for video compression rate, again you confuse average with instantaneous. Let’s say Tesla decide to make the buffer big enough for ½ second of video.

The file doesn't care what is in it dude.

Every 1 minute of video regardless of compression will be ~30MB in size. You can verify this yourself just looking at the files on the USB device.

The rest of the post here was again nonsense based on that fact.

Tesla knows they need 30MB to hold 1 minute of video. Regardless of compression or content.


— I was unaware that HW2.5 now uses H.265. However, so what?

Uh, you're the one who brought H.264 and H.265 up to start. Now they're irrelevant once you're informed they don't use different ones on different HW? :)


— I dont get your point about Sentry mode. First you say it DOESNT record anything, then you say it MOVES the data (not copies) .. “move” here usually means changing a files location from one folder to another on a drive, which would seem to imply that the video WAS already on the drive to begin with, which contradicts your argument that it wasn’t written? eh?

No, you just, again, didn't understand a basic explanation of storage.

DASHCAM (not sentry) writes video to the drive in the recent folder.

It's the only thing that does.

Sentry doesn't write anything. Ever. it just, when alerted, moves already-recorded dashcam files to a different folder.

So your trying to claim the 2 functions write differently made no sense.

(even less now that you're contradicting your own claims about which mode should work better based on other tasks the CPU is doing)


As I said at the start, ad hominem attacks are rarely useful. Shouting “nonsense” with a refutation that is itself nonsense (in the technical sense of the word) seems to me poor judgement.

Which I didn't do.

You just didn't understand the refutation.

Hopefully the second time is the charm?

][/QUOTE]
 
@Knightshade ok, I'll explain again, as I'm patient. I'd also appreciate if you skip the ad hominem attacks, they are rarely constructive in my experience.

The term "latency" is a general term commonly used to mean a delay before a requested operation is actually performed. There are many kinds of latencies. Hard disks, for example, have both seek latency and rotational latency. Flash of course does not suffer from either of these, and so it's internal latency is often very low, measured, as you state, in microseconds. However, it is not ALWAYS that low, for the reasons I've already stated. The internal controllers on flash have to handle a variety of tasks, some of which are quite slow (block erase for example), and, in cheaper drives, these operations are serialized with host read/write requests. That means SOME write operations are delayed for a significant time period before they are completed. This means that, while the majority of writes do indeed have microsecond latency, a small number have a much greater delay. This is what I was referring to when I discussed worst case latency. Note the phrase "worst case" here .. not typical, not average, WORST.

Now let's talk about sustained write speed. What does this mean? It means that. if you measure write speed over some sufficiently long period of time, it will average to a value that indicates the speed the drive can sustain indefinitely (or at least until it wears out) It says nothing at all about the moment-to-moment actual transfer rate of the drive. The drive MIGHT be writing continually at the measured sustained rate, or it MIGHT be writing at double the sustained rate for 5 seconds, then pausing for 5 seconds (not saying this is a real world example). Both drives have the same sustained rate, but one has a worst-case latency of zero, while the other has a worst case latency of 5 seconds. So, same sustained write speed, but very different latencies. Real drives of course are somewhere between these extremes, and typically the SSD drives have the lowest worst-case latencies, the cheaper USB flash drives the highest.

So why does this matter? Because the cameras are generating a continuous byte stream of data, non-stop, without pause. This is why a buffer is needed; it acts as an elastic temporary holding pen for the data, so that video data can be poured in continually, and then sucked out in blocks if and when the flash drive is ready for it. This buffer must be sized so that it can store all the camera data when the drive hits the worst case latency (actually it would typically be double this if a ping-pong model is used). If it isn't big enough, data loss will occur, which is basically what this entire thread is about .. data loss of DashCam/Sentry.

Now, I'm going to speculate here. I'm guessing that Tesla are not keen on using a big buffer for DashCam. Why? Because the computers have finite resources, and there are a LOT of other contenders for those resources, many (most?) of which are higher priority than the DashCam (autopilot anyone?). So they probably took an ad-hoc approach of figuring out a buffer size that worked with a decent flash drive and left it at that. Which means, the slower cheaper drives are going to overflow that buffer at some point and BANG .. DashCam failure.

What is the fix for this? Make the buffer bigger? How much? Double it. Maybe that makes some of those cheap drives work, but not all. Quadruple it? At some point, you are going to have to decide if "Making DashCam work with cheap crappy USB drives" is more important than "map scrolling is smooth" and "new AP features". And I know where I would vote.

What is probably at fault here ISNT Tesla fixing the system to work with every possible drive. What they SHOULD have done, imho, is test with some of the better flash drive brands, then publish a recommended/tested drive list. But that's just my opinion.

As to your other points...

— Yes, I think I do know what sustained speed and worst-case latency mean. I've defined them above.

— Your sustained speed metrics, as I’ve shown twice now, are irrelevant here. Sustained speed isn't the issue.

— I’m not aware of internal USB use either, but I’d suspect SOME devices are on USB (many devices (e.g. audio) on a mainboard use USB interfaces even though its only via internal signal traces). And yes, I agree that they won’t use all the bandwidth, but drives usually use bulk transfers which are very low bus priority. I dont regard this as a major source of latency, but as I stated we are looking at a perfect storm type model here where each small item adds up.

— You argument about internal house-keeping showing up in sustained write speeds is incorrect, as I have shown. In fact, by definition, sustained write speeds will take into account those house-keeping tasks. See my discussion above about sustained being average over time.

— Thread starvation in this case refers to a thread being starved of CPU resource, that is, unable to run. Given the real-time nature of other critical threads I would speculate this is certainly possible, though again its a small contributing factor. As with the buffer size, Tesla will, I suspect, prioritize driving systems over DashCam (in fact, they had better!).

— This isn’t an argument about software vs hardware. Argument 1 says the software need to buffer enough to support ANY drive. Argument 2 says the drives should not have latency worse than a certain acceptable value. Who is right? Where do you draw the line? As I stated above, the real problem isn’t finger pointing, its that Tesla should have created a demarcation by testing known-compatible devices and then making this list available to customers.

— As for video compression rate, again you confuse average with instantaneous. Let’s say Tesla decide to make the buffer big enough for ½ second of video. How much space is that? You would argue that at 2MB/sec, you need 1MB of buffer. But the compression rate for a video stream varies WILDLY with the content .. still video compresses WAY better than average, fast moving video FAR worse. To the tune of 4x worse compression in many cases. So if you want to be sure to capture video when you have a segment of poorly compressed data, then you will need not 1MB of buffer but 4MB. Otherwise you risk buffer overflow again and, worse, it depends on the actual content of the video being recorded, which makes things VERY sensitive to circumstances.

— I was unaware that HW2.5 now uses H.265. However, so what?

— I dont get your point about Sentry mode. First you say it DOESNT record anything, then you say it MOVES the data (not copies) .. “move” here usually means changing a files location from one folder to another on a drive, which would seem to imply that the video WAS already on the drive to begin with, which contradicts your argument that it wasn’t written? eh?

As I said at the start, ad hominem attacks are rarely useful. Shouting “nonsense” with a refutation that is itself nonsense (in the technical sense of the word) seems to me poor judgement.

The purpose of my original post was to add some speculative insight into a possible root cause of the issues people are having, in the hope that it can assist others in further investigations. I do not have access to the inner workings of the Tesla software stack, hence these are speculations. I do, however, have decades of experience with real-time software and hardware .. I'm not saying that means I'm right, far from it, I'm almost certainly wrong in some of the details, but I think my speculations do align with all the observations posted here.

(My apologies to others in this thread for this absurdly long post.)
Dude, dont let him ruin ur day. He attacked on my post saying all usb sticks (even the very worst one) will work and last for a long time using his facts... The best we can do is continue our great discussion and ignore those nonsense.
 
@Knightshade I've made my point, and stand by it. I'm not really interested in your rather curious arguments; there are, again, numerous factual and technical inaccuracies in your reply (some quite bizarre), but it's clearly pointless explaining what they are or why they are inaccurate. I posted to clarify for others, and to speculate on a plausible mechanism to account for some of the issues others are having. And to explain why this may not be a simple "find the bug and fix it" issue.
 
  • Like
Reactions: BBone and jdw