Differences
This shows you the differences between two versions of the page.
| Previous revision | |||
| — | batocera-and-crt [2025/07/23 14:06] (current) – [Connecting the PC to a CRT display] rion | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Batocera native CRT output ====== | ||
| + | |||
| + | <WRAP center round alert> | ||
| + | đźš« **This page is outdated and should no longer be used.** | ||
| + | Please refer to the **[[https:// | ||
| + | |||
| + | đź› An **automated CRT setup script** is now available and should be used to configure native CRT output on the latest x86_64 Batocera builds. | ||
| + | |||
| + | ⚠️ Only refer to this page if you’re troubleshooting legacy setups. | ||
| + | For all current installations, | ||
| + | </ | ||
| + | |||
| + | |||
| + | <WRAP center round info> | ||
| + | This guide only applies to Batocera **v32** on the x86_64. [[: | ||
| + | </ | ||
| + | |||
| + | Batocera has the capability to natively output an analogue signal, should you have the hardware to do so. The specifics are later in this guide, but that basically means you have a VGA/DVI-I port on your graphics card (which is becoming exceedingly rare with modern graphics cards) or on your motherboard (the CPU will need integrated graphics to support it and must not have a DAC altering the signal, probably along with particular BIOS settings). Modern cards with only digital outputs have a minimum bandwidth that's above the acceptable rate that CRTs can interpret, and thus won't be compatible for use in this guide. | ||
| + | |||
| + | <WRAP center round tip> | ||
| + | You can however use an active converter ([[# | ||
| + | </ | ||
| + | |||
| + | Recommended watching: | ||
| + | * [[https:// | ||
| + | |||
| + | Recommended reading: | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | |||
| + | ===== Foreword ===== | ||
| + | |||
| + | <WRAP center round alert> | ||
| + | It should go without saying, but unlike digital signals, analogue signals and the devices that receive them tend not to have safety limitations on what they are capable of. This can result in breaking displays, blowing old fuses, overheating ancient capacitors, making things catch fire, etc. You should perform adequate research before attempting any of this with your old equipment. Although this guide has safety precautions built into it, the safety of you and your equipment is solely your own responsibility. | ||
| + | </ | ||
| + | |||
| + | This guide would not have been possible without the following people to name a few: | ||
| + | * jfroco' | ||
| + | * rtissera' | ||
| + | * Calamity for his knowledge, drivers, tools, GroovyMame, Switchres, etc. | ||
| + | * Substring' | ||
| + | * D0023R Doozer' | ||
| + | * dmanlcf' | ||
| + | * Rion and Atari for compiling this guide. | ||
| + | |||
| + | ===== Glossary ===== | ||
| + | |||
| + | The field of analog signals and CRT-related standards is very complex and occasionally misleading. We won't dive into every aspect in this guide but we will explain some relevant terms here (sorted in alphabetical order) to avoid confusion. Feel free to come back to this section at any time throughout this guide: | ||
| + | |||
| + | * **Active converters** Little boxes that convert one signal to another. These use tiny computers with processors and RAM to process the image digitally and send it out the other side as appropriate. Generally undesirable, | ||
| + | * **BNC cables** These are standard aerial coaxial cords that can carry any analogue signal. For our purposes, they will be carrying an RGB video signal. There were not many consumer TVs that utilized this type of connection, but they were common with professional/ | ||
| + | * **Component video cables** The three red blue green cable connection. Not to be confused with the similarly spelled composite cable, as it uses three cables instead of one. Not to be confused with RGB signal, as this uses a YPbPr signal. Them being colored red blue and green is purely coincidental and not related to RGB at all.{{ hardware: | ||
| + | * **Composite signal** An // | ||
| + | * **Composite video cable** The yellow cable. That's enough, you know what I'm talking about already.{{ hardware: | ||
| + | * **DisplayPort** The modern digital video connection port, common on modern graphics cards. Compatible with both DP and HDMI signals. This port cannot be used to send a native analogue signals so it is not recommended for use with CRT, but this can be worked around if you have the right equipment as explained further on in the guide. | ||
| + | * **DVI-I port** This is the 29 pin port in your graphics card, capable of analogue signals. You will typically find this port alongside the VGA port. Newer cards no longer include this port. It is of extreme importance to not confuse this with the identical-looking DVI-**D** port, which is only capable of digital signals. The DVI-I port has additional pins above and below the flat tongue, whereas DVI-D doesn' | ||
| + | * **EDID** Extended Display Identification Data (EDID) is a //digital// metadata signal used by display devices to describe their capabilities to a video source (in this case, your Batocera computer). Modern digital displays all have this, and Batocera uses that to automatically switch to a compatible resolution. Certain VGA-compatible CRT monitors also use this, but not all of them. This standard was introduced in 1994, so monitors manufactured before then do **not** have EDID. | ||
| + | * **Horizontal scan rate** Usually expressed in kilohertz. This is the number of times per second that a horizontal line is drawn on a display, as opposed to vertical refresh rate which is the number of times per second that an entire screen of image data is displayed. | ||
| + | * **Passive adapter/ | ||
| + | * **RGB video signal** In this context, refers to the // | ||
| + | * **SCART** This is the 21 pin port that superseded the standard composite video output. Popular in Europe and Japan, but not many other places. Carries both analog video and audio signals. Natively uses an RGB video signal, but is backwards compatible with YPbPr, composite and S-video signals.{{ hardware: | ||
| + | * **S-video port** A slightly better version of composite video. This separated the color and luminance signals into two separate wires each, reducing color bleed and artifacts, but in practice the difference wasn't that significant. Common with DVD players, but not much else.{{ hardware: | ||
| + | * **S-video signal** An // | ||
| + | * **RF modulator** This is a device that can translate composite, component or RGB analogue signals into a radio frequency. This is required for CRT displays that only have an RF input. VCRs usually had one of these built-in to them, and make for a fine substitute.{{ hardware: | ||
| + | * **Three-pole A/V composite cable** A more modern analogue signal cable which violates standards by running a video signal through a 3.5mm headphone jack splitting into RCA cables. This is specifically designed to be used in the Raspberry Pi in its composite video modes, and will not be compatible with other devices/ | ||
| + | * **Transcoder** A device that can convert an RGB signal into an inferior signal like component/ | ||
| + | * **Vertical refresh rate** The number you're probably more familiar with, typically measured in just hertz. This is the number of full frames drawn per second. Typically this is 60 Hz for all modern displays, but older CRTs were split between 60 Hz and 50 Hz depending on where you lived. | ||
| + | * **VGA port** This is the 15 pin port ubiquitous with old computer video output and classroom projectors. It is important to note the distinction between a VGA signal and the DSUB connector used to carry that signal, as not all DSUB connectors actually send a VGA signal. Refer to this console-related [[http:// | ||
| + | * **VGA signal** A unique hybrid // | ||
| + | * **YPbPr video signal** A lower-bandwidth form of RGB, which has both the green and luminance channels on one wire. Used by component video cables, but can also be sent through a SCART connection. | ||
| + | |||
| + | ===== Prerequisites ===== | ||
| + | |||
| + | To achieve a native analogue signal on your setup, the following elements are needed: | ||
| + | |||
| + | * A network connection (wired is preferred, as it needs no configuration) | ||
| + | * For x86_64: | ||
| + | * A graphics card or integrated graphics with RGB analogue output | ||
| + | * **AMD**/ | ||
| + | * **Radeon RX** up to the **300** series (excluding the **R9 390**) (**R9 380X** is the newest and most powerful AMD card supporting analogue) | ||
| + | * **Workstation** up to the **FirePro W5000** | ||
| + | * **Nvidia** graphics cards with **VGA** or **DVI-I** ports (major flaws and limited to Super Resolutions, | ||
| + | * **GTX** up to the **900** series cards (**980** is the recommended card to use) <WRAP center round tip> | ||
| + | Cards older than the **GTX 600** series may not be supported by the official Nvidia drivers, though performance with 5th gen systems and below is adequate with the nouveau drivers. | ||
| + | </ | ||
| + | * **Titan** cards up to the **Titan X** (but excluding **Titan X Pascal**) (**Titan X** is the most powerful card supporting analogue) | ||
| + | * **Quadro** cards up to the **Quadro K5200** | ||
| + | * **Nvidia** graphics card with **DisplayPort** (no native analog signal, requires disabling low-level driver limitations which are potentially dangerous, requires additional ratnest of cables): | ||
| + | * If opting to go this route, an active converter or the CableDeconn DP to VGA adapter will be required. In general, this is not recommended as it is not a native analogue signal. | ||
| + | * A transcoder will still be required. | ||
| + | * **AMD** APUs with **VGA** or **DVI-I** ports on the motherboard (hit or miss, highly dependent on hardware limitations, | ||
| + | * **Intel** integrated graphics with **VGA** or **DVI-I** ports on the motherboard (has some flaws and limitations, | ||
| + | * If using a TV/PVM/BVM with **SCART**/ | ||
| + | * If using a computer monitor with **VGA** input, simply a **VGA** cable | ||
| + | * If using a TV with **component**/ | ||
| + | * If using a TV that only has **RF** input, you will need a **composite** to **RF** modulator in addition to the transcoder | ||
| + | * A way to [[: | ||
| + | * A way to edit files over the network (for Windows, WinScp and Notepad++ work fine) | ||
| + | |||
| + | <WRAP center round tip> | ||
| + | It is highly recommended using an external editor like [[http:// | ||
| + | </ | ||
| + | |||
| + | If any of that was confusing here's a professional-grade flowchart explaining what is required for each type of display (on PC): | ||
| + | |||
| + | {{ hardware: | ||
| + | |||
| + | ===== Component Transcoders ===== | ||
| + | |||
| + | Some appropriate VGA-to-component adapters: | ||
| + | |||
| + | RGB VGA to YPbPr Component transcoder/ | ||
| + | |||
| + | * [[https:// | ||
| + | * [[http:// | ||
| + | {{hardware: | ||
| + | |||
| + | GreenAntz RGB to component transcoder | ||
| + | |||
| + | {{hardware: | ||
| + | * [[http:// | ||
| + | * [[https:// | ||
| + | |||
| + | Retrotink RGB2COMP (Scart to Component) | ||
| + | |||
| + | {{hardware: | ||
| + | * [[https:// | ||
| + | |||
| + | RGBS VGA SCART to YPBPR Component Transcoder | ||
| + | | ||
| + | {{hardware: | ||
| + | {{hardware: | ||
| + | * [[https:// | ||
| + | |||
| + | <WRAP center round info> | ||
| + | Color coding is a little different on this | ||
| + | * Green -> Pb | ||
| + | * Red -> Y | ||
| + | * Blue -> Pr | ||
| + | </ | ||
| + | |||
| + | RGBS / SCART to YCBCR / YPBPR / S-Video converter adapter | ||
| + | |||
| + | {{hardware: | ||
| + | Convert VGA to Scart cable to YCBCR & S-Video | ||
| + | * [[https:// | ||
| + | Can also be found by searching AliExpress for "SCART RGBS to YUV YCBCR Video Converter" | ||
| + | |||
| + | ===== Composite/ | ||
| + | |||
| + | If you need composite/ | ||
| + | * [[https:// | ||
| + | {{hardware: | ||
| + | |||
| + | RGB to Composite & S-Video Ver2.0 | ||
| + | |||
| + | {{hardware: | ||
| + | |||
| + | * [[https:// | ||
| + | |||
| + | ===== DisplayPort to VGA DAC ===== | ||
| + | |||
| + | If you only have a DP connection, use the CableDeconn DP to VGA adapter before sending the signal to the transcoder of your choice: | ||
| + | * [[http:// | ||
| + | * [[https:// | ||
| + | {{: | ||
| + | |||
| + | <WRAP center round info> | ||
| + | If you are in a situation where you must use an active adapter, the CableDeconn DP to VGA adapter is one of the best options. It uses a repurposed Realtek RTD 2166 audio chip for its conversion, which doesn' | ||
| + | </ | ||
| + | |||
| + | ===== USB-C to VGA DAC ===== | ||
| + | |||
| + | If you only have a USB-C connection, use the StartTech.com USB type C to VGA, 3m, CDP2VGA3MBNL (Note: this 3m cable has the RTD2166 chip. Shorter versions of the same brand use a different chip that may not be compatible) before sending the signal to the transcoder of your choice: | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | {{: | ||
| + | |||
| + | <WRAP center round info> | ||
| + | If you are in a situation where you must use an active adapter and only have a USB type C connection the StartTech.com USB type C to VGA adapter is one of the best options. It uses a repurposed Realtek RTD 2166 audio chip for its conversion, which doesn' | ||
| + | </ | ||
| + | |||
| + | ===== Connecting the PC to a CRT display ===== | ||
| + | |||
| + | The first step is to safely connect your Batocera computer to the CRT display itself. If using a VGA connection with a EDID CRT monitor, it is as simple as connecting the display, turning it on and then turning the Batocera machine on. Keep reading this section for all other displays. If your CRT monitor does not send an EDID (the standard was introduced in 1994, so monitors manufactured before then **do not have EDID**), then you should still follow the following instructions just to be safe. | ||
| + | |||
| + | <WRAP center round important> | ||
| + | During the boot process and resizing of the partition it will boot up in a non-supported resolution. Keep the CRT TV off for the moment or on another AV channel so it doesn' | ||
| + | |||
| + | Also keep in mind that during the BIOS boot process the same rule applies. Have the CRT TV off or on another input when first booting up.</ | ||
| + | |||
| + | **To solve this we have 4 options:** | ||
| + | * Do the aforementioned, | ||
| + | * Have a look at gambaman' | ||
| + | * Use buttersoft' | ||
| + | * Flash you AMD/ATI card with [[http:// | ||
| + | |||
| + | Once everything is safe, you can turn on your Batocera machine. If you'd like to edit files using the Batocera machine itself, you can hook up a secondary digital display in the meantime. If you have multiple ports and use another port, then you'll not be able to do this once you disable the other port outputs in the upcoming section. If you have a modern digital display that can handle older standard signals over older standards cables without blowing up (such as a LCD monitor with both HDMI and VGA ports), you can use that in place of your CRT until everything is configured correctly for it. | ||
| + | |||
| + | <WRAP center round alert> | ||
| + | đźš« **This page is outdated and should no longer be used.** | ||
| + | Please refer to the **[[https:// | ||
| + | |||
| + | đź› An **automated CRT setup script** is now available and should be used to configure native CRT output on the latest x86_64 Batocera builds. | ||
| + | |||
| + | ⚠️ Only refer to this page if you’re troubleshooting legacy setups. | ||
| + | For all current installations, | ||
| + | </ | ||
| + | ===== Editing the configuration files ===== | ||
| + | |||
| + | ==== How to edit system configuration files in Batocera ==== | ||
| + | |||
| + | Batocera is unlike other typical Linux-based distributions as it contains most system-critical configuration files (such as files in the ''/ | ||
| + | |||
| + | Batocera does not share its virtual filesystem over the network share and nor is it accessible by attempting to access the drive physically from another operating system. In order to edit these files you must use Batocera itself while it is running by either utilizing its included file manager (press '' | ||
| + | |||
| + | The two exceptions to this are files stored in the ''/ | ||
| + | |||
| + | === Using the file manager to edit files === | ||
| + | |||
| + | The easiest way to manage configuration files is via the built-in file manager (x86/x86_64 only). Press '' | ||
| + | |||
| + | {{emulators: | ||
| + | |||
| + | Click on the " | ||
| + | |||
| + | {{emulators: | ||
| + | |||
| + | You can open text files here by just double-clicking them, a basic text editing application will open them: | ||
| + | |||
| + | {{emulators: | ||
| + | |||
| + | You can use ordinary system shortcuts like '' | ||
| + | |||
| + | === Using nano to edit files via SSH === | ||
| + | |||
| + | This is a convenient option if you don't have a second display to use the file manager with. Here's a crash course in using the '' | ||
| + | * Type '' | ||
| + | * Nano operates like a standard text editor, start typing to fill in its contents. If in SSH, you can paste the contents of your clipboard by right-clicking the terminal screen (it doesn' | ||
| + | * All functions are tied to '' | ||
| + | |||
| + | === Using WinSCP and Notepad++ === | ||
| + | |||
| + | You can find a mini-tutorial for WinSCP [[: | ||
| + | |||
| + | ==== Change the main resolution on PC ==== | ||
| + | |||
| + | <WRAP center round tip> | ||
| + | If using a VGA signal display with EDID, this step is not necessary. If using a VGA signal display with**out** EDID, you should use '' | ||
| + | </ | ||
| + | |||
| + | If using a CRT TV, the '' | ||
| + | |||
| + | - Connect to Batocera using SSH. See [[: | ||
| + | - Make the boot partition writable. In the SSH session, run '' | ||
| + | |||
| + | Then, we have to identify the video output we will be using: | ||
| + | |||
| + | - Get your graphics card's analog DVI/VGA output (**without** the `card#` string) using the following command: '' | ||
| + | * This will return something like < | ||
| + | </ | ||
| + | - Search for the '' | ||
| + | * If legacy, the file will be at ''/ | ||
| + | * If UEFI, for Batocera **v39** and higher the file will be at ''/ | ||
| + | - Append a space, followed by '' | ||
| + | |||
| + | In our example: < | ||
| + | |||
| + | For other supported boot resolutions, | ||
| + | |||
| + | --> Click to expand# | ||
| + | <code - syslinux.cfg> | ||
| + | UI menu.c32 | ||
| + | |||
| + | TIMEOUT 50 | ||
| + | TOTALTIMEOUT 300 | ||
| + | |||
| + | SAY Booting Batocera.linux... | ||
| + | |||
| + | MENU CLEAR | ||
| + | MENU TITLE Batocera.linux | ||
| + | MENU SHIFTKEY | ||
| + | |||
| + | LABEL batocera | ||
| + | MENU LABEL Batocera.linux (^normal) | ||
| + | MENU DEFAULT | ||
| + | LINUX /boot/linux | ||
| + | APPEND label=BATOCERA console=tty3 quiet loglevel=0 vt.global_cursor_default=0 mitigations=off video=DVI-I-1: | ||
| + | INITRD / | ||
| + | |||
| + | LABEL verbose | ||
| + | MENU LABEL Batocera.linux (^verbose) | ||
| + | LINUX /boot/linux | ||
| + | APPEND label=BATOCERA vt.global_cursor_default=0 | ||
| + | INITRD / | ||
| + | </ | ||
| + | <-- | ||
| + | |||
| + | Don't worry if your CRT display can render at a higher resolution, we'll be fine-tuning this for EmulationStation later. We just need to //not// send a signal that will destroy your CRT during the boot procedure. | ||
| + | |||
| + | ==== Disabling the other video output on PC ==== | ||
| + | |||
| + | It is highly recommended to disable the digital exclusive outputs (HDMI/ | ||
| + | |||
| + | - Get all the outputs on your graphics card that are capable of digital output we want to disable (**with** the `card#` string this time) using the '' | ||
| + | * This will return something like: < | ||
| + | </ | ||
| + | - Get port name for the connector we want to disable using xrandr: '' | ||
| + | * This will return something like < | ||
| + | DVI-0 connected 655x500+0+0 (normal left inverted right x axis y axis) 0mm x 0mm | ||
| + | </ | ||
| + | - Place the following file into ''/ | ||
| + | Identifier " | ||
| + | Option " | ||
| + | EndSection | ||
| + | |||
| + | Section " | ||
| + | Identifier " | ||
| + | Option " | ||
| + | EndSection</ | ||
| + | |||
| + | Here is an example '' | ||
| + | |||
| + | <code - 10-monitor.conf> | ||
| + | Section " | ||
| + | Identifier " | ||
| + | Option " | ||
| + | EndSection | ||
| + | |||
| + | Section " | ||
| + | Identifier " | ||
| + | Option " | ||
| + | EndSection | ||
| + | </ | ||
| + | |||
| + | Finish by [[: | ||
| + | |||
| + | < | ||
| + | batocera-save-overlay | ||
| + | </ | ||
| + | |||
| + | This will make the changes persist to the next boot (updating Batocera will remove them, however, so remember to re-apply the steps in this guide if you intend on updating). You can check that the changes have taken affect by running '' | ||
| + | |||
| + | ==== Enabling Nvidia 900 series cards to show lower modelines ==== | ||
| + | |||
| + | This is a workaround to allow the GTX 960, 970, 980 and 980ti (ones with a DVI-I port) to show lower resolutions than what they technically report as supported to the motherboard. It is not necessary on other cards. | ||
| + | |||
| + | Place the following file at ''/ | ||
| + | |||
| + | <file - 99-nvidia.conf> | ||
| + | Section " | ||
| + | Identifier | ||
| + | Driver | ||
| + | Option | ||
| + | EndSection | ||
| + | |||
| + | </ | ||
| + | |||
| + | ==== Make 640x480i the default resolution on PC ==== | ||
| + | |||
| + | <WRAP center round tip> | ||
| + | If you are using a VGA signal display, it may not support an interlaced signal (indicated by the " | ||
| + | --> Click here if you have an old IBM monitor from 1987 to 1993 to view their maximum resolutions# | ||
| + | ^ Model ^ Month/Year ^ Standard ^ Physical size ^ Viewable ^ Resolution ^ Dot pitch (mm) ^ Notes ^ | ||
| + | | 8512 | Apr 1987 | VGA | 14" | ||
| + | | 8513 | Apr 1987 | VGA | 12" | ||
| + | | 8514 | Apr 1987 | XGA | 16" | ||
| + | | 8515 | Sept 1991 | XGA | 14" | ||
| + | | 8511 | Mar 1992 | VGA | 14" | ||
| + | | 6312 | Sept 1992 | SVGA | 14" | ||
| + | | 6314 | Sept 1992 | SVGA | 14" | ||
| + | | 6319 | Sept 1992 | SVGA | 15" | ||
| + | | 9515 | Sept 1992 | XGA | 14" | ||
| + | | 9518 | Sept 1992 | VGA | 14" | ||
| + | | 9517 | Nov 1992 | XGA | 17" | ||
| + | | 6317 | Apr 1993 | SVGA | 17" | ||
| + | | 6318 | Apr 1993 | SVGA | 14" | ||
| + | |||
| + | Taken from page 2 of [[https:// | ||
| + | <-- | ||
| + | </ | ||
| + | |||
| + | Get the system level ID for your display. Run '' | ||
| + | |||
| + | {{ hardware: | ||
| + | |||
| + | Identify the port name of the port you intend to use for your CRT display. In this case it is '' | ||
| + | |||
| + | To enable the " | ||
| + | |||
| + | - Open the ''/ | ||
| + | - Go to the blank line just before '' | ||
| + | - Add the new xrandr modeline to it. This will force all running programs on Batocera to run at this default full-screen resolution. For example, you could paste in this text in that new blank line:< | ||
| + | #####-CRT CONFIG-####### | ||
| + | ######################## | ||
| + | ##-Default Resolution-## | ||
| + | ######################## | ||
| + | xrandr -display :0.0 --newmode " | ||
| + | xrandr -display :0.0 --addmode DVI-0 " | ||
| + | xrandr -display :0.0 --output DVI-0 --mode " | ||
| + | ######################## | ||
| + | ######################## | ||
| + | |||
| + | </ | ||
| + | * Or if you were using a VGA monitor with no EDID you would use this instead:< | ||
| + | #####-CRT CONFIG-####### | ||
| + | ######################## | ||
| + | ##-Default Resolution-## | ||
| + | ######################## | ||
| + | xrandr -display :0.0 --newmode " | ||
| + | xrandr -display :0.0 --addmode VGA-0 " | ||
| + | xrandr -display :0.0 --output VGA-0 --mode " | ||
| + | ######################## | ||
| + | ######################## | ||
| + | </ | ||
| + | #####-CRT CONFIG-####### | ||
| + | ######################## | ||
| + | ##-Default Resolution-## | ||
| + | ######################## | ||
| + | xrandr -display :0.0 --newmode " | ||
| + | xrandr -display :0.0 --addmode VGA-0 " | ||
| + | xrandr -display :0.0 --output VGA-0 --mode " | ||
| + | ######################## | ||
| + | ######################## | ||
| + | </ | ||
| + | |||
| + | Save the file, then make the file permanent by running '' | ||
| + | |||
| + | --> Here's an example / | ||
| + | <code - xinitrc> | ||
| + | #!/bin/sh | ||
| + | |||
| + | # hide mouse cursor | ||
| + | unclutter --noevents -b | ||
| + | |||
| + | # disable dpms to prevent screen from blanking | ||
| + | xset -dpms | ||
| + | xset s off | ||
| + | |||
| + | # allow coredumps for ES | ||
| + | ulimit -H -c unlimited | ||
| + | ulimit -S -c unlimited emulationstation | ||
| + | |||
| + | # dbus launch is required for the gio/ | ||
| + | eval `dbus-launch --sh-syntax --exit-with-session` | ||
| + | |||
| + | ### intel-iris-driver ### | ||
| + | irisdriver=" | ||
| + | if test ! -z " | ||
| + | # Force use i965 driver through global environment variable | ||
| + | export MESA_LOADER_DRIVER_OVERRIDE=i965 | ||
| + | fi | ||
| + | ################### | ||
| + | |||
| + | |||
| + | ### nvidia ### | ||
| + | # these are 3 variables used only by nvidia to take nvidia gpu over intel cards when such hybrid cards are available | ||
| + | nvidia_driver=" | ||
| + | if test " | ||
| + | then | ||
| + | nvidia_prime=" | ||
| + | if test " | ||
| + | then | ||
| + | export __NV_PRIME_RENDER_OFFLOAD=1 | ||
| + | export __VK_LAYER_NV_optimus=NVIDIA_only | ||
| + | export __GLX_VENDOR_LIBRARY_NAME=nvidia | ||
| + | fi | ||
| + | fi | ||
| + | |||
| + | ### radeon ### | ||
| + | # variable for AMD Dynamic Switchable Graphics to take amd-radeon gpu over intel cards when such hybrid cards are available | ||
| + | radeon_prime=" | ||
| + | if test " | ||
| + | then | ||
| + | export DRI_PRIME=1 | ||
| + | fi | ||
| + | |||
| + | ######################## | ||
| + | #####-CRT CONFIG-####### | ||
| + | ######################## | ||
| + | ##-Default Resolution-## | ||
| + | ######################## | ||
| + | xrandr -display :0.0 --newmode " | ||
| + | xrandr -display :0.0 --addmode DVI-0 " | ||
| + | xrandr -display :0.0 --output DVI-0 --mode " | ||
| + | ######################## | ||
| + | ######################## | ||
| + | |||
| + | openbox --config-file / | ||
| + | </ | ||
| + | <-- | ||
| + | |||
| + | ===== Disable EmulationStation from forcing 60Hz ===== | ||
| + | |||
| + | By default, EmulationStation will try to force a refresh rate at 60 Hz at all times. This can have adverse effects on games like frame pacing (uneven scrolling), audio (crackling) and timing (speed of gameplay, physics) issues. [[https:// | ||
| + | |||
| + | We will disable ES from forcing 60 Hz at all times by commenting out some lines. | ||
| + | |||
| + | Make a backup of ''/ | ||
| + | |||
| + | < | ||
| + | cp / | ||
| + | </ | ||
| + | |||
| + | Then, underneath the '' | ||
| + | |||
| + | < | ||
| + | FRAMERATE=" | ||
| + | test -z " | ||
| + | which xrandr && xrandr -r " | ||
| + | </ | ||
| + | |||
| + | Your file should look like this now: | ||
| + | |||
| + | < | ||
| + | # try to force 60hz (specific to xorg) | ||
| + | # FRAMERATE=" | ||
| + | # test -z " | ||
| + | # which xrandr && xrandr -r " | ||
| + | ################### | ||
| + | </ | ||
| + | |||
| + | Don't forget to '' | ||
| + | |||
| + | ===== Managing overscan and centering in EmulationStation ===== | ||
| + | |||
| + | As you might have noticed some of EmulationStation' | ||
| + | |||
| + | <WRAP center round tip 60%> | ||
| + | Alternatively: | ||
| + | </ | ||
| + | |||
| + | ==== Offset (position) ==== | ||
| + | |||
| + | {{ hardware: | ||
| + | |||
| + | We will start by aligning the top-left of the image with the top-left corner of the display. This will be important for the next step (scaling). We will do this by utilizing the following argument: | ||
| + | |||
| + | < | ||
| + | --screenoffset [x] [y] Move the canvas by [x] pixels right and [y] pixels down. | ||
| + | </ | ||
| + | |||
| + | Open '' | ||
| + | |||
| + | < | ||
| + | ## ES Settings | ||
| + | es.customsargs=--screenoffset 00 00 | ||
| + | </ | ||
| + | |||
| + | Save the file. To see the changes in effect, restart EmulationStation with the following command: | ||
| + | |||
| + | < | ||
| + | batocera-es-swissknife --restart | ||
| + | </ | ||
| + | |||
| + | Increase or decrease these numbers until the top-left pixel is aligned where you want it to be. Check [[# | ||
| + | |||
| + | ==== Scaling (size) ==== | ||
| + | |||
| + | {{ hardware: | ||
| + | |||
| + | CRTs were a bit loosey-goosey with having every pixel line up 1:1 with the signal, even with a perfectly physically aligned screen you may see pixels blurring into each other. Whether you want to " | ||
| + | |||
| + | < | ||
| + | --screensize [width] [height] | ||
| + | </ | ||
| + | |||
| + | Let's start by using the same resolution as you boot resolution. In this case, '' | ||
| + | |||
| + | Open '' | ||
| + | |||
| + | Append '' | ||
| + | |||
| + | < | ||
| + | ## ES Settings | ||
| + | es.customsargs=--screensize 640 480 --screenoffset 00 00 | ||
| + | </ | ||
| + | |||
| + | After adjustment, it may look like this: | ||
| + | |||
| + | < | ||
| + | ## ES Settings | ||
| + | es.customsargs=--screensize 640 488 --screenoffset 38 16 | ||
| + | </ | ||
| + | |||
| + | Save the file. To see the changes in effect, restart EmulationStation with the following command: | ||
| + | | ||
| + | < | ||
| + | batocera-es-swissknife --restart | ||
| + | </ | ||
| + | |||
| + | Increase or decrease these numbers until the bottom-right pixel is aligned where you want it to be. Check [[# | ||
| + | |||
| + | ==== Results of proper scaling and offset ==== | ||
| + | |||
| + | ^ Before alignment | ||
| + | | {{ hardware: | ||
| + | |||
| + | ==== Persist screen scaling after exiting an emulator ==== | ||
| + | |||
| + | We also need to make a script so this setting persists even after exiting an emulator. Otherwise, EmulationStation will reset back to the default offset and scaling when returning to the menu: | ||
| + | |||
| + | {{ hardware: | ||
| + | |||
| + | Make a folder inside ''/ | ||
| + | |||
| + | <code bash| first_script.sh> | ||
| + | #!/bin/bash | ||
| + | |||
| + | #Case selection for first parameter parsed | ||
| + | case $1 in | ||
| + | gameStop) | ||
| + | xrandr -display :0.0 --output [your video port] --mode " | ||
| + | ;; | ||
| + | esac | ||
| + | </ | ||
| + | |||
| + | Make the script executable with '' | ||
| + | |||
| + | Here is an example file using a DVI port for reference: | ||
| + | |||
| + | <code bash| first_script.sh> | ||
| + | #!/bin/bash | ||
| + | #This will force ES to refresh its display, grabbing the correct custom arguments we've set. | ||
| + | |||
| + | #Set logfile location and filename | ||
| + | # | ||
| + | |||
| + | #Case selection for first parameter parsed | ||
| + | case $1 in | ||
| + | # gameStart) | ||
| + | # echo " | ||
| + | # echo " | ||
| + | # ;; | ||
| + | |||
| + | gameStop) | ||
| + | xrandr -display :0.0 --output DVI-0 --mode " | ||
| + | ;; | ||
| + | esac | ||
| + | </ | ||
| + | |||
| + | Finish with '' | ||
| + | |||
| + | {{ hardware: | ||
| + | |||
| + | ===== Adding Modelines (Read Resolutions) for Emulators ===== | ||
| + | |||
| + | Right now we only have one usable modeline and that is 640x480i. | ||
| + | |||
| + | We would like to add more modelines for external emulators like for example PS2, PSP, GameCube, Wii, Wine (PC) and so on. | ||
| + | |||
| + | To do this we are going to use a program called [[https:// | ||
| + | |||
| + | However it is possible to bypass setting up switchres entirely by defining the resolution modes manually in the config file appropriate to the GPU being used. This is not ordinarily recommended but can make the process much more automated and portable as the video modes will now appear in the menu as available video modes. | ||
| + | |||
| + | --> Manually define modes for use in the menu | ||
| + | |||
| + | Place this file at ''/ | ||
| + | |||
| + | <file - 99-nvidia.conf> | ||
| + | # Config for 15Khz Monitor | ||
| + | Section " | ||
| + | Identifier | ||
| + | Option | ||
| + | ############################################# | ||
| + | EndSection | ||
| + | |||
| + | Section " | ||
| + | Identifier " | ||
| + | VendorName " | ||
| + | |||
| + | Option " | ||
| + | Option " | ||
| + | Option " | ||
| + | |||
| + | Modeline " | ||
| + | Modeline " | ||
| + | Modeline " | ||
| + | Modeline " | ||
| + | Modeline " | ||
| + | Modeline " | ||
| + | |||
| + | Modeline " | ||
| + | Modeline " | ||
| + | Modeline " | ||
| + | Modeline " | ||
| + | Modeline " | ||
| + | Modeline " | ||
| + | Modeline " | ||
| + | Modeline " | ||
| + | |||
| + | #Modeline " | ||
| + | |||
| + | |||
| + | EndSection | ||
| + | |||
| + | Section " | ||
| + | Identifier " | ||
| + | Option " | ||
| + | Option " | ||
| + | Option " | ||
| + | Option " | ||
| + | Option " | ||
| + | Option " | ||
| + | Option " | ||
| + | Option " | ||
| + | Option " | ||
| + | Option " | ||
| + | Option " | ||
| + | Option " | ||
| + | Option " | ||
| + | Option " | ||
| + | Option " | ||
| + | Option " | ||
| + | Option " | ||
| + | #Option " | ||
| + | #Option " | ||
| + | #Option " | ||
| + | #Option " | ||
| + | #Option " | ||
| + | #Option " | ||
| + | |||
| + | EndSection | ||
| + | |||
| + | |||
| + | Section " | ||
| + | Identifier | ||
| + | Device | ||
| + | Monitor | ||
| + | Option | ||
| + | Option | ||
| + | |||
| + | EndSection | ||
| + | |||
| + | |||
| + | Section " | ||
| + | Option "blank time" " | ||
| + | Option " | ||
| + | Option " | ||
| + | Option "off time" " | ||
| + | Option " | ||
| + | Option " | ||
| + | Option " | ||
| + | EndSection | ||
| + | |||
| + | </ | ||
| + | |||
| + | <-- | ||
| + | |||
| + | If this method is taken, skip over to [[# | ||
| + | |||
| + | ==== Creating the switchres.ini file ==== | ||
| + | |||
| + | Switchres will be activated once the appropriate '' | ||
| + | |||
| + | <WRAP center round download> | ||
| + | You can download the '' | ||
| + | </ | ||
| + | |||
| + | === Creating switchres.ini using only SSH === | ||
| + | |||
| + | If you cannot do the above, or would just like to use only SSH, do the following: | ||
| + | |||
| + | We will use '' | ||
| + | |||
| + | < | ||
| + | nano / | ||
| + | </ | ||
| + | |||
| + | This will open up a new empty file for editing. Copy and paste the contents of the INI file below into your SSH session (remember, you only need to right-click to paste): | ||
| + | |||
| + | --> Click here to reveal# | ||
| + | <code - switchres.ini> | ||
| + | # | ||
| + | # Switchres config | ||
| + | # | ||
| + | |||
| + | # Monitor preset. Sets typical monitor operational ranges: | ||
| + | # | ||
| + | # generic_15, ntsc, pal Generic CRT standards | ||
| + | # arcade_15, arcade_15ex | ||
| + | # arcade_25, arcade_31 | ||
| + | # arcade_15_25, | ||
| + | # vesa_480, vesa_600, vesa_768, vesa_1024 | ||
| + | # pc_31_120, pc_70_120 | ||
| + | # h9110, polo, pstar | ||
| + | # k7000, k7131, d9200, d9800, d9400 Wells Gardner | ||
| + | # m2929 Makvision | ||
| + | # m3129 Wei-Ya | ||
| + | # ms2930, ms929 Nanao | ||
| + | # r666b Rodotron | ||
| + | # | ||
| + | # Special presets: | ||
| + | # custom | ||
| + | # lcd Will keep desktop' | ||
| + | # | ||
| + | monitor | ||
| + | |||
| + | # Define a custom preset, use monitor custom to activate | ||
| + | # crt_range0-9 | ||
| + | # e.g.: crt_range0 | ||
| + | crt_range0 | ||
| + | crt_range1 | ||
| + | crt_range2 | ||
| + | crt_range3 | ||
| + | crt_range4 | ||
| + | crt_range5 | ||
| + | crt_range6 | ||
| + | crt_range7 | ||
| + | crt_range8 | ||
| + | crt_range9 | ||
| + | |||
| + | # Set the operational refresh range for LCD monitor, e.g. lcd_range 50-61 | ||
| + | lcd_range | ||
| + | |||
| + | # Force a custom modeline, in XFree86 format. This option overrides the active monitor preset configuration. | ||
| + | modeline | ||
| + | |||
| + | # Forces an user mode, in the format: width x height @ refresh. Here, 0 can used as a wildcard. At least one of the three values | ||
| + | # must be defined. E.g. user_mode 0x240 -> SR can freely choose any width based on the game's requested video mode, but will | ||
| + | # force height as 240. | ||
| + | user_mode | ||
| + | |||
| + | |||
| + | # | ||
| + | # Display config | ||
| + | # | ||
| + | |||
| + | # Select target display | ||
| + | # auto Pick the default display | ||
| + | # 0, 1, 2, ... Pick a display by index | ||
| + | # \\.\DISPLAY1, | ||
| + | # VGA-0, ... X11 display name | ||
| + | display | ||
| + | |||
| + | # Choose a custom video backend when more than one is available. | ||
| + | # auto Let Switchres decide | ||
| + | # adl Windows - AMD ADL (AMD Radeon HD 5000+) | ||
| + | # ati Windows - ATI legacy (ATI Radeon pre-HD 5000) | ||
| + | # powerstrip | ||
| + | # xrandr | ||
| + | # drmkms | ||
| + | api auto | ||
| + | |||
| + | # [Windows] Lock video modes reported as unsupported by your monitor' | ||
| + | lock_unsupported_modes | ||
| + | |||
| + | # Lock system (non-custom) video modes, only use modes that have full detailed timings available | ||
| + | lock_system_modes | ||
| + | |||
| + | # Ignore video mode's refresh reported by the OS when checking ranges | ||
| + | refresh_dont_care | ||
| + | |||
| + | # Keep changes on exit (warning: this skips video mode cleanup) | ||
| + | keep_changes | ||
| + | |||
| + | |||
| + | # | ||
| + | # Modeline generation config | ||
| + | # | ||
| + | |||
| + | # Enable on-the-fly generation of video modes | ||
| + | modeline_generation | ||
| + | |||
| + | # Allow interlaced modes (existing or generated) | ||
| + | interlace | ||
| + | |||
| + | # Allow doublescan modes (warning: doublescan support is broken in most drivers) | ||
| + | doublescan | ||
| + | |||
| + | # Force a minimum dotclock value, in MHz, e.g. dotclock_min 25.0 | ||
| + | dotclock_min | ||
| + | |||
| + | # Maximum refresh difference, in Hz, allowed in order to synchronize. Below this value, the mismatch does not involve penalization | ||
| + | sync_refresh_tolerance | ||
| + | |||
| + | # Super resolution width: above this width, fractional scaling on the horizontal axis is applied without penalization | ||
| + | super_width | ||
| + | |||
| + | # Physical aspect ratio of the target monitor. Used to compensate aspect ratio when the target monitor is not 4:3 | ||
| + | aspect | ||
| + | |||
| + | # [Experimental] Attempts to compensate consumer TVs vertical centering issues | ||
| + | v_shift_correct | ||
| + | |||
| + | # Calculate horizontal borders with 1-pixel precision, instead of the default 8-pixels blocks that were required by old drivers. | ||
| + | # Greatly improves horizontal centering of video modes. | ||
| + | pixel_precision | ||
| + | |||
| + | # Calculate all vertical values of interlaced modes as even numbers. Required by AMD APU hardware on Linux | ||
| + | interlace_force_even | ||
| + | |||
| + | |||
| + | # | ||
| + | # Custom video backend config | ||
| + | # | ||
| + | |||
| + | # [X11] adjusts the crtc position after a new video mode is set, maintaining the relative position of screens in a multi-monitor setup. | ||
| + | screen_compositing | ||
| + | |||
| + | # [X11] stacks the screens vertically on startup to allow each screen to freely resize up to the maximum width. Useful to avoid video | ||
| + | # glitches when using super-resolutions. screen_reordering overrides screen_compositing. | ||
| + | screen_reordering | ||
| + | |||
| + | # [Windows] dynamically adds new modes or updates existing ones, even on stock AMD drivers*. This feature is experimental and is | ||
| + | # disabled by default. It has the following limitations and problems: | ||
| + | # - Synchronization is not perfect yet and the new modes may not always be ready on time for mode switching, causing a wrong display | ||
| + | # | ||
| + | # - A plug-n-play audio notification will be present on startup and exit, if the explorer shell is used. | ||
| + | # - Refreshing the hardware is an expensive task that takes time, specially if the app has already entered fullscreen mode. This | ||
| + | # makes it unpractical for games that switch video modes more than once. | ||
| + | # * When used with stock AMD drivers instead of CRT Emudriver, usual limitations apply: no support for low resolutions (below 640x480) | ||
| + | # nor low dotclocks. | ||
| + | # Not a problem however if you're using a 31 kHz monitor. | ||
| + | allow_hardware_refresh | ||
| + | |||
| + | # Pass a custom video timing string in the native backend' | ||
| + | custom_timing | ||
| + | |||
| + | |||
| + | # | ||
| + | # Logging | ||
| + | # | ||
| + | |||
| + | # Enables verbose mode (0|1) | ||
| + | verbose | ||
| + | |||
| + | # Set verbosity level (from 0 to 3) | ||
| + | # 0: no messages from SR | ||
| + | # 1: only errors | ||
| + | # 2: general information | ||
| + | # 3: debug messages | ||
| + | verbosity | ||
| + | </ | ||
| + | <-- | ||
| + | |||
| + | Press '' | ||
| + | |||
| + | ==== Selecting your monitor type ==== | ||
| + | |||
| + | Switchres will need to know what kind of CRT display you have in order to generate modelines for it. Essentially, | ||
| + | |||
| + | < | ||
| + | monitor | ||
| + | </ | ||
| + | |||
| + | There are several types of CRT display presets to choose from. Here are a few common ones: | ||
| + | |||
| + | < | ||
| + | generic_15 | ||
| + | arcade_15 | ||
| + | pal PAL TV - 50 Hz/625 | ||
| + | ntsc NTSC TV - 60 Hz/525 | ||
| + | arcade_15ex | ||
| + | pc_31_120 | ||
| + | pc_70_120 | ||
| + | </ | ||
| + | |||
| + | '' | ||
| + | |||
| + | Replace '' | ||
| + | |||
| + | < | ||
| + | monitor | ||
| + | </ | ||
| + | |||
| + | Save the file and close it. If using '' | ||
| + | |||
| + | <WRAP center round tip 60%> | ||
| + | If your display device does not support one of the built-in presets, then you'll need to use the custom monitor type [[https:// | ||
| + | </ | ||
| + | |||
| + | ==== Changing the file permissions ==== | ||
| + | |||
| + | We need to change the file access permissions. Run the following command: | ||
| + | |||
| + | chmod 0777 / | ||
| + | |||
| + | Once again, run '' | ||
| + | |||
| + | ==== Creating a modeline ==== | ||
| + | |||
| + | In order to create a new modeline we must first create the appropriate syntax for it. A typical modeline applied via xrandr to a particular display looks like the following: | ||
| + | |||
| + | < | ||
| + | xrandr -display :0.0 --newmode " | ||
| + | xrandr -display :0.0 --addmode " | ||
| + | </ | ||
| + | |||
| + | and it will be put into the ''/ | ||
| + | |||
| + | You can refer to [[# | ||
| + | |||
| + | < | ||
| + | switchres 320 240 60 -i switchres.ini -c | ||
| + | </ | ||
| + | |||
| + | It should output a single line similar to this: | ||
| + | |||
| + | < | ||
| + | Switchres: Modeline " | ||
| + | </ | ||
| + | |||
| + | We have now generated the modeline based on our monitor preset **arcade_15**. Copy this line (from after the word Modeline) and save it to a temporary text file. | ||
| + | |||
| + | < | ||
| + | " | ||
| + | </ | ||
| + | |||
| + | You can opt to shorten the name by removing the '' | ||
| + | |||
| + | < | ||
| + | " | ||
| + | </ | ||
| + | |||
| + | Then add this line to ''/ | ||
| + | |||
| + | Then we will need to tell xorg about the name of this modeline. Simple, add another line underneath that with just the part in double-quotes ("). | ||
| + | |||
| + | < | ||
| + | " | ||
| + | " | ||
| + | </ | ||
| + | |||
| + | This mode will tell xorg that the modeline' | ||
| + | |||
| + | <WRAP center round tip> | ||
| + | Alternatively, | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== Switchres usage ==== | ||
| + | |||
| + | Regular modeline generation (read the [[# | ||
| + | |||
| + | < | ||
| + | # switchres 320 240 60 -i switchres.ini -c | ||
| + | </ | ||
| + | |||
| + | which would output: | ||
| + | |||
| + | < | ||
| + | Switchres: Modeline " | ||
| + | </ | ||
| + | |||
| + | You can also skip reading the '' | ||
| + | |||
| + | < | ||
| + | # switchres 320 240 60 -m generic_15 -c | ||
| + | </ | ||
| + | |||
| + | which would output: | ||
| + | |||
| + | < | ||
| + | Switchres: Modeline " | ||
| + | </ | ||
| + | |||
| + | Forced modeline generation: | ||
| + | |||
| + | < | ||
| + | # switchres 854 480 60 -f 854x480@60 -i switchres.ini -c | ||
| + | </ | ||
| + | |||
| + | which would output the following: | ||
| + | |||
| + | < | ||
| + | Switchres: Modeline " | ||
| + | </ | ||
| + | |||
| + | ==== Telling xinitrc about the new modeline(s) ==== | ||
| + | |||
| + | Now we need to add the modeline to the '' | ||
| + | |||
| + | < | ||
| + | ######################## | ||
| + | #####-CRT CONFIG-####### | ||
| + | ######################## | ||
| + | ##-Default Resolution-## | ||
| + | ######################## | ||
| + | xrandr -display :0.0 --newmode " | ||
| + | xrandr -display :0.0 --addmode DVI-0 " | ||
| + | xrandr -display :0.0 --output DVI-0 --mode " | ||
| + | ######################## | ||
| + | ######################## | ||
| + | |||
| + | openbox --config-file / | ||
| + | </ | ||
| + | |||
| + | On a new line after '' | ||
| + | |||
| + | Then on another new line, type '' | ||
| + | |||
| + | In our example the file would end up looking like this: | ||
| + | |||
| + | < | ||
| + | ######################## | ||
| + | #####-CRT CONFIG-####### | ||
| + | ######################## | ||
| + | ##-Default Resolution-## | ||
| + | ######################## | ||
| + | xrandr -display :0.0 --newmode " | ||
| + | xrandr -display :0.0 --addmode DVI-0 " | ||
| + | xrandr -display :0.0 --output DVI-0 --mode " | ||
| + | ######################## | ||
| + | ##### | ||
| + | ######################## | ||
| + | xrandr -display :0.0 --newmode " | ||
| + | xrandr -display :0.0 --addmode " | ||
| + | |||
| + | openbox --config-file / | ||
| + | </ | ||
| + | |||
| + | Finish with '' | ||
| + | |||
| + | ==== Modelines ==== | ||
| + | |||
| + | Here are some resolutions to use | ||
| + | |||
| + | * Super Resolutions | ||
| + | * 2560x240@60 | ||
| + | * 2560x248@58 | ||
| + | * 2560x256@57 | ||
| + | * 2560x264@55 | ||
| + | * 2560x272@54 | ||
| + | * 2560x280@52 | ||
| + | * 2560x288@51 | ||
| + | * 2560x448@60 | ||
| + | * 2560x464@60 | ||
| + | * 2560x480@60 | ||
| + | * 2560x496@58 | ||
| + | * 2560x512@57 | ||
| + | * 2560x544@54 | ||
| + | * 2560x560@52 | ||
| + | |||
| + | * Emulator/ | ||
| + | * 240x240@60 | ||
| + | * 256x192@60 | ||
| + | * 288x224@60 | ||
| + | * 320x180@60 | ||
| + | * 320x200@60 | ||
| + | * 320x240@60 | ||
| + | * 320x240@60i | ||
| + | * 320x256@55 | ||
| + | * 320x256@60 | ||
| + | * 352x240@60 | ||
| + | * 360x200@60 | ||
| + | * 360x240@60 | ||
| + | * 380x284@60 | ||
| + | * 384x216@60 | ||
| + | * 384x480@60i | ||
| + | * 400x240@60 | ||
| + | * 416x240@60 | ||
| + | * 426x240@60 | ||
| + | * 428x240@60 | ||
| + | * 456x256@55 | ||
| + | * 460x200@60 | ||
| + | * 464@272@50 | ||
| + | * 480x270@50 | ||
| + | * 480x270@60 | ||
| + | * 480x272@60 | ||
| + | * 512x480@60i | ||
| + | * 640x240@60 | ||
| + | * 640x360@60 | ||
| + | * 640x480@60 | ||
| + | * 640x480@60i | ||
| + | * 854x480@60i | ||
| + | |||
| + | ===== Switchres - minimum dot clock ===== | ||
| + | |||
| + | <WRAP center round info> | ||
| + | Most of this information has been gathered from [[https:// | ||
| + | </ | ||
| + | |||
| + | Fun fact about CRTs: they receive more data than they actually display and keep those extra bits outside of the frame at the top and the bottom. This will be relevant for the next paragraph. | ||
| + | |||
| + | The dot clock. Essentially, | ||
| + | |||
| + | The issue with modern graphics cards is that they have a **minimum** required bandwidth to function, anything below that will simply not render (or in some cases, lock up the hardware). Typical minimum bandwidths for these cards are 8 Mp/s, 12 Mp/s and 25 Mp/s. Sometimes the minimum bandwidths will differ depending on which ports are used, digital ports tend to have an even higher minimum bandwidth. | ||
| + | |||
| + | So what can we do about this? The answer is simple: | ||
| + | |||
| + | ==== Super resolutions ==== | ||
| + | |||
| + | CRTs are beautiful in the sense that they don't think in pixels, only lines. So essentially, | ||
| + | |||
| + | It's typically good practice to use a // | ||
| + | |||
| + | So therefore, we will let Switchres calculate the appropriate super resolution for us. It will work out the super resolution that is both a multiple of the original system' | ||
| + | |||
| + | Here's an example: let's say you're playing a game that runs at a native 640x480 at 60 FPS. Our graphics card has a minimum required bandwidth of 25 Mp/s. The bandwidth of that is calculated by 640x480x60 = 18,432,000 p/s. This is close to the required 25 Mp/s but not quite. Switchres calculates our super resolution as 1280x480, as 1280 is a // | ||
| + | |||
| + | Same goes for any other modeline, like for 256x224 it would calculate 512x224x60, 768x224x60 and so on until it meets the minimum required bandwidth (dot clock) set in the INI. | ||
| + | |||
| + | <WRAP center round tip 60%> | ||
| + | Super resolutions are only supported by MAME and Libretro cores. | ||
| + | </ | ||
| + | |||
| + | ===== Testing modelines ===== | ||
| + | |||
| + | {{: | ||
| + | |||
| + | configure switchres.ini to your monitor (WinScp) | ||
| + | |||
| + | Connect to Batocera via SSH | ||
| + | |||
| + | Have a keyboard connected | ||
| + | |||
| + | Exit Emulation Station | ||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | From putty type for this to test modeline 640x480@60 with configured monitor profile | ||
| + | < | ||
| + | DISPLAY=:0 switchres 640 480 60 -i switchres.ini -s -l grid | ||
| + | </ | ||
| + | You can change between 2 types of grids with Tab. | ||
| + | |||
| + | Exit pressing Escape from keyboard to try a new modeline. Do not use '' | ||
| + | If you do then you need to reboot. | ||
| + | |||
| + | Go back to Es with the command | ||
| + | < | ||
| + | batocera-es-swissknife --restart | ||
| + | </ | ||
| + | |||
| + | Modelines to test your switchres.ini settings with | ||
| + | < | ||
| + | |||
| + | Always start with default setting 0 and work your way up. The example below is a low resolution so if your card can handle it then there is no need to change the dotclock. | ||
| + | |||
| + | [[https:// | ||
| + | |||
| + | For example the Arcade game Dottori Kun ([[http:// | ||
| + | < | ||
| + | DISPLAY=:0 switchres 128 192 61.035156 -i switchres.ini -s -l grid | ||
| + | </ | ||
| + | |||
| + | ===== AMD Troubleshooting Tearfree and Freezes ===== | ||
| + | |||
| + | If you get uneven frame-pacing and microstutters in Mame and/or Retroarch we need to disable the option **TearFree** in the driver configuration file located at | ||
| + | ''/ | ||
| + | |||
| + | * 20-amdgpu.conf (GCN 3, GCN 4, GCN 5, RDNA & RDNA 2) or download an already fixed [[https:// | ||
| + | < | ||
| + | Section " | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | EndSection | ||
| + | </ | ||
| + | |||
| + | * 20-radeon.conf (TeraScale and older, GCN 1 & GCN 2) or download an already fixed [[https:// | ||
| + | < | ||
| + | Section " | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | EndSection | ||
| + | </ | ||
| + | |||
| + | Don't forget to '' | ||
| + | |||
| + | **Games freeze or EmulationStation freeze.** | ||
| + | |||
| + | **This has been fixed by a new interlaced resolution patch by Calamity in v34 (beta) and newer versions** | ||
| + | |||
| + | This has been reported by some users and myself included. | ||
| + | It's not know yet what is the underlying reason. It could be a driver or kernel issue. | ||
| + | |||
| + | We need to add **Option " | ||
| + | ''/ | ||
| + | |||
| + | * 20-amdgpu.conf (GCN 3, GCN 4, GCN 5, RDNA & RDNA 2) or download an already fixed [[https:// | ||
| + | |||
| + | < | ||
| + | Section " | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | EndSection | ||
| + | </ | ||
| + | |||
| + | * 20-radeon.conf (TeraScale and older, GCN 1 & GCN 2) or download an already fixed [[https:// | ||
| + | |||
| + | < | ||
| + | Section " | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | EndSection | ||
| + | </ | ||
| + | |||
| + | Don't forget to '' | ||
| + | |||
| + | * Short explanation of expression mentioned here | ||
| + | |||
| + | //TearFree is a tearing prevention option which prevents tearing by using the hardware page flipping mechanism// | ||
| + | |||
| + | // | ||
| + | |||
| + | // | ||
| + | |||
| + | ===== Configure Libretro cores for use with Switchres ===== | ||
| + | |||
| + | ==== Optimizing RA for low resolution output ==== | ||
| + | |||
| + | RetroArch' | ||
| + | |||
| + | {{ hardware: | ||
| + | |||
| + | The following settings will do two things mainly: use the older RGUI menu system which was designed for smaller screens and disable post-display enhancements (not needed or applicable for CRT). Open ''/ | ||
| + | |||
| + | Add this | ||
| + | < | ||
| + | ## CRT CONFIG | ||
| + | global.retroarch.menu_driver=rgui | ||
| + | global.retroarch.menu_show_advanced_settings=true | ||
| + | global.retroarch.menu_enable_widgets=false | ||
| + | global.smooth=0 | ||
| + | </ | ||
| + | |||
| + | If you want a more authentic experience by disabling save states, shaders and bezels you can also add the following (these can also be toggled in **GAMES SETTINGS**): | ||
| + | |||
| + | < | ||
| + | global.rewind=0 | ||
| + | global.autosave=0 | ||
| + | global.shaderset=none | ||
| + | global.bezel=none | ||
| + | </ | ||
| + | |||
| + | <WRAP center round tip 60%> | ||
| + | It is highly recommended to disable bezels if you're only intending on playing 4:3 systems. | ||
| + | </ | ||
| + | |||
| + | ==== Libretro core and directory overrides for use with CRT Switchres ==== | ||
| + | |||
| + | You can define custom resolutions for consoles by using RetroArch' | ||
| + | |||
| + | For Switchres-specific configuration, | ||
| + | |||
| + | < | ||
| + | cp / | ||
| + | </ | ||
| + | |||
| + | with of course replacing '' | ||
| + | |||
| + | Then open the file and scroll down to: | ||
| + | |||
| + | < | ||
| + | # Forces an user mode, in the format: width x height @ refresh. Here, 0 can used as a wildcard. At least one of the three values | ||
| + | # must be defined. E.g. user_mode 0x240 -> SR can freely choose any width based on the game's requested video mode, but will | ||
| + | # force height as 240. | ||
| + | user_mode | ||
| + | </ | ||
| + | |||
| + | Here you can change '' | ||
| + | |||
| + | < | ||
| + | user_mode | ||
| + | </ | ||
| + | |||
| + | This will then force RetroArch to output at a 576i resolution for that core. Switchres will still calculate an appropriate super resolution, it will just treat your user defined resolution as if though //that// were the console' | ||
| + | |||
| + | You can usually discover what resolution a console used by searching for it on Wikipedia. You can also give [[https:// | ||
| + | |||
| + | ==== Forcing integer scaling while Switchres is enabled ==== | ||
| + | |||
| + | Switchres is good at all for automatically sorting out our super resolutions, | ||
| + | |||
| + | Some consoles, such as portables like the Game Boy Advance, don't display their content at 480i. You might instead want to switch your CRT into progressive scan mode (by lowering the resolution to half of 480) and display the raw resolution with a correct aspect ratio. | ||
| + | |||
| + | This will require a combination of Switchres and RetroArch core overrides. | ||
| + | |||
| + | First create the ''/ | ||
| + | |||
| + | < | ||
| + | user_mode | ||
| + | </ | ||
| + | |||
| + | The next step can be done via the RetroArch' | ||
| + | |||
| + | The open that file and enter the following information: | ||
| + | |||
| + | <code - core-name-here.cfg> | ||
| + | aspect_ratio_index = "#" | ||
| + | custom_viewport_height = "#" | ||
| + | custom_viewport_width = "#" | ||
| + | video_scale_integer = " | ||
| + | </ | ||
| + | |||
| + | where the custom viewport' | ||
| + | |||
| + | <code - mGBA.cfg> | ||
| + | aspect_ratio_index = " | ||
| + | custom_viewport_height = " | ||
| + | custom_viewport_width = " | ||
| + | video_scale_integer = " | ||
| + | </ | ||
| + | |||
| + | The result of doing this is the Game Boy Advance screen being integer scaled in the center of our CRT screen with pixel perfect accuracy: | ||
| + | |||
| + | {{hardware: | ||
| + | |||
| + | More information on how use core and directory overrides can be found at [[https:// | ||
| + | |||
| + | ==== Global Libretro Switchres configuration ==== | ||
| + | |||
| + | <WRAP center round important 60%> | ||
| + | Be sure you have configured your [[# | ||
| + | </ | ||
| + | |||
| + | Configure Libretro CRT Switchres in RetroArch | ||
| + | |||
| + | Choose any libretro core and game inside Batocera using your gamepad or keyboard. | ||
| + | |||
| + | Example: Core: Atari 2600 Game: H.E.R.O. | ||
| + | |||
| + | Access the menu and configure (in this order): | ||
| + | |||
| + | Main Menu -- Video -- CRT SwitchRes -- Use High Resolution Menu (Optional) | ||
| + | Main Menu -- Video -- CRT SwitchRes -- CRT Super Resolution (Native) | ||
| + | Main Menu -- Video -- CRT SwitchRes -- CRT SwitchRes [INI] | ||
| + | | ||
| + | It should change to 240p/480i | ||
| + | | ||
| + | Main Menu -- Settings -- Configuration -- Save Configuration on Quit [ON] | ||
| + | Finally, save the configuration by exiting back to Emulationstation. | ||
| + | |||
| + | ==== Per core overrides | ||
| + | |||
| + | In case a particular core/ | ||
| + | |||
| + | Example: Core: Atari 2600 Game: H.E.R.O. | ||
| + | |||
| + | Access the menu and configure (in this order): | ||
| + | |||
| + | Main Menu -- Settings -- Configuration -- Save Configuration on Quit [OFF] | ||
| + | Main Menu -- Settings -- Configuration -- Use Global Core Option Files [OFF] | ||
| + | Main Menu -- Video -- CRT SwitchRes -- Use High Resolution Menu (Optional) | ||
| + | Main Menu -- Video -- CRT SwitchRes -- CRT Super Resolution (Native) | ||
| + | Main Menu -- Video -- CRT SwitchRes -- CRT SwitchRes [INI] | ||
| + | | ||
| + | It should change to 240p/480i | ||
| + | |||
| + | Finally, save the configuration for this core: | ||
| + | Quick Menu -- Overrides -- Save Core overrides | ||
| + | |||
| + | This can be done with any content run in a Libretro core. | ||
| + | |||
| + | ==== Troubleshooting ==== | ||
| + | |||
| + | Should anything go wrong during the configuration you can always delete your Core setting for a specific core in the directory | ||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | You can also complete remove the directory and start again (Only remove the '' | ||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | Same goes for (Only remove the '' | ||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | Or reset/ | ||
| + | < | ||
| + | batocera-es-swissknife --reset-ra | ||
| + | </ | ||
| + | |||
| + | ===== Creating you own Boot Resolution with Switchres ===== | ||
| + | |||
| + | Let's say you have a PC CRT monitor and like to add the boot resolution 1024x768@60hz. | ||
| + | This can be done by using a custom **Extended Display Identification Data (EDID)**. | ||
| + | |||
| + | This will use the Monitor preset '' | ||
| + | < | ||
| + | switchres 1024 768 60 -m pc_31_120 -e | ||
| + | </ | ||
| + | |||
| + | The file will be named '' | ||
| + | |||
| + | * Create the folder '' | ||
| + | |||
| + | * Move the file '' | ||
| + | |||
| + | |||
| + | - Search for the '' | ||
| + | * If legacy, the file will be at ''/ | ||
| + | * If UEFI, the file will be at ''/ | ||
| + | - Replace the boot resolution with your edid file '' | ||
| + | * In our exemple : < | ||
| + | |||
| + | |||
| + | ===== Configure GroovyMame for CRT display ===== | ||
| + | |||
| + | By default, GroovyMame' | ||
| + | |||
| + | {{hardware: | ||
| + | |||
| + | Some settings need to be adjusted from their defaults to fix this. First we need to generate the default configuration files and move them to the userdata partition: | ||
| + | - Go to the MAME folder using the command '' | ||
| + | - Generate the ini files needed by running the MAME script with the following command: '' | ||
| + | * This will create the following files < | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | - Create a new folder in ''/ | ||
| + | - Move the files '' | ||
| + | |||
| + | Now let's configure those files. | ||
| + | |||
| + | === mame.ini === | ||
| + | - Open ''/ | ||
| + | - Under ''# | ||
| + | fontpath | ||
| + | </ | ||
| + | fontpath | ||
| + | </ | ||
| + | We only care about one though. | ||
| + | </ | ||
| + | - Under ''# | ||
| + | uifont | ||
| + | </ | ||
| + | uifont | ||
| + | </ | ||
| + | - Under ''# | ||
| + | modesetting | ||
| + | </ | ||
| + | modesetting | ||
| + | </ | ||
| + | - Save and close the file. '' | ||
| + | |||
| + | === ui.ini === | ||
| + | - Open ''/ | ||
| + | - Under ''# | ||
| + | infos_text_size | ||
| + | </ | ||
| + | infos_text_size | ||
| + | - Also in ''# | ||
| + | font_rows | ||
| + | font_rows | ||
| + | - (Optional) Change the following line< | ||
| + | skip_warnings | ||
| + | </ | ||
| + | skip_warnings | ||
| + | </ | ||
| + | |||
| + | <WRAP center round download 60%> | ||
| + | If you'd like to double-check your file against one that's already set up (but possibly for an older version of MAME), you can check it out on this [[https:// | ||
| + | </ | ||
| + | |||
| + | |||
| + | Now when we launch GroovyMame and go into its menus, it's a lot clearer on our CRT. | ||
| + | |||
| + | {{hardware: | ||
| + | |||
| + | Let's choose GroovyMame as the default emulator for all MAME ROMs in Batocera and set a few other things too: | ||
| + | |||
| + | In EmulationStation, | ||
| + | * **EMULATOR**: | ||
| + | * **VIDEO MODE**: AUTO | ||
| + | * **DECORATION**: | ||
| + | * **GRAPHICS BACKEND**: AUTO | ||
| + | * **BGFX BACKEND**: AUTO | ||
| + | * **BGFX VIDEO FILTER**: AUTO | ||
| + | * **CRT SWITCHRES**: | ||
| + | * **TATE MODE**: AUTO (Change if intending to rotate your CRT display to play vertical TATE MODE games) | ||
| + | |||
| + | ===== Advanced Miscellaneous Emulator Configuration | ||
| + | |||
| + | ==== Dolphin - scale image to window size - ==== | ||
| + | |||
| + | By default dolphins aspect ratio for 4:3 is set to '' | ||
| + | |||
| + | In Batocera **v32** and lower, we need to edit the file '' | ||
| + | |||
| + | Navigate to | ||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | Edit | ||
| + | < | ||
| + | dolphinGenerator.py | ||
| + | </ | ||
| + | Find the line | ||
| + | |||
| + | < | ||
| + | # Ratio | ||
| + | def getGfxRatioFromConfig(config, | ||
| + | # 2: 4:3 ; 1: 16:9 ; 0: auto | ||
| + | if " | ||
| + | if config[" | ||
| + | return 2 | ||
| + | if config[" | ||
| + | return 1 | ||
| + | return 0 | ||
| + | </ | ||
| + | |||
| + | Change to | ||
| + | < | ||
| + | # Ratio | ||
| + | def getGfxRatioFromConfig(config, | ||
| + | # 3: 4:3 ; 1: 16:9 ; 0: auto | ||
| + | if " | ||
| + | if config[" | ||
| + | return 3 | ||
| + | if config[" | ||
| + | return 1 | ||
| + | return 0 | ||
| + | </ | ||
| + | |||
| + | Finish with | ||
| + | |||
| + | batocera-save-overlay | ||
| + | | ||
| + | Set Core Aspect ratio to 4:3. | ||
| + | |||
| + | ==== Dolphin - Turn off onscreen notifications - ==== | ||
| + | |||
| + | From | ||
| + | < | ||
| + | # PanicHandlers displaymessages | ||
| + | dolphinSettings.set(" | ||
| + | dolphinSettings.set(" | ||
| + | </ | ||
| + | To | ||
| + | < | ||
| + | # PanicHandlers displaymessages | ||
| + | dolphinSettings.set(" | ||
| + | dolphinSettings.set(" | ||
| + | </ | ||
| + | |||
| + | Finish with | ||
| + | |||
| + | batocera-save-overlay | ||
| + | |||
| + | ==== Libretro, turn off force notification messages ==== | ||
| + | |||
| + | <WRAP center round info 60%> | ||
| + | This behavior has since been fixed, but this section will remain here for people still having issues with this. | ||
| + | </ | ||
| + | |||
| + | Batocera' | ||
| + | |||
| + | Navigate to the directory | ||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | Edit the file '' | ||
| + | |||
| + | Find the line | ||
| + | |||
| + | < | ||
| + | retroarchConfig[' | ||
| + | </ | ||
| + | |||
| + | Change to | ||
| + | |||
| + | < | ||
| + | retroarchConfig[' | ||
| + | </ | ||
| + | |||
| + | Finish with | ||
| + | |||
| + | batocera-save-overlay | ||