在开始之前

在开始之前

我想在我的电脑上设置多席位。我已经添加了第二个 VGA 适配器以使事情变得更容易/可能?

我们有:

  • Kubuntu Artful 17.10(KDE)
  • systemd
  • sddm(我们可能必须使用 lightdm,因为 sddm 缺少多座位功能)
  • Intel i5-4570S 片上图形
  • 非常老旧的 ATI RV710/Radeon HD4350/4550

让我们尝试记录最新的 Kubuntu/Ubuntu 版本的通用解决方案。

我很困惑,如果我启动 XI 则没有任何输入,seat0并且会出现随机噪音seat-tv

我创建了一个新问题,因为现有的问题/答案要么专门针对硬件,要么在背景解释上不完整。至少我无法使用现有资源解决问题。

我创建了一个社区答案,因此请随意编辑下面的答案。

完成后,我可能会添加如何在 Seat-tv 上仅启动 Kodi,而无需显示管理器和窗口管理器。

答案1

在开始之前

  • 备份您的系统和/或等
  • 安装openssh-server并确保您可以从另一台电脑登录,以防您的本地登录不起作用
  • 禁用显示管理器的自动启动:sudo systemctl set-default multi-user.target
  • 为你的座位想一个好名字。惯例说它必须以 开头seat-。我选择seat-tv

