Multiseat with Ubuntu 16.04

I’ve used multi-seat configurations to achieve one box TV (XBMC/Kodi) + home computer combination since 2007. My 5 year old SSD hard-drive gave up and forced me to reinstall my well working Ubuntu 14.04 configuration, and upgrade to 16.04. As usual, I googled up updated tutorials and simplified my past configuration. To my amazement, this time it only took a couple steps.

Quick multiseat setup

1. Start with a fresh 16.04 installation and Gnome Shell (I love Shell!)

sudo apt install ubuntu-gnome-desktop

lightdm is the safe choice as the display manager.

2. View devices assigned to seat0, the default mandatory seat:

asteri@master:~$ loginctl seat-status
seat0
Sessions: *c2
Devices:
??/sys/devices/LNXSYSTM:00/LNXPWRBN:00/input/input1
? input:input1 "Power Button"
??/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/card1
? [MASTER] drm:card1
? ??/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1/card1-DVI-I-1
? ? [MASTER] drm:card1-DVI-I-1
? ??/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1/card1-HDMI-A-4
? ? [MASTER] drm:card1-HDMI-A-4
? ??/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1/card1-VGA-2
? [MASTER] drm:card1-VGA-2
??/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/renderD129
? drm:renderD129
??/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/graphics/fb1
? [MASTER] graphics:fb1 "radeondrmfb"
??/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1
? sound:card1 "HDMI"
? ??/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input7
? input:input7 "HDA ATI HDMI HDMI/DP,pcm=3"
??/sys/devices/pci0000:00/0000:00:02.0/drm/card0
? [MASTER] drm:card0
? ??/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-DP-1
? ? [MASTER] drm:card0-DP-1
? ??/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-DP-2
? ? [MASTER] drm:card0-DP-2
? ??/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-DP-3
? ? [MASTER] drm:card0-DP-3
? ??/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-1
? ? [MASTER] drm:card0-HDMI-A-1
? ??/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-2
? ? [MASTER] drm:card0-HDMI-A-2
? ??/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-3
? ? [MASTER] drm:card0-HDMI-A-3
? ??/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-VGA-1
? [MASTER] drm:card0-VGA-1
??/sys/devices/pci0000:00/0000:00:02.0/drm/renderD128
? drm:renderD128
??/sys/devices/pci0000:00/0000:00:02.0/graphics/fb0
? [MASTER] graphics:fb0 "inteldrmfb"
??/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/card0
? sound:card0 "PCH"
? ??/sys/devices/pci0000:00/0000:00:1b.0/sound/card0/input10
? ? input:input10 "HDA Intel PCH Line Out Front"
? ??/sys/devices/pci0000:00/0000:00:1b.0/sound/card0/input11
? ? input:input11 "HDA Intel PCH Line Out Surround"
? ??/sys/devices/pci0000:00/0000:00:1b.0/sound/card0/input12
? ? input:input12 "HDA Intel PCH Line Out CLFE"
? ??/sys/devices/pci0000:00/0000:00:1b.0/sound/card0/input8
? ? input:input8 "HDA Intel PCH Mic"
? ??/sys/devices/pci0000:00/0000:00:1b.0/sound/card0/input9
? input:input9 "HDA Intel PCH Line"
??/sys/devices/pci0000:00/0000:00:1c.2/0000:03:00.0/usb3
? usb:usb3
??/sys/devices/pci0000:00/0000:00:1c.2/0000:03:00.0/usb4
? usb:usb4
??/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:1d.0/usb2/2-1/2-1.1
? ? usb:2-1.1
? ? ??/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1.1/2-1.1.1:1.0/sound/card2
? ? ? sound:card2 "AK5370"
? ? ??/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1.3/2-1.1.3:1.0/0003:046D:C52E.0002/input/input5
? ? ? input:input5 "Logitech USB Receiver"
? ? ??/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1.3/2-1.1.3:1.1/0003:046D:C52E.0003/input/input6
? ? ? input:input6 "Logitech USB Receiver"
? ? ??/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1.4/2-1.1.4:1.0/input/input13
? ? ? input:input13 "Microsoft® LifeCam Cinema(TM)"
? ? ??/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1.4/2-1.1.4:1.0/video4linux/video0
? ? ? video4linux:video0 "Microsoft® LifeCam Cinema(TM)"
? ? ??/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1.4/2-1.1.4:1.2/sound/card3
? ? sound:card3 "CinemaTM"
? ??/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:1.0/0003:0417:0061.0004/input/input14
? ? input:input14 "AliTV Remote V1 iPazzPort"
? ??/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:1.1/0003:0417:0061.0005/input/input15
? ? input:input15 "AliTV Remote V1 iPazzPort"
? ??/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:1.2/0003:0417:0061.0006/input/input16
? input:input16 "AliTV Remote V1 iPazzPort"
? ??/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:1.2/0003:0417:0061.0006/input/input16/event13
? ? input:event13
? ??/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:1.2/0003:0417:0061.0006/input/input16/js0
? input:js0
??/sys/devices/virtual/misc/kvm
? misc:kvm
??/sys/devices/virtual/misc/rfkill
misc:rfkill

3. Move chosen graphics and input devices to a new seat (I named mine seatTV):

loginctl attach seatTV /sys/devices/pci0000:00/0000:00:02.0/drm/card0
loginctl attach seatTV /sys/devices/pci0000:00/0000:00:02.0/drm/renderD128
loginctl attach seatTV /sys/devices/pci0000:00/0000:00:02.0/graphics/fb0

That’s it! Once you reboot, you get two login screens. Far easier than any other configurations I’ve done in the past.

The following points are all optional and suit my set-up best:

UDEV rules

When assigning USB devices, it is advisable to define own rules that do not depend on a specific USB hub location. Here is an example I used for my TV remote – saved as /etc/udev/rules.d/99-multiseat.rules

SUBSYSTEM=="input", ATTRS{name}=="*iPazzPort*", ENV{ID_SEAT}="seatTV"

This rule searches all input devices with iPazzPort in their name and assigns them to seatTV.

Pulseaudio

I prefer system wide pulseaudio, so both computer and TV sound goes through the main amplifier. Pulseaudio set-up got simpler too, but was harder to put together from multiple posts. Here is what did the trick for me:

Create pulse user, add the user to the pulse directory and audio group and add your own users to the pulse-access group:

sudo useradd -r -g pulse -d /var/run/pulse pulse
sudo usermod -aG audio pulse
sudo usermod -aG $USER pulse-access

Create systemd service as e.g. /etc/systemd/system/pulseaudio.service

[Unit]
Description=Pulseaudio sound server

[Service]
ExecStart=/usr/bin/pulseaudio --system --realtime --disallow-exit --no-cpu-limit
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target

And enable the new set-up:

sudo systemctl enable pulseaudio

Compared to fiddling with pulse config files previously, this time I only uncommented and updated the number of channels for my 5.1 audio system in /etc/pulse/daemon.conf

default-sample-channels = 6

Resources:

Post from Marius Siuram that got me started
MultiseatTeam – instructions I used previously
System-wide pulse audio (in Russian)