Freeplay Zero/CM3 HDMI (Freeplay CM3/Zero 320×240 Models)

We have worked hard to create a plug-and-play solution for switching between on-the-go LCD gaming and convenience-of-home HDMI gaming.  To do this in a way that works out of the box for MOST people, some concessions had to be made. The basis of this configuration revolves around the fact that the graphics chip of the Raspberry Pi can output video to the HDMI framebuffer (even when HDMI is unplugged) and the LCD will become a (smaller) clone of the HDMI output.

In this document, we will discuss how the HDMI is set up on the Freeplay Zero/CM3 SD image. Then, with each setting, we will discuss how to change that behavior if you would like a different behavior (like another resolution, HDMI audio, etc.).

We will use the term “TV” to describe any HDMI display device, even though we realize that it could be a monitor, TV, goggles, etc.


Current Settings:

The video is set to 1024×768 at 60fps and HDMI autodetection is disabled.

During our testing, 1024×768 was found to be the 4:3 mode that the majority of TVs and monitors would accept.  This gives a broad range of interoperability by default while still maintaining an aspect ratio that looks good when cloned to the built-in LCD.

If you allow the Raspberry Pi (RPi) to autodetect the HDMI settings of the connected monitor/TV, it will do this once during each bootup. With autodetection enabled, if your Freeplay machine is already running and playing on-the-go and then you want to connect HDMI during gameplay, the RPi will likely have defaulted to a HDMI resolution that won’t work with your TV. We need it to be deterministic.

(found in /boot/config.txt)
HDMI_FORCE_MODE=1

The HDMI_FORCE_MODE setting will remove all other modes, except the ones specified by hdmi_mode and hdmi_group from the internal list of allowable video modes.  Essentially, this tells the system to ONLY use the modes we set.

(found in /boot/config.txt)
hdmi_group=2
hdmi_mode=16

These to lines (hdmi_group and hdmi_mode) tell the RPi to use mode 16 of group 2 which is 1024×768 at 60Hz.  You can set these to use other video modes that may look/work better for your TV, but we recommend using resolutions that have a 4:3 aspect ratio unless you want to change other (more complex) settings elsewhere. Just keep in mind that anything you set for the HDMI will affect the cloning process to the built-in LCD.

Some people that don’t care about HDMI output may want to set the HDMI to 320×240 (which is the LCD’s resolution) to help speed things up.

hdmi_force_hotplug=1
hdmi_cvt=320 240 60 1 0 0 0
hdmi_group=2 
hdmi_mode=1 
hdmi_mode=87 

See https://www.raspberrypi.org/documentation/configuration/config-txt/video.md for the other video modes, resolutions, and options.

The audio is set to only come out of the built-in speaker (not HDMI).  

Some HDMI monitors will not accept audio, and they won’t even display video if audio is included in the HDMI signal. We have chosen to keep audio on the built-in speaker by default no matter if HDMI is connected or not.

(found in /boot/config.txt)
hdmi_drive=1

The hdmi_drive setting tells the HDMI to use DVI mode (which does not include audio in the signal).  This is necessary for some monitors to work properly. Setting this to ‘2’ will work for most modern TVs and allow you to listen to sound on the TV instead of the built-in speaker. Once you set this to 2, you may notice that HDMI “steals” the audio if you boot up with HDMI connected.

See https://github.com/RetroPie/RetroPie-Setup/wiki/Sound-Issues for more info.

The HDMI is always set as the master video output.

Most normal Freeplay Zero/CM3 users should not care about this setting. If you remove or change this setting, the Raspberry Pi may default to composite video output. This setting tells the Raspberry Pi to act like a HDMI TV/Monitor is plugged in at bootup, so it will turn on the HDMI output. We recommend that you leave this one alone.

(found in /boot/config.txt)
hdmi_force_hotplug=1