Media Debugging Tips

From MozillaWiki
Jump to: navigation, search

Diagnosing and Reporting Media Playback Issues in Firefox

Reporting Basic Media Playback Issues

For starters, file a bug report in Bugzilla describing the issue you've run into. Please include a URL to or sample of the audio or video you're experiencing issues with. Also please check the web developer console for error messages related to media format issues. If you see messages here related to media playback errors, please add this information to your bug report.

Share Your about:support Text

  1. Open a tab and visit about:support
  2. Click 'Copy Text to Clipboard'
  3. Paste this text in your Bugzilla bug comment and post.

When filing a Bugzilla bug, please post your about:support text. This provides a great deal of information about your graphics hardware, video hardware support, and much more.

Acceleration Support for Media

Hardware support information.png

Currently you can inspect hardware acceleration support using about:support information. Page down to the Media section and check the 'Codec Support Information' section. If you feel this information does not reflect the capabilities of your device, please file a bug and include your about:support text.

Playback Performance Issues

Generating Performance Profiles

For playback performance issues and general media playback problems, capturing and reporting a Firefox Performance Profile can help Mozilla developers diagnose the issue. Please visit profiler.firefox.com to access the profiling feature in Firefox. We also have a Firefox Profiler Getting Started Guide to learn how to record a profile.

Profiler Quick Start

  1. Visit https://profiler.firefox.com/ and enable the Profiler toolbar button.
  2. Click the toolbar button down arrow and select 'Media' in the Settings drop down.
  3. Open a tab and visit the page with the affected media content.
  4. Click the Profiler toolbar main button to start recording.
  5. Play the media until the issue you are seeing manifests.
  6. Click the Profiler toolbar button again to stop recording.
  7. When a new Profile tab opens, click the upload profile button on the upper right.
  8. Copy the resulting profile URL and post this to your Bugzilla report.

Youtube Stats For Nerds

For Youtube playback performance issues, right click the video and select Stats for Nerds. You can select the text in this panel and post it your Bugzilla bug, or grab a screenshot using the Firefox screenshot tool and add the resulting image as an attachment to your bug. This information can be informative for engineers in understanding what video format and resolution you are viewing.

DRM Module Install Logging

For DRM module install or update issues, as well as OpenH264 install issues, the Firefox JS code that downloads and installs media plugin updates can be made to log to the Browser Console.

'Plugin update debugging steps for users

  1. open the browser console
  2. visit about:config and enable logging by creating the numeric pref 'media.gmp.log.level' set to 5
  3. delete the 'media.gmp-manager.lastCheck' pref completely.

Then restart (the browser console should open back up) and wait a bit. You should get logs related to an openh264 and widevine update check.

Advanced Diagnosis Through Internal Logging

In some cases developers will ask reporters to capture detailed media performance profiles and processing logs. This can help diagnose low level content format problems or incompatibilities. If you have already reported a bug in Bugzilla, you can capturing detailed logging as well to help Mozilla engineers diagnose the problem.

Gecko Logging Reference

Collecting Logs in Firefox Performance Profiles

General testing setup steps

  1. Install Firefox Nightly on the test device and open the browser. The test device should be a clean system that has not had Firefox installed on it prior. If the test device does have existing Firefox installs, open Firefox Nightly and open about:profiles. Create a new profile for testing purposes, and launch a browser using this profile.
  2. Once Firefox Nightly is open and running in a clean profile, check for browser updates via the Help menu -> About option. If there are browser updates available, apply them and then restart the browser.
  3. Once Firefox Nightly is open and running in a clean profile with updates applied, open a tab and visit https://profiler.firefox.com/ and enable the Firefox Profiler Button. For general information on how to use the profiler, visit the Profiler documentation site.

Generating a Firefox Performance Profile with media logs

  1. Launch Firefox with a clean profile. Use about:profiles for existing installs (see above).
  2. In Firefox, open a tab and view about:logging.
  3. In the 'Logging preset:' drop down select 'Media Playback'
  4. Click the 'Start Logging' button. (You are now recording a profile, the profiler toolbar toggle button should be selected automatically.)
  5. Open a new tab for testing and view the media you are having an issue with. (After reproducing, DO NOT close this test tab yet.)
  6. Switch to the about:logging tab, click 'Stop logging', and then close the test tab.
  7. Wait approximately 10 - 20 seconds for a new tab to automatically open containing the generated performance profile.
  8. Within the upper-right side of the profiler tab click the 'upload local profile' button to initiate profile upload. Once the upload is complete, a drop down text edit will open displaying the URL of the profile. Select this text and copy it.
  9. Share the URL of the profile for analysis with the engineer you are working with.

These instructions in video: https://paul.cx/public/about-logging-presentation.webm

Gecko Media Plugin Logging Collection

For DRM content playback issues (example sites: Amazon Video, Disney+, Hulu, Netflix, Spotify) it can be helpful to generate Encrypted Media Extensions (EME) related logging. EME logs are generated for the web page and the secure Gecko Media Plugin (GMP) module that handles DRM licensing and decryption.

The steps to produce these logs are bit more involved compared to basic media playback logging but are worth the effort when tracking down DRM related issues.

General testing setup steps

  1. Install Firefox Nightly on the test device and open the browser. The test device should be a clean system that has not had Firefox installed on it prior. If the test device does have existing Firefox installs, open Firefox Nightly and open about:profiles. Create a new profile for testing purposes, and launch a browser using this profile.
  2. Once Firefox Nightly is open and running in a clean profile, check for browser updates via the Help menu -> About option. If there are browser updates available, apply them and then restart the browser.
  3. Once Firefox Nightly is open and running in a clean profile with updates applied, open a tab and visit https://profiler.firefox.com/ and enable the Firefox Profiler Button. For general information on how to use the profiler, visit the Profiler documentation site.

Generating a Firefox Profile with logs

  1. Launch Firefox with a clean profile. Use about:profiles for existing installs (see above).
  2. In Firefox, open a tab and view about:config.
  3. Enter media.gmp.use-minimal-xpcom in the upper edit, select the corresponding pref below, and set the pref value to True.
  4. Close the about:config tab and close Firefox.
  5. Launch Firefox again using the same profile.
  6. In Firefox, open a tab and view about:logging.
  7. Enter timestamp,sync,GMP:5,EME:5 to the 'new log modules' text and click on 'Set Log Modules'.
  8. Under Output choose 'Logging to the Firefox Profiler' and check the 'Enable stack traces for log messages' checkbox.
  9. Click the 'Start Logging' button. (You are now recording a profile, the profiler toolbar toggle button should be selected automatically.)
  10. Open a new tab for testing and view the media you are having an issue with. (After reproducing, DO NOT close this test tab yet.)
  11. Switch to the about:logging tab, click 'Stop logging', and then close the test tab.
  12. Wait approximately 10 - 20 seconds for a new tab to automatically open containing the generated performance profile.
  13. Within the upper-right side of the profiler tab click the 'upload local profile' button to initiate profile upload. Once the upload is complete, a drop down text edit will open displaying the URL of the profile. Select this text and copy it.
  14. Share the URL of the profile for analysis with the engineer you are working with.

Generating text based logs in a local folder

  1. Launch Firefox using the clean profile set up prior via about:profiles.
  2. In the browser, open a tab and view about:config.
  3. Enter media.gmp.use-minimal-xpcom in the upper edit, select the corresponding pref below, and set the pref value to True.
  4. Open a command line console and browse to the install location for Firefox Nightly.
  5. On Windows, enter 'set MOZ_DISABLE_GMP_SANDBOX=1'(return).
  6. Launch Firefox from the command console using the clean profile you set up prior (firefox.exe -p profilename (return)).
  7. In the browser, open a tab and view about:logging.
  8. Enter 'timestamp,sync,GMP:5,EME:5' in the 'new log modules' text edit and click on 'Set Log Modules'.
  9. Select the 'Logging to a file' radio button.
  10. Choose an appropriate path for log output.
    Note, on Windows, change any default 'AppData\Local\' path to a 'AppData\LocalLow\' path so that content processes can access the file system. For example:
    C:\Users\(username)\AppData\LocalLow\Temp\emelogs
  11. Click the 'Set Log File' button.
  12. Click the 'Start Logging' button.
  13. Open a test tab and play the media past a point where the issue occurs.
  14. Close the test tab
  15. In about:logging, click 'Stop Logging'.

In the temp dir, you should get a few logs (something like 'emelogs.txt-child.23884.moz_log' and 'emelog.txt-main.23435.moz_log'. Attach logs to your Bugzilla report.