GearVRf
GearVRf copied to clipboard
Camera Preview Faster S7, S7Edge
We are experiencing the same issue as #270 with the Galaxy S7 and S7 Edge. The FPS Range will not go above 30 when using the CameraSceneObject with setUpCameraForVrMode( 1 ). The Note 5 and Galaxy S6 are working correctly. Can anyone confirm this behavior?
Hi. I can confirm. Will ask around but it may take some time before there is an update.
Is this still an issue? I successfully set the same parameters on an S7 edge in my own app and do get 60FPS preview.
I do also set preview size manually to 1280x720, so I wonder if this is required for it to work properly on S7 devices?
Thanks so much for this project and code; I've been struggling to enable 60FPS mode on Samsung devices for ages and it has literally made my year!
One further question that I wonder if you can pass on to the internal team - is there any way of enabling these sensor modes through the Camera2 API? Ideally I want to use the zero-copy ImageReader -> SurfaceTexture pipeline as I need to do processing on the CPU. The callbackBuffer works with the camera 1 API but there's no frame timestamps or zero-copy route to the GPU.
I've been able to set my S7 to render camera frames at 60 fps using the parameter configuration outlined by gaurav-mcl in the previous linked issue. I am trying to enable 120fps with the old camera API. Is it possible to enable this by adding some additional Samsung specific config?
I've tried to achieve this by setting the following but without any success:
...
Camera.Parameters param = mCamera.getParameters();
...
param.set("fast-fps-mode", 2); // 2 for 120fps
param.setPreviewFpsRange(120000, 120000);
...
Any help would be appreciated.. Thanks.
@parkitny Are you sure the SurfaceTexture doesn't get updated at 120FPS in that case? At least with the ConstrainedHighSpeedCaptureSession on Camera2, I have seen timestamps 8 ms apart, suggesting SurfaceTexture is updated at 120 FPS (can't remember which device that was though, possibly a Galaxy S8).
The screen updates at 60FPS so you wouldn't expect any visible difference from that mode (though perhaps slightly lower latency?)
Thanks for the response, I am using the old camera API and each frame is available as a SurfaceTexture
via the onFrameAvailable
callback. The time difference between frames is fluctuating between 16 and 20 ms (I am calling surfaceTexture.getTimestamp()
and taking the difference from the previous frame time stamp). It appears to still be rendering at ~60fps. Some slight lag is noticeable at times, which I want to reduce.
Just confirming this is with the Galaxy S7.
Yes the latency with vrmode seems a bit high to me too. Some of it is introduced by GLSurfaceView / SurfaceFlinger buffer queues, but even with the same rendering setup it seems other devices often offer lower latency, so some of it must be coming from the camera pipeline.
Worth noting that the newest Samsung devices (S9 and Note 9) don't support the old camera API "vrmode" any more, so it seems the Camera2 HighSpeedCaptureSession is the way to go there. I haven't yet done any detailed comparisons between the latency between the two approaches on devices that support both.