Run splashscreen at Raspberry Pi boot before running Qt App - qt

I am trying to run two services at RPi 4 startup:
one is my Qt App which I made executable and which has to wait for the graphical.target before running, which makes it start only after the raspberry loads the desktop.
the second is a simple splash screen which I would like to start from the very early boot of the RPi (thus hiding the console log) and ending just before the Qt app starts, therefore hiding everything, including the desktop frame, till the full-screen app appears.
Following several different guides, I tried various combination of parameters in the systemd files, such as:
[Unit]
Description= My Qt App Service
After=graphical.target
[Service]
Type=simple
User=pi
Environment=DISPLAY=:0
WorkingDirectory=/home/pi
ExecStart=/home/pi/myqtApp
[Install]
WantedBy=multi-user.target
for the Qt app (starting after the desktop loaded)
and:
[Unit]
Description=Splash Screen Service
DefaultDependencies=no
After=local-fs.target
Before=graphical.target
[Service]
ExecStart=/usr/bin/fbi -d /dev/fb0 --once --noverbose -a /opt/splashscreen.jpg
StandardInput=tty
StandardOutput=tty
[Install]
WantedBy=sysinit.target
I also modified the /boot/config.txt with display_splash=1 and /boot/cmdline.txt with
console=serial0,115200 console=tty1 root=PARTUUID=c8e5bf6e-02
rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait logo.nologo
consoleblank=0 loglevel=1 quiet vt.global_cursor_default=0
Now, two things happen depending on whether I set console=tty1 or tty3 (a guide suggested doing this) in the cmdline.txt file,
if tty1 is set, then the splash screen page is only briefly shown during startup, and then the desktop loads, and finally, my qt app starts. But I would like the splash screen to persist till the app starts without showing the desktop loading.
if tty3 is set, then the splash screen page is shown immediately at startup, but then the boot is stuck on it and nothing else is shown. In this case, I can see that my Qt app service started (no errors appear in its status) however somehow the splash screen service does not stop and therefore my qt app is not shown.
I would like everything to work as in this second case, with only the splash screen appearing since the beginning, but, of course, being replaced by the qt app as soon as the graphics allow it to run properly. I tried many other combinations of parameters in the service files but nothing seems to work.
edit: Forgot to mention that I am connected through an HDMI micro port to an external LCD display.

Related

Qt control not working properly in custom Linux

I'm trying to develop a Qt application to a custom linux built with Buildroot for Raspberry PI 4. My goal is to make an GUI through Touch interface and for that I'm using an USB Infrared frame.
My Problem
When I try to interact with a frame, I can move the dial, but when i try to use another dial it behaves like the first pressed dial didn't get released (like when you press mouse 1 and don't release it anymore).
It just stays selected and I can't interact with any other thing in the application.
I run the program using this command :
./dials -platform linuxfb
and here is the frame I am talking about.
What I tried so far
I tried some of the examples provided by Qt that came with buildroot. They seem to work just fine with the mouse in both the Raspberry and in Ubuntu (my PC). Also I tried the same examples in Ubuntu with the touch frame and they also worked flawlessly .
I've set QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS:/dev/input/event1 , if I don't do this it doesn't even move anything.

Qt cross compiled for RaspberryPi 4 - application runs but is not displayed

I'm trying to develop a gui for a RaspberryPi 4 using Qt. I followed the directions shown in this video and managed to get things up and running on the RaspberryPi. The speedometer demo that was demonstrated near the end of the video also works in my case. After getting the demo to work, I began working through the QML tutorials that were on qt.io.
I started with QML Tutorial 1 - Basic Types, and managed to get this to run on the RaspberryPi.
I then moved on to QML Tutorial 2 - QML Components. I attempted to run this application on the RaspberryPi, however, no gui/window displayed on the Pi.
Since I am new to Qt and new to cross-compiling in general, I went through basic troubleshooting steps:
Rebooted the Pi
Rebooted my Ubuntu VM that I am running Qt Creator from.
Deleted the build directory on my Ubuntu VM so that the application would be forced to rebuild everything.
Attempted to rerun the application (still no gui present).
Deleted the application from the Pi
Attempted to rerun the application (still no gui present).
Checked for a pid for the app on my Pi (A pid was present).
killed pid and reran the application, both from the Ubuntu VM as well as directly from the Pi. (Still no gui)
Attempted to run the demo speedometer application that I referred to in the first paragraph. This ran without a hitch.
I then deleted the additional code that QML Tutorial 2 introduced, and reverted back to the code that was only present in QML Tutorial 1. Reran and still did not have a gui.
What am I missing here? It doesn't appear that Qt is throwing any errors (from what I can tell).

awesome-wm external monitor and laptop

