Page 1 of 1

DIY VR headset for the StereoPi. 10 ms latency for just $135

Posted: Sat Oct 19, 2019 11:06 am
by Realizator
Here is a step-by-step guide in our blog on Medium:
https://medium.com/stereopi/diy-vr-helm ... 42eb60c6dc

Re: DIY VR headset for the StereoPi. 10 ms latency for just $135

Posted: Mon Oct 21, 2019 6:14 am
by stereomaton
Filming a timer and a screen which displays it through the camera... It reminds me a similar latency test I did on an endoscope several years ago.
However, I am surprised by the measure you give. Standard 60fps is about 16ms, thus anything under 32ms (Shannon frequency) or even 0.1s (realistic error interval) sounds like optimistic value.

Nice project nonetheless and useful application.

Re: DIY VR headset for the StereoPi. 10 ms latency for just $135

Posted: Tue Apr 14, 2020 6:33 pm
by SachMach
Hi all,

I like that project. I am starting my a project based on this one.

I ordered a display:
https://de.aliexpress.com/item/32820986 ... 4c4dgu49eI
using a higher resolution of 1440x2560 pixel.
I could make it work using HD resolution as you described it.

It does not work at it's natural resolution giving me that message:

bin root$ ./raspivid -3d tb -w 1440 -h 2560 -fs -t 1000
Too many macroblocks/s: Increasing H264 Level to 4.2
mmal: mmal_vc_port_enable: failed to enable port vc.ril.video_encode:in:0(I420): EINVAL
mmal: mmal_port_enable: failed to enable connected port (vc.ril.video_encode:in:0(I420))0x2aad30 (EINVAL)
mmal: mmal_connection_enable: output port couldn't be enabled
mmal: main: Failed to connect camera video port to encoder input
mmal: Argument is invalid
mmal: Failed to run camera app. Please check for firmware updates

Is there a given limit or can this be overcome?

Re: DIY VR headset for the StereoPi. 10 ms latency for just $135

Posted: Wed Apr 15, 2020 8:11 am
by stereomaton
The H264 encoder is limited in definition (I found about 2048×1350) and you exceed it with your configuration. Since you do not save the file, you can try to use the mjpeg encoder (-cd mjpg). Also check the camera modes, because you may have a trade off to do between fps and definition.
Note: this proposition is based on readings, not tried.

Re: DIY VR headset for the StereoPi. 10 ms latency for just $135

Posted: Wed Apr 15, 2020 2:21 pm
by Realizator
SachMach, Stereomaton is right. You set a resolution, which exceeds resolution limits.
Try to use lower resolution (closer to 1920x1080, but where height is dividable by 16 and width is dividable by 32) - these limits are from h264 encoder.
If you will set MJPEG compression, there are no such a limits. But you need to check appropriate video resolutions, supported by the cameras you use (V1 or V2).
You can set a sensor mode using '-md' option for the raspivid. Available options you can find here, in a camera documentation:
https://www.raspberrypi.org/documentati ... /camera.md
(search for "-md" on this page)