As root, I changed one user’s home directory to a soft link to another drive (while the user was not logged in). Then this user could not run startx anymore, though other users with the same .xinitrc and also in audio group still could. Changing back to the previous home directory or setting it via usermod did not help. No error on console, startx exits with success, only this hint appears if logging:
xf86EnableIOPorts: failed to set IOPL for I/O (Operation not permitted)
Here is a log (xorg’s log is much longer but does not seem to have more to offer).
root@Freesia/~# startx >& /tmp/startxlog
root@Freesia/~# cat /tmp/startxlog
X.Org X Server 1.20.4
X Protocol Version 11, Revision 0
Build Operating System: Linux 5.10.0-21-amd64 x86_64 Debian
Current Operating System: Linux Freesia 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07) x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.19.0-9-amd64 root=UUID=27ab16fe-4180-4d31-ba99-60476076083f ro quiet
Build Date: 28 March 2023 05:03:02PM
xorg-server 2:1.20.4-1+deb10u9 (https://www.debian.org/support)
Current version of pixman: 0.36.0
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/home/alex/.local/share/xorg/Xorg.1.log", Time: Tue Mar 19 17:47:00 2024
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
xf86EnableIOPorts: failed to set IOPL for I/O (Operation not permitted)
(II) modeset(0): Initializing kms color map for depth 24, 8 bpc.
xinit: connection to X server lost
waiting for X server to shut down (II) Server terminated successfully (0). Closing log file.
I tried to delete and recreate the user with the legacy home directory, to no avail.