WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Xorg and dual monitor  (Read 7840 times)

Offline core.dump

  • Jr. Member
  • **
  • Posts: 50
Xorg and dual monitor
« on: March 18, 2020, 12:17:02 PM »
Hello everybody,
I'm currently using TC on a dual monitor computer (CorePure64 + Xorg). After a fresh install, I found Xorg works perfectly and has dual monitor support activated by default (thru xrandr I suppose, since it has been installed as a dependency), and this is OK.

Now, my problem is: when I enter the graphical environment, the two monitors are inverted, i.e. the left part of the desktop is on the right monitor and vice versa: moving the mouse towards the very right side, the cursor "exits" the desktop and "re-enters" at the left side. This clearly means my primary monitor is the one on the right, while I need it to be the one on the left.

You can tell me the most immediate and logical solution would be "phisically swap the monitors, idiot..." Well, you're not wrong of course, and I'd like to solve the problem that way, but actually I can't, it's a matter of cables' length. Thus I have to find a way to swap the left and right parts of the desktop in Xorg, rather than phisically change the monitors' order.

By searching the forum, I found a possible solution here, but there are a couple of things I don't understand:

(1) That topic is about editing the xorg.conf file, but my system has no xorg.conf. Do I have to create one by myself? Where should I place it, and how I tell Xorg to use that file? My Xorg is working despite it hasn't a configuration file, how is it possible?

(2) AFAYK, does it exist a way to pass one or more directives to Xorg and/or Xrandr on the command line (I mean in .xsession) without creating a custom xorg.conf, so that the left and right desktop pairing is correctly set at boot time?

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11670
Re: Xorg and dual monitor
« Reply #1 on: March 18, 2020, 12:38:02 PM »
Hi core.dump
Click the  Exit  icon and select  Exit to Prompt. Then execute this:
Code: [Select]
sudo Xorg -configure
This will create an  xorg.conf  file in  /root. The name may be a little different (xorg.conf.new?). Copy the file to your  /home  directory:
Code: [Select]
sudo cp /root/xorg* /home/tc/
Now restart X:
Code: [Select]
startx
Now you can change permissions, edit, and copy it to /etc/X11/.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11048
Re: Xorg and dual monitor
« Reply #2 on: March 18, 2020, 01:36:22 PM »
As found in your link, you can change the monitor order with xrandr commands at runtime. If you find something like "xrandr --output DVI-0 --right-of VGA-0" is enough, you can then put that into a file in ~/.X.d to run it on each X startup.
The only barriers that can stop you are the ones you create yourself.

Offline core.dump

  • Jr. Member
  • **
  • Posts: 50
Re: Xorg and dual monitor
« Reply #3 on: March 18, 2020, 03:11:35 PM »
As found in your link, you can change the monitor order with xrandr commands at runtime. If you find something like "xrandr --output DVI-0 --right-of VGA-0" is enough, you can then put that into a file in ~/.X.d to run it on each X startup.

Well, I tried and it works actually, but this just fixes the mouse movement and doesn't affect wallpaper and other screen objects like Wbar.

Offline core.dump

  • Jr. Member
  • **
  • Posts: 50
Re: Xorg and dual monitor
« Reply #4 on: March 18, 2020, 04:15:15 PM »
OK, I created a fresh xorg.conf file and edited it as follows:

Code: [Select]
Section "ServerLayout"
Identifier     "X.org Configured"
Screen      0  "Screen0" 0 0
InputDevice    "Mouse0" "CorePointer"
InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
ModulePath   "/usr/local/lib/xorg/modules"
FontPath     "/usr/local/lib/X11/fonts/misc/"
FontPath     "/usr/local/lib/X11/fonts/TTF/"
FontPath     "/usr/local/lib/X11/fonts/OTF/"
FontPath     "/usr/local/lib/X11/fonts/Type1/"
FontPath     "/usr/local/lib/X11/fonts/100dpi/"
FontPath     "/usr/local/lib/X11/fonts/75dpi/"
EndSection

Section "Module"
Load  "glx"
EndSection

Section "InputDevice"
Identifier  "Keyboard0"
Driver      "kbd"
EndSection

Section "InputDevice"
Identifier  "Mouse0"
Driver      "mouse"
Option     "Protocol" "auto"
Option     "Device" "/dev/input/mice"
Option     "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
Identifier   "HDMI"
Option      "Primary" "true"
EndSection

Section "Monitor"
Identifier   "DVI"
Option      "Primary" "false"
Option      "RightOf" "HDMI"
EndSection

Section "Device"
Identifier  "Card0"
Driver      "nouveau"
BusID       "PCI:101:0:0"
        Option      "HDMI-0" "HDMI"
        Option      "DVI-0" "DVI"
EndSection

Section "Screen"
Identifier "Screen0"
Device     "Card0"
Monitor    "HDMI"
DefaultDepth 24
SubSection "Display"
Viewport   0 0
Depth     24
Modes   "1920x1080" "1680x1050"
EndSubSection
EndSection

Then I did a test as suggested by Xorg itself:

Code: [Select]
/home/tc/$ Xorg -config xorg.conf
Note, I tried to put xorg.conf in /etc/X11/ but I was returned an error stating it's not possible to call Xorg using abolute paths or something similar.
However, the test result was a blank screen (actually two blank screens), and the following error(s) in console:

Code: [Select]
X.Org X Server 1.20.6
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.19.10-tinycore64 x86_64
Current Operating System: Linux box 5.4.3-tinycore64 #2020 SMP Tue Dec 17 17:38:30 UTC 2019 x86_64
Kernel command line: BOOT_IMAGE=/tce/boot/vmlinuz64 quiet  waitusb=5 loglevel=3 home=sda1 tce=sda1 opt=sda1 kmaps=qwerty/it syslog waitusb=5:UUID="17e65e47-1cf4-4b7e-8b24-72597b4a3e7d" tce=UUID="17e65e47-1cf4-4b7e-8b24-72597b4a3e7d"  initrd=/tce/boot/corepure64.gz
Build Date: 10 December 2019  03:37:35PM
 
Current version of pixman: 0.38.4
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Wed Mar 18 20:55:04 2020
(==) Using system config directory "/usr/local/share/X11/xorg.conf.d"
MESA-LOADER: failed to open nouveau (search paths /usr/local/lib/dri)
failed to load driver: nouveau
MESA-LOADER: failed to open kms_swrast (search paths /usr/local/lib/dri)
failed to load driver: kms_swrast
MESA-LOADER: failed to open swrast (search paths /usr/local/lib/dri)
failed to load swrast driver
couldn't get display device
(II) modeset(0): Initializing kms color map for depth 24, 8 bpc.
(II) Server terminated successfully (0). Closing log file.

Probably I forgot something, or wrote something wrong... but what exactly?

P.S.: Please be patient, I'm not a system administrator...  :-\

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11670
Re: Xorg and dual monitor
« Reply #5 on: March 18, 2020, 04:43:36 PM »
Hi core.dump
Quote
Code: [Select]
MESA-LOADER: failed to open nouveau (search paths /usr/local/lib/dri)
That looks like  Xorg-7.7-3d.tcz  is missing.

Offline core.dump

  • Jr. Member
  • **
  • Posts: 50
Re: Xorg and dual monitor
« Reply #6 on: March 18, 2020, 05:37:16 PM »
Hi core.dump
Quote
Code: [Select]
MESA-LOADER: failed to open nouveau (search paths /usr/local/lib/dri)
That looks like  Xorg-7.7-3d.tcz  is missing.

Ummm ok, installed Xorg-7.7-3d.tcz, it was actually missing, BUUUT... the result is still a blank screen! :D
Here is the output of the Xorg test call:

