Figure 1: The location of the dpi_timings line in the config.txt file.
One issue that can crop up with the PiBoy, although it isn’t common, are display artifacts. This is more likely when using a Pi 3 or Pi Zero. To correct these you can tweak the Pi’s dpi display timings to resolve the issue. You can find these settings in the config.txt file in the /boot partition on the Pi’s SD card.
Figure 2: An example of timings that are incorrect. The horizontal lines on the display show the problem. The Moire pattern on the screen is an artifact of the photo.
1. Remove the SD card from the PiBoy and insert it in to the card reader of a computer. Open the sd card in the file explorer and open the file “config.txt” in a text editor.
2. In the config.txt file find the line: dpi_timings=
3. Following the dpi_timings= text is a string of numbers, each one being separated by a space.
4. Below is a table of what each value is, in order. You will only need to tweak a handful of these values. You can also use this webpage as a reference.
h_active_pixels = horizontal pixels (width)
h_sync_polarity = invert hsync polarity
h_front_porch = horizontal forward padding from DE active edge
h_sync_pulse = hsync pulse width in pixel clocks
h_back_porch = vertical back padding from DE active edge
v_active_lines = vertical pixels height (lines)
v_sync_polarity = invert vsync polarity
v_front_porch = vertical forward padding from DE active edge
v_sync_pulse = vsync pulse width in pixel clocks
v_back_porch = vertical back padding from DE active edge
v_sync_offset_a = leave at zero
v_sync_offset_b = leave at zero
pixel_rep = leave at zero
frame_rate = screen refresh rate in Hz
interlaced = leave at zero
pixel_freq = clock frequency (width*height*framerate)
aspect_ratio = *
5. The values above in bold are the only ones you will want to change in trying to correct display artifacts. These are the relevant values to change: h_front_porch, h_sync_pulse, h_back_porch, v_front_porch, v_sync_pulse, v_back_porch, pixel_freq.
6. Before you change any values make note of what the original settings were so you can change back to them if you need to. These are the sane default values we use with the PiBoy: 640 1 56 4 42 480 1 16 4 12 0 0 0 60 0 22800000 1
7. The minimum values for the triplet of horizontal value are: 56 4 and 42. The minimum values for the triplet of vertical values are: 16 4 and 12.
8. We recommend raising the values of the horizontal and vertical triplets in an attempt to correct display artifacts. After changing these values you’ll need to calculate the new pixel_frequency and enter it.
9. The calculation for pixel_frequency is: (h_active_pixels + h_front_porch + h_sync_pulse + h_back_porch) * (v_active_lines + v_front_porch + v_sync_pulse + v_back_porch) * frame_rate. You can round the value up to the nearest thousandth.
10. Once you changes the values in the text file, save your changes, safely eject the SD card, put the SD card back in the PiBoy and start the PiBoy. If your changes do not fix the problem try the process over again with different values.
Article last updated on: 16 Mar 2021