Firefly Open Source Community

   Login   |   Register   |
New_Topic
Print Previous Topic Next Topic

Android Dev : surfaceview / thread / canvas

42

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
42

Android Dev : surfaceview / thread / canvas

Posted at 4/25/2016 23:24:00      View:7073 | Replies:7        Print      Only Author   [Copy Link] 1#
Hello,

we try to remplave Radxa (RK3188 Mali 400) by the Firefly RK3288. On paper, Firefly performance are better than the Radxa one. But we meet a problem using surfaceview / Canvas refresh rate:

-> On Radxa the time between to frame is stable and around 16ms
-> On Firefly, the same code give 25 or 32 ms ... and show lag and "fickering" on screen.

radxa has android 4.2.2 and firefly "out of the box" 4.4.

Please is some one as an idea from where this lower performance can came from.

thanks
Reply

Use props Report

543

Credits

19

Prestige

15

Contribution

advanced

Rank: 4

Credits
543
Posted at 4/26/2016 01:09:07        Only Author  2#
Hi

Please try Android 5.1 on Firefly.
It should provide far better performance.

Can you tell more about what you are trying to do?
I'm sure someone will be able to help you if they can do similar tests and provide feedback.
Reply

Use props Report

42

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
42
Posted at 4/26/2016 16:43:24        Only Author  3#

RE: Android Dev : surfaceview / thread / canvas

Hi,

thank you for your help.
I have try Android 5.1 and the result is worse ... i can back to 4.4 (mars 2016 the last one).

What i do is develop android application in witch i want to display a 360° panorama 'turning at a given velocity".
For that i have a SurfaceView, surfaceholder and a thread.
the thread run is like :
public void run() {
   Canvas c;
   while(run){
      c=null;
      try{
         c=surfaceholder.lockCanvas(null);
         synchronized( surfaceholder){
            surf.draw(c);
         }
      }finally{
         if (c!=null){
            surfaceholder.unlockCanvasAndPost(c);
         }
      }
   }
}
in the draw function i have :

canvas.drawBitmap(bipmap, src , dst, null) ;

the bitmap hold the 360° panorama,
src is a rect that move everuy call to draw function and dst is a fixed rect on all screen.

On a RK3188+Mali400 it runs perfectly with a very nice smooth motion (time between to call to
draw is stable and is 16ms).
On firefly the time between to calls are between 25 and 35 ms without stability creating saccades
movement.
If i remove he DrawBitmap call and replace by a simple canvas draw call the time between to calls
came back to 16ms ... so i suspect the drawbitmap call is the problem (memory access ?)...



Reply

Use props Report

42

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
42
Posted at 4/29/2016 15:00:31        Only Author  4#
hi,

i replace surfaceview by textureview and it is better, but not perfect.... next step us GLSurfaceView .... but still not normal that performances of Rk3288 + Mali T760 looks lower than RK3188 + Mali 400 for this point.

Reply

Use props Report

42

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
42
Posted at 5/5/2016 00:02:13        Only Author  5#
Hi,

now i use a GLSurfaceView (2.0) and texture to dsplay a bitmap... (small one).
It is not normal that with the RK3288 and Mali T764 i have poor render performance using any display technique (SurfaceView, TextureView, GLSurfaceView)...

With a "basic" RK3188+MALI 400 stick  it is perfect ... (smooth animation without lag). And with this RK3288 i have many saccadic movement. !!!

WHYYYYYYYY   ????
Reply

Use props Report

8

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
8
Posted at 6/3/2016 19:40:44        Only Author  6#
Hello,

I have noticed a slower performance as well on the GPU. My board is a Firefly Rk3288 reload.

My application loads a 1080 texture. Here is the information I could get.

- Firefly-RK3288_Beta_Android4.4_201501271125
    - Average loading time 100ms
    - Driver = OpenGL ES 3.1 v1.r6p0-02rel0.0f4218be5cc66c20a4f31b6cc856ee46
    - GPU : Mali-T760

- FireFly-RK3288-Reload_Android5.1_201603111814
    - Average loading time 11ms
    - Driver = OpenGL ES 3.0
    - GPU = Mali-T764

I think the driver has been updated in the Android 5.1 image. How can I select or re-install the GPU driver used in the 4.4 image? Where to get it from?
Reply

Use props Report

42

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
42
Posted at 11/25/2020 16:16:32        Only Author  7#
Hi,
we still meet problem regarding RK3288 performances / resolution.

In fact we found that with Android 4.4 and HDMI screen resolution 1280x720 all graphic canvas use 1280x720 resolution
(SurfaceView.width = 1280 and SurfaceView.height = 720). This makes that big bitmap manipulation are on 1280x720

With Android 5.1 and HDMI screen resolution 1280x720 all graphic canvas still use 1920x1080 resolution ...
(SurfaceView.width = 1920 and SurfaceView.height = 1080) ... this is the reason that high frame rate (60fps) display is not possible as the Bitmap used is 1920x1080 pixels !!! (even with HDMI output set to 1280x720).

So we back to Android 4.4 on our old RK3288 and it was OK !

Last month we receive new RK3288 from firefly, .. .and it is now impossible to install Android 4.4 ...... so our problem is back again.

Finally we want to use the 5.1 reload firmware, BUT Why the 'working resolution (in Android APK) is not equal to HDMI output mode !! )

Thank you for your help
Reply

Use props Report

42

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
42
Posted at 11/27/2020 00:22:47        Only Author  8#
.... also i notice that when using the VGA output in place of HDMI and select any available resolution (from very low to high), the SurfaceView "canvas" Width and Height still fixed to 1920x1080 ....

Everything looks like the Android 5.1 works in 1920x1080 and make a final scale to the choosen resolution ...
Witch was not the case for Android 4.4

Reply

Use props Report

You need to log in before you can reply Login | Register

This forum Credits Rules

Quick Reply Back to top Back to list