Change keyboard layout on Linux without X11 - console

I built a Yocto/Poky (zeus) minimal core image (without X11) for an embedded device and I would like to change the keyboard layout for the console. I tried the following:
$ localectl set-keymap fr
$ localectl status
System Locale: LANG=C
VC Keymap: fr
X11 Layout: fr
X11 Model: pc105
X11 Options: terminate:ctrl_alt_bksp
This did not do anything (neither on an ssh-console nor on the serial terminal). Also this did not have any effect:
$ loadkeys /usr/share/keymaps/i386/azerty/fr.map.gz
What else could I try? Or any clue what could prevent the changing of the keyboard layout?

Related

Qt Overlay over GStreamer

I've a question considering the current setup:
Yocto Linux on iMX6
Neither a window-, nor a display-manager
A fully functional Qt Application, tested on Debian 9
The application consists of 2 main elements:
A GStreamer part, with a imxg2dvideosink
A semi-transparent Qt Overlay, which should be displayed over the stream
The question:
How can I accomplish to display the overlay over the stream, while having both parts on fullscreen (filling the whole screen)? Possible solutions:
/dev/fb1 as an overlay to /dev/fb0 (How to split a single application to two fb's ?)
Use a display-manager ?
Use a window-manager ?
linuxfb instead of eglfs ?
My current (not working) solution:
Using -platform eglfs
The application will first start GStreamer, and afterwards show the overlay
I've found the solution myself. Shared below:
1) Run Qt Application on /dev/fb1:
export QT_QPA_EGLFS_FB=/dev/fb1 (Specify /dev/fb1 as eglfs framebuffer)
echo 0 > /sys/class/graphics/fb1/blank (Unblank framebuffer)
fbset -fb /dev/fb1 --geometry <your geometry here> (Set framebuffer geometry)
./YourApplication -platform eglfs (Run application)
Use a Color Key if you want full opacity while having fully transparent parts of your overlay.
2) Run GStreamer on /dev/fb0:
gst-launch-1.0 videotestsrc ! imxg2dvideosink framebuffer=/dev/fb0
This is the solution for eglfs. Other possibilities are linuxfb.

How to save fbset setting?

I am working on a embedded Linux project using Qt, when the Qt program runs, it does not sit on the middle of the 7" LCD,so I used "fbset -move -step" to move it,then it is ok.
But when the board is switched off and on again, the setting is lost, the Qt program still not sit on the middle of the LCD. I checked the etc/fb.modes, and I also modified it, but the problem still remains. Can anyone help me?
Very lucky this time, I solved the question by myself. After "fbset -move -step", I printed the current setting using "fbset" command, and then I write these setting into the /etc/fb.modes. If you want to use this setting every bootup, you should add one line in /etc/rc.local: fbset mymode (the name you set in the fb.modes).
You can output the current settings by running fbset with no arguments other than -s/--show or -fb:
# fbset
mode "1024x768-60"
# D: 65.003 MHz, H: 48.365 kHz, V: 60.006 Hz
geometry 1024 768 1024 768 16
timings 15384 160 24 29 3 136 6
hsync high
vsync high
rgba 5/11,6/5,5/0,0/0
endmode
And you can write that into a file:
fbset >>/etc/local.fb.modes
Edit to rename the mode, add any comments you want; you can then use your new file with the -db argument:
fbset -db /etc/local.fb.modes --all "1024x768-60"
You can put that command into your /etc/rc.local to take effect every boot.
Tip: if setting mode in /etc/rc.local fails with:
systemctl status rc-local.service -l
"open /dev/fb0: No such file or directory"
Then simply run "fbset" 1st before setting mode:
/etc/rc.local
fbset
fbset -g 800 600 800 600 32
Had this problem in VMWare..

RStudio HiDPI support

