Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Player size on Android TV #3807

Closed
okaymak opened this issue Feb 6, 2018 · 6 comments
Closed

Player size on Android TV #3807

okaymak opened this issue Feb 6, 2018 · 6 comments
Assignees
Labels

Comments

@okaymak
Copy link

okaymak commented Feb 6, 2018

There are a Android TV devices running it's interface in 1280x720 (tvdpi). The TV itself has 1080p panel (i.e. Philips QM164E (model 32PFS6402/12)).

How can I make sure that ExoPlayer is correctly switching to 1920x1080?

@AquilesCanta
Copy link
Contributor

I think you are talking about track selection in adaptive streaming. If not, please clarify below. Look at DefaultTrackSelector. Under the video section in Parameters there are viewport width and viewport height. The selected tracks will be the most adequate for your viewport.

@andrewlewis
Copy link
Collaborator

andrewlewis commented Feb 6, 2018

You can also look at the output of adb shell dumpsys SurfaceFlinger to verify that the Surface buffers have the right resolution. We use the Display.Mode API to check the physical display resolution in DefaultTrackSelector.ParametersBuilder.setViewportSizeToPhysicalDisplaySize.

@okaymak
Copy link
Author

okaymak commented Feb 8, 2018

I was talking about making sure that a 1920x1080 video being played through ExoPlayer does not get played inside a frame of 1280x720, because the device does not report it's physical display size correctly. This device still is on API 22, so Display.Mode is not available yet.

