【问题标题】:Why does xrandr give me errors if I try and use commands on my computer, but not if I ssh into it?如果我尝试在我的计算机上使用命令,为什么 xrandr 会给我错误,但如果我 ssh 进入它却不会?
【发布时间】:2018-02-01 07:45:39
【问题描述】:

在我的设备上使用 xrandr 选择分辨率时,我不断收到一条错误消息,指出“配置 crtc 0 失败:”

选择显示并运行后(缩短)xrandr 输出$ xrandr

Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
DP1 disconnected (normal left inverted right x axis y axis)
DP2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 1439mm x 809mm
   1920x1080     60.00*+  50.00    59.94    30.00    24.00    29.97    23.98  
   4096x2160     24.00    23.98  
   3840x2160     30.00    25.00    24.00    29.97    23.98  
   1920x1080i    60.00    50.00    59.94  
   1680x1050     59.88   
   1280x720      60.00    50.00    30.00    59.94    29.97    24.00    23.98  
   1024x768      60.00  
   720x480       60.00    59.94  
   640x480       60.00    59.94  
HDMI1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)  

我用来选择新分辨率的代码

$ xrandr --output DP2 --mode 3840x2160

当这给了我错误时,我还通过尝试两者来添加帧速率

$ xrandr  --output DP2 --mode 3840x2160 30

$xrandr --output DP2 --mode 3840x2160_30

(因为我不确定添加它的正确格式)两者都给了我错误“configure crtc 0 failed:”

这是在设备本身上完成的。出于人体工程学的原因,我回到办公桌前使用 SSH 访问设备。

然后我使用了自定义分辨率(与上面相同)并尝试改用它。

我用于自定义分辨率的步骤(减去长输出)

$ cvt 3840x2160

$ xrandr --newmode "3840x2160 30.00" 338.75 3840 4080 4488 5136 2160 2163 2168 2200 -hsync +vsync

$ xrandr --addmode DP2 3840x2160_30.00

$ xrandr --output DP2 --mode 3840x2160_30.00

这似乎在我的设备上工作。当我的设备重新启动时,我需要再次重复该过程(当我需要 4k 时恢复到 100p)。我将$ xrandr --output DP2 --mode 3840x2160_30.00 卡在一个 .sh 文件中,现在如果我从笔记本电脑运行它(使用 SSH),它会更改我的屏幕分辨率,但是如果我尝试从我的设备本身运行 .sh 文件,我会得到“配置 crtc 0 失败: " 错误

【问题讨论】:

    标签: ssh terminal xrandr


    【解决方案1】:

    您可以重新配置 xOrg。我通过在我的/usr/share/X11/xorg.conf.d 目录中创建一个文件来做到这一点。

    我是用 vim 做的:

    sudo vim /usr/share/X11/xorg.conf.d/5-monitor.conf
    

    这是我的文件示例

    Section "Monitor"
       Identifier "Monitor0"
       Modeline "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
       Modeline "3840x2160_30.0" 297.00 3840 4016 4104 4400 2160 2168 2178 2250 +hsync +vsync
       Modeline "4096x2160_24.0" 297.00 4096 5116 5204 5500 2160 2168 2178 2250 +hsync +vsync
    EndSection
    Section "Device"
       Identifier "Device0"
       Driver "intel"
    EndSection
    Section "Screen"
       Identifier "Screen0"
       Device "Device0"
       Monitor "Monitor0"
       DefaultDepth 24
       SubSection "Display"
          Depth 24
          Modes "3840x2160" "1920x1080"
       EndSubSection
    EndSection
    

    有关如何执行此操作的说明,您可以按照本教程进行操作:https://wiki.gentoo.org/wiki/Xorg/Multiple_monitors

    我在使用 ubuntu 16.0.4 时遇到了这个问题

    【讨论】:

      【解决方案2】:

      你可以尝试用cvt -r 3840 2160代替cvt 3840 2160的操作

      【讨论】:

        猜你喜欢
        • 2013-01-02
        • 1970-01-01
        • 2020-05-11
        • 2014-08-08
        • 2016-09-14
        • 2016-10-22
        • 2011-01-12
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多