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




Audio/Video: Playback
3 years ago
3 years ago


(Reporter: Alice0775 White, Assigned: jya)


({power, regression})

42 Branch
power, regression

Firefox Tracking Flags

(Not tracked)



(2 attachments)



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:

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

Comment 1

3 years ago
Tested with:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0 ID:20150805030208

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0 ID:20150805004014


3 years ago
Assignee: nobody → jyavenard

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)


3 years ago
See Also: → bug 1188131

Comment 4

3 years ago
Profiler log with media.mediasource.format-reader=false

Comment 5

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

Comment 6

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

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)


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


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


Incremental GC: true


Activated: false
Prevent Accessibility: 0

Library Versions

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

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

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

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

Expected minimum version: 3.19.2
Version in use: 3.19.2

Experimental Features

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 ?

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
Mime Type:	video/mp4; codecs="avc1.4d401e"
DASH:	yes (134/140)

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.


3 years ago
Depends on: 1188131
See Also: bug 1188131

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.

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).

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0 ID:20150806042142

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.
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.