Zend certified PHP/Magento developer

Set custom resolution without stretching on HDMI TV on Linux

I have been struggling without success to set a custom resolution on Linux on my laptop to my TV connected via HDMI. My use case is I have a huge 55 inch TV and would like to use it as an ultrawide monitor, with a custom resolution of 3840×1200 or if not possible, 3840×1080, so that I have the image centered with black bars on top and bottom of the screen.

I can get it to work on my desktop on Windows with an Nvidia GPU on the same TV, by setting the custom resolution and on Nvidia Control Panel -> Adjust desktop size and position -> Sacaling -> No scaling. I want to replicate that on my Linux laptop.

The laptop doesn’t have nvidia card, it has an AMD GPU, but I believe it uses intel GPU for HDMI display: the output of lspci -k | grep -A 3 -E "(VGA|3D)" is

00:02.0 VGA compatible controller: Intel Corporation WhiskeyLake-U GT2 [UHD Graphics 620] (rev 02)
        Subsystem: Lenovo Device 5073
        Kernel driver in use: i915
        Kernel modules: i915

If I try the below command on the laptop screen instead of the HDMI TV it works as I want:

xrandr --output eDP1 --mode 1600x900 --set "scaling mode" "Center"

In the example above, my laptop screen, which has native res of 1920×1080 gets the desired effect of filling only the center of the screen with black bars and not stretching out.

However, if I try to do the same with the HDMI TV, it gives me an error message, apparently the scaling mode option is not available with HDMI:

# add the custom res I want, this command runs fine
xrandr --newmode "3840x1200_30.00"  180.00  3840 3992 4376 4912  1200 1203 1213 1224 -hsync +vsync
xrandr --addmode HDMI1 3840x1200_30.00

# try to change to the new added res
xrandr --output HDMI1 --mode 3840x1200_30.00 --set "scaling mode" "Center"
X Error of failed request: BadName (named color or font does not exist)

If I set the command without the scaling mode, it works, but the image is stretched to fill the whole area of the TV.
I’ve also tried the following commands that i’ve seen in other answers, all of them without success:

xrandr --output HDMI1 --mode 3840x1200_30.00 --scale 1x1 --fb 3840x1200 --panning 3840x1200

xrandr --output HDMI1 --mode 3840x1200_30.00 --transform 1,0,0,0.5,0,0,1
xrandr --output HDMI1 --mode 3840x1200_30.00 --scale 1x0.5

The TV model by the way is an LG C1 Oled, and I’ve also tried setting its scaling in the TV menu to original, 16:9, 4:3, none of those working out either. (In windows it works correctly with the Original setting)

I am beginning to think what I want is simply not possible, maybe a limitation of the Intel driver?