Can Kodi, or any Android application on Nvidia Shield Android TV, play 4K video and maintain 4K resolution all the way to the TV? I think the video is being scaled down from 4K to 1080p and back up to 4K. See "dumpsys SurfaceFlinger" below. This was done while Kodi was playing a H.265 2160p60 video file. Notice the Display [0] configuration is 1080p60. Also notice that HWC is scaling the 2160p output from Kodi to 1080p and that the HWC_FRAMEBUFFER_TARGET is 1080p. I have a 4K Samsung TV model number UN40HU6950F. The Shield is connected to HDMI port 3 which supports HDCP 2.2. The Samsung TV shows that it is receiving 2160p60 video.
Is the Shield decoding 4K, scaling the decode texture to 1080p for hardware compositing and then scaling back up to 4K before sending over HDMI? That's what the SurfaceFlinger dump suggests.
Code:
shell@foster:/ $ dumpsys SurfaceFlinger
Build configuration: [sf] [libui] [libgui DONT_USE_FENCE_SYNC]
Sync configuration: [using: EGL_ANDROID_native_fence_sync EGL_KHR_wait_sync]
DispSync configuration: app phase 0 ns, sf phase 0 ns, present offset 0 ns (refresh 16661700 ns)
Visible layers (count = 5)
+ LayerDim 0x203867c000 (DimLayer)
Region transparentRegion (this=0x203867c1e0, count=1)
[ 0, 0, 0, 0]
Region visibleRegion (this=0x203867c010, 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=0x2034412480
format= 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)={}
+ Layer 0x2038896000 (com.android.systemui.ImageWallpaper)
Region transparentRegion (this=0x20388961e0, count=1)
[ 0, 0, 0, 0]
Region visibleRegion (this=0x2038896010, count=1)
[ 0, 0, 0, 0]
layerStack= 0, z= 21010, pos=(0,0), size=(1920,1080), crop=( 0, 0,1920,1080), isOpaque=1, invalidate=0, alpha=0x00, flags=0x00000003, tr=[1.00, 0.00][0.00, 1.00]
client=0x20383e9e80
format= 2, activeBuffer=[1920x1080:1920, 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=[1920x1080], default-format=2, transform-hint=00, FIFO(0)={}
+ Layer 0x203830f000 (org.xbmc.kodi/org.xbmc.kodi.Main)
Region transparentRegion (this=0x203830f1e0, count=1)
[ 0, 0, 0, 0]
Region visibleRegion (this=0x203830f010, count=1)
[ 0, 0, 1920, 1080]
layerStack= 0, z= 21010, pos=(0,0), size=(1920,1080), crop=( 0, 0,1920,1080), isOpaque=0, invalidate=0, alpha=0xff, flags=0x00000000, tr=[1.00, 0.00][0.00, 1.00]
client=0x2034412660
format= 1, activeBuffer=[3840x2160:3840, 1], queued-frames=1, mRefreshPending=0
mTexName=9 mCurrentTexture=0
mCurrentCrop=[0,0,0,0] mCurrentTransform=0
mAbandoned=0
-BufferQueue mMaxAcquiredBufferCount=1, mDequeueBufferCannotBlock=0, default-size=[1920x1080], default-format=1, transform-hint=00, FIFO(1)={01:0x2034432640 crop=[0,0,0,0], xform=0x00, time=0x2fa21e6801, scale=SCALE_TO_WINDOW
}
>[00:0x20377feb00] state=ACQUIRED, 0x203830b5c0 [3840x2160:3840, 1]
[01:0x2034432640] state=QUEUED , 0x203830a1c0 [3840x2160:3840, 1]
[02:0x2034432aa0] state=DEQUEUED, 0x2034408500 [3840x2160:3840, 1]
+ Layer 0x20387f0000 (FocusedStackFrame)
Region transparentRegion (this=0x20387f01e0, count=1)
[ 0, 0, 0, 0]
Region visibleRegion (this=0x20387f0010, count=1)
[ 0, 0, 0, 0]
layerStack= 0, z= 21011, 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=0x2034412480
format= 1, activeBuffer=[ 0x 0: 0, 0], queued-frames=0, mRefreshPending=0
mTexName=3 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 0x2037ea6000 (DimLayer)
Region transparentRegion (this=0x2037ea61e0, count=1)
[ 0, 0, 0, 0]
Region visibleRegion (this=0x2037ea6010, count=1)
[ 0, 0, 0, 0]
layerStack= 0, z= 100999, pos=(-480,-270), size=(2880,1620), crop=( 0, 0, -1, -1), isOpaque=0, invalidate=0, alpha=0x00, flags=0x00000001, tr=[1.00, 0.00][0.00, 1.00]
client=0x2034412480
format= 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=[2880x1620], default-format=1, transform-hint=00, FIFO(0)={}
Displays (1 entries)
+ DisplayDevice: Built-in Screen
type=0, hwcId=0, layerStack=0, (1920x1080), ANativeWindow=0x2038199c10, orient= 0 (type=00000000), flips=3028, isSecure=1, secureVis=0, powerMode=2, activeConfig=0, numLayers=1
v:[0,0,1920,1080], f:[0,0,1920,1080], s:[0,0,1920,1080],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=[1920x1080], default-format=1, transform-hint=00, FIFO(0)={}
>[00:0x20377fe400] state=ACQUIRED, 0x2033c52c40 [1920x1080:1920, 1]
[01:0x20377ff120] state=DEQUEUED, 0x2038309a40 [1920x1080:1920, 1]
SurfaceFlinger global state:
EGL implementation : 1.4
EGL_NV_system_time EGL_KHR_surfaceless_context EGL_KHR_image EGL_KHR_image_base EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_config_attribs EGL_KHR_fence_sync EGL_NV_sync EGL_KHR_reusable_sync EGL_KHR_create_context EGL_EXT_create_context_robustness EGL_KHR_stream EGL_KHR_stream_fifo EGL_KHR_stream_producer_eglsurface EGL_KHR_stream_consumer_gltexture EGL_KHR_stream_cross_process_fd EGL_NV_stream_sync EGL_KHR_get_all_proc_addresses EGL_ANDROID_blob_cache EGL_NV_set_context_extraction_callback EGL_ANDROID_recordable EGL_IMG_context_priority EGL_ANDROID_image_native_buffer EGL_ANDROID_native_fence_sync EGL_KHR_wait_sync EGL_EXT_buffer_age EGL_NV_post_sub_buffer
GLES: NVIDIA Corporation, NVIDIA Tegra, OpenGL ES 3.1 NVIDIA 349.00
GL_EXT_debug_marker GL_NV_internalformat_sample_query GL_EXT_base_instance GL_EXT_blend_minmax GL_EXT_buffer_storage GL_EXT_color_buffer_float GL_EXT_color_buffer_half_float GL_EXT_copy_image GL_EXT_debug_label GL_EXT_discard_framebuffer GL_EXT_disjoint_timer_query GL_EXT_draw_buffers_indexed GL_EXT_draw_elements_base_vertex GL_EXT_frag_depth GL_EXT_geometry_point_size GL_EXT_geometry_shader GL_EXT_gpu_shader5 GL_EXT_map_buffer_range GL_EXT_multi_draw_indirect GL_EXT_occlusion_query_boolean GL_EXT_post_depth_coverage GL_EXT_primitive_bounding_box GL_EXT_raster_multisample GL_EXT_render_snorm GL_EXT_robustness GL_EXT_separate_shader_objects GL_EXT_shader_implicit_conversions GL_EXT_shader_integer_mix GL_EXT_shader_io_blocks GL_EXT_shader_texture_lod GL_EXT_shadow_samplers GL_EXT_sRGB GL_EXT_sRGB_write_control GL_EXT_tessellation_point_size GL_EXT_tessellation_shader GL_EXT_texture_border_clamp GL_EXT_texture_buffer GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map_array GL_EXT_texture_filter_anisotropic GL_EXT_texture_filter_minmax GL_EXT_texture_format_BGRA8888 GL_EXT_texture_norm16 GL_EXT_texture_rg GL_EXT_texture_sRGB_decode GL_EXT_texture_storage GL_EXT_texture_view GL_EXT_unpack_subimage GL_KHR_context_flush_control GL_KHR_debug GL_KHR_robust_buffer_access_behavior GL_KHR_robustness GL_KHR_texture_compression_astc_ldr GL_NV_bgr GL_NV_bindless_texture GL_NV_blend_equation_advanced GL_NV_blend_equation_advanced_coherent GL_NV_conditional_render GL_NV_conservative_raster GL_NV_copy_buffer GL_NV_copy_image GL_NV_draw_buffers GL_NV_draw_instanced GL_NV_draw_texture GL_NV_EGL_stream_consumer_external GL_NV_explicit_attrib_location GL_NV_fbo_color_attachments GL_NV_fill_rectangle GL_NV_fragment_coverage_to_color GL_NV_fragment_shader_interlock GL_NV_framebuffer_blit GL_NV_framebuffer_mixed_samples GL_NV_framebuffer_multisample GL_NV_generate_mipmap_sRGB GL_NV_geometry_shader_passthrough GL_NV_instanced_arrays GL_NV_image_formats GL_NV_occlusion_query_samples GL_NV_non_square_matrices GL_NV_pack_subimage GL_NV_packed_float GL_NV_packed_float_linear GL_NV_path_rendering GL_NV_path_rendering_shared_edge GL_NV_pixel_buffer_object GL_NV_polygon_mode GL_NV_read_buffer GL_NV_read_depth GL_NV_read_depth_stencil GL_NV_read_stencil GL_NV_sample_locations GL_NV_sample_mask_override_coverage GL_NV_secure_context GL_NV_shader_noperspective_interpolation GL_NV_shadow_samplers_array GL_NV_shadow_samplers_cube GL_NV_sRGB_formats GL_NV_texture_array GL_NV_texture_border_clamp GL_NV_texture_compression_latc GL_NV_texture_compression_s3tc GL_NV_texture_compression_s3tc_update GL_NV_timer_query GL_NV_viewport_array GL_NV_viewport_array2 GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth24 GL_OES_depth32 GL_OES_depth_texture GL_OES_depth_texture_cube_map GL_OES_copy_image GL_OES_draw_buffers_indexed GL_OES_draw_elements_base_vertex GL_OES_texture_border_clamp GL_OES_tessellation_point_size GL_OES_tessellation_shader GL_OES_texture_buffer GL_OES_geometry_point_size GL_OES_geometry_shader GL_OES_gpu_shader5 GL_OES_shader_io_blocks GL_OES_texture_view GL_OES_primitive_bounding_box GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_get_program_binary GL_OES_mapbuffer GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_OES_sample_shading GL_OES_sample_variables GL_OES_shader_image_atomic GL_OES_shader_multisample_interpolation GL_OES_standard_derivatives GL_OES_surfaceless_context GL_OES_texture_cube_map_array GL_OES_texture_npot GL_OES_texture_float GL_OES_texture_float_linear GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_stencil8 GL_OES_texture_storage_multisample_2d_array GL_OES_vertex_array_object GL_OES_vertex_half_float GL_ANDROID_extension_pack_es31a
Region undefinedRegion (this=0x2038152a98, count=1)
[ 0, 0, 1920, 1080]
orientation=0, isDisplayOn=1
last eglSwapBuffers() time: 2591.458000 us
last transaction time : 41.406000 us
transaction-flags : 00000000
refresh-rate : 60.017885 fps
x-dpi : 26.000000
y-dpi : 26.000000
gpu_to_cpu_unsupported : 0
eglSwapBuffers time: 0.000000 us
transaction time: 0.000000 us
VSYNC state: disabled
soft-vsync: disabled
numListeners=13,
events-delivered: 2050
0x2033fdddd0: count=-1
0x2033fdde20: count=-1
0x2033fdde70: count=-1
0x2033fddec0: count=-1
0x2033fddf10: count=-1
0x203442f060: count=-1
0x203442f1a0: count=-1
0x203442f2e0: count=-1
0x20383cb1a0: count=-1
0x20383cb1f0: count=-1
0x20383cb5b0: count=-1
0x20383cba60: count=-1
0x2038815240: count=-1
h/w composer state:
h/w composer present and enabled
Hardware Composer state (version 01040000):
mDebugForceFakeVSync=0
Display[0] configurations (* current):
* 0: 1920x1080, xdpi=26.000000, ydpi=26.000000, refresh=16661700
1: 720x400, xdpi=10.000000, ydpi=10.000000, refresh=14276478
2: 640x480, xdpi=9.000000, ydpi=12.000000, refresh=16666440
3: 640x480, xdpi=9.000000, ydpi=12.000000, refresh=14911377
4: 640x480, xdpi=9.000000, ydpi=12.000000, refresh=13734589
5: 640x480, xdpi=9.000000, ydpi=12.000000, refresh=13333320
6: 800x600, xdpi=11.000000, ydpi=15.000000, refresh=16579200
7: 800x600, xdpi=11.000000, ydpi=15.000000, refresh=13852800
8: 800x600, xdpi=11.000000, ydpi=15.000000, refresh=13333320
9: 832x624, xdpi=11.000000, ydpi=15.000000, refresh=13324780
10: 1024x768, xdpi=14.000000, ydpi=19.000000, refresh=16664933
11: 1024x768, xdpi=14.000000, ydpi=19.000000, refresh=14271216
12: 1024x768, xdpi=14.000000, ydpi=19.000000, refresh=13319424
13: 1280x1024, xdpi=17.000000, ydpi=25.000000, refresh=13328215
14: 1152x864, xdpi=16.000000, ydpi=21.000000, refresh=13332960
15: 1280x720, xdpi=17.000000, ydpi=17.000000, refresh=16675239
16: 1280x800, xdpi=17.000000, ydpi=19.000000, refresh=16659579
17: 1280x1024, xdpi=17.000000, ydpi=25.000000, refresh=16660718
18: 1440x900, xdpi=20.000000, ydpi=22.000000, refresh=16670823
19: 1600x900, xdpi=22.000000, ydpi=22.000000, refresh=16670067
20: 1680x1050, xdpi=23.000000, ydpi=25.000000, refresh=16667914
21: 1366x768, xdpi=19.000000, ydpi=19.000000, refresh=16724037
22: 1920x1080, xdpi=26.000000, ydpi=26.000000, refresh=16666650
23: 1920x1080, xdpi=26.000000, ydpi=26.000000, refresh=19999980
24: 1280x720, xdpi=17.000000, ydpi=17.000000, refresh=16666650
25: 1280x720, xdpi=17.000000, ydpi=17.000000, refresh=19999980
26: 1920x1080, xdpi=26.000000, ydpi=26.000000, refresh=41666625
27: 1920x1080, xdpi=26.000000, ydpi=26.000000, refresh=39999960
28: 1920x1080, xdpi=26.000000, ydpi=26.000000, refresh=33333300
29: 3840x2160, xdpi=52.000000, ydpi=52.000000, refresh=41666625
30: 3840x2160, xdpi=52.000000, ydpi=52.000000, refresh=39999960
31: 3840x2160, xdpi=52.000000, ydpi=52.000000, refresh=33333300
32: 3840x2160, xdpi=52.000000, ydpi=52.000000, refresh=19994040
33: 4096x2160, xdpi=56.000000, ydpi=52.000000, refresh=19994040
34: 4096x2160, xdpi=56.000000, ydpi=52.000000, refresh=16661700
35: 4096x2160, xdpi=56.000000, ydpi=52.000000, refresh=41666625
36: 4096x2160, xdpi=56.000000, ydpi=52.000000, refresh=39999960
37: 4096x2160, xdpi=56.000000, ydpi=52.000000, refresh=33333300
38: 720x480, xdpi=10.000000, ydpi=12.000000, refresh=16666650
39: 720x576, xdpi=10.000000, ydpi=14.000000, refresh=19999980
numHwLayers=2, flags=00000000
type | handle | hint | flag | tr | blnd | format | source crop (l,t,r,b) | frame | name
-----------+----------+------+------+----+------+-------------+--------------------------------+------------------------+------
HWC | 203830b5c0 | 0000 | 0000 | 00 | 0105 | RGBA_8888 | 0.0, 0.0, 3840.0, 2160.0 | 0, 0, 1920, 1080 | org.xbmc.kodi/org.xbmc.kodi.Main
FB TARGET | 2033c52c40 | 0000 | 0000 | 00 | 0105 | RGBA_8888 | 0.0, 0.0, 1920.0, 1080.0 | 0, 0, 1920, 1080 | HWC_FRAMEBUFFER_TARGET
Nvidia HWC:
Display 0 (PRIMARY):
Resolution: 3840 x 2160
Colorspace: Rec.709, 8-bit YUV420
Blank: false
Protected: false
Compositor: draw_arrays
Composition: 1 layers in a scratch buffer
Window 0 (phys 0 caps fb): unused
Window 1 (phys 2 caps eb): unused
Window 2 (phys 3 caps 0): unused
Window 3 (phys 1 caps 235 blend 0x100 xform 0x0): scratch containing 1 layers
src (0.0,0.0,1920.0,2160.0), dst (0.0,0.0,1920.0,2160.0)
buffer 0x2038309040, compbits 0x0
Display 1 (EXTERNAL):
disabled
Composite policy: assign-windows
Idle machine: detection enabled, idle false
Allocated buffers:
0x2033c52c40: 8100.00 KiB | 1920 (1920) x 1080 | 1 | 0x00001a00
0x2034408500: 32400.00 KiB | 3840 (3840) x 2160 | 1 | 0x00000b00
0x2034409cc0: 8100.00 KiB | 1920 (1920) x 1080 | 1 | 0x00000b00
0x2038309a40: 8100.00 KiB | 1920 (1920) x 1080 | 1 | 0x00001a00
0x203830a1c0: 32400.00 KiB | 3840 (3840) x 2160 | 1 | 0x00000b00
0x203830b5c0: 32400.00 KiB | 3840 (3840) x 2160 | 1 | 0x00000b00
Total allocated (estimate): 121500.00 KB
Nvidia Gralloc
Compression: on
Decompression: lazy
GPU mapping cache: on
Continuous property scan: off
shell@foster:/ $