New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 846418 link

Starred by 4 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

WebRTC not using hardware encoding with h264

Reported by jacob.ad...@k3integrations.com, May 24 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36

Example URL:
https://appr.tc/r/947934884?vrc=H264

Steps to reproduce the problem:
1. Open two tabs with https://appr.tc/r/947934884?vrc=H264 (or other room with h264 encoder)
2. Click join room in each tab

The cpu usage (on a MacBook Pro 2015) jumps from around 20% (idle Google Chrome) to 140%.

What is the expected behavior?
Using the gstreamer command line to simulate the same scenario (but forcing hardware and software codecs), the same scenario only consumed a total of 40% cpu. The test I ran can be reproduced by running this command in two terminals:

gst-launch-1.0 avfvideosrc ! video/x-raw,width=1280,height=720 ! vtenc_h264_hw realtime=true ! queue ! vtdec_hw ! videoscale ! videoconvert ! osxvideosink

What went wrong?
I checked the debug logs to see what had happened, and was not able to find evidence that hardware encoding is happening. Instead, I see references to the OpenH264 codec being instantiated. This makes me suspect that the hardware encoder is not being used.

Did this work before? N/A 

Is it a problem with Flash or HTML5? HTML5

Does this work in other browsers? Yes

Chrome version: 66.0.3359.181  Channel: stable
OS Version: OS X 10.13.4
Flash Version: 

Contents of chrome://gpu: 