DefaultTrackSelector.Parameter.withViewportSizeFromContext returns 1280x720. When I use the system property sys.display-size (like ExoPlayer does it for Nvidia Shield in Util.getPhysicalDisplaySize, it returns 1920x1080. I use that value now to set DefaultTrackSelector.Parameter.withViewportSize. Using adb shell dumpsys SurfaceFlinger reports:

shell@QM16XE_F:/ $ dumpsys SurfaceFlinger
Build configuration: [sf] [libui] [libgui]
Sync configuration: [using: EGL_ANDROID_native_fence_sync]
DispSync configuration: app phase 0 ns, sf phase 0 ns, present offset 0 ns (refresh 16666666 ns)
Visible layers (count = 8)
+ Layer 0xb657b000 (NativeMediaPlayerSurface)
  Region transparentRegion (this=0xb657b160, count=1)
    [  0,   0,   0,   0]
  Region visibleRegion (this=0xb657b008, count=1)
    [  0,   0,   0,   0]
      layerStack=   0, z=        0, pos=(0,0), size=(1920,1080), crop=(   0,   0,  -1,  -1), isOpaque=0, invalidate=0, alpha=0xff, flags=0x00000000, tr=[1.00, 0.00][0.00, 1.00]
      client=0xb5c28040
      format= 1, sideband= 0 activeBuffer=[   0x   0:   0,  0], queued-frames=0, mRefreshPending=0
            mTexName=2 mCurrentTexture=-1
            mCurrentCrop=[0,0,0,0] mCurrentTransform=0
            mAbandoned=0
            -BufferQueue mMaxAcquiredBufferCount=1, mDequeueBufferCannotBlock=0, default-size=[1920x1080], default-format=1, transform-hint=00, FIFO(0)={}
+ LayerDim 0xb64e7000 (DimLayer)
  Region transparentRegion (this=0xb64e7160, count=1)
    [  0,   0,   0,   0]
  Region visibleRegion (this=0xb64e7008, count=1)
    [  0,   0,   0,   0]
      layerStack=   0, z=        0, pos=(0,0), size=(  16,  16), crop=(   0,   0,  -1,  -1), isOpaque=0, invalidate=0, alpha=0xff, flags=0x00000001, tr=[1.00, 0.00][0.00, 1.00]
      client=0xb541d0c0
      format= 0, sideband= 0 activeBuffer=[   0x   0:   0,  0], queued-frames=0, mRefreshPending=0
            mTexName=5 mCurrentTexture=-1
            mCurrentCrop=[0,0,0,0] mCurrentTransform=0
            mAbandoned=0
            -BufferQueue mMaxAcquiredBufferCount=1, mDequeueBufferCannotBlock=0, default-size=[1x1], default-format=1, transform-hint=00, FIFO(0)={}
+ LayerDim 0xb64e9000 (DimLayer)
  Region transparentRegion (this=0xb64e9160, count=1)
    [  0,   0,   0,   0]
  Region visibleRegion (this=0xb64e9008, count=1)
    [  0,   0,   0,   0]
      layerStack=   0, z=        0, pos=(0,0), size=(  16,  16), crop=(   0,   0,  -1,  -1), isOpaque=0, invalidate=0, alpha=0xff, flags=0x00000001, tr=[1.00, 0.00][0.00, 1.00]
      client=0xb541d0c0
      format= 0, sideband= 0 activeBuffer=[   0x   0:   0,  0], queued-frames=0, mRefreshPending=0
            mTexName=6 mCurrentTexture=-1
            mCurrentCrop=[0,0,0,0] mCurrentTransform=0
            mAbandoned=0
            -BufferQueue mMaxAcquiredBufferCount=1, mDequeueBufferCannotBlock=0, default-size=[1x1], default-format=1, transform-hint=00, FIFO(0)={}
+ Layer 0xb6580000 (com.android.systemui.ImageWallpaper)
  Region transparentRegion (this=0xb6580160, count=1)
    [  0,   0,   0,   0]
  Region visibleRegion (this=0xb6580008, count=1)
    [  0,   0,   0,   0]
      layerStack=   0, z=    21000, pos=(0,-120), size=(1280, 960), crop=(   0,   0,1280, 960), isOpaque=1, invalidate=0, alpha=0x00, flags=0x00000003, tr=[1.00, 0.00][0.00, 1.00]
      client=0xb541d100
      format= 2, sideband= 0 activeBuffer=[1280x 960:1280,  1], queued-frames=0, mRefreshPending=0
            mTexName=8 mCurrentTexture=0
            mCurrentCrop=[0,0,0,0] mCurrentTransform=0
            mAbandoned=0
            -BufferQueue mMaxAcquiredBufferCount=1, mDequeueBufferCannotBlock=0, default-size=[1280x960], default-format=2, transform-hint=00, FIFO(0)={}
+ Layer 0xb658f000 (SurfaceView)
  Region transparentRegion (this=0xb658f160, count=1)
    [  0,   0,   0,   0]
  Region visibleRegion (this=0xb658f008, count=1)
    [  0,   0, 1280, 720]
      layerStack=   0, z=    21025, pos=(0,0), size=(1280, 720), crop=(   0,   0,1280, 720), isOpaque=1, invalidate=0, alpha=0xff, flags=0x00000002, tr=[1.00, 0.00][0.00, 1.00]
      client=0xb541d140
      format= 4, sideband= 0 activeBuffer=[1920x1080:1920,103], queued-frames=0, mRefreshPending=0
            mTexName=10 mCurrentTexture=15
            mCurrentCrop=[0,0,1920,1080] mCurrentTransform=0
            mAbandoned=0
            -BufferQueue mMaxAcquiredBufferCount=1, mDequeueBufferCannotBlock=0, default-size=[1280x720], default-format=4, transform-hint=00, FIFO(0)={}
             [00:0xb5c2d180] state=DEQUEUED, 0xb5c26100 [1920x1080:1920,103]
             [01:0xb5426200] state=DEQUEUED, 0xb541b0a0 [1920x1080:1920,103]
             [02:0xb2827400] state=DEQUEUED, 0xb281e280 [1920x1080:1920,103]
             [03:0xb5c2d080] state=DEQUEUED, 0xb5c263a0 [1920x1080:1920,103]
             [04:0xb5426080] state=DEQUEUED, 0xb5c261c0 [1920x1080:1920,103]
             [05:0xb5426280] state=DEQUEUED, 0xb541b1c0 [1920x1080:1920,103]
             [06:0xb2827300] state=DEQUEUED, 0xb281e040 [1920x1080:1920,103]
             [07:0xb5426300] state=DEQUEUED, 0xb541b220 [1920x1080:1920,103]
             [08:0xb2827480] state=DEQUEUED, 0xb281e340 [1920x1080:1920,103]
             [09:0xb5c2d200] state=DEQUEUED, 0xb5c26160 [1920x1080:1920,103]
             [10:0xb5426400] state=DEQUEUED, 0xb541b100 [1920x1080:1920,103]
             [11:0xb2827500] state=DEQUEUED, 0xb281e3a0 [1920x1080:1920,103]
             [12:0xb5c2d100] state=FREE    , 0xb5c26220 [1920x1080:1920,103]
             [13:0xb5426480] state=FREE    , 0xb541b160 [1920x1080:1920,103]
             [14:0xb5426380] state=FREE    , 0xb541b280 [1920x1080:1920,103]
            >[15:0xb5426500] state=ACQUIRED, 0xb541b2e0 [1920x1080:1920,103]
             [16:0xb5426600] state=DEQUEUED, 0xb541b340 [1920x1080:1920,103]
             [17:0xb5c2d280] state=DEQUEUED, 0xb5c262e0 [1920x1080:1920,103]
             [18:0xb2827580] state=DEQUEUED, 0xb281e400 [1920x1080:1920,103]
             [19:0xb5c2d300] state=DEQUEUED, 0xb5c26340 [1920x1080:1920,103]
+ Layer 0xb657e000 ([redacted].PlayerActivity)
  Region transparentRegion (this=0xb657e160, count=1)
    [  0,   0,   0,   0]
  Region visibleRegion (this=0xb657e008, count=1)
    [  0,   0, 1280, 720]
      layerStack=   0, z=    21030, pos=(0,0), size=(1280, 720), crop=(   0,   0,1280, 720), isOpaque=0, invalidate=0, alpha=0xff, flags=0x00000000, tr=[1.00, 0.00][0.00, 1.00]
      client=0xb541d140
      format= 1, sideband= 0 activeBuffer=[1280x 720:1280,  1], queued-frames=0, mRefreshPending=0
            mTexName=9 mCurrentTexture=0
            mCurrentCrop=[0,0,0,0] mCurrentTransform=0
            mAbandoned=0
            -BufferQueue mMaxAcquiredBufferCount=1, mDequeueBufferCannotBlock=0, default-size=[1280x720], default-format=1, transform-hint=00, FIFO(0)={}
            >[00:0xb5426180] state=ACQUIRED, 0xb541b040 [1280x 720:1280,  1]
             [01:0xb2827080] state=FREE    , 0xb281e1c0 [1280x 720:1280,  1]
             [02:0xb2827380] state=FREE    , 0xb281e220 [1280x 720:1280,  1]
+ Layer 0xb64e4000 (FocusedStackFrame)
  Region transparentRegion (this=0xb64e4160, count=1)
    [  0,   0,   0,   0]
  Region visibleRegion (this=0xb64e4008, count=1)
    [  0,   0,   0,   0]
      layerStack=   0, z=    21031, pos=(0,0), size=(   1,   1), crop=(   0,   0,  -1,  -1), isOpaque=0, invalidate=0, alpha=0x4d, flags=0x00000001, tr=[1.00, 0.00][0.00, 1.00]
      client=0xb541d0c0
      format= 1, sideband= 0 activeBuffer=[   0x   0:   0,  0], queued-frames=0, mRefreshPending=0
            mTexName=4 mCurrentTexture=-1
            mCurrentCrop=[0,0,0,0] mCurrentTransform=0
            mAbandoned=0
            -BufferQueue mMaxAcquiredBufferCount=1, mDequeueBufferCannotBlock=0, default-size=[1x1], default-format=1, transform-hint=00, FIFO(0)={}
+ Layer 0xb64ec000 (StrictModeFlash)
  Region transparentRegion (this=0xb64ec160, count=1)
    [  0,   0,   0,   0]
  Region visibleRegion (this=0xb64ec008, count=1)
    [  0,   0,   0,   0]
      layerStack=   0, z=  1010000, pos=(0,0), size=(1280, 720), crop=(   0,   0,  -1,  -1), isOpaque=0, invalidate=0, alpha=0xff, flags=0x00000001, tr=[1.00, 0.00][0.00, 1.00]
      client=0xb541d0c0
      format= 1, sideband= 0 activeBuffer=[1280x 720:1280,  1], queued-frames=0, mRefreshPending=0
            mTexName=7 mCurrentTexture=1
            mCurrentCrop=[0,0,0,0] mCurrentTransform=0
            mAbandoned=0
            -BufferQueue mMaxAcquiredBufferCount=1, mDequeueBufferCannotBlock=0, default-size=[1280x720], default-format=1, transform-hint=00, FIFO(0)={}
             [00:0xb2827100] state=FREE    , 0xb281e0a0 [   1x   1:  16,  1]
            >[01:0xb2827180] state=ACQUIRED, 0xb281e100 [1280x 720:1280,  1]
Displays (1 entries)
+ DisplayDevice: Built-in Screen
   type=0, hwcId=0, layerStack=0, (1280x 720), ANativeWindow=0xb64d3608, orient= 0 (type=00000000), flips=41615, isSecure=1, secureVis=0, powerMode=2, activeConfig=0, numLayers=2
   v:[0,0,1280,720], f:[0,0,1280,720], s:[0,0,1280,720],transform:[[1.000,0.000,-0.000][0.000,1.000,-0.000][0.000,0.000,1.000]]
mAbandoned=0
-BufferQueue mMaxAcquiredBufferCount=1, mDequeueBufferCannotBlock=0, default-size=[1280x720], default-format=1, transform-hint=00, FIFO(0)={}
 [00:0xb6462f00] state=FREE    , 0xb64c24c0 [1280x 720:1280,  1]
>[01:0xb6554400] state=ACQUIRED, 0xb64c25e0 [1280x 720:1280,  1]
 [02:0xb6554a80] state=FREE    , 0xb64c28e0 [1280x 720:1280,  1]
SurfaceFlinger global state:
EGL implementation : 1.4 Linux-r5p0-00dev0
EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_fence_sync EGL_ANDROID_image_native_buffer EGL_ANDROID_recordable EGL_ANDROID_native_fence_sync EGL_ANDROID_framebuffer_target EGL_EXT_create_context_robustness EGL_ANDROID_blob_cache EGL_KHR_create_context 
GLES: ARM, Mali-450 MP, OpenGL ES 2.0
GL_EXT_debug_marker GL_OES_texture_npot GL_OES_vertex_array_object GL_OES_compressed_ETC1_RGB8_texture GL_EXT_compressed_ETC1_RGB8_sub_texture GL_OES_standard_derivatives GL_OES_EGL_image GL_OES_depth24 GL_ARM_rgba8 GL_ARM_mali_shader_binary GL_OES_depth_texture GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 GL_OES_vertex_half_float GL_EXT_blend_minmax GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_rgb8_rgba8 GL_EXT_multisampled_render_to_texture GL_EXT_discard_framebuffer GL_OES_get_program_binary GL_ARM_mali_program_binary GL_EXT_shader_texture_lod GL_EXT_robustness GL_OES_depth_texture_cube_map GL_KHR_debug GL_ARM_shader_framebuffer_fetch GL_ARM_shader_framebuffer_fetch_depth_stencil 
  Region undefinedRegion (this=0xb648066c, count=1)
    [  0,   0,   0,   0]
  orientation=0, isDisplayOn=1
  last eglSwapBuffers() time: 3263.333000 us
  last transaction time     : 134.792000 us
  transaction-flags         : 00000000
  refresh-rate              : 60.000002 fps
  x-dpi                     : 32.512001
  y-dpi                     : 18.288000
  gpu_to_cpu_unsupported    : 0
  eglSwapBuffers time: 0.000000 us
  transaction time: 0.000000 us
VSYNC state: disabled
  soft-vsync: disabled
  numListeners=12,
  events-delivered: 15688
    0xb282e038: count=-1
    0xb282e060: count=-1
    0xb5c30038: count=-1
    0xb5c30060: count=-1
    0xb5c30088: count=-1
    0xb5c300b0: count=-1
    0xb5c300d8: count=-1
    0xb6425ab0: count=-1
    0xb6425ad8: count=-1
    0xb6587038: count=-1
    0xb65870b0: count=-1
    0xb6587218: count=-1
h/w composer state:
  h/w composer present and enabled
Hardware Composer state (version 01030000):
  mDebugForceFakeVSync=0
  Display[0] configurations (* current):
    * 0: 1280x720, xdpi=32.512001, ydpi=18.288000, refresh=16666666
  numHwLayers=3, flags=00000000
    type   |  handle  | hint | flag | tr | blnd |   format    |     source crop (l,t,r,b)      |          frame         | name 
-----------+----------+------+------+----+------+-------------+--------------------------------+------------------------+------
       HWC | b541b2e0 | 0002 | 0000 | 00 | 0100 | ? 00000103  |    0.0,    0.0, 1920.0, 1080.0 |    0,    0, 1280,  720 | SurfaceView
       HWC | b541b040 | 0000 | 0000 | 00 | 0105 | RGBA_8888   |    0.0,    0.0, 1280.0,  720.0 |    0,    0, 1280,  720 | [redacted].PlayerActivity
 FB TARGET | b64c25e0 | 0000 | 0000 | 00 | 0105 | RGBA_8888   |    0.0,    0.0, 1280.0,  720.0 |    0,    0, 1280,  720 | HWC_FRAMEBUFFER_TARGET
hwcomposer detail version 1.0317
Allocated buffers:
0xb281e040: unknown     | 1920 (1920) x 1080 |      103 | 0x60006900
0xb281e0a0:    0.06 KiB |    1 (  16) x    1 |        1 | 0x00000933
0xb281e100: 3600.00 KiB | 1280 (1280) x  720 |        1 | 0x00000933
0xb281e160: 4800.00 KiB | 1280 (1280) x  960 |        1 | 0x00000f02
0xb281e1c0: 3600.00 KiB | 1280 (1280) x  720 |        1 | 0x00000f02
0xb281e220: 3600.00 KiB | 1280 (1280) x  720 |        1 | 0x00000f02
0xb281e280: unknown     | 1920 (1920) x 1080 |      103 | 0x60006900
0xb281e340: unknown     | 1920 (1920) x 1080 |      103 | 0x60006900
0xb281e3a0: unknown     | 1920 (1920) x 1080 |      103 | 0x60006900
0xb281e400: unknown     | 1920 (1920) x 1080 |      103 | 0x60006900
0xb541b040: 3600.00 KiB | 1280 (1280) x  720 |        1 | 0x00000f02
0xb541b0a0: unknown     | 1920 (1920) x 1080 |      103 | 0x60006900
0xb541b100: unknown     | 1920 (1920) x 1080 |      103 | 0x60006900
0xb541b160: unknown     | 1920 (1920) x 1080 |      103 | 0x60006900
0xb541b1c0: unknown     | 1920 (1920) x 1080 |      103 | 0x60006900
0xb541b220: unknown     | 1920 (1920) x 1080 |      103 | 0x60006900
0xb541b280: unknown     | 1920 (1920) x 1080 |      103 | 0x60006900
0xb541b2e0: unknown     | 1920 (1920) x 1080 |      103 | 0x60006900
0xb541b340: unknown     | 1920 (1920) x 1080 |      103 | 0x60006900
0xb5c26100: unknown     | 1920 (1920) x 1080 |      103 | 0x60006900
0xb5c26160: unknown     | 1920 (1920) x 1080 |      103 | 0x60006900
0xb5c261c0: unknown     | 1920 (1920) x 1080 |      103 | 0x60006900
0xb5c26220: unknown     | 1920 (1920) x 1080 |      103 | 0x60006900
0xb5c262e0: unknown     | 1920 (1920) x 1080 |      103 | 0x60006900
0xb5c26340: unknown     | 1920 (1920) x 1080 |      103 | 0x60006900
0xb5c263a0: unknown     | 1920 (1920) x 1080 |      103 | 0x60006900
0xb64c24c0: 3600.00 KiB | 1280 (1280) x  720 |        1 | 0x00001e02
0xb64c25e0: 3600.00 KiB | 1280 (1280) x  720 |        1 | 0x00001e02
0xb64c28e0: 3600.00 KiB | 1280 (1280) x  720 |        1 | 0x00001e02
Total allocated (estimate): 30000.06 KB

Is the display resolution now being fully used by ExoPlayer according to the above output?

@andrewlewis
Copy link
Collaborator

I think so: the SurfaceView's buffers are 1920 * 1080.

Please could you provide the output of adb shell getprop ro.build.fingerprint (or even better, the output of adb bugreport)? We should probably check sys.display-size on this device too.

@andrewlewis
Copy link
Collaborator

See also #800.

@okaymak
Copy link
Author

okaymak commented Feb 8, 2018

Output adb shell getprop ro.build.fingerprint:
PHILIPS/QM16XE_F/QM16XE_F:5.1.1/LMY48N/0115243:user/release-keys

I will send the bugreport output by email.

@andrewlewis andrewlewis self-assigned this Feb 8, 2018
ojw28 pushed a commit that referenced this issue Feb 16, 2018
Device models are from
https://support.google.com/googleplay/answer/1727131?hl=en. It looks like among
these devices Build.MANUFACTURER can be set to either "PHILIPS" or "Philips",
based on looking at internal bug reports.

Issue: #3807

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185121182
@ojw28 ojw28 closed this as completed Feb 16, 2018
ojw28 pushed a commit that referenced this issue Feb 20, 2018
Device models are from
https://support.google.com/googleplay/answer/1727131?hl=en. It looks like among
these devices Build.MANUFACTURER can be set to either "PHILIPS" or "Philips",
based on looking at internal bug reports.

Issue: #3807

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185121182
@google google locked and limited conversation to collaborators Jun 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants