FifoPlayer: Difference between revisions

From Dolphin Emulator Wiki
Jump to navigation Jump to search
m (Made the framelimit vaguer. It needs to be adjusted based on whatever is going on. A 10 frame fifolog with a lot of action is unintelligible at 30fps. Just said to set it as needed... which is the truth.)
Line 10: Line 10:
* Press ''Record'' and wait until the recording has finished
* Press ''Record'' and wait until the recording has finished
* Press ''Save'' and make sure the specified filename uses a ''.dff'' extension
* Press ''Save'' and make sure the specified filename uses a ''.dff'' extension
* '''Things to keep in mind:''' Depending on the game, the settings ''Virtual XFB'', ''Real XFB'' and ''EFB copies to RAM'' may cause various issues for playback. Before recording, check if '''EFB Copies''' and '''External Frame Buffer''' can be disabled, then record. It will minimize dud fifologs. If you have to use EFB Copies, use '''EFB to Texture''' and avoid '''EFB to Ram'''.
* '''Things to keep in mind:''' Depending on the game, enabling ''XFB'' or disabling ''EFB Copies to Texture Only'' may cause various issues for playback. Before recording, check if '''External Frame Buffer''' can be disabled and '''EFB Copies to Texture Only''' can be enabled, then record. It will minimize dud fifologs.
* Scenes involving texture preloading can only be recorded properly since revision {{revision|3.5-173}} (198d60c5)
* Scenes involving texture preloading can only be recorded properly since revision {{revision|3.5-173}} (198d60c5)
* When sharing fifo logs with others, you should always post a screenshot of the recorded scene since fifo logs aren't guaranteed to play back equally on all systems.
* When sharing fifo logs with others, you should always post a screenshot of the recorded scene since fifo logs aren't guaranteed to play back equally on all systems.

Revision as of 18:47, 10 July 2015

FifoPlayer is a powerful developer tool for debugging graphics related issues. It can be used to record an emulated scene during emulation and to playback it arbitrarily often later on. Furthermore, it allows for close inspection of each FIFO command sent to the GPU during emulation. Possible use cases for FifoPlayer include debugging rendering issues in games which a developer does not have access to. Users can just record a fifo log and give it to devs, who can analyze the rendering commands without the actual game iso. Also, having an automatically formatted FIFO command list very much eases the task of figuring out how a specific game's graphics are rendered and where it goes wrong in Dolphin. FifoPlayer can restrict the render output to the objects of interest, effectively cleaning up any irritating "unrelated" objects.


How to record a fifo log?

Any of the FifoPlayer functionality requires a FIFO log to be recorded. This basically intercepts all commands sent to the GPU during the recording and stores them in a .dff file to allow easy playback and inspection.

  • While running a game, open the Fifo Player dialog from the Tools menu
  • In the Fifo Player dialog, select the Record tab
  • Adjust the number of frames to render (different issues will need a different fifo log length; for example when render output depends on the previously rendered frame, you'll want to record more than one frame)
  • Press Record and wait until the recording has finished
  • Press Save and make sure the specified filename uses a .dff extension
  • Things to keep in mind: Depending on the game, enabling XFB or disabling EFB Copies to Texture Only may cause various issues for playback. Before recording, check if External Frame Buffer can be disabled and EFB Copies to Texture Only can be enabled, then record. It will minimize dud fifologs.
  • Scenes involving texture preloading can only be recorded properly since revision 3.5-173 (198d60c5)
  • When sharing fifo logs with others, you should always post a screenshot of the recorded scene since fifo logs aren't guaranteed to play back equally on all systems.

How to play back a fifo log?

Developers of course will want to use this to see if they can reproduce issues locally. But it's also useful for users to verify that their recorded fifo log actually works.

  • Use the Open toolbar button to open the .dff file that you want to play back. Note that fifo logs won't appear in your game list. For a more streamlined workflow you might want to use dolphin in batch mode by calling "dolphin-emu -b -e file.dff" from command line (this will play back the fifo log and immediately close the emulator once you close the emulation window).
  • Note: If the emulator immediately crashes or shows fifo errors when opening a .dff file, try disabling Dual Core mode. It's known to have some problems at the moment.
  • Render output is divided in frames. Each frame is divided in different objects. An object is defined as a group of vertices that are drawn consecutively with the same pipeline configuration.
  • In the Play tab of the Fifo Player dialog, you can adjust which frames will be rendered during playback. Note that skipped frames are rendered (but not shown) nevertheless to ensure resource validity (e.g. for EFB copies) in the following frames.
  • Similarly, you can limit the range of rendered objects. This is especially useful when you have a huge scene but are only interested in one single object which is rendered incorrectly.
  • TODO: Explain Early Memory Updates.
  • WARNING: Dual Core mode is currently broken when using FifoPlayer. As a workaround, disable DC
  • Playback will be ridiculously fast with the Auto framerate. Adjust as required.
  • tl;dr: Disable Dual Core, Disable XFBs, adjust framelimit.

How to analyze a fifo log?

This is purely a developer tool because it requires strong knowledge of what GPU registers are and how they are used in the GPU FIFO.

  • Start fifo log playback like explained above and open the Analyze tab in the Fifo Player dialog
  • You should see three columns there: The leftmost one will show you a list of rendered frames. The mid column lists all objects within the selected frame. The right column shows all FIFO commands called for that object. When selecting one of the FIFO commands, a more or less descriptive explanation will be shown at the bottom of the dialog.
  • Note that the FIFO command list is a tad unintuitive: The first command should generally be a vertex draw command (e.g. 0x80) which is the one which actually draws the command, while the FIFO commands after that refer to any state changes after that (i.e. they actually apply to the next object)
  • There's also a search function that allows you to search within the currently shown command list (i.e. not across different objects/frames). It's a bit buggy at the moment, so it takes some time to get used to.
  • The currently selected FIFO command can be copied to clipboard by pressing CTRL+C