1

A project I'm working on requires unmodified 1080p video to be taken from the CSI interface and sent to a screen (over HDMI) as quickly as possible. I don't currently have a CSI-compatible camera to test with. What is the lowest latency one should expect from this arrangement?

5

This isn't a terribly scientific test, but it may provide a rough idea. I ran the following script on a reasonably fast desktop system, causing it to print the current timestamp including microseconds to the console:

import datetime

while True:
    print(datetime.datetime.now().strftime('%H:%M:%S.%f')

Then I started the Pi's camera module preview system (which can be done with raspidvid -t 0 or alternatively with the start_preview method in picamera), and positioned the Pi's display in front of the desktop's monitor.

Finally, I snapped a picture of the script's output on both the desktop's monitor and the Pi's camera preview with my phone. The results aren't great as I was using a stock camera module which can't really focus at distances this close. Still, they're just enough to see that the latency is somewhere around 30-40ms:

latency of Pi camera module preview

While the desktop's display is showing 00:32:01.466nnn, you can just make out the Pi's is showing 00:32:01.43nnnn, hence latency is somewhere around the 30-40ms range. I should also note that the camera was running with a resolution of 1280x800 (as that's the native resolution of the HDMIPi screen, and I don't have anything better to hand), but I'd be surprised if the latency were significantly different at 1080p.

  • Great answer, I really appreciate the effort you put into this! However, do you have specs on the second display you're using (to display video from the Pi)? What is its display lag? If you can factor that out of the latency value you're calculating, that'll give the actual latency for the Pi. – Trey Keown Nov 27 '14 at 5:39
  • Yea that is a great and practical way to proove your findings. I think the 40-50ms may be further reduced by using faster LCD screens (like 5ms) which are more expensive or possibly a different configuration, OS or drivers. But that might only shave of 5-25ms overall, so is it worth it? Maybe. – Piotr Kula Nov 27 '14 at 9:21
  • @ppumkin It's not so much about shaving time as it is determining the true delay from camera to HDMI. That's not a number that has been calculated anywhere, AFAIK – Trey Keown Nov 27 '14 at 9:40
  • Yea I realise that. But if we are talking about optimizing milliseconds here, then we are entering extreme tracing territory that requires some expensive and professional equipment and some serious skill set. If the OP was concerned about x seconds of lag then we have no problem at all. – Piotr Kula Nov 27 '14 at 10:35
  • @Trey the screen I'm using is an HDMIPi which according to the instruction manual (which has a decent picture of the driver board) uses a RealTek RTD2362 chipset - that's about as much information as I can dig up (I can't find anything specific on the display latency) – Dave Jones Nov 27 '14 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.