High CPU usage on Nightly42.0a1 than Aurora41.0a2

RESOLVED DUPLICATE of bug 1188131

Status

()

Core
Audio/Video: Playback
RESOLVED DUPLICATE of bug 1188131
3 years ago
3 years ago

People

(Reporter: Alice0775 White, Assigned: jya)

Tracking

({power, regression})

42 Branch
power, regression
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

3 years ago
+++ This bug was initially created as a clone of Bug #1190258 +++

Steps to reproduce
1. Open https://www.youtube.com/watch?v=eyU3bRy2x44

Actual Results:
plugin-container.exe consumes 10-15% CPU (C2Q Q8300).
And "Page fault delta" in taskmanager indicates 2000-2500.
(Firefox.exe consumes 1-2% CPU)


Expected Results:
plugin-container.exe consumes around 5% CPU.
And "Page fault delta" in taskmanager indicates 0-200.
(Firefox.exe consumes 1-2% CPU)



Regression window:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=f8051d507461&tochange=de0a5cf8c4f9

Suspect: a465aecfd856	Jean-Yves Avenard — Bug 1171379: P1. Enable MediaSourceDemuxer by default. r=kentuckyfriedtakahe


And I confirmed that setting media.mediasource.format-reader = false fixes the problem
(Reporter)

Comment 1

3 years ago
Tested with:
Nightly42.0a1
https://hg.mozilla.org/mozilla-central/rev/f3b757156f69
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0 ID:20150805030208

Aurora41.0a2 
https://hg.mozilla.org/releases/mozilla-aurora/rev/2b17edd9c297
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0 ID:20150805004014
(Assignee)

Updated

3 years ago
Assignee: nobody → jyavenard
(Assignee)

Comment 2

3 years ago
I can't reproduce this here. Running under a profiler actually shows that the CPU usage is significantly lower (as far as MediaSource is concerned) than the old architecture.

A drop in 20% CPU time in fact spent less in the mediasource+demuxing on average over a 2 minutes youtube playback (TrackBuffersManager+MediaSourceDemuxer vs TrackBuffer+MediaSourceReader).
And the old MSE architecture the entire time is spent on the main thread while the new one is highly parallelized resulting in the UI being more responsive.

Could it be related to bug 1188131, and what Alice is seeing is that it's now using software decoding.

I don't see how that's possible.

Matt, how can we tell if DXVA is in used or not for a particular video and have the user reports this info?
Flags: needinfo?(matt.woodrow)
(Assignee)

Updated

3 years ago
See Also: → bug 1188131
(Reporter)

Comment 4

3 years ago
Profiler log with media.mediasource.format-reader=false
http://people.mozilla.org/~bgirard/cleopatra/#report=c50edeb0685f2b9476b09e6cfee4bbd6d7b6a267
(Reporter)

Comment 5

3 years ago
Created attachment 8644248 [details]
Screenshot, what I see CPU usage
(Reporter)

Comment 6

3 years ago
Created attachment 8644250 [details]
Screenshot2, what I see CPU usage with media.mediasource.format-reader=false
(Reporter)

Comment 7

3 years ago
Application Basics
------------------

Name: Firefox
Version: 42.0a1
Build ID: 20150805030208
Update Channel: nightly
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0
Multiprocess Windows: 1/1 (default: true)
Safe Mode: false

Crash Reports for the Last 3 Days
---------------------------------

All Crash Reports (including 1 pending crash in the given time range)

Extensions
----------

Name: about:media
Version: 1
Enabled: true
ID: aboutmedia@gavinsharp.com

Graphics
--------

Adapter Description: AMD Radeon HD 6450
Adapter Drivers: aticfx64 aticfx64 aticfx64 aticfx32 aticfx32 aticfx32 atiumd64 atidxx64 atidxx64 atiumdag atidxx32 atidxx32 atiumdva atiumd6a atitmm64
Adapter RAM: 1024
Asynchronous Pan/Zoom: wheel input enabled
ClearType Parameters: Gamma: 2200 Pixel Structure: R ClearType Level: 100 Enhanced Contrast: 300
Device ID: 0x6779
Direct2D Enabled: true
DirectWrite Enabled: true (6.2.9200.17292)
Driver Date: 6-22-2015
Driver Version: 15.200.1046.0
GPU #2 Active: false
GPU Accelerated Windows: 1/1 Direct3D 11 (OMTC)
Subsys ID: 23111787
Supports Hardware H264 Decoding: true
Vendor ID: 0x1002
WebGL Renderer: Google Inc. -- ANGLE (AMD Radeon HD 6450 Direct3D11 vs_5_0 ps_5_0)
windowLayerManagerRemote: true
AzureCanvasBackend: direct2d 1.1
AzureContentBackend: direct2d 1.1
AzureFallbackCanvasBackend: cairo
AzureSkiaAccelerated: 0

Important Modified Preferences
------------------------------

