dvdhrm / kmscon

Linux KMS/DRM based virtual Console Emulator
http://www.freedesktop.org/wiki/Software/kmscon
Other
432 stars 79 forks source link

Can't switch to VTx after login #88

Closed thiagokokada closed 10 years ago

thiagokokada commented 11 years ago

I am using Arch Linux with KDE 4.10 and KDM as my graphical login manager. I put systemd to auto-spawn kmsconvt@.service to the VT1-6 (like it's written on the Arch Wiki: https://wiki.archlinux.org/index.php/KMSCON) and everything works fine until I login on my KDE session using KDM (doesn't happen before I login, i.e. it works fine while I am on my KDM screen). After that, every time I try to change to a VT with an already running kmscon it just stays on a freeze screen (like a screenshot) of my KDE desktop. If I switch to a empty VT (with a not yet running kmscon or a VT that doesn't run kmscon by default like VT8), I can go to any of the VT already running kmscon without problem. I can go back to my KDE session too, so it seems it isn't a problem of really freezing kmscon, just the display buffer or something that isn't refreshing after the switching.

vkravets commented 11 years ago

I faced with the same issue. Thus I don't fully going to kmscon from gettty

dvdhrm commented 11 years ago

That sounds like your xserver doesn't drop DRM-Master in time. In fact, I saw the same issue with weston (wayland compositor) and sometimes with the xserver. The thing is, kmscon cannot access graphics devices if it is not DRM-Master. But only one process can be DRM-Master and needs to drop it before another process can acquire it. The xserver may hold it back if a compositing window manager (like kwin) tells it to. Maybe some delayed framebuffer deletion or something like that. But, the xserver must not acknowledge the VT switch befor it released DRM-Master. So this is an xserver bug.

Could you run kmscon with "--debug" and tell me what it says? It should tell you the correct error.

The thing is, the kernel VT doesn't need DRM-Master because it uses fbdev devices. So if you need no multi-head support, you can use --no-drm as command-line option as a workaround.

I will try adding a short timeout that makes kmscon retry to become DRM-Master if that fails during a VT switch. This should work as a proper workaround for buggy xservers and co.

thiagokokada commented 11 years ago

After I removed and installed again, now it works as it should. So sorry, I can't generate debug information. If it happens again I will run it with --debug and I will post it here.

yshui commented 8 years ago

I can reproduce this problem with.

Switch from X -> empty vt, kmscon auto starts as works fine, switch from X -> vt where kmscon is already running, black screen.