Graphics Feature Status
Canvas: Hardware accelerated
CheckerImaging: Disabled
Flash: Hardware accelerated
Flash Stage3D: Hardware accelerated
Flash Stage3D Baseline profile: Hardware accelerated
Compositing: Hardware accelerated
Multiple Raster Threads: Enabled
Native GpuMemoryBuffers: Hardware accelerated
Rasterization: Hardware accelerated
Surface Synchronization: Enabled
Video Decode: Hardware accelerated
WebGL: Hardware accelerated
WebGL2: Hardware accelerated
Driver Bug Workarounds
add_and_true_to_loop_condition
adjust_src_dst_region_for_blitframebuffer
avoid_stencil_buffers
decode_encode_srgb_for_generatemipmap
disable_framebuffer_cmaa
disable_webgl_rgb_multisampling_usage
dont_use_loops_to_initialize_variables
emulate_abs_int_function
get_frag_data_info_bug
init_two_cube_map_levels_before_copyteximage
msaa_is_slow
pack_parameters_workaround_with_pack_buffer
rebind_transform_feedback_before_resume
regenerate_struct_names
remove_invariant_and_centroid_for_essl3
reset_teximage2d_base_level
rewrite_texelfetchoffset_to_texelfetch
scalarize_vec_and_mat_constructor_args
set_zero_level_before_generating_mipmap
unfold_short_circuit_as_ternary_operation
unpack_alignment_workaround_with_unpack_buffer
unpack_image_height_workaround_with_unpack_buffer
use_intermediary_for_copy_texture_image
use_unused_standard_shared_blocks
Problems Detected
Unfold short circuit on Mac OS X: 307751
Applied Workarounds: unfold_short_circuit_as_ternary_operation
Always rewrite vec/mat constructors to be consistent: 398694
Applied Workarounds: scalarize_vec_and_mat_constructor_args
Mac drivers handle struct scopes incorrectly: 403957
Applied Workarounds: regenerate_struct_names
On Intel GPUs MSAA performance is not acceptable for GPU rasterization: 527565
Applied Workarounds: msaa_is_slow
glGenerateMipmap fails if the zero texture level is not set on some Mac drivers: 560499
Applied Workarounds: set_zero_level_before_generating_mipmap
Pack parameters work incorrectly with pack buffer bound: 563714
Applied Workarounds: pack_parameters_workaround_with_pack_buffer
Alignment works incorrectly with unpack buffer bound: 563714
Applied Workarounds: unpack_alignment_workaround_with_unpack_buffer
copyTexImage2D fails when reading from IOSurface on multiple GPU types.: 581777
Applied Workarounds: use_intermediary_for_copy_texture_image
Multisample renderbuffers with format GL_RGB8 have performance issues on Intel GPUs.: 607130
Applied Workarounds: disable_webgl_rgb_multisampling_usage
Use GL_INTEL_framebuffer_CMAA on ChromeOS: 535198
Applied Workarounds: disable_framebuffer_cmaa
glGetFragData{Location|Index} works incorrectly on Max: 638340
Applied Workarounds: get_frag_data_info_bug
glResumeTransformFeedback works incorrectly on Intel GPUs: 638514
Applied Workarounds: rebind_transform_feedback_before_resume
Result of abs(i) where i is an integer in vertex shader is wrong: 642227
Applied Workarounds: emulate_abs_int_function
Rewrite texelFetchOffset to texelFetch for Intel Mac: 642605
Applied Workarounds: rewrite_texelfetchoffset_to_texelfetch
Rewrite condition in for and while loops for Intel Mac: 644669
Applied Workarounds: add_and_true_to_loop_condition
Decode and encode before generateMipmap for srgb format textures on macosx: 634519
Applied Workarounds: decode_encode_srgb_for_generatemipmap
Init first two levels before CopyTexImage2D for cube map texture on Intel Mac 10.12: 648197
Applied Workarounds: init_two_cube_map_levels_before_copyteximage
Insert statements to reference all members in unused std140/shared blocks on Mac: 618464
Applied Workarounds: use_unused_standard_shared_blocks
Tex(Sub)Image3D performs incorrectly when uploading from unpack buffer with GL_UNPACK_IMAGE_HEIGHT greater than zero on Intel Macs: 654258
Applied Workarounds: unpack_image_height_workaround_with_unpack_buffer
adjust src/dst region if blitting pixels outside read framebuffer on Mac: 644740
Applied Workarounds: adjust_src_dst_region_for_blitframebuffer
Mac driver GL 4.1 requires invariant and centroid to match between shaders: 639760, 641129
Applied Workarounds: remove_invariant_and_centroid_for_essl3
Disable KHR_blend_equation_advanced until cc shaders are updated: 661715
Applied Workarounds: disable(GL_KHR_blend_equation_advanced), disable(GL_KHR_blend_equation_advanced_coherent)
Certain Apple devices leak stencil buffers: 713854
Applied Workarounds: avoid_stencil_buffers
Reset TexImage2D base level to 0 on Intel Mac 10.12.4: 705865
Applied Workarounds: reset_teximage2d_base_level
Don't expose disjoint_timer_query extensions to WebGL: 808744
Shader variable initialization in a loop caused perf regression on Mac Intel.: 809422
Applied Workarounds: dont_use_loops_to_initialize_variables
Checker-imaging has been disabled via finch trial or the command line.
Disabled Features: checker_imaging
Version Information
Data exported	2018-05-24T18:27:08.939Z
Chrome version	Chrome/66.0.3359.181
Operating system	Mac OS X 10.13.4
Software rendering list URL	https://chromium.googlesource.com/chromium/src/+/a10b9cedb40738cb152f8148ddab4891df876959/gpu/config/software_rendering_list.json
Driver bug list URL	https://chromium.googlesource.com/chromium/src/+/a10b9cedb40738cb152f8148ddab4891df876959/gpu/config/gpu_driver_bug_list.json
ANGLE commit id	22c768fbda54
2D graphics backend	Skia/66 773868fdade5f9f0e7697e6d09c9bd80aaa9b402-
Command Line	/Applications/Google Chrome.app/Contents/MacOS/Google Chrome --flag-switches-begin --enable-experimental-web-platform-features --flag-switches-end
Driver Information
Initialization time	54
In-process GPU	false
Passthrough Command Decoder	false
Direct Composition	false
Supports overlays	false
Sandboxed	true
GPU0	VENDOR = 0x1002, DEVICE= 0x6821
GPU1	VENDOR = 0x8086, DEVICE= 0x0d26 *ACTIVE*
Optimus	false
Optimus	false
AMD switchable	true
Driver vendor	
Driver version	10.32.48
Driver date	
Pixel shader version	4.10
Vertex shader version	4.10
Max. MSAA samples	8
Machine model name	MacBookPro
Machine model version	11.5
GL_VENDOR	Intel Inc.
GL_RENDERER	Intel Iris Pro OpenGL Engine
GL_VERSION	4.1 INTEL-10.32.48
GL_EXTENSIONS	GL_ARB_blend_func_extended GL_ARB_draw_buffers_blend GL_ARB_draw_indirect GL_ARB_ES2_compatibility GL_ARB_explicit_attrib_location GL_ARB_gpu_shader_fp64 GL_ARB_gpu_shader5 GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_occlusion_query2 GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_separate_shader_objects GL_ARB_shader_bit_encoding GL_ARB_shader_subroutine GL_ARB_shading_language_include GL_ARB_tessellation_shader GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_cube_map_array GL_ARB_texture_gather GL_ARB_texture_query_lod GL_ARB_texture_rgb10_a2ui GL_ARB_texture_storage GL_ARB_texture_swizzle GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_vertex_attrib_64bit GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_texture_compression_s3tc GL_EXT_texture_filter_anisotropic GL_EXT_texture_sRGB_decode GL_APPLE_client_storage GL_APPLE_container_object_shareable GL_APPLE_flush_render GL_APPLE_object_purgeable GL_APPLE_rgb_422 GL_APPLE_row_bytes GL_APPLE_texture_range GL_ATI_texture_mirror_once GL_NV_texture_barrier
Disabled Extensions	GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent
Disabled WebGL Extensions	EXT_disjoint_timer_query EXT_disjoint_timer_query_webgl2
Window system binding vendor	
Window system binding version	
Window system binding extensions	
Direct rendering	Yes
Reset notification strategy	0x0000
GPU process crash count	0
Compositor Information
Tile Update Mode	Zero-copy
Partial Raster	Enabled
GpuMemoryBuffers Status
ATC	Software only
ATCIA	Software only
DXT1	Software only
DXT5	Software only
ETC1	Software only
R_8	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
R_16	Software only
RG_88	Software only
BGR_565	Software only
RGBA_4444	Software only
RGBX_8888	Software only
RGBA_8888	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
BGRX_8888	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE
BGRX_1010102	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
RGBX_1010102	Software only
BGRA_8888	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
RGBA_F16	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
YVU_420	Software only
YUV_420_BIPLANAR	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
UYVY_422	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
Display(s) Information
Info	Display[69733248] bounds=0,0 1440x900, workarea=0,23 1440x797, scale=2, external
Color space information	{primaries:[[0.4443,0.3794,0.1404,],[0.2248,0.7262,0.0491,],[0.0055,0.0780,0.7415,],], transfer:0.0774*x + 0.0000 if x < 0.0404 else (0.9479*x + 0.0521)**2.4000 + 0.0000, matrix:RGB, range:FULL}
Bits per color component	8
Bits per pixel	24
Video Acceleration Information
Decode h264 baseline	up to 4096x2160 pixels
Decode h264 extended	up to 4096x2160 pixels
Decode h264 main	up to 4096x2160 pixels
Decode h264 high	up to 4096x2160 pixels
Encode h264 baseline	up to 4096x2160 pixels and/or 30.000 fps
Encode h264 main	up to 4096x2160 pixels and/or 30.000 fps
Encode h264 high	up to 4096x2160 pixels and/or 30.000 fps
Log Messages
[1188:775:0524/112630.919872:ERROR:gles2_cmd_decoder.cc(18288)] : [.DisplayCompositor-0x7fd5aff37000]GL ERROR :GL_INVALID_OPERATION : glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
[1188:775:0524/112630.919946:ERROR:gles2_cmd_decoder.cc(18288)] : [.DisplayCompositor-0x7fd5aff37000]GL ERROR :GL_INVALID_OPERATION : glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
[1188:775:0524/112630.919971:ERROR:gles2_cmd_decoder.cc(18288)] : [.DisplayCompositor-0x7fd5aff37000]GL ERROR :GL_INVALID_OPERATION : glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
[1188:775:0524/112630.923652:ERROR:gles2_cmd_decoder.cc(10129)] : [.DisplayCompositor-0x7fd5aff37000]RENDER WARNING: texture bound to texture unit 3 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering.
[1188:775:0524/112630.923680:ERROR:gles2_cmd_decoder.cc(10129)] : [.DisplayCompositor-0x7fd5aff37000]RENDER WARNING: texture bound to texture unit 1 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering.
[1188:775:0524/112630.923692:ERROR:gles2_cmd_decoder.cc(10129)] : [.DisplayCompositor-0x7fd5aff37000]RENDER WARNING: texture bound to texture unit 2 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering.
 
chrome_debug.log
1.3 MB View Download
Labels: Needs-Triage-M66
Cc: krajshree@chromium.org
Labels: Needs-Feedback Triaged-ET
Unable to reproduce the issue on mac 10.13.3 using chrome reported version #66.0.3359.181 and latest canary #68.0.3439.0.

Attached a screen shot for reference.

Following are the steps followed to reproduce the issue.
------------
1. Opened two tabs with https://appr.tc/r/947934884?vrc=H264 (or other room with h264 encoder)
2. Clicked join room in each tab.
3. Observed that the CPU usage of apprtc went from 25-30 mb.

reporter@ - Could you please check the attached screen shot and please let us know if anything missed from our end.

Thanks...!!
Screen Shot 2018-05-25 at 16.19.04.png
96.7 KB View Download
Ah, you're viewing the cpu usage in the chrome task manager. I was looking at the cpu usage from top (with top -o CPU). I'd be curious if your stats looked more like mine if viewed from top. Even so, I still find it a little strange that your total CPU usage is around 80%. What was your gstreamer cpu/gpu usage to compare? (You can install it via brew if you don't have it)

brew install gstreamer gst-validate gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly
Project Member

Comment 4 by sheriffbot@chromium.org, May 25 2018

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
I've added a little more feedback, were you able to compare your cpu usage from chrome with the setup I've described in gstreamer?
Cc: phanindra.mandapaka@chromium.org
Components: Blink>WebRTC
Adding Blink>Media>Webrtc for someone from the respective team to help in further debugging of the attached log in C#0.

Thanks.!

Comment 7 by xhw...@chromium.org, Jun 12 2018

Components: -Internals>Media
Labels: TE-NeedsTriageHelp
The issue seems to be out of TE-scope as it require gstreamer to test the issue by running command gst-launch-1.0 avfvideosrc ! video/x-raw,width=1280,height=720 ! vtenc_h264_hw realtime=true ! queue ! vtdec_hw ! videoscale ! videoconvert ! osxvideosink. Hence, adding label TE-NeedsTriageHelp for further investigation from dev team.

Thanks...!!

Comment 9 by guidou@chromium.org, Jun 14 2018

Components: -Blink>WebRTC Blink>WebRTC>Video
Owner: emir...@chromium.org
emircan, you have looked into CPU usage on mac, right? Do you think this could be related?
Status: Assigned (was: Unconfirmed)

Sign in to add a comment