Experiments with X

In this page we are collecting our first experiments with the graphical environment X.org

Test the framebuffer

To simply test the framebuffer before install anything try this command:

sudo sh -c "cat /dev/urandom > /dev/fb0"

You should see a random pattern of colors on the display.

Installation of X.org

To install X.org on your Acme board simply type:

sudo apt update
sudo apt -y install xorg

Now you can run it from the DPI port or a SSH session by typing:

FRAMEBUFFER=/dev/fb0 startx &

The console prompt on the display will change and the mouse point will appear. If you connect an USB port and a mouse you can proceede like a small Linux PC (without the windows manager).

I don't suggest to install any windows manager like KDE or GNOME because you don't have enough power to manage it and the user experience is the poor.

The first thind to do during the test is to disable the screen saver by typing:

~# DISPLAY=":0" xset s off

Now lets try some simple program just to see something on the scree.

A simple calculator:

~# DISPLAY=":0" xcalc
~# xeyes

Type CTRL-C to exit.

Now plug a mouse and try:

~# DISPLAY=":0" xeyes

Type CTRL-C to exit.

If you want to kill X type:

~# pkill X

Screen rotation

Create the file /etc/X11/xorg.conf with this content:

Section "Device"
    Identifier     "Frame Buffer"
    Driver         "fbdev"
    Option         "fbdev"     "/dev/fb0"
    Option         "Rotate"    "CW"
EndSection

or

    Option         "Rotate"    "CCW"

then restart X

Keyboard configuration

If you are using a Keyboard plugged in one of the board USB probably you need to set the keyboard layout. To do that type:

~# dpkg-reconfigure keyboard-configuration
~# invoke-rc.d keyboard-setup start

Another way is:

~# setxbmap -layout it

Touch screen calibration

If you are using a Debian Wheezy download xinput-calibrator from the Debian Sid repository and install in in that way:

~# wget http://ftp.lt.debian.org/debian/pool/main/x/xinput-calibrator/xinput-calibrator_0.7.5+git20140201-1_armhf.deb
~# dpkg -i xinput-calibrator_0.7.5+git20140201-1_armhf.deb

If you are using Debian Jessy install with apt-get:

~# apt-get update
~# apt-get install xinput-calibrator

Run it:

4.3 inch LCD display:

~# DISPLAY=":0" xinput_calibrator --geometry 480x272

5 or 7 LCD display:

~# DISPLAY=":0" xinput_calibrator --geometry 800x480

Create a photo frame

Create a directory for your photos:

~# mkdir myphoto
~# cd myphoto

and save on it these sample images:

800x480 images for 5 and 7 inch display:

~/myphoto# wget http://terzo.acmesystems.it/download/images-800x480.tar.gz
~/myphoto# tar -xvzf images-800x480.tar.gz

480x272 images for 4.3 inch display:

~/myphoto# wget http://terzo.acmesystems.it/download/images-480x272.tar.gz
~/myphoto# tar -xvzf images-480x272.tar.gz

Run the photo gallery using mplayer:

~/myphoto# mplayer mf://*.jpg -mf fps=0.1 -loop 0

Play a movie

Install Mplayer from the Debian repository:

~# apt-get install mplayer

Play with the Doom Arcade game

Install Chocolate Doom from the Debian repository:

~# apt-get install chocolate-doom

plug an USB PC keyboard and launch it:

~# DISPLAY=":0" /usr/games/chocolate-doom -width 320 -height 240

Disable the blank screen

export DISPLAY=:0.0
xset s off
xset s noblank
xset -dpms

View images without X

~# apt-get install fbi
~# fbi -T 1 -noverbose photo.jpg

Framebuffer info

The /sys virtual filesystem contains all information about a framebuffer device in /sys/class/graphics/.

In order to get the size, use

cat /sys/class/graphics/fb0/virtual_size