pjorgegerman
Posts: 5
Joined: Wed Apr 18, 2018 1:31 pm

How to start an app without windows manager

Wed Apr 18, 2018 1:46 pm

I need to start an app developed with Qt in C++, it has a GUI, this app has strict timing requirements so I need to get rid of all the overhead of the graphic interface of Raspbian. So the question is how can I start only this app on startup. Please excuse my english, it's not my mother tongue.

User avatar
thagrol
Posts: 3178
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: How to start an app without windows manager

Wed Apr 18, 2018 3:11 pm

Configure your pi to boot to command line rather than gui then try:

Code: Select all

xinit /path/to/app
Usual methods of running a command on boot should work.

See

Code: Select all

man xinit
for more info.
Arguing with strangers on the internet since 1993.

pjorgegerman
Posts: 5
Joined: Wed Apr 18, 2018 1:31 pm

Re: How to start an app without windows manager

Wed Apr 18, 2018 7:57 pm

It didn´t work. Stop whit error:
(EE) Server terminated with error (1). Closing log file.share/xorg/Xorg.0.log" for additional information.
Don´t know if it´s a problem with the xinit configuration.
Here is the log file.

Code: Select all

[   156.070] 
X.Org X Server 1.18.4
Release Date: 2016-07-19
[   156.096] X Protocol Version 11, Revision 0
[   156.105] Build Operating System: Linux 4.4.26-v7+ armv7l Raspbian
[   156.112] Current Operating System: Linux raspberrypi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l
[   156.112] Kernel command line: 8250.nr_uarts=0 bcm2708_fb.fbwidth=1024 bcm2708_fb.fbheight=768 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000  dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=/dev/mmcblk0p7 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
[   156.142] Build Date: 11 November 2016  11:59:59AM
[   156.149] xorg-server 2:1.18.4-2+rpi1 (https://www.debian.org/support) 
[   156.157] Current version of pixman: 0.33.3
[   156.171] 	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
[   156.171] Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[   156.200] (==) Log file: "/home/pi/.local/share/xorg/Xorg.0.log", Time: Fri Apr 13 00:05:38 2018
[   156.208] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[   156.208] (==) No Layout section.  Using the first Screen section.
[   156.208] (==) No screen section available. Using defaults.
[   156.208] (**) |-->Screen "Default Screen Section" (0)
[   156.208] (**) |   |-->Monitor "<default monitor>"
[   156.208] (==) No device specified for screen "Default Screen Section".
	Using the first device section listed.
[   156.208] (**) |   |-->Device "Allwinner A10/A13 FBDEV"
[   156.209] (==) No monitor specified for screen "Default Screen Section".
	Using a default monitor configuration.
[   156.209] (==) Automatically adding devices
[   156.209] (==) Automatically enabling devices
[   156.209] (==) Automatically adding GPU devices
[   156.209] (==) Max clients allowed: 256, resource mask: 0x1fffff
[   156.209] (WW) The directory "/usr/share/fonts/X11/misc" does not exist.
[   156.209] 	Entry deleted from font path.
[   156.209] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[   156.209] 	Entry deleted from font path.
[   156.209] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.
[   156.209] 	Entry deleted from font path.
[   156.209] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.
[   156.209] 	Entry deleted from font path.
[   156.209] (==) FontPath set to:
	/usr/share/fonts/X11/100dpi/:unscaled,
	/usr/share/fonts/X11/Type1,
	/usr/share/fonts/X11/100dpi,
	built-ins
[   156.209] (==) ModulePath set to "/usr/lib/xorg/modules"
[   156.209] (II) The server relies on udev to provide the list of input devices.
	If no devices become available, reconfigure udev or disable AutoAddDevices.
[   156.209] (II) Loader magic: 0x54cf4f20
[   156.209] (II) Module ABI versions:
[   156.209] 	X.Org ANSI C Emulation: 0.4
[   156.209] 	X.Org Video Driver: 20.0
[   156.209] 	X.Org XInput driver : 22.1
[   156.209] 	X.Org Server Extension : 9.0
[   156.214] (II) systemd-logind: took control of session /org/freedesktop/login1/session/c1
[   156.215] (II) no primary bus or device found
[   156.215] (II) LoadModule: "glx"
[   156.215] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[   156.219] (II) Module glx: vendor="X.Org Foundation"
[   156.219] 	compiled for 1.18.4, module version = 1.0.0
[   156.219] 	ABI class: X.Org Server Extension, version 9.0
[   156.219] (==) AIGLX enabled
[   156.219] (II) LoadModule: "fbturbo"
[   156.220] (II) Loading /usr/lib/xorg/modules/drivers/fbturbo_drv.so
[   156.220] (II) Module fbturbo: vendor="X.Org Foundation"
[   156.220] 	compiled for 1.18.4, module version = 0.5.1
[   156.220] 	Module class: X.Org Video Driver
[   156.220] 	ABI class: X.Org Video Driver, version 20.0
[   156.220] (II) FBTURBO: driver for framebuffer: fbturbo
[   156.220] (EE) 
Fatal server error:
[   156.220] (EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)
[   156.220] (EE) 
[   156.220] (EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
[   156.221] (EE) Please also check the log file at "/home/pi/.local/share/xorg/Xorg.0.log" for additional information.
[   156.221] (EE) 
[   156.221] (WW) xf86CloseConsole: KDSETMODE failed: Bad file descriptor
[   156.221] (WW) xf86CloseConsole: VT_GETMODE failed: Bad file descriptor
[   156.229] (EE) Server terminated with error (1). Closing log file.

User avatar
thagrol
Posts: 3178
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: How to start an app without windows manager

Wed Apr 18, 2018 11:20 pm

Code: Select all

Fatal server error:
[   156.220] (EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)
appears to be the error.

Not ideal but worth a try:

Code: Select all

sudo xinit /path/to/app
Someone else, or google, might havew a better suggestion.

See also https://www.x.org/archive/X11R6.8.1/doc/xinit.1.html
Arguing with strangers on the internet since 1993.

gkreidl
Posts: 6335
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: How to start an app without windows manager

Thu Apr 19, 2018 5:50 am

xinit has to be called like this:
xinit /path/to/app -- vt$(fgconsole)

Note: Usually you will also need a window manager, not just XORG. Create a script in the root of you user directory, e.g. "startapp":
#!/bin/sh
openbox --startup "/path/to/app"

and make it executable. Test it with:
xinit ./startapp -- vt$(fgconsole)

If it works, you can add the following to /home/pi/.profile for auto-start at boot (to the command line):

if [ $(tty) == "/dev/tty1" ] ; then
xinit ./startapp -- vt$(fgconsole) &
fi
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

Return to “Beginners”