Qt: Could not read from input device: No such device - linux

I have a Qt application that's been built to run on Embedded Linux platform (i.Mx.6). My application should support both touch screen as primary input device and an optional USB keyboard if connected. So for now, I have configured my application to be launched as mentioned below:
my-qt-app -plugin tslib:/dev/input/event0 -plugin evdevkeyboard:/dev/input/event1
My application is able to detect the touchscreen and keyboard properly, BUT, I am noticing a problem if I unplug the keyboard while my application is still running, I see the below error on the console:
Could not read from input device: No such device
And my Qt application is lagging and is very slow in responding to the touch screen. Looking at the above error message it seems my application is still expecting some sort of data from the keyboard ?
Can somebody help me to recover from this error or give pointers to what's happening please, also if there is a way that I can detect the keyboard presence runtime so that I no need to pass -plugin evdevkeyboard as command line argument to my GUI application.

Related

Can't log in to embedded Linux Buildroot

I'm looking to install Linux onto an Intel Galileo Gen 2 utilizing this and this via installing onto an SD card.
I believe I have successfully done this, as during the boot sequence I am able to select Linux to boot from, however as soon as it starts booting from Linux, I am unable to interact with the Galileo anymore by say typing in my username and password when it comes time to login.
I'm unsure if my peripheral setup is wrong, if I need to install some more drivers to support I/O or something else.
I am viewing the logs from the Galileo via an FTDI cable and currently have a keyboard plugged directly into the Galileo.
Log data
When I boot the Galileo, this is what is logged.
Interestingly, the
flashing cursor stops flashing and is just steady when I get to the
login screen, as if the device is sort of frozen
However if I then
say connect a keyboard, it recognizes it and outputs this log data.
Solved! Turns out it was a faulty FTDI cable!

How do I keep polling HIDAPI in wxWidgets?

Moving from the world of Embedded Micro controllers and C, to C++ with wxWidgets.
I've created a simple GUI program, using codeblocks and wxWidgets to interface with a USB Hid device I've made using the HIDAPI from signal11.
Using simple buttons, I can connect, disconnect and check firmware software versions on the device.
What I want to be able to do is have the GUI automatically detect if a device is present or not, so If I unplug my device the GUI responds (Greys everything out) or re enables everything when plugged in.
Is this something that needs a never ending thread to achieve, or is there a better way? I would usually do something like this in an interrupt routine on a micro controller, but am unsure of its equivalent on the desktop platform?
USB devices connections/disconnections are not handled by wxWidgets, so you will have to use platform-specific APIs for this and they vary depending on your platform. Under Windows, you actually don't need a background thread because you get these notifications in the form of Windows WM_DEVICECHANGE message, so you can simply override MSWHandleMessage() in the window for which you had previously asked Windows to send these messages to using RegisterDeviceNotification() and handle them there.

How to remotely send keyboard events to embedded Qt Quick Application?

I have an embedded Linux 3.10.17 system running a Qt Quick 5.2.1 application. It has a graphical UI that can be controlled by plugging in a USB keyboard. What I would like to do is to control the application remotely via a remote desktop connection to a Windows PC sitting next to the embedded system. Currently any STDIO is not sent in as keyboard events to the Qt application. Three ideas came to mind
Modify Qt application to take in STDIO data so it acts on those events. I thought this would be a common thing to do, but so far my searches has not yielded any good solutions.
Create a Linux kernel driver that sends any keycodes received through a char device write (pipe) through the input subsystem. Something like this should be available I'd think...
Buy some form device that plugs into the embedded system via USB and connects to the PC via USB, RS232 or Ethernet.
I'm not sure which path offers the least resistance. Any expert advice on this would be appreciated
Thanks,
Otto

Sending touch screen events through X11

I have an embedded application which is using x11 with opengl for windowing and rendering of graphics. The device has a touch screen, which is used for application interaction. Currently, the touch screen driver is implemented in our application space and we handle the events accordingly.
However, I want that the touch events should go to the application via X11 interface.
Can anyone help me understand how this can be achieved ?
Probably the easiest way is the uinput module. This allows you to create a "virtual device" in userspace that can generate events. Those can be caught with the evdev driver by the xserver and sent to your application (o any other window).
See linux uinput: simple example?

QNX Neutrino sound card not working

I have installed QNX 6.4.0 neutrino on an unused x86 box. It's all working fine, I can run my test code on there via the network connection (qconn).
However the sound does not work. When I click the audio settings I get an error, similarly if I run my code it can't find an audio card.
I had an on-board sound card (built-in). Running io-audio, I was not able to detect it. So I went a purchased a new off the shelf PCI sound card (CMI-8738), this also failed to be recognized by QNX.
When I run "pci -vvv | less" I am able to see both audio devices are connected (and I can see in the BIOS as well).
I read somewhere that I need to get some driver called deva-ctrl-cmpci.so, but I can't find that anywhere.
What can I do?

Resources