Raspberry Pi 400 with 3440×1140 screen resolution

New Raspberry Pi 4 and 400 support HD which is switched off by default. Even turning it on will not show Ultra Wide HD resolution 3440×1140 on the list of available options, so how to add custom resolution? Simply edit a configuration file. The instruction works on recent versions of Raspberry Pi OS and Manjaro.

To do so, open file

sudo nano /boot/config.txt

You can leave all hash-tags and simply paste the code below on the end of file:

hdmi_enable_4kp60=1
gpu_mem=256
hdmi_aspect_21_9=7
hdmi_pixel_freq_limit=600000000
hdmi_group:0=2
hdmi_mode:0=87
hdmi_cvt=3440 1440 60 7 0 0 1
framebuffer_width=3440
framebuffer_height=1440
max_framebuffer_width=3440
max_framebuffer_height=1440

Ctrl+x, y and Enter will save the file.

Now restart you machine.

sudo reboot

This solution works on Raspberry Pi 400 (it shouldn't make any difference on RPi 4) with iiyama Red Eagle G-MASTER monitor.