AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1213492
Accepted
BradChesney79
BradChesney79
Asked: 2020-02-28 10:51:51 +0800 CST2020-02-28 10:51:51 +0800 CST 2020-02-28 10:51:51 +0800 CST

Lenovo T540p、Nvidia GeForce GT 730M、19.10 Eoan、4K 第二显示器问题、未自动检测到 3840x2160 模式

  • 772

我只希望我的 4K 显示器在插入时可以用作 4K 显示器。像素有帮助,FPS 没那么多。

基本上就像标题所说的那样,我办公室的屏幕是通过 HDMI 到 Mini Display Port 电缆插入的。监视器确实显示在位置和分辨率以及其他设置的视频设置中。但是,如果不发送 xrandr 命令或摆弄 /etc/X11/xorg.conf 文件,则 3840x2160 不是分辨率的选项。

监视器 edid 信息确实具有我认为在工厂嵌入的模式列表中可以接受的模式。它使用的是 HDMI 1.4(而不是 2.0)。

Anyhoo,这是我的解决方法-您能找到更好的处理方法吗?

那是我的问题,如果硬件不会自动配置所有东西,是否有更好的内置方法来做到这一点?

#!/usr/bin/env bash

apt update

apt -y upgrade

apt -y autoremove

#ubuntu-drivers devices

##  Output:
##  == /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
##  modalias : pci:v000010DEd00001290sv000017AAsd0000221Ebc03sc00i00
##  vendor   : NVIDIA Corporation
##  model    : GK208M [GeForce GT 730M]
##  driver   : nvidia-340 - distro non-free
##  driver   : nvidia-driver-390 - distro non-free recommended
##  driver   : xserver-xorg-video-nouveau - distro free builtin
##  
##  == /sys/devices/pci0000:00/0000:00:1c.1/0000:04:00.0 ==
##  modalias : pci:v00008086d000008B2sv00008086sd0000C270bc02sc80i00
##  vendor   : Intel Corporation
##  model    : Wireless 7260 (Dual Band Wireless-AC 7260)
##  manual_install: True
##  driver   : backport-iwlwifi-dkms - distro free

ubuntu-drivers autoinstall

apt install -y get-edid

get-edid

##  Output:
##  This is read-edid version 3.0.2. Prepare for some fun.
##  Attempting to use i2c interface
##  No EDID on bus 1
##  No EDID on bus 2
##  No EDID on bus 3
##  No EDID on bus 4
##  No EDID on bus 6
##  No EDID on bus 8
##  No EDID on bus 9
##  3 potential busses found: 0 5 7
##  Will scan through until the first EDID is found.
##  Pass a bus number as an option to this program to go only for that one.
##  Bus 0 doesn't really have an EDID...
##  256-byte EDID successfully retrieved from i2c bus 5
##  ������N�▒�
##ץ�YJ�$PT�������@��t0�pZ��X�Ď!f!P�Q@p6?C!�LP
##        �W55
##           �5tS�_^] &     Pm
##                            < `�`a�rQ� n(UĎ!�▒q X,%Ď!��
##  Њ �->��!▒�
##  Looks like i2c was successful. Have a good day.
##  А @1 
##       @U�!▒5

### <!> As it turns out, I wanted the info on bus 5.
### <!> Let's get the Modelines

get-edid -b5 | parse-edid