设置 udev 规则

  • 点击此处了解 udev 规则https://docs.oracle.com/cd/E37670_01/E41138/html/ch07s03.html http://www.reactivated.net/writing_udev_rules.html
  • 使用以下任一方法查找硬件

    $ lspci -nn
    [stripped non-audio, nongraphics]
    00:02.0 VGA compatible controller [0300]: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller [8086:0412] (rev 06)
    00:03.0 Audio device [0403]: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller [8086:0c0c] (rev 06)
    00:1b.0 Audio device [0403]: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller [8086:8c20] (rev 05)
    01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] RV710 [Radeon HD 4350/4550] [1002:954f]
    01:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] RV710/730 HDMI Audio [Radeon HD 4000 series] [1002:aa38]
    
    $ lsusb
    [stripped non-audio, non-input]
    Bus 003 Device 019: ID 413c:a503 Dell Computer Corp. [Soundbar]
    Bus 003 Device 018: ID 03f0:034a Hewlett-Packard Elite Keyboard
    Bus 003 Device 017: ID 046d:c050 Logitech, Inc. RX 250 Optical Mouse
    Bus 003 Device 023: ID 1915:0196 Nordic Semiconductor ASA [Mele USB remote keyboard and mouse]
    # how do I get a more useful output from lsusb?
    
    $ loginctl seat-status
    Devices:
    ├─/sys/devices/LNXSYSTM:00/LNXPWRBN:00/input/input1
    │ input:input1 "Power Button"
    ├─/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/LNXVIDEO:00/input/input5
    │ input:input5 "Video Bus"
    ├─/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input0
    │ input:input0 "Power Button"
    ├─/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/renderD128
    │ drm:renderD128
    ├─/sys/devices/pci0000:00/0000:00:02.0/drm/card1
    │ [MASTER] drm:card1
    │ ├─/sys/devices/pci0000:00/0000:00:02.0/drm/card1/card1-DP-1
    │ │ [MASTER] drm:card1-DP-1
    │ ├─/sys/devices/pci0000:00/0000:00:02.0/drm/card1/card1-HDMI-A-1
    │ │ [MASTER] drm:card1-HDMI-A-1
    │ ├─/sys/devices/pci0000:00/0000:00:02.0/drm/card1/card1-HDMI-A-2
    │ │ [MASTER] drm:card1-HDMI-A-2
    │ ├─/sys/devices/pci0000:00/0000:00:02.0/drm/card1/card1-HDMI-A-3
    │ │ [MASTER] drm:card1-HDMI-A-3
    │ └─/sys/devices/pci0000:00/0000:00:02.0/drm/card1/card1-VGA-1
    │   [MASTER] drm:card1-VGA-1
    ├─/sys/devices/pci0000:00/0000:00:02.0/drm/renderD129
    │ drm:renderD129
    ├─/sys/devices/pci0000:00/0000:00:02.0/graphics/fb1
    │ [MASTER] graphics:fb1 "inteldrmfb"
    ├─/sys/devices/pci0000:00/0000:00:03.0/sound/card0
    │ sound:card0 "HDMI_1"
    │ ├─/sys/devices/pci0000:00/0000:00:03.0/sound/card0/input10
    │ │ input:input10 "HDA Intel HDMI HDMI/DP,pcm=8"
    │ ├─/sys/devices/pci0000:00/0000:00:03.0/sound/card0/input11
    │ │ input:input11 "HDA Intel HDMI HDMI/DP,pcm=9"
    │ ├─/sys/devices/pci0000:00/0000:00:03.0/sound/card0/input12
    │ │ input:input12 "HDA Intel HDMI HDMI/DP,pcm=10"
    │ ├─/sys/devices/pci0000:00/0000:00:03.0/sound/card0/input8
    │ │ input:input8 "HDA Intel HDMI HDMI/DP,pcm=3"
    │ └─/sys/devices/pci0000:00/0000:00:03.0/sound/card0/input9
    │   input:input9 "HDA Intel HDMI HDMI/DP,pcm=7"
    ├─/sys/devices/pci0000:00/0000:00:14.0/usb3
    │ usb:usb3
    │ ├─/sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0/0003:1915:0196.0027/input/input47
    │ │ input:input47 "MELE RI"
    │ ├─/sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.1/0003:1915:0196.0028/input/input48
    │ │ input:input48 "MELE RI"
    │ ├─/sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.2/0003:1915:0196.0029/input/input49
    │ │ input:input49 "MELE RI"
    │ └─/sys/devices/pci0000:00/0000:00:14.0/usb3/3-5
    │   usb:3-5
    │   ├─/sys/devices/pci0000:00/0000:00:14.0/usb3/3-5/3-5.1/3-5.1:1.0/0003:046D:C050.0017/input/input34
    │   │ input:input34 "Logitech USB-PS/2 Optical Mouse"
    │   ├─/sys/devices/pci0000:00/0000:00:14.0/usb3/3-5/3-5.2/3-5.2:1.0/0003:03F0:034A.0018/input/input35
    │   │ input:input35 "Chicony HP Elite USB Keyboard"
    │   ├─/sys/devices/pci0000:00/0000:00:14.0/usb3/3-5/3-5.2/3-5.2:1.1/0003:03F0:034A.0019/input/input36
    │   │ input:input36 "Chicony HP Elite USB Keyboard"
    │   ├─/sys/devices/pci0000:00/0000:00:14.0/usb3/3-5/3-5.3/3-5.3:1.0/sound/card3
    │   │ sound:card3 "SoundBar"
    │   └─/sys/devices/pci0000:00/0000:00:14.0/usb3/3-5/3-5.3/3-5.3:1.3/0003:413C:A503.001A/input/input37
    │     input:input37 "Dell Dell AC511 USB SoundBar"
    ├─/sys/devices/pci0000:00/0000:00:14.0/usb4
    │ usb:usb4
    ├─/sys/devices/pci0000:00/0000:00:1a.0/usb1
    │ usb:usb1
    │ └─/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1
    │   usb:1-1
    ├─/sys/devices/pci0000:00/0000:00:1b.0/sound/card1
    │ sound:card1 "PCH"
    │ ├─/sys/devices/pci0000:00/0000:00:1b.0/sound/card1/input13
    │ │ input:input13 "HDA Intel PCH Front Mic"
    │ ├─/sys/devices/pci0000:00/0000:00:1b.0/sound/card1/input14
    │ │ input:input14 "HDA Intel PCH Rear Mic"
    │ ├─/sys/devices/pci0000:00/0000:00:1b.0/sound/card1/input15
    │ │ input:input15 "HDA Intel PCH Line"
    │ ├─/sys/devices/pci0000:00/0000:00:1b.0/sound/card1/input16
    │ │ input:input16 "HDA Intel PCH Line Out"
    │ └─/sys/devices/pci0000:00/0000:00:1b.0/sound/card1/input17
    │   input:input17 "HDA Intel PCH Front Headphone"
    ├─/sys/devices/pci0000:00/0000:00:1d.0/usb2
    │ usb:usb2
    │ └─/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1
    │   usb:2-1
    ├─/sys/devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sr0
    │ block:sr0
    ├─/sys/devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/scsi_generic/sg0
    │ scsi_generic:sg0
    ├─/sys/devices/platform/eeepc-wmi/input/input6
    │ input:input6 "Eee PC WMI hotkeys"
    ├─/sys/devices/virtual/misc/kvm
    │ misc:kvm
    └─/sys/devices/virtual/misc/rfkill
    misc:rfkill
    
  • 通过...添加规则

    • 使用loginctl路径上方的加号来创建 udev 规则,但我不推荐这样做。公交车 ID 保持不变吗?

      # gfx
      sudo loginctl attach seat-tv /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card0
      sudo loginctl attach seat-tv /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/graphics/fb0
      # hdmi audio
      sudo loginctl attach seat-tv /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card2
      # mele remote
      sudo loginctl attach seat-tv /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0/0003:1915:0196.0008/input/input21
      sudo loginctl attach seat-tv /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.1/0003:1915:0196.0009/input/input22
      sudo loginctl attach seat-tv /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.2/0003:1915:0196.000A/input/input23
      
    • 这将添加如下规则文件。如果 ID_FOR_SEAT 与给定值匹配,则规则将 ID_SEAT 设置为 seat-tv。

      $ cat /etc/udev/rules.d/72-seat-graphics-pci-0000_01_00_0.rules`
      TAG=="seat", ENV{ID_FOR_SEAT}=="graphics-pci-0000_01_00_0", ENV{ID_SEAT}="seat-tv"
      
    • 或手动创建 udev 规则。我更喜欢使用 VendorID/ProductID 来识别。文件名应该以 72 开头,因为其他与座位相关的东西/lib/udev/rules.d是 71 或 73。

      $ cat 72-seat0.rules
      # do I really need to set up anything for seat0?
      # It should just grab anything not allocated to another seat?
      # Intel GFX
      # if TAG contains seat and vendor and product match the hex codes than set ID_SEAT to seat0
      TAG=="seat", ATTRS{idVendor}=="0x8086", ATTRS{idProduct}=="0x0412", ENV{ID_SEAT}="seat0"
      
      # Dell AC511 Sound
      #/sys/devices/pci0000:00/0000:00:14.0/usb3/3-5/3-5.3/3-5.3:1.0/sound/card3
      #/sys/devices/pci0000:00/0000:00:14.0/usb3/3-5/3-5.3/3-5.3:1.3/0003:413C:A503.001A/input/input37
      TAG=="seat", ATTRS{idVendor}=="0x413c", ATTRS{idProduct}=="0xa503", ENV{ID_SEAT}="seat0"
      
      # HP Keyboard
      #/sys/devices/pci0000:00/0000:00:14.0/usb3/3-5/3-5.2/3-5.2:1.0/0003:03F0:034A.0018/input/input35
      #/sys/devices/pci0000:00/0000:00:14.0/usb3/3-5/3-5.2/3-5.2:1.1/0003:03F0:034A.0019/input/input36
      SUBSYSTEM=="input", ATTRS{idVendor}=="0x03f0", ATTRS{idProduct}=="0x034a", ENV{ID_INPUT.tags}="input_seat0"
      
      # Logitech Mouse
      #/sys/devices/pci0000:00/0000:00:14.0/usb3/3-5/3-5.1/3-5.1:1.0/0003:046D:C050.0017/input/input34
      SUBSYSTEM=="input", ATTRS{idVendor}=="0x046d", ATTRS{idProduct}=="0xc050", ENV{ID_INPUT.tags}="input_seat0"
      
      $ cat 72-seat-tv.rules
      # ATI RV710
      #/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card0
      #/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/graphics/fb0
      # any graphics card should already have the master-of-seat TAG,
      # see /lib/udev/rules.d/71-u-d-c-gpu-detection.rules
      #SUBSYSTEM=="drm", KERNEL=="card[0-9]*", ATTRS{idVendor}=="0x1002", ATTRS{idProduct}=="0x954f", TAG+="master-of-seat"
      TAG=="seat", ATTRS{idVendor}=="0x1002", ATTRS{idProduct}=="0x954f" , ENV{ID_SEAT}="seat-tv"
      
      # ATI HDMI audio
      #/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card2
      #/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card2/input7
      TAG=="seat", ATTRS{idVendor}=="0x1002", ATTRS{idProduct}=="0xaa38", ENV{ID_SEAT}="seat-tv"
      #TAG=="seat", ENV{ID_FOR_SEAT}=="sound-pci-0000_01_00_1", ENV{ID_SEAT}="seat-tv"
      
      # Mele USB remote keyboard and mouse
      #1915:0196
      SUBSYSTEM=="input", ATTRS{idVendor}=="0x1915", ATTRS{idProduct}=="0x0196", ENV{ID_INPUT.tags}="input_seat-tv", ENV{ID_SEAT}="seat-tv"
      
      # TODO usb hub where all attached devices belong to this seat
      #SUBSYSTEM=="input", DEVPATH=="/devices/pci0000:00/0000:00:1d.0/usb2/*", ENV{ID_INPUT.tags}="input_seat-tv"
      
  • 您现在应该(在显示管理器重新启动后?)意识到以下情况

    • 分配给其他座位的输入在座位 0 上不再起作用
    • 分配给其他座位的屏幕应从系统设置/显示中消失
    • 音频设备也一样

设置 Xorg

  • 创建一个类似 /etc/X11/xorg.conf.multiseat 的目录,这样它就不会改变你的默认设置。
  • 使用以下命令获取当前 xorg 配置sudo Xorg :2 -configure
  • 创建文件/etc/X11/xorg.conf.multiseat/90-seat-tv.conf

    Section "Device"
            # get this from Xorg -configure
            Identifier  "Card0"
            Driver      "amdgpu"
            BusID       "PCI:1:0:0"
    
            MatchSeat      "seat-tv"
    #    Identifier     "Seat-TV"
    #    Option         "ProbeAllGpus" "FALSE"
    EndSection
    
    #Section "Device"
    #       Identifier  "Card1"
    #       Driver      "amdgpu"
    #       BusID       "PCI:1:0:1"
    #EndSection
    
    Section "InputClass"
            Identifier      "ignore_other_seats"
            Option          "Ignore" "yes"
    EndSection
    
    Section "InputClass"
            Identifier      "use_seat_devices"
            MatchTag        "input_seat-tv"
            Option          "Ignore" "no"
    EndSection
    
  • 我不知道所评论的条目。

  • 我是否需要为 seat0 设置类似的文件,或者使用默认文件就可以了?
  • TODO:服务器布局

测试

撤消

  • 暂时地
    • 再次启用窗口管理器sudo systemctl set-default graphical.target
  • 永久
    • 删除你的 udev 文件/etc/udev/rules.d/72-*
    • 删除你的/etc/X11/xorg.conf.multseat文件夹

现在怎么办?

  • 我错过了什么?
  • 服务器布局如何工作?
  • Mele 键盘不知为何没有连接到 Seat-tv?

相关内容