Fix resolution (avoid 4K) <SOLVED>

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
NeroR
Level 2
Level 2
Posts: 68
Joined: Fri Oct 26, 2018 4:32 pm

Fix resolution (avoid 4K) <SOLVED>

Post by NeroR »

My PC, with Intel UHD 605 (Pentium Silver, J5005), is connected by HDMI to an AVR, connected to a UHD-TV.
Due to limitations of my AVR at 4K (3840 × 2160) and because of other reasons I'd like to use it only at Full HD resolution (1920 × 1080).

I'm running Linux Mint 19 Xfce and I've set the display settings to 1920 × 1080. Most of the time it's running OK at Full HD but sometimes it was at UHD.
I'm running Kodi on auto-start and I also have auto-login active.
To fix the resolution for my user-session permanently I've set the resolution of 1920 × 1080 in my .xprofile.

Code: Select all

$ cat ~/.xprofile
xrandr --output HDMI-1 --mode 1920x1080
This is working fine for me at my Xfce session and Full HD resolution is always active at my desktop.

The problem is when I exit the Xfce session (logout). Then the resolution goes up to 3840 × 2160.

I want to restrict the resolution to 1920x1080 always and anytime. How can I do this?

Code: Select all

$ inxi -Fx
System:    Host: rome Kernel: 4.15.0-38-generic x86_64 bits: 64 gcc: 7.3.0 Console: tty 0
           Distro: Linux Mint 19 Tara
Machine:   Device: desktop Mobo: ASRock model: J5005-ITX serial: N/A UEFI: American Megatrends v: P1.40 date: 08/06/2018
Battery    hidpp__0: charge: N/A condition: NA/NA Wh
           model: Logitech Wireless Touch Keyboard K400 Plus status: N/A
CPU:       Quad core Intel Pentium Silver J5005 (-MCP-) arch: N/A cache: 4096 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 11980
           clock speeds: max: 2800 MHz 1: 1380 MHz 2: 1201 MHz 3: 1476 MHz 4: 1030 MHz
Graphics:  Card: Intel Device 3184 bus-ID: 00:02.0
           Display Server: N/A drivers: modesetting (unloaded: fbdev,vesa)
           tty size: 237x63 Advanced Data: N/A out of X
Audio:     Card-1 Intel Device 3198 driver: snd_hda_intel bus-ID: 00:0e.0 Sound: ALSA v: k4.15.0-38-generic
           Card-2 Microdia driver: USB Audio usb-ID: 001-003
Network:   Card-1: Intel Wireless-AC 9260 driver: iwlwifi bus-ID: 02:00.0
           IF: wlp2s0 state: up mac: 30:24:32:ca:0f:d5
           Card-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
           driver: r8169 v: 2.3LK-NAPI port: e000 bus-ID: 03:00.0
           IF: enp3s0 state: up speed: 1000 Mbps duplex: full mac: 70:85:c2:7e:06:b7
Drives:    HDD Total Size: 250.1GB (7.9% used)
           ID-1: /dev/sda model: CT250MX500SSD1 size: 250.1GB
Partition: ID-1: / size: 30G used: 7.3G (26%) fs: ext4 dev: /dev/sda7
           ID-2: /home size: 30G used: 3.5G (13%) fs: ext4 dev: /dev/sda8
           ID-3: swap-1 size: 8.59GB used: 0.00GB (0%) fs: swap dev: /dev/sda9
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 47.0C mobo: N/A
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 190 Uptime: 1:11 Memory: 635.6/7626.0MB Init: systemd runlevel: 5 Gcc sys: 7.3.0
           Client: Shell (bash 4.4.191) inxi: 2.3.56
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Fix resolution (avoid 4K)

Post by roblm »

Are you saying that the resolution changes to 3840x2160 in the logout screen and persists when you return to the desktop?
User avatar
NeroR
Level 2
Level 2
Posts: 68
Joined: Fri Oct 26, 2018 4:32 pm

Re: Fix resolution (avoid 4K)

Post by NeroR »

Well, it changes to 3840 × 2160 after I logged out so the high resolution is on the "Login screen".
The resolution will change to 1920x1080 back if I log in again (automatically or because of the xrandr in my ~/.xprofile).

So I only have to high resolution now on the login screen.
Normally I don't see the login screen because of auto-login. Because I also use remote desktop (xrdp) I have to log out therefore. If I want lo login again locally I have to do this at the 4k resolution. Since it's on my TV and it's a few meters away everything is quite small, too small.

It might be good to have a FullHD resolution in general so it will work for every user, I don't have to modify ~/.xprofile for each user. The switch of the resolution will be avoided which causes "no signal" on my AVR/TV for seconds.

So I'm looking for the easiest/best way to fix the resolution permanently, for all users and also for the login screen (including a splash screen).
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Fix resolution (avoid 4K)

Post by roblm »

I don’t know of a way to have one command in one configuration file that affects both the desktop and login screen resolution.

To change the login screen resolution, you could try the method user AndyMH used in his last post on page 1 of this topic: viewtopic.php?f=46&t=280143

It didn’t work for me until I made a change. Create a new document in Home named .login (the dot makes it hidden) and add the command: xrandr --output HDMI-1 --mode 1920x1080

Make the file executable. Use this command to open the lightdm.conf file:
xed admin:///etc/lightdm/lightdm.conf

Add this line at the bottom: display-setup-script=/home/your-user-name/.login

Change your-user-name to your actual user name.

Use this command to make the file executable: sudo chmod +x /etc/lightdm/lightdm.conf

Reboot.
User avatar
NeroR
Level 2
Level 2
Posts: 68
Joined: Fri Oct 26, 2018 4:32 pm

Re: Fix resolution (avoid 4K)

Post by NeroR »

roblm wrote: Sun Oct 28, 2018 3:36 pm It didn’t work for me until I made a change. Create a new document in Home named .login (the dot makes it hidden)
~/.login is maybe not the best name (and location) because this is the name of a start script for KornShell and C-Shell (Login-Shell).
User avatar
NeroR
Level 2
Level 2
Posts: 68
Joined: Fri Oct 26, 2018 4:32 pm

Re: Fix resolution (avoid 4K) <SOLVED>

Post by NeroR »

Thx, this helped me!

I did it with a new config-file in /etc/lightdm/lightdm.conf.d/ where I call my shell-script set-resolution.sh.

Code: Select all

$ cat /etc/lightdm/lightdm.conf.d/90-my.conf
[Seat:*]
display-setup-script=/etc/lightdm/set-resolution.sh

Code: Select all

$ cat /etc/lightdm/set-resolution.sh
#!/bin/bash

xrandr --output HDMI-1 --mode 1920x1080

Of course, because it's a shell-script, it must be executable (for root).

Code: Select all

$ ls -l /etc/lightdm/set-resolution.sh
-rwxr--r-- 1 root root 54 Oct 29 22:41 /etc/lightdm/set-resolution.sh*
I've placed the shell-script to a system-wide location and not to a user-based location because it's not user-related.

It works fine for me!
Because this setting affects the running X server itself, all sessions should run with the new resolution, i.e. the greater session and also the user session(s), mostly the desktop. Therefore my originally setting in my ~/.xprofile shouldn't be needed any more and I've removed it.


In a config file (e.g. /etc/lightdm/lightdm.conf) it should be in a section [Seat:*].
Note: [SeatDefaults] is deprecated and [Seat:*] should be used instead (see posting p1546019).


P.S.: This solution (dynamically changing the X server resolution by the Display Manager settings) is surely only one possible solution. Another solution might be to change/define the resolution statically in xorg.conf, but this is (a little bit) more complicated. The dynamically approach has the advantage that the resolution could be changed easily, also in a running desktop session, with xrandr.
User avatar
NeroR
Level 2
Level 2
Posts: 68
Joined: Fri Oct 26, 2018 4:32 pm

Re: Fix resolution (avoid 4K) <SOLVED>

Post by NeroR »

