Plugable

One Fedora 17 Box up to 16 USB Multiseat Terminals

Fedora 17, as shipped, supports only 7 or 8 plug-and-play USB terminals per machine. The cause is the kernel evdev driver’s limit of 32 input devices.

You can see how your 32 evdev slots are currently getting used on a system with the command

for i in {0..31..1}; do udevadm info -a -n /dev/input/event$i | grep name; done

On the Fedora 17 multiseat box I’m using now to write this post, I have 3 USB terminals sharing one box — while I’ve spent the afternoon figuring this stuff out on one of the USB terminals, at the same time the kids have been watching endless youtube videos with their headsets on the other two. On this box, the command above shows:

    ATTRS{name}=="Power Button"
    ATTRS{name}=="Power Button"
    ATTRS{name}=="Plantronics Plantronics .Audio 655 DSP"
    ATTRS{name}=="Dell Dell USB Keyboard"
    ATTRS{name}=="USB Optical Mouse"
    ATTRS{name}=="USB Optical Mouse"
    ATTRS{name}=="Dell Dell USB Keyboard"
    ATTRS{name}=="GASIA USB KB V11"
    ATTRS{name}=="GASIA USB KB V11"
    ATTRS{name}=="SIGMACHIP Usb Mouse"
    ATTRS{name}=="C-Media Electronics Inc. USB Multimedia Audio Device"
    ATTRS{name}=="CM109 USB driver"
    ATTRS{name}=="HDA Intel PCH HDMI/DP,pcm=3"
    ATTRS{name}=="HDA Intel PCH Line"
    ATTRS{name}=="HDA Intel PCH Rear Mic"
    ATTRS{name}=="HDA Intel PCH Front Mic"
    ATTRS{name}=="HDA Intel PCH Front Headphone"
    ATTRS{name}=="HDA Intel PCH Line Out"
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found

This shows I only have 14 evdev slots left (the “device node not found” ones are available slots). So I know I could only connect 7 terminals total to this machine (a USB terminal’s unused audio buttons + keyboard + mouse takes up 3, I could only get 14 / 3 = 4 more than the three I have).

We can lift the limit of USB terminals from 7 to 16 by disabling often unused input devices: hardware volume controls and system (power) buttons. The following udev rules script does that with 3 rules.

Note that this will mean you’ll have to power off / sleep from the UI, your mainboard audio will be disabled, and special keyboard multimedia keys will be disabled. Feel free to comment out the appropriate lines in the udev rules if you want to keep those.

To apply these optimizations, create a system file (as sudo) called /usr/lib/udev/rules.d/72-seat.rules
with the following contents and reboot.

#
# Bernie Thompson bernie@plugable.com
#
# These udev rules help alleviate the Linux kernel limit of 32 evdev devices.
# This file should be deleted once the kernel's 32 device limit is lifted.
#
# Background: Every input device on the system, including several for 
# power buttons, PCI audio, USB audio, keyboard multimedia keys, etc. 
# all count towards the 32 limit.  Many systems reserve at least 8 for
# these uses. So as shipped with Fedora 17, only 7 or so USB terminals 
# (like the Plugable DC-125 or Plugable UD-160-M) will work.
#
# Run this at a command line to see how your 32 event slots are being used:
#
# for i in {0..31..1}; do udevadm info -a -n /dev/input/event$i | grep name; done
#
# If you have any event slots free, you'll see a "device node not found" message for each
#
# USB terminals consume an extra event device with the USB HID device
# associated with the audio interface for volume control. The udev rule below
# frees it up. This will enable around 12 USB terminals per server.
#
SUBSYSTEMS=="usb", SUBSYSTEM=="input", ENV{ID_SEAT}!="seat0", ENV{ID_USB_INTERFACE_NUM}!="00", RUN="/bin/sh -c 'echo $id > /sys/$devpath/../../../driver/unbind'"

#
# Free up any input devices associated with audio on the PCI bus.
# *IMPORTANT* This will disable your PC's mainboard PCI audio
# (because we can only unbind the whole PCI device)
# This will enable 13 or so USB terminals per server
# Comment out the line with a "#" if you'd like PCI audio to work
#
SUBSYSTEM=="pci", ATTR{class}=="0x040300", RUN="/bin/sh -c 'echo $kernel > /sys/$devpath/driver/unbind'"

# 
# Free up any ACPI (system power) buttons. 
# *IMPORTANT* This will disable all built-in buttons on your PC (e.g. power)
# You will need to shut down, etc. from the Linux UI with administrative rights.
# This has the side-effect of making your PC slightly more secure against student tampering.
# Comment out the line with a "#" if you'd like these to work
# This will enable an extra USB terminal or so per server
# If you have no other event devices, other than the USB terminals, should get to 16 terminals.
#
SUBSYSTEM=="acpi", DRIVER=="button", RUN="/bin/sh -c 'echo $kernel > /sys/$devpath/driver/unbind'"

After creating that udev rule and rebooting, things look much more favorable in terms of evdev slots. Only the “real” USB keyboards and mice are left to consume slots:

    ATTRS{name}=="SIGMACHIP Usb Mouse"
device node not found
device node not found
    ATTRS{name}=="Dell Dell USB Keyboard"
    ATTRS{name}=="USB Optical Mouse"
    ATTRS{name}=="USB Optical Mouse"
    ATTRS{name}=="Dell Dell USB Keyboard"
    ATTRS{name}=="GASIA USB KB V11"
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found

There are now enough free slots for 16 USB terminals (or, more specifically, their keyboards and mice).

Hopefully this is just a temporary workaround, until someone tackles the task of lifting the kernel’s limit of 32 evdev devices. That’s a very constraining limit for a whole host of reasons.

Note that one of the remaining bugs in Fedora 17 is that random USB terminals often come up to a green screen, requiring an unplug/replug to get a login. These scripts may increase the frequency of that if you have a lot of terminals, as the system bounces against the 32 device limit, then returns below it as the udev rules execute.

Hopefully in future versions of Fedora / systemd, those race conditions will be closed.

Hope you enjoy turning your one Fedora 17 PC into many. Please comment if you have any problems applying, we’ll try to help. See also our post on some huge Fedora 17 performance optimizations for USB multiseat which greatly improve the default experience.

And if you’re running more than 8 terminals with Fedora 17, please post a comment – we’d love to hear about it!


neither object nor array? not implemented yet

Switch to gutenberg-Blocks!
There the JSON Content Importer Block gives an easier way to use the JSON-APIs.
Or: Switch on the Debugmode by adding "debugmode=10" in the Shortcode.

If all is without success: Open ticket at wordpress.org please


We have a Problem with JSON here:
Either we got no JSON from the API. Or the basenode-parameter is not ok.
Switch on the Debugmode of the Plugin!
Switch to gutenberg-Blocks!
There the JSON Content Importer Block gives an easier way to use the JSON-APIs.
Or: Switch on the Debugmode by adding "debugmode=10" in the Shortcode.

If all is without success: Open ticket at wordpress.org please