You are not logged in.

#1 2014-08-26 14:38:19

loh
Member
Registered: 2014-02-26
Posts: 36

Running applications in a separate X server

Hi there,

Prior to the xorg update I used this handy script to launch certain programs in a separate X display. Since I use dwm, this was particularly useful for SDL programs (e.g. zsnes, scummvm) that don't play nicely with non-reparenting window managers, such as dwm. Since the update I understand that it is necessary to launch the new X server from the same virtual terminal that you are on by making use of the vt option. While this works fine for me (I've read the announcent and tested it out), I'd ideally like something more like the old system where I could use xrun in my current tty to launch a game on a different display. I would automatically be switched to the new tty and returned to the original one when the program was closed. Is this not possible with the new xorg setup?

For reference. I'm running slim as a login manager and dwm as my window manager (launched by slim using my .xinitrc). I have a default slim setup that logs me in to vt07 and I use vt01-06 for launching any pesky applications that aren't dwm friendly.

Cheers.

Last edited by loh (2014-10-03 08:11:44)

Offline

#2 2014-09-26 10:57:35

loh
Member
Registered: 2014-02-26
Posts: 36

Re: Running applications in a separate X server

Okay, I've finally made some progress with this and I thought I'd write it up so as to help anyone else who may be experiencing similar issues. Since my problems are the result of issues with xorg and bugs in the kernel I'm no longer sure if this is the most appropriate place in the forums for this posting. Let me know if I should move it elsewhere.

Here's what I needed to do in order to get things working:

1. Stop using a display manager.
None of the subsequent fixes made any difference if I continued to use a Display Manager. I was using SLiM and also tried getting things to work with CDM and LightDM. No luck. Since I pretty much only use dwm these days I simply removed SLiM and set up X to start at login as described in the wiki.

2. Re-enable root rights for Xorg.
Whatever I've tried, I cannot get things working with a rootless setup. As such, I renabled root rights as described here.

3. i915 errors? See if you need to patch your kernel.
I've been having a whole host of issues over the summer related to a kernel bug causing problems with the i915 DRM driver. Many of the problems relating to this are well documented in this thread. In my own experiences I was unable to launch any applications that required OpenGL and I would see errors such as the following in my logs.

Sep 23 18:30:30 ***** kernel: [drm:init_ring_common] *ERROR* render ring initialization failed ctl 0001f001 (valid? 1) head 0000029c tail 00000000 start 003eb000 [expected 00...
Sep 23 18:30:30 ***** kernel: [drm:i915_gem_init] *ERROR* Failed to initialize GPU, declaring it wedged

This problem could be somewhat cirumvented by switching to the UXA backend as suggested here. Although this fixed some of the problems I would still experience DRM issues when trying to launch programs in a separate X display. I would typically get a black screen with a blinking (or sometimes frozen) cursor, after which I would be unable to switch tty and would have to hard reset. When I got rid of my display manager (step 1) the application would launch correctly (it would open in another tty and I could use ctrl+alt+F? to switch) but would crash when I tried to close it. It appeared from the logs that the second X server was unable to close leaving me with a black screen and an entirely unresponsive system.

Rather than patching and compiling the kernel myself I took advantage of Graysky's hard work and installed linux-ck from repo-ck. I've installed this alongside the stock kernel and added an entry to my bootloader's menu. According to Graysky's post in this thread the patch should arrive in the stock kernel with 3.16.4.

4. Other issues.
For some reason, after seemingly getting things to work, I had to re-add myself to the audio and video groups in order to avoid permission errors with sound (I use alsa) and libGL for applications launched in a separate X display. I had removed myself from these groups following the switch to systemd and hadn't experienced any issues prior to the xorg update. I certainly have a valid local session so I'm not sure what's going on here.

I'm also experiencing a bug with xf86-video-intel which causes the backlight to dim whenever I switch tty. It's certainly not a big deal, just kind of annoying after fixing all of the above.

After recovering a setup that works as I don't really feel as if I've learned anything. Does anyone know how one would achieve something similar while still running rootless? I tried setting up Xorg as a systemd user service as described in the wiki but it doesn't seem to work. Maybe I'm lacking understanding but I've followed the details and have the same issue as described in this post.

Offline

#3 2014-11-16 19:50:53

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,457

Re: Running applications in a separate X server

Any help on this issue would be REALLY appreciated here too.
Also, i hope this is considered a bug by systemd and/or xorg devs.


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

Board footer

Powered by FluxBB