browser.cache.disk.capacity: 358400
browser.cache.disk.filesystem_reported: 1
browser.cache.disk.smart_size.first_run: false
browser.cache.frecency_experiment: 3
browser.download.importedFromSqlite: true
browser.places.smartBookmarksVersion: 7
browser.sessionstore.upgradeBackup.latestBuildID: 20150805030208
browser.startup.homepage_override.buildID: 20150805030208
browser.startup.homepage_override.mstone: 42.0a1
browser.tabs.drawInTitlebar: false
browser.tabs.warnOnClose: false
dom.apps.reset-permissions: true
dom.mozApps.used: true
extensions.lastAppVersion: 42.0a1
gfx.direct3d.last_used_feature_level_idx: 0
gfx.driver-init.appVersion: 42.0a1
gfx.driver-init.deviceID: 0x6779
gfx.driver-init.driverVersion: 15.200.1046.0
gfx.driver-init.feature-d2d: true
gfx.driver-init.feature-d3d11: true
gfx.driver-init.status: 2
media.gmp-eme-adobe.lastUpdate: 1438780512
media.gmp-eme-adobe.version: 12
media.gmp-gmpopenh264.lastUpdate: 1438780514
media.gmp-gmpopenh264.version: 1.4
media.gmp-manager.buildID: 20150805030208
media.gmp-manager.lastCheck: 1438812354
media.hardware-video-decoding.failed: false
network.cookie.prefsMigrated: true
network.predictor.cleaned-up: true
places.database.lastMaintenance: 1438780850
places.history.expiration.transient_current_max_pages: 104858
plugin.disable_full_page_plugin_for_types: application/pdf
plugin.importedState: true
privacy.cpd.downloads: false
privacy.cpd.history: false
privacy.cpd.offlineApps: true
privacy.sanitize.migrateFx3Prefs: true
privacy.sanitize.timeSpan: 0
security.sandbox.content.tempDirSuffix: {36af7824-1ec4-4bd7-8ec9-5466a519be4c}
storage.vacuum.last.index: 0
storage.vacuum.last.places.sqlite: 1438780850

Important Locked Preferences
----------------------------

JavaScript
----------

Incremental GC: true

Accessibility
-------------

Activated: false
Prevent Accessibility: 0

Library Versions
----------------

NSPR
Expected minimum version: 4.10.9 Beta
Version in use: 4.10.9 Beta

NSS
Expected minimum version: 3.19.2 Basic ECC
Version in use: 3.19.2 Basic ECC

NSSSMIME
Expected minimum version: 3.19.2 Basic ECC
Version in use: 3.19.2 Basic ECC

NSSSSL
Expected minimum version: 3.19.2 Basic ECC
Version in use: 3.19.2 Basic ECC

NSSUTIL
Expected minimum version: 3.19.2
Version in use: 3.19.2

Experimental Features
---------------------
(Assignee)

Comment 8

3 years ago
Comment on attachment 8644250 [details]
Screenshot2, what I see CPU usage with media.mediasource.format-reader=false

156% in the plugin container is almost certainly due to software decoding...

What resolution was the video in 1080P ?
(Reporter)

Comment 9

3 years ago
Right click video stat:

Video ID:	eyU3bRy2x44
Dimensions:	640 x 360
Resolution:	640 x 360@30
Volume:	100%
Stream Host:	r1---sn-3pm7sn7z
Stream Type:	https
CPN:	-CnjSvW8B26TJnFO
Mime Type:	video/mp4; codecs="avc1.4d401e"
DASH:	yes (134/140)
(Assignee)

Comment 10

3 years ago
Okay, found the issue, it is indeed bug 1188131.

The hardware layer isn't initialized and as such HW acceleration is never active.

The reason is that MediaDecoderReader::InitLayersBackendType() is called way too early, before we know that the media is video or audio only.
(Assignee)

Updated

3 years ago
Depends on: 1188131
See Also: bug 1188131
(Assignee)

Comment 11

3 years ago
Alice, let me know if the build from https://treeherder.mozilla.org/#/jobs?repo=try&revision=b37aaa47a155 you see any improvement.

Was watching a 4K video and my debug build on windows 8.1 went from 74% to 12% (nvidia quadro card). An opt build will use much less.
(Reporter)

Comment 12

3 years ago
(In reply to Jean-Yves Avenard [:jya] from comment #11)
> Alice, let me know if the build from
> https://treeherder.mozilla.org/#/jobs?repo=try&revision=b37aaa47a155 you see
> any improvement.
> 

Yes, it improved. CPU usage are less than 5% (360p).

https://hg.mozilla.org/try/rev/b37aaa47a155
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0 ID:20150806042142
(Assignee)

Comment 13

3 years ago
awesome. I'm going to mark this bug as duplicate of 1188131.

Thanks again for your outstanding bug reports.

Always easy to reproduce thanks to the amazingly detailed STR; all informations always there and prompt to answer.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Flags: needinfo?(matt.woodrow)
Resolution: --- → DUPLICATE
Duplicate of bug: 1188131
Not tracked, flag cleared, as this is a duplicate of bug 1188131.
tracking-firefox42: ? → ---
No longer blocks: 1171379
status-firefox42: affected → ---
No longer depends on: 1188131
You need to log in before you can comment on or make changes to this bug.