Difference between revisions of "Using RetroArch"

From Emulation General Wiki
Jump to navigation Jump to search
(Installing RetroArch on Linux)
(From latest Wayback Machine snapshot. Cleaning)
(41 intermediate revisions by 17 users not shown)
Line 1: Line 1:
Work in progress guide. Please expand upon it.
+
==Basic Usage==
 +
{{Main|Dummies Guide: RetroArch}}
 +
After downloading [[RetroArch]],[[File:Rgui.png|thumb|300px|RGUI, RetroArch's original interface.]]
 +
[[File:GLUI.png|thumb|300px|GLUI]]
 +
[[File:XMB.jpeg|thumb|300px|XMB]]
 +
[[File:Ozon.png|thumb|300px|Ozon]]
 +
start up retroarch.exe.
  
==Basic Usage (RGUI)==
+
To launch a game, select the libretro core you'd like to use under '''Load Core''', and select a ROM under '''Load Content>Select File'''. Alternatively, you can use '''Load Content>Select File And Detect Core''' to be presented with a list of cores detected based on the file extension of the content.
  
After downloading [[RetroArch]],[[File:Rgui.png|thumb|205px|RGUI, RetroArch's interface]] start up retroarch.exe.
+
For more convenient ROM selection, setup your browser directory under '''Settings>Directory'''.
 
 
To launch a game, select the emulator core you'd like to use under '''Core''', and select a ROM under''' Load Game'''.
 
 
 
For more convenient ROM selection, setup your browser directory under '''Path Options'''.
 
  
 
==Installing RetroArch on Linux==
 
==Installing RetroArch on Linux==
===Debian based===
+
===Ubuntu based===
First, add the PPA for hunter-kaller/ppa (instructions [[Emulation on Ubuntu|here]]), then type the following into a terminal:
+
First, add the PPA for <code>ppa:libretro/stable</code> or <code>ppa:libretro/testing</code> for stable builds and dev builds respectively (instructions [[Emulation on Ubuntu|here]]), then type the following into a terminal:
 
  sudo apt-get update
 
  sudo apt-get update
 
   
 
   
Line 18: Line 20:
 
  sudo apt-get install <corename>
 
  sudo apt-get install <corename>
  
Replace <corename> with the name of the package the core is available in. You can see all of the cores available to you either in your package manager (e.g. Synaptic, Software Center) or by visiting [https://launchpad.net/~hunter-kaller/+archive/ppa Launchpad]. To install all (or at least most) of the cores in one go, run
+
Replace <corename> with the name of the package the core is available in. You can see all of the cores available to you either in your package manager (e.g. Synaptic, Software Center) or by visiting [https://launchpad.net/~libretro/+archive/ubuntu/stable Launchpad]. To install all (or at least most) of the cores in one go, run
 
  sudo apt-get install libretro*
 
  sudo apt-get install libretro*
  
Line 33: Line 35:
 
find may return several directories. Use '''ls''' to check each one until you find the downloaded cores.
 
find may return several directories. Use '''ls''' to check each one until you find the downloaded cores.
  
Once you've located the libretro cores, it's time to open retroarch.cfg using your editor of choice. Look for the option '''libretro_directory''', which may be located near the bottom of the file. Insert the path to the libretro cores between the quotation marks on the right hand side. Assuming the cores are located in /usr/lib/libretro, the line in the configuration file should look like
+
Once you've located the libretro cores, it's time to open retroarch.cfg using your editor of choice. Look for the option '''libretro_directory''', which may be located near the bottom of the file. Insert the path to the libretro cores between the quotation marks on the right hand side. Assuming the cores are located in <code>/usr/lib/libretro</code>, the line in the configuration file should look like
 
  libretro_directory = "/usr/lib/libretro"
 
  libretro_directory = "/usr/lib/libretro"
  
You can also set the libretro path using the RGUI. In Retroarch, go to Settings -> Path Options -> Core Directory and navigate to the appropriate folder. If you set everything up correctly, you should see the cores when you select the ''Core'' option in the RGUI.
+
You can also set the libretro path using the menu. In Retroarch, go to Settings -> Path Options -> Core Directory and navigate to the appropriate folder. If you set everything up correctly, you should see the cores when you select the ''Core'' option in the menu.
  
==Installation on Gentoo==
+
===Installation on Gentoo===
  
 
First, install an overlay manager with git support:  
 
First, install an overlay manager with git support:  
Line 54: Line 56:
  
 
Set USE flags that you want, it is not required to enable every single one (you only need at least one audio and video output device; defaults are suitable enough). It is recommended to add udev for joystick support and netplay for netplay support.
 
Set USE flags that you want, it is not required to enable every single one (you only need at least one audio and video output device; defaults are suitable enough). It is recommended to add udev for joystick support and netplay for netplay support.
 
  
 
Build and install RetroArch from the git repository
 
Build and install RetroArch from the git repository
Line 64: Line 65:
 
  # emerge <corename>-libretro
 
  # emerge <corename>-libretro
  
Alternatively, you can set USE flags through /etc/portage/package.use libretro-meta package to choose what cores you wish; small all USE flags are on.
+
Alternatively, you can set USE flags through <code>/etc/portage/package.use</code> libretro-meta package to choose what cores you wish; small all USE flags are on.
  
 
  Syntax:
 
  Syntax:
Line 73: Line 74:
  
 
The cores will be installed under /usr/lib/libretro/
 
The cores will be installed under /usr/lib/libretro/
 
  
 
===Other Distros===
 
===Other Distros===
Line 89: Line 89:
 
*nvidia-cg-toolkit - Cg shaders
 
*nvidia-cg-toolkit - Cg shaders
 
===Using RetroArch===
 
===Using RetroArch===
RetroArch has a robust CLI for those who prefer the command line, there are also many pages which should have been installed by default for retro-arch, retroarch-joyconfig and others. If you use the CLI be sure to configure your retroarch.cfg file before first use. This config is well commented so each option can be fully understood. Use retroarch-joyconfig command for simplified input setup. RetroArch can auto-detect inputs, which is a great feature to simplify playing with multiple/different controllers (refer to "man retroarch-joyconfig" for details). The retroarch.cfg file should be located in /etc/retroarch.cfg, your home folder or the directory where RetroArch was installed depending on your distro and compilation setup.
+
RetroArch has a robust CLI for those who prefer the command line, there are also many pages which should have been installed by default for <code>retroarch</code>, <code>retroarch-joyconfig</code> and others. If you use the CLI be sure to configure your <code>retroarch.cfg</code> file before first use. This config is well commented so each option can be fully understood. Use <code>retroarch-joyconfig</code> command for simplified input setup. RetroArch can auto-detect inputs, which is a great feature to simplify playing with multiple/different controllers (refer to <code>man retroarch-joyconfig</code> for details). The <code>retroarch.cfg</code> file should be located in <code>/etc/retroarch.cfg</code>, your home folder or the directory where RetroArch was installed depending on your distro and compilation setup.
  
 
==General Setup/Usage==
 
==General Setup/Usage==
===RGUI Controls===
+
===Menu Controls===
  
 
Default keys for the keyboard are: x (confirm), z (back) and the arrow keys. If you're using an XInput (xbox 360) controller, your controller should already be set-up.
 
Default keys for the keyboard are: x (confirm), z (back) and the arrow keys. If you're using an XInput (xbox 360) controller, your controller should already be set-up.
 
===BIOS===
 
===BIOS===
  
If you are going to play in a system that needs a BIOS (e.g. PS1), place the BIOS files in RetroArch's 'system' directory.
+
If you are going to play in a system that needs a BIOS (e.g. PS1), place the [[Emulator_Files#Multi-System|BIOS files]] in RetroArch's 'system' directory.
 +
 
 +
===Disc images===
 +
 
 +
RetroArch requires you to load games through CUE sheets. Ensure that the CUE sheet is properly set up in order for the game to run. See the [[Cue sheet (.cue)]] for more.
 +
 
 +
===Mupen64Plus===
 +
This core has the option to choose between four graphics plugins and two RSP plugins:
 +
 
 +
*Glide64 is the most recommended general use graphics plugin, as it is very compatible and reasonably accurate while still being decently fast.
 +
 
 +
*Rice is much faster than Glide64, but it also suffers from a lot more issues. Only use if your device is too slow to handle Glide64.
 +
 
 +
*gln64 has even more problems than Rice, while not being much faster. Not recommended. Will likely be replaced with GLideN64 in the near future.
  
Mednafen is very picky about which BIOS to use. The ones that you might need are:
+
*Angrylion is ultra accurate, but is too slow for most people to use. Requires the CXD4 RSP to work. Resolution must be set to 640x480 or higher.
  
<ul>
+
*paraLLEl is a Vulkan renderer based on Angrylion. It is much faster than Angrylion, but is still incomplete and has more issues. Turning Synchronous RDP off results in a speed boost, but also breaks many things.
<li class="de2">scph5500.bin</li>
 
<li class="de2">scph5501.bin</li>
 
<li class="de2">scph5502.bin</li>
 
</ul>
 
  
===Disc images===
+
*The HLE RSP plugin is very fast and will work fine for most games.
  
[[Mednafen]] requires you to load games through CUE sheets. Ensure that the CUE sheet is properly set up in order for the game to run. See the [[Cue sheet (.cue)]] for more.
+
*The CXD4 RSP is more accurate, and is needed for a few games to work correctly.
  
===Mupen64Plus===
+
A good general purpose setup is Glide64 with the CXD4 RSP. If it's a tad slow for your setup, switch to the HLE RSP.
The following file need to be placed in the System folder to use the Rice plugin:
 
  
*RiceVideoLinux.ini
+
There is currently a bug in Glide64 that makes it so texture filtering is applied to everything, even when the Texture Filtering setting is set to Automatic. To make it display textures correctly, go to Core Options, toggle the setting to something other than Automatic, then set it back to Automatic. Glide64 will display textures correctly now, using the 3-point Bilinear method.
  
Download it [http://www.mediafire.com/?au459fbk8r86jat here].
+
If you get strange texture issues while using Glide64, such as textures partially disappearing or popping over polygons, mess around with the Polygon Offset Factor setting in Core Options until the issue goes away. Keep in mind some games may require a more aggressive setting than others, so experiment until you get a good balance that works for most games. The optimal setting tends to be GPU-specific.
  
Glide64mk2.ini is no longer needed in the current version of mupen64plus-libretro, as it is baked into the Glide64 now.
+
A few games, such as Star Fox 64, suffer from looking too dark due to a lack of gamma correction, which was done on real hardware. Short of implementing this in a plugin, a decent workaround is to use the image-adjustment.cg shader, and set the Target Gamma setting to 1.0. This will make such games look as they ought to.
  
 
===Super Game Boy===
 
===Super Game Boy===
  
Using recent builds of the bsnes libretro cores, you can load Game Boy games in a fully emulated Super Game Boy. As this feature is not currently implemented in RGUI, you must do so using a command line.  
+
Using recent builds of the bsnes libretro cores, you can load Game Boy games in a fully emulated Super Game Boy. As this feature is not currently usable from the menu, you must do so using a command line.  
First you need to set the core to a bsnes core (any of the 3 profiles will work) using RGUI or editing your config file, then start RetroArch with the following command to load GB games in SGB mode using bsnes:
+
Start RetroArch with the following command to load GB games in SGB mode using bsnes:
 +
 
 +
retroarch "path to Super Game Boy SNES cartridge ROM" --libretro "path to bsnes libretro" --subsystem sgb "path to Game Boy cartridge ROM"
 +
 
 +
Put the actual paths to the ROMs in double quotes if there are spaces in the paths. For example:
  
  retroarch "path to Super Game Boy SNES cartridge ROM" --gameboy "path to Game Boy cartridge ROM"
+
  retroarch "C:\Games\SNES\Super Game Boy 2 (Japan).sfc" --libretro ".\cores\bsnes_balanced_libretro.dll" --subsystem sgb "C:\Games\Game Boy\Kirby's Dream Land (USA, Europe).gb"
  
Put the actual paths to the ROMs in double quotes. For example:
+
You will need <code>sgb.boot.rom</code> (CRC: ec8a83b9) in your System folder, this can be found on the [[Emulator Files]] page in the SNES file pack if you do not have it. If it is named "sgb_bios.bin" then rename it to "sgb.boot.rom".
  
retroarch "C:/Games/SNES/Super Game Boy 2 (Japan).sfc" --gameboy "C:/Games/Game Boy/Kirby's Dream Land (USA, Europe).gb"
+
CRC of Super Game Boy SNES cartridge roms:[http://wiki.libretro.com/index.php?title=Bsnes#Super_Gameboy_Support]
 +
*Super Game Boy (Japan, USA) (Rev 1).sfc (CRC: 27a03c98)
 +
*Super Game Boy (World) (Rev 2).sfc (CRC: 8a4a174f)
 +
*Super Game Boy 2 (Japan).sfc (CRC: cb176e45)
  
You will need sgb.boot.rom in your System folder, this can be found on the [[Emulator Files]] page in the SNES file pack if you do not have it.
+
You can also use the RetroArch-Phoenix launcher to load them, but YMMV since it is not being updated anymore. Also, you can create a batch file like [http://pastebin.com/raw.php?i=yLm3HuDT this] to be able to drag and drop Game Boy ROMs onto it and launch them in SGB mode.
  
You can also use the RetroArch-Phoenix launcher to launcher to load them, but YMMV since it is not being updated anymore.
+
Also, if you are using nightly build or Linux build it might just hang at black screen, even if you have all correct requirements.
  
 
===Dual Analog Controllers===
 
===Dual Analog Controllers===
 
+
PS1 games often used a set of default remappings if they didn't support it directly. Some games used both analogs as the D-pad, RetroArch doesn't support that though. Dual analogs only work in games that fully supported them, such as Ape Escape. To use dual analog for such games, start a game with mednafen/beetle_psx then go to Input Options, and change Device Type to '''DualShock'''. Also make sure you're using a [[RetroArch#PC_Versions|recent version]] of RetroArch and the mednafen/beetle_psx core.
PS1 games often used a set of default remappings if they didn't support it directly. Some games used both analogs as the D-pad, RetroArch doesn't support that though. Dual analogs only work in games that fully supported them, such as Ape Escape. To use dual analog for such games, go to Input Options, and change Device Type to '''JoyPad w/ Analog'''.
 
  
 
===Transfer PS1 Memory Card Files===
 
===Transfer PS1 Memory Card Files===
Mednafen creates memory card files for each individual game, in contrast to PCSX-R/ePSXe where all game saves are stored into 2 memory card files. To transfer memory card files from PCSX-R/ePSXe to RetroArch:
+
RetroArch creates memory card files for each individual game, in contrast to PCSX-R/ePSXe where all game saves are stored into 2 memory card files. To transfer memory card files from PCSX-R/ePSXe to RetroArch:
  
 
*Start game in RetroArch.
 
*Start game in RetroArch.
Line 153: Line 167:
  
 
===Disk Changing===
 
===Disk Changing===
To changes disks in-game, go to Disk Options > Disk Image Append.
+
To changes disks in-game, go to Core Disk Options > Disk Image Append.
  
 
Some games like Metal Gear Solid require the disk tray to be opened before changing disks. To do this, change 'Disk Index' to 'No Disk' first.
 
Some games like Metal Gear Solid require the disk tray to be opened before changing disks. To do this, change 'Disk Index' to 'No Disk' first.
 +
 +
=== FDS Disk Side Changing ===
 +
Just press the configured "Y" button. RetroArch won't display any OSD message to confirm the change.
 +
 +
=== Gambatte GB custom palettes ===
 +
It is possible to use the custom palettes created with the standalone Qt GUI version of [[Gambatte]].
 +
 +
First set the "gb_colorization" core option as "custom". Then create a "palettes" subdirectory in the system directory and copy the custom palettes there.
 +
 +
The custom palettes will be searched in this order:
 +
* Your Rom Filename.pal
 +
* YOUR_ROM_INTERNAL_NAME.pal
 +
* default.pal
 +
You can download the set of standard SGB and GBC palettes [http://eadmaster.tk here] (look for "goomba2gambatte palette converter in python").
  
 
===Audio DSP Plugins===
 
===Audio DSP Plugins===
RetroArch supports loading audio DSP plugins to add effects such as reverb to the audio output. This has been in RetroArch for a long time, but was recently reworked to be easier to use and more accessible from RGUI, and are available in the main RetroArch repository now. Now you can load DSP filters using RGUI under Settings\Audio Options\DSP Filter, where you can load a DSP preset with .dsp extension, which is a text file similar to a shader preset that lets you chain DSP filters and specify their options. The DSP filters themselves are dynamic libraries that are loaded according to the .dsp file. Each DSP filter has a standalone preset that documents the default options, and there are some example presets that combine more than one filter.
+
RetroArch supports loading audio DSP plugins to add effects such as reverb to the audio output. This has been in RetroArch for a long time, but was recently reworked to be easier to use and more accessible from the menu, and are available in the main RetroArch repository now. Now you can load DSP filters in the menu under Settings>Audio>Audio DSP Plugin, where you can load a DSP preset with .dsp extension, which is a text file similar to a shader preset that lets you chain DSP filters and specify their options. The DSP filters themselves are dynamic libraries that are loaded according to the .dsp file. Each DSP filter has a standalone preset that documents the default options, and there are some example presets that combine more than one filter.
  
 
Note that some of these filters may reduce volume a bit, so you may want to boost RA's volume level to compensate. If you want to remove the filter, press Start when the DSP Filter option is highlighted.
 
Note that some of these filters may reduce volume a bit, so you may want to boost RA's volume level to compensate. If you want to remove the filter, press Start when the DSP Filter option is highlighted.
  
The filters and their presets can be found [https://github.com/libretro/RetroArch/tree/master/audio/filters here], which the DSP filters can be built for your platform with the makefile. Some precompiled Windows x64 builds of these filters can be obtained [https://www.mediafire.com/?89eu6fk5kx8z39a here].
+
The filters and their presets can be found [https://github.com/libretro/RetroArch/tree/master/audio/audio_filters here], which the DSP filters can be built for your platform with the makefile. These files should be included in nightly builds from the buildbot.
  
 
===SoftFilters===
 
===SoftFilters===
Classic emulator filters like SuperEagle or Blargg's NTSC have been available as bSNES filter plugins in the past, which is no longer supported in bSNES/higan but was still available in RetroArch. However, this filter format was recently replaced with the SoftFilter spec, which has been upgraded to support more platforms, multi-threading and SIMD usage. The filters are dynamic libraries which are loaded in RGUI under Settings\Video\Soft Filter, which will apply the filter before any shaders are applied.  
+
Classic emulator filters like SuperEagle or Blargg's NTSC have been available as bsnes filter plugins in the past, which is no longer supported in bsnes/higan but was still available in RetroArch. However, this filter format was recently replaced with the SoftFilter spec, which has been upgraded to support more platforms, multi-threading and SIMD usage. The filters are dynamic libraries which are loaded in the menu under Settings>Video>Video Filter, which will apply the filter before any shaders are applied.  
  
The filters are found [https://github.com/libretro/RetroArch/tree/master/gfx/filters here], which can be built for your platform with the makefile. Precompiled Windows x64 builds can be found [https://www.mediafire.com/?o9r9n8u7njwygcz here].
+
The filters are found [https://github.com/libretro/RetroArch/tree/master/gfx/video_filters here], which can be built for your platform with the makefile. These files should be included in nightly builds from the buildbot.
  
Note that these filters are WIP and may not work with all cores as they need to have codepaths for the pixel format the core uses (either 32bpp XRGB8888 or 16bpp RGB565). Blargg's NTSC is currently limited to 16bpp cores for example (bSNES is 32bpp so it won't work, but SNES9x is 16bpp so it works there). Cores that use Libretro GL for 3D like Mupen64plus can not use these filters.
+
Note that these filters are WIP and may not work with all cores as they need to have codepaths for the pixel format the core uses (either 32bpp XRGB8888 or 16bpp RGB565). Blargg's NTSC is currently limited to 16bpp cores for example (bsnes is 32bpp so it won't work, but Snes9x is 16bpp so it works there). Cores that use Libretro GL for 3D like Mupen64Plus can not use these filters.
  
 
===Outputting log to a file===
 
===Outputting log to a file===
Line 176: Line 204:
 
  retroarch --menu --verbose >> log.txt 2>&1
 
  retroarch --menu --verbose >> log.txt 2>&1
  
It will load up to RGUI as if you just double clicked the executable, but it will redirect standard output and standard error to a text file called log.txt in your RetroArch folder. The command above will append to the log and not overwrite existing information, if you want it to overwrite, change ">>" into ">". This can be put into a .bat file to easily run it when desired.
+
It will load up to the menu as if you just double clicked the executable, but it will redirect standard output and standard error to a text file called <code>log.txt</code> in your RetroArch folder. The command above will append to the log and not overwrite existing information, if you want it to overwrite, change ">>" into ">". This can be put into a .bat file to easily run it when desired.
  
 
==Building from source==
 
==Building from source==
Line 195: Line 223:
 
==Hotkeys==
 
==Hotkeys==
  
*F1 - Open RGUI
+
*F1 - Open menu
 
*F2 - Save state
 
*F2 - Save state
 
*F4 - Load state
 
*F4 - Load state
Line 208: Line 236:
  
 
==Problems and Solutions==
 
==Problems and Solutions==
 +
 +
===Menu runs too fast===
 +
 +
If Vsync is disabled for any reason, the menu may run unthrottled and scroll too fast to be usable. To fix this, enable ''Limit Maximum Run Speed'', and set ''Maximum Run Speed'' to 1.0x in ''Settings''→''Frame Throttle''. In the config file, these options are called <code>fastforward_ratio_throttle_enable</code> and <code>fastforward_ratio</code>. However, this will make fast forward not work, you will need to increase the ''Maximum Run Speed'' higher than 1.0x for that to work.
 +
 +
This tends to happen when you first start up RetroArch and not after loading a game. This is because without a core loaded, the menu is only throttled by Vsync when ''Limit Maximum Run Speed'' is disabled, while cores are able to throttle on audio as well. Fastforward disables both Vsync and audio sync, which allows the core to run unthrottled unless it is specifically limited by the ''Limit Maximum Run Speed'' setting.
 +
 +
In newer RetroArch versions, you can just enable ''Throttle Menu Framerate'' under ''Settings''→''Frame Throttle'' to specifically limit the menu to 60fps without impacting fastforward speed.
  
 
===Command prompt running and closing itself upon running retroarch.exe===
 
===Command prompt running and closing itself upon running retroarch.exe===
  
Open up retroarch.cfg using Notepad. Inside, you should find
+
If this only happens on certain cores, then you should check to see if you have all the required BIOS and other files available in the "system" folder or in the folder where the game is located.
 +
 
 +
If it happens on all cores with a clean config file, then try changing <code>video_driver</code> setting from <code>gl</code> to <code>d3d</code> or <code>sdl2</code>, if you have a particularly ancient GPU.
 +
 
 +
===Performance issues while using the GL driver===
 +
 
 +
Windows users with Nvidia hardware may find that even while idle, RetroArch CPU usage is upwards of 12% or above while using the GL video driver. If this is the case, go into the Nvidia Control Panel, and under Manage 3D Settings, check to see if the Threaded Optimizations option is set to Auto or On. If so, add retroarch.exe to the list of programs, and then toggle it to Off. This should lower CPU usage drastically.
 +
 
 +
===Stuttering due to inaccurate refresh rate estimation===
 +
 
 +
RetroArch uses [[Vsync#Dynamic_Rate_Control|Dynamic Rate Control]] to synchronize both audio and video rates of the emulated game to those of your system. It relies on the refresh rate setting being accurate to your display. By default, it is set to sync to 59.95Hz, which is the standard rate for NTSC video. However, if your display runs at a different rate than what , it can cause problems with synchronization, so you should make sure that setting accurately reflects your display's actual refresh rate. If you don't know your display's exact refresh rate, RetroArch provides a couple of ways of accurately estimating it.
 +
 
 +
The first method is to go into ''Settings''→''Video'' in the menu, and go to ''Estimated Monitor Framerate''. You'll probably see it already counting up frames as soon as you enter that menu. In order to get an accurate reading, press '''Start''' button or '''Spacebar''' key to reset the counter, then let it run for 2048 frames (about 34 seconds at 60fps), then press '''A''' button or '''Enter''' key to have the estimation set as the refresh rate for synchronization. A lower deviation is better for accurate estimation, using exclusive fullscreen can help with that.
 +
 
 +
The second method is to simply launch RetroArch from the command line in verbose logging mode, by doing <code>retroarch --menu --verbose</code>, and let it run for at least 4096 frames (about 1 minute at 60fps). When you close RetroArch, it will report the estimation results in the log. Again, running in exclusive fullscreen gives more accurate results. Example estimation output:
  
config_save_on_exit = "true"
+
RetroArch [INFO] :: Average audio buffer saturation: 49.84 %, standard deviation (percentage points): 11.99 %.
 +
RetroArch [INFO] :: Amount of time spent close to underrun: 0.70 %. Close to blocking: 1.04 %.
 +
RetroArch [INFO] :: Average monitor Hz: 60.006001 Hz. (27.568 % frame time deviation, based on 2048 last samples).
  
Now, under it, write
+
The refresh rate given there should be very accurate, and you can copy it into <code>video_refresh_rate</code> in your config file.
  
video_driver = "d3d9" or
+
===Stuttering on multi-monitor setups===
  
video_driver = "gl"
+
Further testing is needed, but on multi-monitor setups on Windows using the GL driver, it appears RetroArch will only sync smoothly when outputting to the Windows-designated primary monitor. Outputting to a secondary monitor will often result in occasional stutter, even in exclusive fullscreen and after accurate refresh rate estimation, [https://mollyrocket.com/casey/blog_0032.html possibly due to a WGL oversight]. Short of switching primary and secondary designations prior to opening RetroArch, increasing audio latency and/or using only video sync seems to help mitigate this to an extent. Switching to either the D3D or Vulkan (if available) driver appears to eliminate this problem completely.
  
 
==External links==
 
==External links==
*[http://www.libretro.com/index.php/wiki-list/ Libretro Wiki]
+
*[http://wiki.libretro.com/index.php?title=Main_Page Libretro Wiki]
 
*[http://forum.themaister.net/viewtopic.php?id=467 Windows Compilation Guide]
 
*[http://forum.themaister.net/viewtopic.php?id=467 Windows Compilation Guide]
 
*[http://www.libretro.com/index.php/wiki/compilation/linux/ Linux Compilation Guide]
 
*[http://www.libretro.com/index.php/wiki/compilation/linux/ Linux Compilation Guide]
 
*[https://github.com/libretro/RetroArch/wiki/RGUI RGUI Documentation]
 
*[https://github.com/libretro/RetroArch/wiki/RGUI RGUI Documentation]
 
*[http://www.libretro.com/index.php/wiki/configuration/general-configuration/ General Configuration]
 
*[http://www.libretro.com/index.php/wiki/configuration/general-configuration/ General Configuration]
*[http://www.libretro.com/index.php/wiki/configuration/windows-guide/ Advanced Configuration]
 
  
 
[[Category:FAQs]]
 
[[Category:FAQs]]
 +
[[Category:RetroArch]]

Revision as of 16:10, 29 July 2021

Basic Usage

Main article: Dummies Guide: RetroArch

After downloading RetroArch,

RGUI, RetroArch's original interface.
GLUI
XMB
Ozon

start up retroarch.exe.

To launch a game, select the libretro core you'd like to use under Load Core, and select a ROM under Load Content>Select File. Alternatively, you can use Load Content>Select File And Detect Core to be presented with a list of cores detected based on the file extension of the content.

For more convenient ROM selection, setup your browser directory under Settings>Directory.

Installing RetroArch on Linux

Ubuntu based

First, add the PPA for ppa:libretro/stable or ppa:libretro/testing for stable builds and dev builds respectively (instructions here), then type the following into a terminal:

sudo apt-get update

sudo apt-get install retroarch

sudo apt-get install <corename>

Replace <corename> with the name of the package the core is available in. You can see all of the cores available to you either in your package manager (e.g. Synaptic, Software Center) or by visiting Launchpad. To install all (or at least most) of the cores in one go, run

sudo apt-get install libretro*

Initial setup (Ubuntu)

This section applies to most distros of Linux, but the paths referenced may be Ubuntu-specific.

Before you can use the cores you've downloaded in Retroarch, you need to set the path to the libraries in retroarch.cfg, the configuration file for Retroarch. Run Retroarch at least once to create a skeleton retroarch.cfg. By default, retroarch.cfg will be created in the directory $HOME/.config/retroarch, where $HOME is your home directory. If retroarch.cfg is not found at that location, run Retroarch and choose the Save Config option - Retroarch will save a new configuration file and display its path on screen. Alternatively, you can use the find command:

find ~ -name "retroarch.cfg"

Next you need to locate the directory in which the libretro cores are stored. They should have been saved in the directory /usr/lib/libretro. You can check this by entering the command

ls /usr/lib/libretro

You should see a list of all the cores you downloaded. If the directory does not exist, you can find where the cores were saved with the find command:

sudo find / -name "libretro"

find may return several directories. Use ls to check each one until you find the downloaded cores.

Once you've located the libretro cores, it's time to open retroarch.cfg using your editor of choice. Look for the option libretro_directory, which may be located near the bottom of the file. Insert the path to the libretro cores between the quotation marks on the right hand side. Assuming the cores are located in /usr/lib/libretro, the line in the configuration file should look like

libretro_directory = "/usr/lib/libretro"

You can also set the libretro path using the menu. In Retroarch, go to Settings -> Path Options -> Core Directory and navigate to the appropriate folder. If you set everything up correctly, you should see the cores when you select the Core option in the menu.

Installation on Gentoo

First, install an overlay manager with git support:

# USE="git" emerge layman

Add the abendbrot repository for straightforward installation through RetroArch's git repository:

# layman -a abendbrot
# echo "source /var/lib/layman/make.conf" >> /etc/portage/make.conf

Now, change portage to pull from the RetroArch git repository:

# echo "games-emulation/retroarch-9999 **" >> /etc/portage/package.accept_keywords

Set USE flags that you want, it is not required to enable every single one (you only need at least one audio and video output device; defaults are suitable enough). It is recommended to add udev for joystick support and netplay for netplay support.

Build and install RetroArch from the git repository

# emerge retroarch

No cores are added by default, you will need to emerge them.

# emerge <corename>-libretro

Alternatively, you can set USE flags through /etc/portage/package.use libretro-meta package to choose what cores you wish; small all USE flags are on.

Syntax:
games-emulation/libretro-meta <USEFLAG> <USEFLAG> ...

bsnes has USE flags for its balanced, performance and accuracy profiles:

games-emulation/bsnes-libretro profile_accuracy ...

The cores will be installed under /usr/lib/libretro/

Other Distros

You will have to compile from source. For Arch Linux, there are AUR packages that simplify this process, although it is not incredibly difficult otherwise. The most important part is making sure you have all the dependencies.

Dependencies: (refer to your distro's wiki or package manager for exact package names)

  • pkgconfig
  • OpenGL headers (should be on most distros by default, if not try installing libgl/mesa development package

Optional

  • libxml2 - For XML shaders and cheat support
  • freetype - TTF font rendering
  • ffmpeg/libavcodec - FFmpeg recording
  • nvidia-cg-toolkit - Cg shaders

Using RetroArch

RetroArch has a robust CLI for those who prefer the command line, there are also many pages which should have been installed by default for retroarch, retroarch-joyconfig and others. If you use the CLI be sure to configure your retroarch.cfg file before first use. This config is well commented so each option can be fully understood. Use retroarch-joyconfig command for simplified input setup. RetroArch can auto-detect inputs, which is a great feature to simplify playing with multiple/different controllers (refer to man retroarch-joyconfig for details). The retroarch.cfg file should be located in /etc/retroarch.cfg, your home folder or the directory where RetroArch was installed depending on your distro and compilation setup.

General Setup/Usage

Menu Controls

Default keys for the keyboard are: x (confirm), z (back) and the arrow keys. If you're using an XInput (xbox 360) controller, your controller should already be set-up.

BIOS

If you are going to play in a system that needs a BIOS (e.g. PS1), place the BIOS files in RetroArch's 'system' directory.

Disc images

RetroArch requires you to load games through CUE sheets. Ensure that the CUE sheet is properly set up in order for the game to run. See the Cue sheet (.cue) for more.

Mupen64Plus

This core has the option to choose between four graphics plugins and two RSP plugins:

  • Glide64 is the most recommended general use graphics plugin, as it is very compatible and reasonably accurate while still being decently fast.
  • Rice is much faster than Glide64, but it also suffers from a lot more issues. Only use if your device is too slow to handle Glide64.
  • gln64 has even more problems than Rice, while not being much faster. Not recommended. Will likely be replaced with GLideN64 in the near future.
  • Angrylion is ultra accurate, but is too slow for most people to use. Requires the CXD4 RSP to work. Resolution must be set to 640x480 or higher.
  • paraLLEl is a Vulkan renderer based on Angrylion. It is much faster than Angrylion, but is still incomplete and has more issues. Turning Synchronous RDP off results in a speed boost, but also breaks many things.
  • The HLE RSP plugin is very fast and will work fine for most games.
  • The CXD4 RSP is more accurate, and is needed for a few games to work correctly.

A good general purpose setup is Glide64 with the CXD4 RSP. If it's a tad slow for your setup, switch to the HLE RSP.

There is currently a bug in Glide64 that makes it so texture filtering is applied to everything, even when the Texture Filtering setting is set to Automatic. To make it display textures correctly, go to Core Options, toggle the setting to something other than Automatic, then set it back to Automatic. Glide64 will display textures correctly now, using the 3-point Bilinear method.

If you get strange texture issues while using Glide64, such as textures partially disappearing or popping over polygons, mess around with the Polygon Offset Factor setting in Core Options until the issue goes away. Keep in mind some games may require a more aggressive setting than others, so experiment until you get a good balance that works for most games. The optimal setting tends to be GPU-specific.

A few games, such as Star Fox 64, suffer from looking too dark due to a lack of gamma correction, which was done on real hardware. Short of implementing this in a plugin, a decent workaround is to use the image-adjustment.cg shader, and set the Target Gamma setting to 1.0. This will make such games look as they ought to.

Super Game Boy

Using recent builds of the bsnes libretro cores, you can load Game Boy games in a fully emulated Super Game Boy. As this feature is not currently usable from the menu, you must do so using a command line. Start RetroArch with the following command to load GB games in SGB mode using bsnes:

retroarch "path to Super Game Boy SNES cartridge ROM" --libretro "path to bsnes libretro" --subsystem sgb "path to Game Boy cartridge ROM"

Put the actual paths to the ROMs in double quotes if there are spaces in the paths. For example:

retroarch "C:\Games\SNES\Super Game Boy 2 (Japan).sfc" --libretro ".\cores\bsnes_balanced_libretro.dll" --subsystem sgb "C:\Games\Game Boy\Kirby's Dream Land (USA, Europe).gb"

You will need sgb.boot.rom (CRC: ec8a83b9) in your System folder, this can be found on the Emulator Files page in the SNES file pack if you do not have it. If it is named "sgb_bios.bin" then rename it to "sgb.boot.rom".

CRC of Super Game Boy SNES cartridge roms:[1]

  • Super Game Boy (Japan, USA) (Rev 1).sfc (CRC: 27a03c98)
  • Super Game Boy (World) (Rev 2).sfc (CRC: 8a4a174f)
  • Super Game Boy 2 (Japan).sfc (CRC: cb176e45)

You can also use the RetroArch-Phoenix launcher to load them, but YMMV since it is not being updated anymore. Also, you can create a batch file like this to be able to drag and drop Game Boy ROMs onto it and launch them in SGB mode.

Also, if you are using nightly build or Linux build it might just hang at black screen, even if you have all correct requirements.

Dual Analog Controllers

PS1 games often used a set of default remappings if they didn't support it directly. Some games used both analogs as the D-pad, RetroArch doesn't support that though. Dual analogs only work in games that fully supported them, such as Ape Escape. To use dual analog for such games, start a game with mednafen/beetle_psx then go to Input Options, and change Device Type to DualShock. Also make sure you're using a recent version of RetroArch and the mednafen/beetle_psx core.

Transfer PS1 Memory Card Files

RetroArch creates memory card files for each individual game, in contrast to PCSX-R/ePSXe where all game saves are stored into 2 memory card files. To transfer memory card files from PCSX-R/ePSXe to RetroArch:

  • Start game in RetroArch.
  • Go to system folder. Copy the names of the .mcr files created for the game.
  • Delete them.
  • Rename the files you want to transfer with the names of the RetroArch memcard files.
  • Place the new ones in the system folder.

Disk Changing

To changes disks in-game, go to Core Disk Options > Disk Image Append.

Some games like Metal Gear Solid require the disk tray to be opened before changing disks. To do this, change 'Disk Index' to 'No Disk' first.

FDS Disk Side Changing

Just press the configured "Y" button. RetroArch won't display any OSD message to confirm the change.

Gambatte GB custom palettes

It is possible to use the custom palettes created with the standalone Qt GUI version of Gambatte.

First set the "gb_colorization" core option as "custom". Then create a "palettes" subdirectory in the system directory and copy the custom palettes there.

The custom palettes will be searched in this order:

  • Your Rom Filename.pal
  • YOUR_ROM_INTERNAL_NAME.pal
  • default.pal

You can download the set of standard SGB and GBC palettes here (look for "goomba2gambatte palette converter in python").

Audio DSP Plugins

RetroArch supports loading audio DSP plugins to add effects such as reverb to the audio output. This has been in RetroArch for a long time, but was recently reworked to be easier to use and more accessible from the menu, and are available in the main RetroArch repository now. Now you can load DSP filters in the menu under Settings>Audio>Audio DSP Plugin, where you can load a DSP preset with .dsp extension, which is a text file similar to a shader preset that lets you chain DSP filters and specify their options. The DSP filters themselves are dynamic libraries that are loaded according to the .dsp file. Each DSP filter has a standalone preset that documents the default options, and there are some example presets that combine more than one filter.

Note that some of these filters may reduce volume a bit, so you may want to boost RA's volume level to compensate. If you want to remove the filter, press Start when the DSP Filter option is highlighted.

The filters and their presets can be found here, which the DSP filters can be built for your platform with the makefile. These files should be included in nightly builds from the buildbot.

SoftFilters

Classic emulator filters like SuperEagle or Blargg's NTSC have been available as bsnes filter plugins in the past, which is no longer supported in bsnes/higan but was still available in RetroArch. However, this filter format was recently replaced with the SoftFilter spec, which has been upgraded to support more platforms, multi-threading and SIMD usage. The filters are dynamic libraries which are loaded in the menu under Settings>Video>Video Filter, which will apply the filter before any shaders are applied.

The filters are found here, which can be built for your platform with the makefile. These files should be included in nightly builds from the buildbot.

Note that these filters are WIP and may not work with all cores as they need to have codepaths for the pixel format the core uses (either 32bpp XRGB8888 or 16bpp RGB565). Blargg's NTSC is currently limited to 16bpp cores for example (bsnes is 32bpp so it won't work, but Snes9x is 16bpp so it works there). Cores that use Libretro GL for 3D like Mupen64Plus can not use these filters.

Outputting log to a file

An easy way to get RetroArch to output logs to file for easy copy/pasting:

retroarch --menu --verbose >> log.txt 2>&1

It will load up to the menu as if you just double clicked the executable, but it will redirect standard output and standard error to a text file called log.txt in your RetroArch folder. The command above will append to the log and not overwrite existing information, if you want it to overwrite, change ">>" into ">". This can be put into a .bat file to easily run it when desired.

Building from source

Main article: Building RetroArch

Libretro-super is a series of scripts used to ease the compilation and installation of each and every libretro emulation core and RetroArch itself. Thus this is the simplest route to a fully functional installation. If you need or want to build each core individually then you can refer to the build-common.sh script for direction.

git clone git://github.com/libretro/libretro-super.git
cd libretro-super
sh libretro-fetch.sh
sh libretro-build.sh
sh libretro-install.sh <path where you'd like RetroArch installed>

If you want to build cores individually with the script instead of all of them at once, you can do this

sh libretro-build.sh build_libretro_<corename>

to call one core's build function directly instead of calling them all.

Hotkeys

  • F1 - Open menu
  • F2 - Save state
  • F4 - Load state
  • F6 - Input save state slot decrease
  • F7 - Input save state slot increase
  • F8 - Take Screenshot
  • F9 - Mute Audio
  • F11 - Hide Cursor
  • Space - Turn off Frame Limiter
  • Esc - Exit game
  • f - Fullscreen

Problems and Solutions

Menu runs too fast

If Vsync is disabled for any reason, the menu may run unthrottled and scroll too fast to be usable. To fix this, enable Limit Maximum Run Speed, and set Maximum Run Speed to 1.0x in SettingsFrame Throttle. In the config file, these options are called fastforward_ratio_throttle_enable and fastforward_ratio. However, this will make fast forward not work, you will need to increase the Maximum Run Speed higher than 1.0x for that to work.

This tends to happen when you first start up RetroArch and not after loading a game. This is because without a core loaded, the menu is only throttled by Vsync when Limit Maximum Run Speed is disabled, while cores are able to throttle on audio as well. Fastforward disables both Vsync and audio sync, which allows the core to run unthrottled unless it is specifically limited by the Limit Maximum Run Speed setting.

In newer RetroArch versions, you can just enable Throttle Menu Framerate under SettingsFrame Throttle to specifically limit the menu to 60fps without impacting fastforward speed.

Command prompt running and closing itself upon running retroarch.exe

If this only happens on certain cores, then you should check to see if you have all the required BIOS and other files available in the "system" folder or in the folder where the game is located.

If it happens on all cores with a clean config file, then try changing video_driver setting from gl to d3d or sdl2, if you have a particularly ancient GPU.

Performance issues while using the GL driver

Windows users with Nvidia hardware may find that even while idle, RetroArch CPU usage is upwards of 12% or above while using the GL video driver. If this is the case, go into the Nvidia Control Panel, and under Manage 3D Settings, check to see if the Threaded Optimizations option is set to Auto or On. If so, add retroarch.exe to the list of programs, and then toggle it to Off. This should lower CPU usage drastically.

Stuttering due to inaccurate refresh rate estimation

RetroArch uses Dynamic Rate Control to synchronize both audio and video rates of the emulated game to those of your system. It relies on the refresh rate setting being accurate to your display. By default, it is set to sync to 59.95Hz, which is the standard rate for NTSC video. However, if your display runs at a different rate than what , it can cause problems with synchronization, so you should make sure that setting accurately reflects your display's actual refresh rate. If you don't know your display's exact refresh rate, RetroArch provides a couple of ways of accurately estimating it.

The first method is to go into SettingsVideo in the menu, and go to Estimated Monitor Framerate. You'll probably see it already counting up frames as soon as you enter that menu. In order to get an accurate reading, press Start button or Spacebar key to reset the counter, then let it run for 2048 frames (about 34 seconds at 60fps), then press A button or Enter key to have the estimation set as the refresh rate for synchronization. A lower deviation is better for accurate estimation, using exclusive fullscreen can help with that.

The second method is to simply launch RetroArch from the command line in verbose logging mode, by doing retroarch --menu --verbose, and let it run for at least 4096 frames (about 1 minute at 60fps). When you close RetroArch, it will report the estimation results in the log. Again, running in exclusive fullscreen gives more accurate results. Example estimation output:

RetroArch [INFO] :: Average audio buffer saturation: 49.84 %, standard deviation (percentage points): 11.99 %.
RetroArch [INFO] :: Amount of time spent close to underrun: 0.70 %. Close to blocking: 1.04 %.
RetroArch [INFO] :: Average monitor Hz: 60.006001 Hz. (27.568 % frame time deviation, based on 2048 last samples).

The refresh rate given there should be very accurate, and you can copy it into video_refresh_rate in your config file.

Stuttering on multi-monitor setups

Further testing is needed, but on multi-monitor setups on Windows using the GL driver, it appears RetroArch will only sync smoothly when outputting to the Windows-designated primary monitor. Outputting to a secondary monitor will often result in occasional stutter, even in exclusive fullscreen and after accurate refresh rate estimation, possibly due to a WGL oversight. Short of switching primary and secondary designations prior to opening RetroArch, increasing audio latency and/or using only video sync seems to help mitigate this to an extent. Switching to either the D3D or Vulkan (if available) driver appears to eliminate this problem completely.

External links