I use awesome wm with an external monitor on my laptop but sometimes I move and take the laptop only.
My question is: what happens with the clients opened in the external monitor when I disconnect it to move the laptop?
Is there a way to make awesome remember the layout of the screens? currently I'm using arandr every time I plug the screen but it is very annoying to do that every time I move the laptop.
In general any tips about how to handle a setup with an external display and a laptop is what I'm looking for.
Thanks!
Check out autorandr
It's been working perfectly for me when plugging/unplugging monitors.
EDIT:
Here's an example of how I used autorandr (on Ubuntu)
git clone https://github.com/wertarbyte/autorandr.git
cd autorandr
make deb
dpkg -i autorandr*.deb
Save my current config (no monitors)
autorandr --save mobile
Plug in additional monitor (and configure your settings)
autorandr --save multi
It should now automatically detect and apply the correct configurations when devices are plugged/unplugged. This works via a udev rule:
cat /lib/udev/rules.d/40-monitor-hotplug.rules
ACTION=="change", SUBSYSTEM=="drm", RUN+="/bin/systemctl start --no-block autorandr.service"
Nothing happens! All your applications stay open as they were when you had your monitor connected. When you reconnect the monitor everythingi will still be the same.
Take note that this means that you can still go with your mous on the disconnected screen. Your mouse will simply disappear ath the edge of your monitor because awesome still thinks that there are two screens.
If you want awesome to realize that there is only one screen remaining you have to reload the awesome-config. Once you do that, all open clients will be distributed according to your client rules on the available tags.

Beaglebone Black, Qt Application, and startup procedure

I have a BBB running Debian 3.18.13-bone70. I have made a Qt application that works great. I would like this application to run on startup.
Currently, I have made a script, placed it in /etc/init.d and made a symbolic link to it in /etc/rc5.d/S05application. This all functions correctly.
The issue that I'm having is when my system boots up, I see my application briefly (<1 second) before the CLI login screen appears and hides my application.
I've tried playing around with the startup script location (moving it to rc2.d, but the same issue persists.
I have a splash screen that times out after 10 seconds, and it moves on to the next screen. After moving to the next screen the application is never hidden again. I would like to see the splash screen the entire time and hide the CLI login screen entirely. How could I go about doing this?
EDIT:
#!/bin/bash
export QWS_MOUSE_PROTO=tslib:/dev/input/event1
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/lib/ts
export TSLIB_TSDEVICE=/dev/input/event1
/home/root/./Scanscale -qws
This is the script that I use to start the application. The Qt window service is used when I start the program.
EDIT 2:
I'm running Debian 7 using the Debian 7 image from http://elinux.org/Beagleboard:BeagleBoneBlack_Debian from March 1, 2015. This is maintained by Robert Nelson, I'm not sure if it's a yocto build or something else.
Furthermore, it doesn't appear to be an X issue. I've stopped loading X, I no longer boot into the application and just sit on the command line waiting to log in. The system flickers at about the same point in time. Any thoughts?
I should probably also mention that I'm running it on a 4.3" LCD cape, not on the HDMI interface.
You weren't specific about your system and what else is running on it. For example, is it a yocto build and does it run the sato user interface, or is it more traditional X server with a display manager, window manager, etc? Either way, there is a session-specific file which directs what programs get launched when the Xserver starts up. Using matchbox, that file is .matchbox/session. With X, it's usually xinit, which is driven by .xinitrc or .xserverrc. Also, look at startx as another poster mentioned. The latter can either be in your home directory or /etc/X11. Depending on your system and configuration, likely one of those methods, customized, is what you're looking for. See man xinit for more info.

How to respond to desktop startup notification with Qt

I have a Qt application, running under Xfce and other Linux desktops, which works well, except that the circulating "startup notification" icon is not dismissed when the app starts up, so that it persists for some time after the app main window is showing and complete.
I would assume that either the QApplication would by default dismiss the notification when the main window event loop starts, or I would call some method to do so. I can't find anything relevant in the Qt API documentation, or with google searches on Qt startup notification.
How can one dismiss the startup notification, in a Qt application.
Doesn't adding of
StartupNotify=false
to the .desktop file of your app solve the problem?.In KDE,
X-KDE-StartupNotify=false
works; perhaps XFCE has a similar variable.
The startup notification is sent automatically inside Qt when the first window is first shown (see src/plugins/platforms/xcb/qxcbscreen.cpp), but obviously, due to a bug, it does not work if there are quotes or the escape character (\) in the .desktop file in the path to the program.
In addition, if Terminal=true is presented, the environment variable DESKTOP_STARTUP_ID is deleted by xterm and does not reach your application, so it is better not to enable both Terminal and StartupNotify flags at the same time.
Was tested on MATE.

Resources