Now I've updated to Linux Mint 19.1 (some days ago).

Today I saw 4K resolution again! My config-file /etc/lightdm/lightdm.conf.d/90-my.conf and my shell-script /etc/lightdm/set-resolution.sh still exists and are unchanged.
My PC was running headless (TV switched off) since yesterday. Today, I've noticed the fan and I switched on the TV and there I saw a 4K resolution. I had high CPU usage on idle (> 10 %) but I didn't had time to examine the problem. In my understanding I should never get a 4K resolution with my configuration.
I will observe this the next days.
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Fix resolution (avoid 4K) <SOLVED>

Post by roblm »

Are you still using Xfce? Did you make any changes using the Display program?

With the method you are using, I’ve found that for Mint Cinnamon, it only affects the login screen resolution.

With Xfce & MATE, it affects both the login screen and desktop resolution. If it doesn’t work, then delete the displays.xml file (For MATE, the monitors.xml file).

For Xfce, use this command: rm ~/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml

For MATE, use this command: rm ~/.config/monitors.xml
User avatar
NeroR
Level 2
Level 2
Posts: 68
Joined: Fri Oct 26, 2018 4:32 pm

Re: Fix resolution (avoid 4K) <SOLVED>

Post by NeroR »

I still use Xfce and I didn't change anything, even not the display settings.

The next time it was okay and it run with FullHD (1920x1080), like it should be.

My displays.xml seems to be okay and so I will not delete it now. [Currently it run headless.]

Code: Select all

$ cat ~/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
<?xml version="1.0" encoding="UTF-8"?>

<channel name="displays" version="1.0">
  <property name="Default" type="empty">
    <property name="HDMI-1" type="string" value="1. DENON, Ltd. 40&quot;">
      <property name="Active" type="bool" value="true"/>
      <property name="Resolution" type="string" value="1920x1080"/>
      <property name="RefreshRate" type="double" value="60.000000"/>
      <property name="Rotation" type="int" value="0"/>
      <property name="Reflection" type="string" value="0"/>
      <property name="Primary" type="bool" value="true"/>
      <property name="Position" type="empty">
        <property name="X" type="int" value="0"/>
        <property name="Y" type="int" value="0"/>
      </property>
    </property>
  </property>
  <property name="Notify" type="bool" value="false"/>
</channel>
At the moment everything seems to be fine. Let's hope it will be good also in the future.
User avatar
NeroR
Level 2
Level 2
Posts: 68
Joined: Fri Oct 26, 2018 4:32 pm

Re: Fix resolution (avoid 4K) <SOLVED>

Post by NeroR »

Yesterday it occurred again and resolution was set to UHD, and I don't know why.
However, in most cases it's okay and the resolution is (only) FullHD.

P.S.: At the moment I will not take further actions, even I wouldn't know what I should do. Furthermore I have another problem(s) with Linux Mint and I'm not sure how long I'll stay with it.
User avatar
NeroR
Level 2
Level 2
Posts: 68
Joined: Fri Oct 26, 2018 4:32 pm

Re: Fix resolution (avoid 4K) <SOLVED>

Post by NeroR »

It happened again several times (because of HDMI Control, power off of AVR and restart, etc.) but I found a different solution.
It's not a software solution in Linux Mint but a hardware solution. I found a way to limit the HDMI capability (resolution) of specific HDMI ports at my AVR. I've set the max. resolution to 1080p for the HDMI port where my HTPC is connected and hence there will be no 4K signal out of Linux. It's finally fine for me now!

P.S.: For my Denon AVR (AVR-X2400H) I found an official PDF in the web (search for "Denon HDMI Diagnostics and Troubleshooting"). There you can find diagnostic methods (test of video, audio, cable) and how to make limitations per HDMI port (resolution, HDCP, Deep Color, etc.). It's working also for other AVR's of Denon (see PDF, maybe also for other/newer models, not documented). Maybe such a limitation feature also exists for other AVR's of other manufactures.
Locked

Return to “Graphics Cards & Monitors”