Code: [Select]
X.Org X Server 1.20.6
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.19.10-tinycore64 x86_64
Current Operating System: Linux box 5.4.3-tinycore64 #2020 SMP Tue Dec 17 17:38:30 UTC 2019 x86_64
Kernel command line: BOOT_IMAGE=/tce/boot/vmlinuz64 quiet  waitusb=5 loglevel=3 home=sda1 tce=sda1 opt=sda1 kmaps=qwerty/it syslog waitusb=5:UUID="17e65e47-1cf4-4b7e-8b24-72597b4a3e7d" tce=UUID="17e65e47-1cf4-4b7e-8b24-72597b4a3e7d"  initrd=/tce/boot/corepure64.gz
Build Date: 10 December 2019  03:37:35PM
 
Current version of pixman: 0.38.4
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Wed Mar 18 22:16:18 2020
(==) Using system config directory "/usr/local/share/X11/xorg.conf.d"
(II) modeset(0): Initializing kms color map for depth 24, 8 bpc.
(II) Server terminated successfully (0). Closing log file.

It looks like there weren't errors. What did I forget?

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11670
Re: Xorg and dual monitor
« Reply #7 on: March 18, 2020, 09:16:27 PM »
Hi core.dump
First run a dependency to make sure nothing else is missing. You can do this using the  Apps  utility, or if you prefer, through the
command line like this:
Code: [Select]
tce-audit builddb
tce-audit updatedeps
tce-audit fetchmissing
tce-update
Now reboot.

When X comes up:
Code: [Select]
sudo mkdir /etc/X11
sudo cp xorg.conf /etc/X11

Click the  Exit  icon and select  Exit to Prompt. Then execute this:
Code: [Select]
startx
When X comes up, check  /var/log/Xorg.0.log  for errors or post it here.

If X is messed up, hit  Ctrl-Alt-F1  to get into the console. Then:
Code: [Select]
cp /var/log/Xorg.0.log /var/log/Xorg.0.log.bak
sudo rm /etc/X11/xorg.conf
sudo kill Xorg
startx
When X comes up, check  /var/log/Xorg.0.log.bak  for errors or post it here.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11048
Re: Xorg and dual monitor
« Reply #8 on: March 19, 2020, 03:42:35 AM »
If you only start Xorg, ie running Xorg -whatever instead of startx, a black screen is expected (that's the default background) - you didn't start any X apps. The -retro option will tell it to use the retro background instead, which is useful for such tests.
The only barriers that can stop you are the ones you create yourself.

Offline core.dump

  • Jr. Member
  • **
  • Posts: 50
Re: Xorg and dual monitor
« Reply #9 on: March 19, 2020, 06:25:46 AM »
If you only start Xorg, ie running Xorg -whatever instead of startx, a black screen is expected (that's the default background) - you didn't start any X apps. The -retro option will tell it to use the retro background instead, which is useful for such tests.

Yes this works, what I see is a black-white dotted weave with a x-shaped mouse cursor in the middle of the desktop. The problem is the monitors are still NOT swapped.


Hi core.dump
First run a dependency to make sure nothing else is missing.
[...snip...]
When X comes up, check  /var/log/Xorg.0.log.bak  for errors or post it here.

Hi Rich,
OK I exactly followed your instructions in that order (tce-audit, reboot and all), the result is "failed in waitforX", here is what I got (Xorg.0.log):
Code: [Select]
[   981.559]
X.Org X Server 1.20.6
X Protocol Version 11, Revision 0
[   981.559] Build Operating System: Linux 4.19.10-tinycore64 x86_64
[   981.559] Current Operating System: Linux box 5.4.3-tinycore64 #2020 SMP Tue Dec 17 17:38:30 UTC 2019 x86_64
[   981.559] Kernel command line: BOOT_IMAGE=/tce/boot/vmlinuz64 quiet  waitusb=5 loglevel=3 home=sda1 tce=sda1 opt=sda1 kmaps=qwerty/it syslog waitusb=5:UUID="17e65e47-1cf4-4b7e-8b24-72597b4a3e7d" tce=UUID="17e65e47-1cf4-4b7e-8b24-72597b4a3e7d"  initrd=/tce/boot/corepure64.gz
[   981.559] Build Date: 10 December 2019  03:37:35PM
[   981.559] 
[   981.559] Current version of pixman: 0.38.4
[   981.559] Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
[   981.559] Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[   981.559] (==) Log file: "/var/log/Xorg.0.log", Time: Thu Mar 19 10:35:51 2020
[   981.559] (==) Using config file: "/etc/X11/xorg.conf"
[   981.559] (==) Using system config directory "/usr/local/share/X11/xorg.conf.d"
[   981.559] (==) ServerLayout "X.org Configured"
[   981.559] (**) |-->Screen "Screen0" (0)
[   981.559] (**) |   |-->Monitor "HDMI"
[   981.560] (**) |   |-->Device "Card0"
[   981.560] (**) |-->Input Device "Mouse0"
[   981.560] (**) |-->Input Device "Keyboard0"
[   981.560] (==) Automatically adding devices
[   981.560] (==) Automatically enabling devices
[   981.560] (==) Automatically adding GPU devices
[   981.560] (==) Max clients allowed: 256, resource mask: 0x1fffff
[   981.560] (WW) The directory "/usr/local/lib/X11/fonts/OTF/" does not exist.
[   981.560] Entry deleted from font path.
[   981.560] (WW) The directory "/usr/local/lib/X11/fonts/100dpi/" does not exist.
[   981.560] Entry deleted from font path.
[   981.560] (WW) The directory "/usr/local/lib/X11/fonts/OTF/" does not exist.
[   981.560] Entry deleted from font path.
[   981.560] (WW) The directory "/usr/local/lib/X11/fonts/100dpi/" does not exist.
[   981.560] Entry deleted from font path.
[   981.560] (**) FontPath set to:
/usr/local/lib/X11/fonts/misc/,
/usr/local/lib/X11/fonts/TTF/,
/usr/local/lib/X11/fonts/Type1/,
/usr/local/lib/X11/fonts/75dpi/,
/usr/local/lib/X11/fonts/misc/,
/usr/local/lib/X11/fonts/TTF/,
/usr/local/lib/X11/fonts/Type1/,
/usr/local/lib/X11/fonts/75dpi/
[   981.560] (**) ModulePath set to "/usr/local/lib/xorg/modules"
[   981.560] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
[   981.560] (WW) Disabling Mouse0
[   981.560] (WW) Disabling Keyboard0
[   981.560] (II) Loader magic: 0x5b0be0
[   981.560] (II) Module ABI versions:
[   981.560] X.Org ANSI C Emulation: 0.4
[   981.560] X.Org Video Driver: 24.0
[   981.560] X.Org XInput driver : 24.1
[   981.560] X.Org Server Extension : 10.0
[   981.561] (II) xfree86: Adding drm device (/dev/dri/card0)
[   981.576] (--) PCI:*(101@0:0:0) 10de:1f82:1043:86b9 rev 161, Mem @ 0xd7000000/16777216, 0xc0000000/268435456, 0xd0000000/33554432, I/O @ 0x0000b000/128, BIOS @ 0x????????/131072
[   981.576] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
[   981.576] (II) "glx" will be loaded. This was enabled by default and also specified in the config file.
[   981.576] (II) LoadModule: "glx"
[   981.576] (II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so
[   981.578] (II) Module glx: vendor="X.Org Foundation"
[   981.578] compiled for 1.20.6, module version = 1.0.0
[   981.578] ABI class: X.Org Server Extension, version 10.0
[   981.578] (II) LoadModule: "nouveau"
[   981.578] (WW) Warning, couldn't open module nouveau
[   981.578] (EE) Failed to load module "nouveau" (module does not exist, 0)
[   981.578] (EE) No drivers available.
[   981.578] (EE)
Fatal server error:
[   981.578] (EE) no screens found(EE)
[   981.578] (EE)
Please consult the The X.Org Foundation support
at http://wiki.x.org
 for help.
[   981.578] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[   981.578] (EE)
[   981.578] (EE) Server terminated with error (1). Closing log file.

Please disregard the warnings (WW), I'll check them later. The error says "Failed to load module "nouveau" (module does not exist, 0)" but the strangest thing is: I installed nouveau-5.4.3-tinycore64.tcz (since that's the only way to make Xorg start correctly), but all works regularly (and no nouveau-related errors are raised) only if I don't tell Xorg to use the xorg.conf file.

I'm still not able to understand how can Xorg work without a configuration but with the correct driver, and not work work with a configuration because of the driver.

AFAIK there is no other suitable driver for my graphics card in the TC repo. I also tried installing the official Nvidia proprietary driver, without success (too many missing libs, too many wrong hardcoded paths, etc.).
Should I just remove the Driver "nouveau" statement from the Section "Device" in xorg.conf? Does it make sense?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14831
Re: Xorg and dual monitor
« Reply #10 on: March 19, 2020, 06:29:34 AM »
In recent versions of x, you can use "snippets" of the config file - i.e. only the part you wish to alter from the default behaviour (in your case, swap screens) - you could try that?

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11670
Re: Xorg and dual monitor
« Reply #11 on: March 19, 2020, 09:15:23 AM »
Hi core.dump
...  The error says "Failed to load module "nouveau" (module does not exist, 0)" but the strangest thing is: I installed nouveau-5.4.3-tinycore64.tcz (since that's the only way to make Xorg start correctly), but all works regularly (and no nouveau-related errors are raised) only if I don't tell Xorg to use the xorg.conf file. ...
Yes, but did you install  xf86-video-nouveau.tcz ?

Offline core.dump

  • Jr. Member
  • **
  • Posts: 50
Re: Xorg and dual monitor
« Reply #12 on: March 19, 2020, 09:18:44 AM »
Yes, but did you install  xf86-video-nouveau.tcz ?
Well no, I suppose xf86-video-nouveau.tcz is useless for me since it has no support for my GPU (supported by nouveau-5.4.3.-tinycore64.tcz instead).

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11670
Re: Xorg and dual monitor
« Reply #13 on: March 19, 2020, 09:38:42 AM »
Hi core.dump
Well no, I suppose xf86-video-nouveau.tcz is useless for me since it has no support for my GPU (supported by nouveau-5.4.3.-tinycore64.tcz instead).
I thought it was  nvidia-390.116  that didn't support your GPU.

First see what  xf86-video-nouveau.tcz  does.

If that errors out, you can try changing this in your  xorg.conf  file from this:
Code: [Select]
Section "Device"
Identifier  "Card0"
Driver      "nouveau"
to that:
Code: [Select]
Section "Device"
Identifier  "Card0"
Driver      "nv"

and install  xf86-video-nv.tcz.

Offline core.dump

  • Jr. Member
  • **
  • Posts: 50
Re: Xorg and dual monitor
« Reply #14 on: March 19, 2020, 09:59:05 AM »
Hi core.dump
First see what  xf86-video-nouveau.tcz  does.

If that errors out, you can try changing this in your  xorg.conf  file from this:
Code: [Select]
Section "Device"
Identifier  "Card0"
Driver      "nouveau"
to that:
Code: [Select]
Section "Device"
Identifier  "Card0"
Driver      "nv"

and install  xf86-video-nv.tcz.

Of course I can try, but are we sure xf86-video-nouveau.tcz and/or xf86-video-nv.tcz won't overlap my currently installed driver and mess up everything? The description for xf86-video-nouveau.tcz reports:

"Driver for NVidia Cards including RIVA TNT, RIVA TNT2, GeForce 256, QUADRO, GeForce2, QUADRO2, GeForce3, QUADRO DDC, nForce, nForce2, GeForce4, QUADRO4, GeForce FX, QUADRO FX, GeForce 6XXX and GeForce 7xxx chipsets"

while xf86-video-nv.tcz is for GeForce 8 series GPUs. Mine is a GTX 16xx chipset, and it does not appear to be supported by any TC drivers package except for nouveau-5.4.3-tinycore64.tcz.

Certainly there are some hacks to get the things working, but I'm not so experienced in playing with x servers and video drivers, so I'm quite afraid of breaking all up :-\
« Last Edit: March 19, 2020, 10:03:02 AM by core.dump »