7

I connected Soundbar system to HDMI port (1), and I connected my monitor to Display Port (2). On windows I can mirror two outputs 3840x1600 and thanks to that have normal display on a monitor via display port and 5.1 audio on a sounbar (ignoring video). Ubuntu does not allow to mirror outputs at such high resolutions, and forces me to use side by side displays. But Yamaha soundbar is always detected as a first display, and my monitor is always detected as a 2nd display. I'm changing display settings to make 2nd monitor as a primary monitor, but it only works after login. While login the HDMI display is always treated as primary, and invisible because it is sound device :). How to force HDMI port to be always 2nd / 2ndary display? Or how to mirror 3840x1600 outputs in Ubuntu (Windows allows for it, both cables Display Port and HDMI port are capable of 8K output).

2 Answers2

13

For at least Ubuntu 22.04:

  1. Log in and set the monitor layout
  2. Check inside the configuration file ~/.config/monitors.xml if the tag <primary>yes</primary> is set in the right monitor.
  3. Copy the configuration file from your user to gdm3 folder: sudo cp ~/.config/monitors.xml /var/lib/gdm3/.config/
  4. Correct the owner of monitors.xml file: sudo chown gdm:gdm /var/lib/gdm3/.config/monitors.xml
  5. Reboot

gdm3 config folder is here -> /var/lib/gdm3/.config.

user .config folder is here-> /home/user/.config.

This worked for me.

2

After you've set your monitors, copy the configuration file ~/.config/monitors.xml into the folder of your display manager.

For gnome display manager, it would be: /etc/gdm3/

For lightdm, it would be: /etc/ldm/

This should allow you to set your main monitor to display the login part, not the background.