##  Output:
##  5
##  This is read-edid version 3.0.2. Prepare for some fun.
##  Attempting to use i2c interface
##  Only trying 5 as per your request.
##  256-byte EDID successfully retrieved from i2c bus 5
##  Looks like i2c was successful. Have a good day.
##  Checksum Correct
##  
##  Section "Monitor"
##          Identifier "W55"
##          ModelName "W55"
##          VendorName "SPT"
##          # Monitor Manufactured week 24 of 2018
##          # EDID version 1.3
##          # Digital Display
##          # Display Physical Size not given. Normal for projectors.
##          Gamma 1.00
##          Option "DPMS" "false"
##          Horizsync 30-80
##          VertRefresh 30-76
##          # Maximum pixel clock is 300MHz
##          #Not giving standard mode: 1920x1080, 60Hz
##          #Not giving standard mode: 1680x1050, 60Hz
##          #Not giving standard mode: 1280x800, 60Hz
##          #Not giving standard mode: 1280x1024, 60Hz
##          #Not giving standard mode: 1280x960, 60Hz
##          #Not giving standard mode: 1280x720, 60Hz
##  
##          #Extension block found. Parsing...
##  #WARNING: I may have missed a mode (CEA mode 95)
##  #WARNING: I may have missed a mode (CEA mode 94)
##  #WARNING: I may have missed a mode (CEA mode 93)
##          Modeline        "Mode 18" 74.25 1280 1390 1430 1650 720 725 730 750 +hsync +vsync 
##          Modeline        "Mode 0" 297.00 3840 4016 4104 4400 2160 2168 2178 2250 +hsync +vsync 
##          Modeline        "Mode 1" 85.50 1360 1424 1536 1792 768 771 777 795 +hsync +vsync 
##          Modeline        "Mode 2" 148.500 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
##          Modeline        "Mode 3" 74.250 1920 2008 2052 2200 1080 1082 1087 1125 +hsync +vsync interlace
##          Modeline        "Mode 4" 74.250 1280 1390 1420 1650 720 725 730 750 +hsync +vsync
##          Modeline        "Mode 5" 27.027 720 736 798 858 480 489 495 525 -hsync -vsync
##          Modeline        "Mode 6" 27.027 1440 1478 1602 1716 480 484 487 525 -hsync -vsync interlace
##          Modeline        "Mode 7" 27.027 720 736 798 858 480 489 495 525 -hsync -vsync
##          Modeline        "Mode 8" 27.027 1440 1478 1602 1716 480 484 487 525 -hsync -vsync interlace
##          Modeline        "Mode 9" 25.200 640 656 752 800 480 490 492 525 -hsync -vsync
##          Modeline        "Mode 10" 148.500 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsync
##          Modeline        "Mode 11" 74.250 1920 2448 2492 2640 1080 1082 1089 1125 +hsync +vsync interlace
##          Modeline        "Mode 12" 74.250 1280 1720 1760 1980 720 725 730 750 +hsync +vsync
##          Modeline        "Mode 13" 27.000 720 732 796 864 576 581 586 625 -hsync -vsync
##          Modeline        "Mode 14" 27.000 1440 1464 1590 1728 576 578 581 625 -hsync -vsync interlace
##          Modeline        "Mode 15" 27.000 720 732 796 864 576 581 586 625 -hsync -vsync
##          Modeline        "Mode 16" 27.000 1440 1464 1590 1728 576 578 581 625 -hsync -vsync interlace
##          Modeline        "Mode 17" 74.250 1920 2558 2602 2750 1080 1084 1089 1125 +hsync +vsync
##          Modeline        "Mode 19" 74.25 1920 2008 2052 2200 540 542 547 562 +hsync +vsync interlace
##          Modeline        "Mode 20" 27.00 720 736 798 858 480 489 495 525 -hsync -vsync 
##          Modeline        "Mode 21" 27.00 720 732 796 864 576 581 586 625 -hsync -vsync 
##          Option "PreferredMode" "Mode 18"
##  EndSection


### <!> It did not work for me, but you can try generating Modelines with cvt

#cvt 3840 2160
##  Output:
##  # 3840x2160 59.98 Hz (CVT 8.29M9) hsync: 134.18 kHz; pclk: 712.75 MHz
##  Modeline "3840x2160_60.00"  712.75  3840 4160 4576 5312  2160 2163 2168 2237 -hsync +vsync

### <!> 60Hz is the default for cvt refresh rate parameter-- my screen is 60Hz...
### <!> A more specifica cvt refresh rate is the optional third parameter


### <!> The only line I see that is 4K is "Mode 0"
### <!> Modeline        "Mode 0" 297.00 3840 4016 4104 4400 2160 2168 2178 2250 +hsync +vsync 
### <!> The quoted part of the Modeline is just a label
### <!> Changing "Mode 0" to "3480x2160" for my own nitpicky self

xrandr --newmode "3840x2160" 297.00 3840 4016 4104 4400 2160 2168 2178 2250 +hsync +vsync

### <!> cvt generated mode
#xrandr --newmode "3840x2160_60.00"  712.75  3840 4160 4576 5312  2160 2163 2168 2237 -hsync +vsync

xrandr --addmode HDMI-1-1 "3840x2160"

### <!> cvt generated mode
#xrandr --addmode HDMI-1-1 "3840x2160_60.00"


### <!> To see what's what and the available modes for each
#xrandr -q


### <!> Used arandr for help with xrandr bash command that follows
#apt install arandr && arandr
#  ...save output file as xrandr-example.sh from GUI application
#tail xrandr-example.sh
##  Output:
##  #!/bin/sh
##  xrandr --output HDMI-1-2 --off --output HDMI-1-1 --mode 1920x1080 --pos 1920x0 --rotate normal --output eDP-1-1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output VGA-1-1 --off --output DP-1-2 --off --output DP-1-1 --off

### <!> I took that "template" and substituted my own mode and positions

xrandr --output HDMI-1-1 --mode 3840x2160 --pos 0x0 --rotate normal --output HDMI-1-2 --off --output eDP-1-1 --primary --mode 1920x1080 pos 960x2160 --rotate normal --output VGA-1-1 --off --output DP-1-2 --off --output DP-1-1 --off


### <!> Now I want it to happen when I plug in my monitor
### <!> If W55 is seen, then run my xrandr command

#udevadm monitor

##  Output:
##  monitor will print the received events for:
##  UDEV - the event which udev sends out after rule processing
##  KERNEL - the kernel uevent
##  
##  KERNEL[10928.549817] change   /devices/pci0000:00/0000:00:02.0/drm/card1 (drm)
##  UDEV  [10928.551102] change   /devices/pci0000:00/0000:00:02.0/drm/card1 (drm)
##  KERNEL[10939.083981] change   /devices/pci0000:00/0000:00:02.0/drm/card1 (drm)
##  UDEV  [10939.085367] change   /devices/pci0000:00/0000:00:02.0/drm/card1 (drm)


