Android framerate not correct

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Android framerate not correct

ソリューションへジャンプ
1,489件の閲覧回数
emilmyhrman
Contributor IV


Hello,

I'm running Android 5.1.1_2.1.0-ga release with kernel 3.14.52 and are having problem getting the framerate up to 60fps (this worked earlier on kitkat release with kernel 3.0.35).

The display is configured with a pixelclock for 60fps (for our display and resolution pclk is 10MHz) but framerate for Android's SurfaceFlinger get limited to 30fps (limited by IPU interrupts?).

When running a camera overlay in 60fps it seems to output in the correct rate, so I believe the display setup is correct. But for some reason the default framebuffer is rate limited to 30fps.

Has anyone else experienced this problem also?

We're using MIPI DSI (but problem also seen with MIPI DPI).

Framerate is shown in logcat after "setprop debug.sf.showfps 1" and "killing" surfaceflinger process.

ラベル(4)
0 件の賞賛
1 解決策
983件の閲覧回数
emilmyhrman
Contributor IV

The problem was found in hwcomposer HAL. A nanosleep in vsync thread was too long, causing ioctl MXCFB_WAIT_FOR_VSYNC to sometimes miss first vsync (NF-ACK from IPU), and instead wait for second vsync, causing time to wait for vsync to double.

diff --git a/mx6/hwcomposer/hwc_vsync.cpp b/mx6/hwcomposer/hwc_vsync.cpp

index fc6b9bf..8fec0a6 100644

--- a/mx6/hwcomposer/hwc_vsync.cpp

+++ b/mx6/hwcomposer/hwc_vsync.cpp

@@ -125,7 +125,7 @@ void VSyncThread::performVSync()

     struct timespec tm;

     struct timespec ts;

-    const nsecs_t wake_up = 400000;

+    const nsecs_t wake_up = 800000; // Allow for some time to reschedule this thread and start wait on next VSYNC ioctl

     double m_frame_period_ns = mCtx->mDispInfo[HWC_DISPLAY_PRIMARY].vsync_period;

元の投稿で解決策を見る

0 件の賞賛
2 返答(返信)
983件の閲覧回数
SergioSolis
NXP Employee
NXP Employee

Thank you for posting the solution

0 件の賞賛
984件の閲覧回数
emilmyhrman
Contributor IV

The problem was found in hwcomposer HAL. A nanosleep in vsync thread was too long, causing ioctl MXCFB_WAIT_FOR_VSYNC to sometimes miss first vsync (NF-ACK from IPU), and instead wait for second vsync, causing time to wait for vsync to double.

diff --git a/mx6/hwcomposer/hwc_vsync.cpp b/mx6/hwcomposer/hwc_vsync.cpp

index fc6b9bf..8fec0a6 100644

--- a/mx6/hwcomposer/hwc_vsync.cpp

+++ b/mx6/hwcomposer/hwc_vsync.cpp

@@ -125,7 +125,7 @@ void VSyncThread::performVSync()

     struct timespec tm;

     struct timespec ts;

-    const nsecs_t wake_up = 400000;

+    const nsecs_t wake_up = 800000; // Allow for some time to reschedule this thread and start wait on next VSYNC ioctl

     double m_frame_period_ns = mCtx->mDispInfo[HWC_DISPLAY_PRIMARY].vsync_period;

0 件の賞賛