RStudio is great IDE for R development. I wonder if there is any way for nice support HiDPI resolution?
I currently have 13 inch display and 3200x1800 resolution, it is even hard to read RStudio options to adjust more appropriate setting.
This is of course not an RStudio issue but general issue related to high resolution display which requires HiDPI support to make it reasonably usable.
Posting it here as question because RStudio still doesn't allow to fill questions/issues on github.
RStudio is a Qt application. I've solved this by setting a scaling factor in Qt with this environment variable (note it must be an integer):
export QT_DEVICE_PIXEL_RATIO=2
The Arch wiki has some excellent advice on getting HiDPI working.
UPDATE: This solution is only for WINDOWS!
There is a simple solution for you, it comes from the option "Compatibility" of the execute file.
Close all current RStudio windows.
Right click on the shortcut of RStudio (or the original exe file) and choose Properties
In the RStudio Properties pop-up windows, choose the tab Compatibility
Tick on option Override hide DPI scaling... and then choose System from the drop-down list.
Apply > OK.
(Re)open Rstudio to see the change
Note that, on the HiDPI screen, resolution of modified RStudio is not so good but it really solved the bad scale problem.
You can also apply this technique to other apps without supporting HiDPI.
I use the following bash script to determine the current screen resolution and substitute the scaling factor by 1 (normal resolution) or 1.75 (high resolution) in the RStudio desktop file:
#!/bin/bash
# Determine resolution
width=$(xdpyinfo | grep 'dimensions:' | grep -o -E '[0-9]+' | head -1 | sed -e 's/^0\+//')
echo "Screen width is $width pixels"
if [ $width -gt 3000 ]; then
echo "High resolution detected -> setting zoom level to 1.75"
sed -i 's/view.zoomLevel.*/view.zoomLevel=1.75/' ~/.config/RStudio/desktop.ini
else
echo "Normal resolution detected -> setting zoom level to 1.0"
sed -i 's/view.zoomLevel.*/view.zoomLevel=1/' ~/.config/RStudio/desktop.ini
fi
QT_QPA_PLATFORMTHEME=gtk2 /usr/lib/rstudio/bin/rstudio %F
I am on Ubuntu 17.10. If I want to use the GTK theme, I have to set the QT_QPA_PLATFORMTHEME environment variable.

How to exchange the width and height of W35 Touchscreen for Mini2440 FriendlyARM embedded board

I have a Friendly-ARM embedded board with a W35 3.5" Touchscreen. You can see the board via the following link: http://www.friendlyarm.net/sites/products/mini2440-35s.jpg. Also I write QT program for that using Qt Creator. I have to write a GUI using QT with Width x Height = 240 x 320. I mean width = 240 and height = 320. According to what I found at various online documents and pages, the dimensions of W35 are 320 x 240, it means width = 320 and height = 320. So when I run the program, there are large margins at left and right and some part of GUI is cut at top and button. How do I exchange the board width and height?
The closest page I found on Friendly-ARM site is: http://www.friendlyarm.net/forum/topic/2881.
At this page someone mentioned, there is a file s3c2410.c at drivers/video directory, or there is file mach-mini2440.c at arch/arm/mach-s3c2440 directory and we should tweak some C #define, but I don't have neither one on the board kernel. What should I do?
1) Reinstalling the Kernel?
2) Writing program for 320 x 240 instead of 240 x 320
3) Changing the touchscreen to similar ones like X35 or T35
FYI, when the board starts up, there is Qtopia with right dimensions.
TIA,
-- Saeed Amrollahi Boyouki
First of all cross-compile your Qt with -qt-gfx-transformed option.
Method 1:
You can rotate your Qt Application using
./myApp -qws -display ":Transformed:Rot90:0"
Method 2:
You can set Display Dimension using
export QWS_DISPLAY=Transformed:Rot90:0
and start your application using
./myApp -qws
What you need to look for are instructions to rotate the display from "landscape" mode to "portrait" mode. I am unsure if there is a hardware option on the ARM processor included in the FriendlyArm, but that gives you a place to start searching. I'd also look in the Qtopia forums for a similar switch, ie http://qt-project.org/forums/viewthread/8875 or similar.

How to enable Linux penguin logo on Android?

TI OMAP 4460 + Android file system + Android Linux kernel 3.0
I have set CONFIG_LOGO, CONFIG_VT and CONFIG_FRAMEBUFFER_CONSOLE in kernel config, logo image type is CLUT224.
Then I saw strange things, almost 10 seconds later after kernel booting, a broken image appeared, looked like the head of the penguin, only several pixels of lines on the top of sreen. Then I reboot again and agian, sometimes I saw the 'ANDROID' characters, just below the penguin's head, but sometimes not.
see the linkenter link description here
My colleague reminded me I should disable the Android booting logo('ANDROID' characters, to be exactly), because it needs to open a tty console. That might have effect on something?
Besides, why the penguin logo showed up so late? I added some print in drivers/video/fbmem.c
fb_do_show_logo(), this function was called at 3 seconds after kernel booting. Why I saw the logo at 10 seconds?

Resources