0

I need to run a set of (graphical) benchmarks with the screen disabled. The following command did not work:

xset dpms force off

Because any keyboard/mouse input would re-enable the screen. The other option was the following:

xrandr --output eDP-1 --off

This turns off the screen for a second, then, causes the following segmentation fault:

gnome-shell[25737]: segfault at 8 ip 00007f3d02ef9210 sp 00007ffeee4e1fd8 error 4 in libmutter-2.so.0.0.0[7f3d02e99000+156000]

How can the problem be solved? Is there any other user/kernel level alternative?


UPDATE:

The output for xinput --list is shown below:

⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ ETPS/2 Elantech Touchpad                  id=15   [slave  pointer  (2)]
⎜   ↳ USBest Technology SiS HID Touch Controller    id=11   [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Asus Wireless Radio Control               id=7    [slave  keyboard (3)]
    ↳ Video Bus                                 id=8    [slave  keyboard (3)]
    ↳ Video Bus                                 id=9    [slave  keyboard (3)]
    ↳ Sleep Button                              id=10   [slave  keyboard (3)]
    ↳ USB2.0 HD UVC WebCam: USB2.0 HD           id=12   [slave  keyboard (3)]
    ↳ Asus WMI hotkeys                          id=13   [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=14   [slave  keyboard (3)]

P.S.: This question is also asked in the Unix StackExchange Website and Xorg Mailing List.

1 Answer 1

1

You can disable mouse and keyboard input using xinput --list to list the input devices by name and id, then using xinput --disable device-or-id for each of the real mouse and keyboard devices. To reverse use --enable.

Alternatively, you can use sudo evtest --grab /dev/input/eventN & where N is the number of the input device. The grab lasts until the process is interrupted.


Another thing to try is setting the screen to stay on in the Xserver, then use ddccontrol to talk directly to the monitor over the DDC I2C bus. If the monitor is recognised, you can give a command to turn it off. Presumably, the Xserver will not try to turn it on if it assumes it is still on.

5
  • I need to receive the inputs. Because the benchmarks are interactive applications. The inputs are recorded and replayed using Cnee (in the form of mouse/keyboard events) even when the screen is disabled.
    – TheAhmad
    Commented Aug 24, 2023 at 13:09
  • 1
    xinput --list should show you that there are separate XTEST pointer and keyboard; these are used by playback tools like cnee.
    – meuh
    Commented Aug 24, 2023 at 14:36
  • When I use the first deactivation command (i.e., xset dpms...), using Cnee will also reactivate the screen. Do you mean that I should disable the input types used by Cnee and this will prevent screen re-activation? Could you elaborate further? I have updated the question to include the xinput --list command output.
    – TheAhmad
    Commented Aug 24, 2023 at 15:43
  • I do not understand how using XTEST can help avoid screen reactivation. Also even if this is true, based on the traces, Cnee is not using XTEST slave devices. How can I force Cnee to use XTEST devices?
    – TheAhmad
    Commented Aug 24, 2023 at 20:33
  • 1
    No, you are right. I dont see how to avoid reactivation if there is interactive input, even XTEST. I thought you were wanting to avoid unintentional input, from people jogging the mouse etc. Perhaps you can try the ddccontrol hack I also mentioned.
    – meuh
    Commented Aug 25, 2023 at 9:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .