Low FPS

1,207 views
Skip to first unread message
Assigned to patel...@google.com by eri...@google.com

sumit kumar

unread,
Jan 31, 2022, 2:26:56 AM1/31/22
to Android CameraX Discussion Group
Hello,

CameraX analysis api is giving fps as low as 8-10 in some devices. I have tried setting range as (30, 30) which is valid range on the device still its not adhering to these ranges.

With Camera Api(which is deprecated) I am able to get fps in range of 21-25. What could be the reason for this inconsistency? Or am I missing something?

Thank you
Sumit

sumit kumar

unread,
Jan 31, 2022, 2:56:56 AM1/31/22
to Android CameraX Discussion Group, sumit kumar
Also this is the log 

I/BufferQueueProducer: [SurfaceTexture-1-23259-1](this:0x836b4800,id:2,api:4,p:2157,c:23259) queueBuffer: fps=29.64 dur=1012.20 max=40.09 min=25.57
I/BufferQueueProducer: [SurfaceTexture-0-23259-0](this:0x8c798000,id:1,api:1,p:23259,c:23259) queueBuffer: fps=13.93 dur=1004.69 max=111.40 min=66.86

Seemingly preview frame rate is ~30 but the analysis frame rate is ~14. This is when I am not doing any work on analyze(image: ImageProxy) except of closing the image.

Android CameraX Discussion Group

unread,
Jan 31, 2022, 5:18:27 PM1/31/22
to Android CameraX Discussion Group, sumit...@eka.care

Hi There,

Thanks for writing in - can you tell us which device(s) you are seeing low FPS on? (if you can provide the device name and model number that would be helpful) We are trying to determine if this is a Legacy device. There is a code snippet for checking hardware level is at the bottom of this section in the documentation here: https://developer.android.com/training/camerax/architecture#combine-use-cases

Thanks! 

sumit kumar

unread,
Feb 1, 2022, 2:23:54 AM2/1/22
to Android CameraX Discussion Group, Android CameraX Discussion Group, sumit kumar
Hi,

The device that I have tested on is showing INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY(2). 

Other devices with same issue are
Vivo - vivo 1606
OPPO - CPH1923
Samsung - SM-M215F

Sumit

Android CameraX Discussion Group

unread,
Feb 1, 2022, 5:29:11 PM2/1/22
to Android CameraX Discussion Group, sumit...@eka.care, Android CameraX Discussion Group
Hi Sumit,

Thank you for the information. Unfortunately for devices with Legacy hardware there exists an additional copy in memory which contributes to the performance issue. Unfortunately there isn't much CameraX can do as a library to speed this up, but we will try to look into this as times permits. Thank you!

Tomáš Válek

unread,
Feb 3, 2022, 10:41:35 AM2/3/22
to Android CameraX Discussion Group, Android CameraX Discussion Group, sumit...@eka.care
The similar problem on Huawei Nova 3, Android 9, HARDWARE_LEVEL_LIMITED

Camera preview FPS is very low and some resolutions do not work. With deprecated Camera API everything was all right ... There are lot issues compared to the old Camera API.

Dne úterý 1. února 2022 v 23:29:11 UTC+1 uživatel Android CameraX Discussion Group napsal:

Charcoal Chen

unread,
Feb 9, 2022, 2:56:03 AM2/9/22
to Tomáš Válek, Android CameraX Discussion Group, sumit...@eka.care
Hi Tomáš Válek,

I did some testing on a Huawei Nova 3 device, but I didn’t see an obvious FPS issue on Preview or ImageAnalysis.

The device I used to do the testing is:

Model: PAR-LX9
Build number: 9.1.0.346(C636E1R1P3)
Android version 9

Both front and back cameras are HARDWARE_LEVEL_LIMITED. By checking the CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES value, both front and back cameras support the following avail FPS ranges:

Available FPS ranges: [12, 15]
Available FPS ranges: [15, 15]
Available FPS ranges: [14, 20]
Available FPS ranges: [20, 20]
Available FPS ranges: [14, 25]
Available FPS ranges: [25, 25]
Available FPS ranges: [14, 30]
Available FPS ranges: [30, 30]

If I didn't set a specific CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE value, I can see the following log printed by the device. The default target FPS range setting should be [14, 25]. Both Preview and ImageAnalysis's FPS were 25.x in normal situations and decreased to 14.x if I covered the camera by hand. 

2022-02-09 13:55:00.604 778-1252/? I/Feature: setFpsParam set SUBCMD_AE_TARGET_FPS_RANGE![14, 25], intent = 1, fps = 0 Thermal = 0  m_fHwcamera=0, m_IppCtrlFlag=0

If I set CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE value as [30, 30], the following log would be printed. No matter if I covered the camera by hand or not, both Preview and ImageAnalysis's FPS of the back camera became 27.x . And, both Preview and ImageAnalysis's FPS of the front camera could reach 29.x.

2022-02-09 13:52:04.944 778-1252/? I/Feature: setFpsParam set SUBCMD_AE_TARGET_FPS_RANGE![30, 30], intent = 1, fps = 0 Thermal = 0  m_fHwcamera=0, m_IppCtrlFlag=0

The selected resolutions are 1440x1080 for Preview and 640x480 for ImageAnalysis in the above testing. Basically I think the results matched the target FPS range settings. Could you help to create an issue here and provide more detailed information about the Preview FPS issue encountered by you? The information might include:
  1. Do you only see the FPS issue in Preview or also ImageAnalysis? What is the "very low" value you encountered?
  2. Does the issue only or easier occur in specific environment settings?
  3. What does "some resolutions do not work" mean? Can the resolutions be found by StreamConfigurationMap#getOutputSizes(int)?
  4. Is your Huawei Nova 3 device the same as what I used to do the testing?
  5. Could you describe more about the issues you encountered compared to the old Camera API?
  6. Do you encounter the same issues on other LIMITED level devices or Huawei Nova 3 is the only one you encountered those issues?

--
You received this message because you are subscribed to the Google Groups "Android CameraX Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camerax-develop...@android.com.
To view this discussion on the web visit https://groups.google.com/a/android.com/d/msgid/camerax-developers/75f7a4b1-8ec1-45cd-8e38-3d5ab3c34f67n%40android.com.
Reply all
Reply to author
Forward
0 new messages