Skip to content

Instantly share code, notes, and snippets.

@aacero
Last active August 24, 2022 05:45
Show Gist options
  • Save aacero/7a5f54a44a6e87838b040f3df70c19b1 to your computer and use it in GitHub Desktop.
Save aacero/7a5f54a44a6e87838b040f3df70c19b1 to your computer and use it in GitHub Desktop.
How I got 4K video resolution working with an older Intel graphics chipset (Ubuntu 20.04, Samsung U32R59x)
#!/bin/bash
# cvt 2560 1440 30
# xrandr --newmode "2560x1440_30.00" 146.25 2560 2680 2944 3328 1440 1443 1448 1468 -hsync +vsync
# xrandr --addmode HDMI-1 2560x1440_30.00
# xrandr --output HDMI-1 --mode 2560x1440_30.00
# This one is easier on the eyes than 3840x2160 @24Hz:
# cvt -r 2560 1440 60
# 2560x1440 59.95 Hz (CVT 3.69M9-R) hsync: 88.79 kHz; pclk: 241.50 MHz
xrandr --newmode "2560x1440R" 241.50 2560 2608 2640 2720 1440 1443 1448 1481 +hsync -vsync
xrandr --addmode HDMI-1 2560x1440R
xrandr --output HDMI-1 --mode 2560x1440R
# cvt -r 3840 2160 60
# 3840x2160 59.97 Hz (CVT 8.29M9-R) hsync: 133.25 kHz; pclk: 533.00 MHz
# xrandr --newmode "3840x2160R" 533.00 3840 3888 3920 4000 2160 2163 2168 2222 +hsync -vsync
# xrandr --addmode HDMI-1 3840x2160R
# xrandr --output HDMI-1 --mode 3840x2160R
# Doesn't work for me: xrandr: Configure crtc 0 failed
# cvt 3840 2160 60
# 3840x2160 59.98 Hz (CVT 8.29M9) hsync: 134.18 kHz; pclk: 712.75 MHz
# xrandr --newmode "3840x2160_60.00" 712.75 3840 4160 4576 5312 2160 2163 2168 2237 -hsync +vsync
# xrandr --addmode HDMI-1 3840x2160_60.00
# xrandr --output HDMI-1 --mode 3840x2160_60.00
# Doesn't work for me: xrandr: Configure crtc 0 failed
# cvt 3840 2160 30
# 3840x2160 29.98 Hz (CVT) hsync: 65.96 kHz; pclk: 338.75 MHz
# xrandr --newmode "3840x2160_30.00" 338.75 3840 4080 4488 5136 2160 2163 2168 2200 -hsync +vsync
# xrandr --addmode HDMI-1 3840x2160_30.00
# xrandr --output HDMI-1 --mode 3840x2160_30.00
# Doesn't work for me: xrandr: Configure crtc 0 failed
#cvt 3840 2160 24
# 3840x2160 23.99 Hz (CVT) hsync: 52.59 kHz; pclk: 266.75 MHz
xrandr --newmode "3840x2160_24.00" 266.75 3840 4056 4456 5072 2160 2163 2168 2192 -hsync +vsync
xrandr --addmode HDMI-1 3840x2160_24.00
xrandr --output HDMI-1 --mode 3840x2160_24.00
# After determing that 3840x2160 worked at 24Hz, I created this file as
# /usr/share/X11/xorg.conf.d/10-monitor.conf
# in order to have the settings survive reboots.
Section "Monitor"
Identifier "HDMI-1"
Modeline "2560x1440R" 241.50 2560 2608 2640 2720 1440 1443 1448 1481 +hsync -vsync
Modeline "3840x2160_24.00" 266.75 3840 4056 4456 5072 2160 2163 2168 2192 -hsync +vsync
Option "PreferredMode" "3840x2160_24.00"
# Option "PreferredMode" "2560x1440R"
EndSection
@maxatka
Copy link

maxatka commented Jun 13, 2020

Thanks a lot! It helped me.
This mode is a little bit better:
Modeline "3840x2160U" 297.0 3840 4016 4104 4400 2160 2168 2178 2250 +hsync +vsync

@zach-at-healthpilot
Copy link

where does one put/execute these files to test this out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment