Unter Ubuntu 20.04 habe ich 2 Bildschirme, einen 4K-Fernseher (3840 x 2160) und einen 1080p-Monitor. Ich möchte sie spiegeln, wobei der Fernseher der Hauptbildschirm und der 1080p-Bildschirm der Backup-Bildschirm ist. Und ich möchte, dass das Bild auf beiden Bildschirmen in 4k gerendert wird, damit sie genau dasselbe zeigen. Über die Anzeigeeinstellungen kann ich auf beiden nur bis zu 1080p auswählen, also habe ich versucht, zu verwenden xrandr
, aber ohne Erfolg. Das Beste, was ich erreichen konnte, war die Darstellung von 4k auf beiden Bildschirmen, wobei der 1080p-Bildschirm das Bild jedoch beschneidet und nur 1/4 des Bildes zeigt.
xrandr --prop
:
HDMI-0 connected (normal left inverted right x axis y axis)
CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0
0 1
CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0
EDID:
00ffffffffffff0061a4e20001000000
0a1d0103806f3e780acf74a3574cb023
09484c21080081804540614095000101
010101010101023a801871382d40582c
4500c48e2100001e662150b051001b30
40703600c48e2100001e000000fc004d
692054560a20202020202020000000fd
00324b1e5017000a2020202020200150
02033df251010304050790121314161f
5d5e5f6263642f097f07150750570600
3d06c05f7e01830100006e030c001000
b83c20008001020304e3060501011d00
bc52d01e20b8285540c48e2100001e01
1d80d0721c1620102c2580c48e210000
9e000000000000000000000000000000
000000000000000000000000000000bc
BorderDimensions: 4
supported: 4
Border: 0 0 0 0
range: (0, 65535)
SignalFormat: TMDS
supported: TMDS
ConnectorType: HDMI
ConnectorNumber: 1
_ConnectorLocation: 1
non-desktop: 0
supported: 0, 1
1920x1080 60.00 + 59.94 50.00 60.00 50.04
4096x2160 29.97 25.00 24.00 23.98
3840x2160 29.97 25.00 23.98 23.98
1440x900 59.89
1360x768 60.02
1280x1024 60.02
1280x720 59.94 50.00
1024x768 60.00
800x600 60.32
720x576 50.00
720x480 59.94
640x480 59.94 59.93
HDMI-1-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 527mm x 296mm
_MUTTER_PRESENTATION_OUTPUT: 0
EDID:
00ffffffffffff0010acdad042394435
2b1d010380351e78ea0565a756529c27
0f5054a54b00714f8180a9c0d1c00101
010101010101023a801871382d40582c
45000f282100001e000000ff00484c36
593159320a2020202020000000fc0044
454c4c205032343139480a20000000fd
00384c1e5311000a20202020202001fb
020317b14c9005040302071601141f12
1365030c001000023a801871382d4058
2c45000f282100001e011d8018711c16
20582c25000f282100009e011d007251
d01e206e2855000f282100001e8c0ad0
8a20e02d10103e96000f282100001800
00000000000000000000000000000000
0000000000000000000000000000003d
PRIME Synchronization: 0
supported: 0, 1
HDCP Content Type: HDCP Type0
supported: HDCP Type0, HDCP Type1
Content Protection: Undesired
supported: Undesired, Desired, Enabled
max bpc: 12
range: (8, 12)
content type: No Data
supported: No Data, Graphics, Photo, Cinema, Game
Colorspace: Default
supported: Default, SMPTE_170M_YCC, BT709_YCC, XVYCC_601, XVYCC_709, SYCC_601, opYCC_601, opRGB, BT2020_CYCC, BT2020_RGB, BT2020_YCC, DCI-P3_RGB_D65, DCI-P3_RGB_Theater
aspect ratio: Automatic
supported: Automatic, 4:3, 16:9
Broadcast RGB: Automatic
supported: Automatic, Full, Limited 16:235
audio: auto
supported: force-dvi, off, auto, on
link-status: Good
supported: Good, Bad
CONNECTOR_ID: 74
supported: 74
non-desktop: 0
range: (0, 1)
1920x1080 60.00*+ 50.00 59.94
1920x1080i 60.00 50.00 59.94
1600x900 60.00
1280x1024 75.02 60.02
1152x864 75.00
1280x720 60.00 50.00 59.94
1024x768 75.03 60.00
800x600 75.00 60.32
720x576 50.00
720x576i 50.00
720x480 60.00 59.94
720x480i 60.00 59.94
640x480 75.00 60.00 59.94
720x400 70.08
3840x2160_60.00 60.00
3840x2160_29.97 29.97
Ich habe es versucht:
xrandr --fb 3840x2160 --output HDMI-0 --rate 29.97 --mode 3840x2160 --output HDMI-1-1 --rate 29.97 --mode 1920x1080 --panning 0x0 --scale 2x2
Sowie:
xrandr --fb 3840x2160 --output HDMI-0 --rate 29.97 --mode 3840x2160 --output HDMI-1-1 --rate 29.97 --mode "3840x2160_29.97" --panning 0x0
Wobei „3840x2160_29.97“ das Ergebnis von ist gtf
:
gtf 3840 2160 29.97
Ist mein Ziel mit überhaupt erreichbar xrandr
? Wie mache ich das? Und wenn es mit nicht möglich ist xrandr
, gibt es dann einen anderen Weg?
Antwort1
#!/bin/bash
mode="3840x2160_60.00"
screen="HDMI1"
cvt_res="712.75 3840 4160 4576 5312 2160 2163 2168 2237 -hsync +vsync"
if [[ "$(xrandr|grep $mode)" ="" ]];
then
xrandr --newmode $mode $cvt_res &&
xrandr --addmode $screen $mode
fi
xrandr --output HDMI-0 --mode "3840x2160" --output $screen --mode "1920x1080" --scale 2.0x2.0 --panning 3840x2160
Nach der Ausführung des obigen Schrittes wird der Inhalt des UHD-Bildschirms skaliert, aber 3/4 des Bildschirms sind schwarz. Danach gehe ich manuell in die Anzeigeeinstellungen und ändere beide Anzeigen auf gespiegelte 3840 x 2160, woraufhin das gewünschte Ergebnis erreicht ist. Leider muss dies jedoch bei jedem Start durchgeführt werden!
PS: Hier ist dieQuelleIch benutzte.
BEARBEITEN: Es sieht so aus, als ob die automatische Generierung (von Nvidia) xorg.conf
die Probleme verursacht hat!