### <!> So, it is a drm UDEV change
### <!> We can use the change to trigger a script

echo "SUBSYSTEM==\"drm\", ACTION==\"change\", RUN+=\"/usr/local/bin/xrandr-for-W55-monitor.sh\"" > /etc/udev/rules.d/xrandr-for-W55-monitor.rules

### <!> Create the script and make it executable

### <!> There's a second way to get edid info

ls -1 /sys/class/drm/*/edid

##  Output:
##  /sys/class/drm/card1-DP-1/edid
##  /sys/class/drm/card1-DP-2/edid
##  /sys/class/drm/card1-eDP-1/edid
##  /sys/class/drm/card1-HDMI-A-1/edid
##  /sys/class/drm/card1-HDMI-A-2/edid
##  /sys/class/drm/card1-VGA-1/edid


### <!> To get the bash script "heredoc" to respect indent spacing below, the indents must be tabs...


cat <<-EOF > /usr/local/bin/xrandr-for-W55-monitor.sh
#!/usr/bin/env bash

if [[ $(xrandr | grep "HDMI-1-1 connected" | wc -l) -gt 0 ]]
    then
        #echo $(date) "drm event HDMI-1-1 changed" >> /tmp/checkin.txt
        if [[ $(parse-edid < /sys/class/drm/card1-HDMI-A-1/edid | grep "Identifier \"W55\"" | wc -l) -gt 0 ]]
            then
                #echo "IT'S W55!!!" >> /tmp/checkin.txt

                xrandr --newmode "3840x2160" 297.00 3840 4016 4104 4400 2160 2168 2178 2250 +hsync +vsync

                xrandr --addmode HDMI-1-1 "3840x2160"

                xrandr --output HDMI-1-1 --mode 3840x2160 --pos 0x0 --rotate normal --output HDMI-1-2 --off --output eDP-1-1 --primary --mode 1920x1080 --pos 960x2160 --rotate normal --output VGA-1-1 --off --output DP-1-2 --off --output DP-1-1 --off
            else
                xrandr --output HDMI-1-1 --mode 1920x1080 --above eDP-1-1
        fi
    else
        xrandr --output HDMI-1-1 --off
fi
EOF

chmod 550 /usr/local/bin/xrandr-for-W55-monitor.sh

### <!> That ought to do it...
multiple-monitors nvidia display-resolution 4k-monitor
  • 2 2 个回答
  • 435 Views

2 个回答

  • Voted
  1. Dr. Jonas August
    2020-03-13T00:34:44+08:002020-03-13T00:34:44+08:00

    作为部分数据点,我已将三星 40 英寸电视(通过 HDMI 2.0 支持 4:4:4 的 4k60Hz)连接到 MacBookPro11,3(2014 年中 15 英寸 Macbook Pro)和 Nvidia GT 750m,分辨率为 3840 -by-2160(“4k”)在 Ubuntu 上,使用 HDMI 到 HDMI 电缆。除了安装正确的 nvidia 驱动程序外,我不必摆弄命令行。我能够使用 Ubuntu 的 Gnome 显示设置工具以及 nvidia-settings(玩 4:4:4)。由于我目前没有使用它,因此我无法查阅确切的版本,尽管我相信它是带有 38x 或 4xx nvidia 驱动程序的 Ubuntu 18.04.x(我隐约记得更高 nvidia 版本的暂停问题)。GT 750m 不支持 HDMI 2.0,仅支持 1.4,因此 4:4:4 的 4k60Hz 是不可能的,尽管 4:2:0(小彩色文本的渲染效果较差)可能是可能的。

    显然,自动检测最适合您。至于为什么在您的情况下它没有自动检测,我推测这是由于 HDMI 到 DisplayPort 的转换。可能值得用另一个避免转换的显示器测试您的笔记本电脑。

    • 1
  2. Best Answer
    BradChesney79
    2020-03-28T17:00:14+08:002020-03-28T17:00:14+08:00

    所以,显然我的电视的所有输入都作为 4k 输入工作......但是,根据用户手册,HDMI2 应该是特殊的。HDMI2 默认工作,我必须强制上述所有恶作剧用于输入 HDMI1、HDMI3 和 HDMI4。

    我能够在完全不同的笔记本电脑上重复完全相同的故障,并通过简单地连接到 HDMI2 来解决完全相同的问题。

    我仍然认为对 xrandr 和视频子系统有更深入的了解是很好的。(虽然我也可以在不知情的情况下死得很开心......所以,嗯。)

    • 0

相关问题

  • 自 10.04 起,笔记本电脑的扩展显示器显示摇晃/波动的图像 [关闭]

  • 有没有办法在 Ubuntu a la Windows 中拥有扩展桌面?[关闭]

  • 升级到 10.04 后字体模糊,Nvidia 问题?

  • 帮助让 Flash 播放器在第二个屏幕上工作?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve