No categories assigned

Operating System installation

Revision as of 20:52, 16 April 2022 by B.Naegele (talk | contribs) (Screen rotation)

> Main Page > Piano Expander based on Pianoteq and Odroid-N2


Contents

Ubuntu 20.04

Kernel-Version

root@odroid:~# cat /proc/version 
Linux version 4.9.277-122 (root@builder_n2) (gcc version 7.5.0 (Ubuntu/Linaro 7.5.0-6ubuntu2) ) #1 
SMP PREEMPT Mon Feb 28 14:30:14 UTC 2022

Installation of the base-system

  • The installation of the operating system is pretty easy when you are using the Linux distributions which are supported by "Hardkernel".
  • The new Operating-System which I have used is the ubuntu-20.04-4.9-mate-odroid-n2-20220228.img.xz . Download the Image from the Release Note of Ubuntu MATE 20.04.4 LTS (v3.3)-Web-Page or directly from here
  • The new Operating-System which I have used is the ubuntu-20.04-4.9-minimal-odroid-n2-20220228.img.xz . Download the Image from the Release Note of Ubuntu Minimal 20.04.4 LTS (v3.3)-Web-Page or directly from here
  • A guideline for installing the Image (Hardkernel) can be found here

Programm the downloaded image to eMMC

  • use a Windows-PC + Balena Etcher to burn the Image onto the eMMC

enable root-login to network ssh-login

  • edit the file /etc/ssh/sshd_config on the eMMC
PermitRootLogin yes

copy new kernel, FDT-Files, modules and firmware to the eMMC

  • replace original Image.gz with the new compiled one on BOOT-Partition
  • copy device-tree-files to BOOT/amlogic and device-tree-overlay files to "BOOT/amlogic/odroidn2
  • copy modules to directory lib/modules
  • copy firmware to directory lib

FIRST STARTUP

  • put the eMMC on your Odroid-N2, connect Ethernet the the RJ45 connector and power-on the module

(optional) update system

apt update
apt list --upgradable

(optional) Install some tools

mc

apt install mc

vim

apt install vim

install desktop-environment Cinnamon

sudo apt install cinnamon-desktop-environment

installs full Cinnamon with all bells and whistles.

Other packages are available if you want to try a more minimal environments:

sudo apt install cinnamon #minimal

OR

sudo apt install cinnamon-core #essentials  -> my choice

User pianoteq anlegen

useradd -s /bin/bash -d /home/pianoteq/ -m -G sudo pianoteq

Enable Auto-Login

[SeatDefaults]
greeter-session=lightdm-gtk-greeter
autologin-user=pianoteq

Change Cinnamon/Mate-Keymap

  • Connect a Keyboard to one of the USB-Ports and a Mouse to another one.
  • Goto "Menu -> Preferences -> Keyboard"
  • On the Tab "Layouts" you can choose the right one

(optional) Install mplayer

apt install mplayer

Performance configuration

  • Edit config.ini file and add max. frequencies for A53 and A73 cores
...

; Maximum CPU frequency of ARM A73
; N2: 500/667/1000/1200/1398/1512/1608/1704/1800 (Stock)/1908/2004
; N2 Plus: 500/667/1000/1200/1398/1512/1608/1704/1800/1908/2016/2100/2208 (Stock)/2304/2400
max_freq_a73=1800

; Maximum CPU frequency of ARM A53
; N2: 100/250/500/667/1000/1200/1398/1512/1608/1704/1896 (Stock)/1992
; N2 Plus: 500/667/1000/1200/1398/1512/1608/1704/1800/1908 (Stock)/2016
max_freq_a53=1896

...

Frequency-Scaling

Dynamic CPU frequency scaling (also known as CPU throttling) is a technique in computer architecture where a processor is run at a less-than-maximum frequency in order to conserve power.

Here is a setup process using “cpufrequtils”.

1. Install "cpufrequtils"

sudo apt-get install cpufrequtils

2. Set governor and cpu speed You need to create /etc/default/cpufrequtils file and fill it as the following format.

sudo vi /etc/default/cpufrequtils
    ENABLE="true"
    GOVERNOR="performance"
    MAX_SPEED=1536000
    MIN_SPEED=100000

You can check the available list of governor and cpu speed under those nodes.

cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors
cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequencies
  • especially for N2

Available governor and cpu frequency sets

$ cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors 
ondemand powersave userspace conservative interactive performance schedutil 
$ cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequencies 
100000 250000 500000 667000 1000000 1200000 1398000 1512000 1608000 1704000 1896000
 
$ cat /sys/devices/system/cpu/cpufreq/policy2/scaling_available_frequencies                                                          
100000 250000 500000 667000 1000000 1200000 1398000 1512000 1608000 1704000 1800000 

cpufrequtils option

$ sudo vi /etc/default/cpufrequtils
 
ENABLE="true"
GOVERNOR="ondemand"

cpufreq-info

$ sudo service cpufrequtils restart
 
$ cpufreq-info -o
          minimum CPU frequency  -  maximum CPU frequency  -  governor
CPU  0       100000 kHz (  5 %)  -    1896000 kHz (100 %)  -  ondemand
CPU  1       100000 kHz (  5 %)  -    1896000 kHz (100 %)  -  ondemand
CPU  2       100000 kHz (  5 %)  -    1800000 kHz (100 %)  -  ondemand
CPU  3       100000 kHz (  5 %)  -    1800000 kHz (100 %)  -  ondemand
CPU  4       100000 kHz (  5 %)  -    1800000 kHz (100 %)  -  ondemand
CPU  5       100000 kHz (  5 %)  -    1800000 kHz (100 %)  -  ondemand

3. Restart cpufrequtils service Restart cpufrequtils service.

sudo service cpufrequtils restart

Then, you can check the cpufreq info is updated.

$ cpufreq-info -o
          minimum CPU frequency  -  maximum CPU frequency  -  governor
CPU  0       100000 kHz (  6 %)  -    1536000 kHz (100 %)  -  ondemand
CPU  1       100000 kHz (  6 %)  -    1536000 kHz (100 %)  -  ondemand
CPU  2       100000 kHz (  6 %)  -    1536000 kHz (100 %)  -  ondemand
CPU  3       100000 kHz (  6 %)  -    1536000 kHz (100 %)  -  ondemand

4. [Option] Ubuntu 18.04 - Disable ondemand.service using systemctl In case of Ubuntu 18.04, ondemand.service overrides the default governor, so you should disable it to use cpufrequtils.

 sudo systemctl disable ondemand

If you want to restore this service as default, please use this command.

sudo systemctl enable ondemand

Optional: Install and configure WiFi-Network

Optional: Install VIM as a good commandline editor

  • In case that you have a valid network connection you can easily install the full-featured editor "VIM" by typing the following command on the console
sudo apt install vim

-> enter the password for the root-user (default: odroid) and accept that a small amount of memory is used for the installation  

Deactivate Screensaver

  • Drop down the Mate-Menu
  • Go to "Preferences -> Screensaver"
  • Deactivate the Check-Box "Activate screensaver when computer is idle"
  • In the same window press the Button "Power-Management" select "Never" for the question "Put display to sleep when inactive for:"

Optional: Gnome-Screenshot

  • If you want to make screenshots e.g. for documentation purposes you can add the tool "Gnome-Screenshot" with the following commands:
apt install gnome-screenshot

Rotating the Touch-Display

Articles regarding Display and Touch Rotation

Screen rotation

cd /usr/share/X11
mkdir xorg.conf.d
cd xorg.conf.d
vi 99-odroidn2.conf

insert the following content into this file:

# This is a minimal sample config file, which can be copied to
# /etc/X11/xorg.conf in order to make the Xorg server pick up
# and load xf86-video-fbturbo driver installed in the system.
#
# When troubleshooting, check /var/log/Xorg.0.log for the debugging
# output and error messages.
#
# Run "man fbturbo" to get additional information about the extra
# configuration options for tuning the driver.

Section "Device"
        Identifier      "FBTURBO"
        Driver          "fbturbo"
        Option          "fbdev" "/dev/fb0"
        Option          "Rotate" "CW"
        Option          "SwapbuffersWait" "true"
        Option          "alpha_swap" "true"
EndSection

  • Ausgabe von /var/log/Xorg.0.log
root@odroid:~# cat /var/log/Xorg.0.log
[    14.551] 
X.Org X Server 1.20.13
X Protocol Version 11, Revision 0
[    14.551] Build Operating System: linux Ubuntu
[    14.551] Current Operating System: Linux odroid 4.9.277-122 #1 SMP PREEMPT Mon Feb 28 14:30:14 UTC 2022 aarch64
[    14.551] Kernel command line: root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait rw console=ttyS0,115200n8  no_console_suspend fsck.repair=yes net.ifnames=0 elevator=noop hdmimode=custombuilt cvbsmode=576cvbs max_freq_a53=1896 max_freq_a73=1800 maxcpus=6 voutmode=dvi modeline=1280,800,75000,49472,60,1280,1344,1392,1516,800,805,812,824,1,0,1 disablehpd=false cvbscable= overscan=100  monitor_onoff=false logo=osd0,loaded hdmitx=cec3f sdrmode=auto consoleblank=0 enable_wol=0
[    14.551] Build Date: 14 December 2021  02:14:13PM
[    14.551] xorg-server 2:1.20.13-1ubuntu1~20.04.2 (For technical support please see http://www.ubuntu.com/support) 
[    14.551] Current version of pixman: 0.38.4
[    14.551] 	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
[    14.551] Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    14.551] (==) Log file: "/var/log/Xorg.0.log", Time: Sun Apr  3 10:50:27 2022
[    14.552] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[    14.553] (==) No Layout section.  Using the first Screen section.
[    14.553] (==) No screen section available. Using defaults.
[    14.553] (**) |-->Screen "Default Screen Section" (0)
[    14.553] (**) |   |-->Monitor "<default monitor>"
[    14.555] (==) No device specified for screen "Default Screen Section".
	Using the first device section listed.
[    14.555] (**) |   |-->Device "FBTURBO"
[    14.555] (==) No monitor specified for screen "Default Screen Section".
	Using a default monitor configuration.
[    14.555] (==) Automatically adding devices
[    14.555] (==) Automatically enabling devices
[    14.555] (==) Automatically adding GPU devices
[    14.555] (==) Automatically binding GPU devices
[    14.555] (==) Max clients allowed: 256, resource mask: 0x1fffff
[    14.561] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[    14.561] 	Entry deleted from font path.
[    14.561] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist.
[    14.561] 	Entry deleted from font path.
[    14.561] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.
[    14.561] 	Entry deleted from font path.
[    14.562] (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist.
[    14.562] 	Entry deleted from font path.
[    14.562] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.
[    14.562] 	Entry deleted from font path.
[    14.562] (==) FontPath set to:
	/usr/share/fonts/X11/misc,
	/usr/share/fonts/X11/Type1,
	built-ins
[    14.562] (==) ModulePath set to "/usr/lib/xorg/modules"
[    14.562] (II) The server relies on udev to provide the list of input devices.
	If no devices become available, reconfigure udev or disable AutoAddDevices.
[    14.562] (II) Loader magic: 0x555d833010
[    14.562] (II) Module ABI versions:
[    14.562] 	X.Org ANSI C Emulation: 0.4
[    14.562] 	X.Org Video Driver: 24.1
[    14.562] 	X.Org XInput driver : 24.1
[    14.562] 	X.Org Server Extension : 10.0
[    14.563] (++) using VT number 7

[    14.563] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[    14.564] (II) no primary bus or device found
[    14.564] (II) LoadModule: "glx"
[    14.569] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[    14.584] (II) Module glx: vendor="X.Org Foundation"
[    14.584] 	compiled for 1.20.13, module version = 1.0.0
[    14.584] 	ABI class: X.Org Server Extension, version 10.0
[    14.584] (II) LoadModule: "fbturbo"
[    14.585] (II) Loading /usr/lib/xorg/modules/drivers/fbturbo_drv.so
[    14.586] (II) Module fbturbo: vendor="X.Org Foundation"
[    14.587] 	compiled for 1.20.8, module version = 0.5.1
[    14.587] 	Module class: X.Org Video Driver
[    14.587] 	ABI class: X.Org Video Driver, version 24.1
[    14.587] (II) FBTURBO: driver for framebuffer: fbturbo
[    14.595] (WW) Falling back to old probe method for fbturbo
[    14.595] (II) Loading sub module "fbdevhw"
[    14.595] (II) LoadModule: "fbdevhw"
[    14.595] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[    14.597] (II) Module fbdevhw: vendor="X.Org Foundation"
[    14.597] 	compiled for 1.20.13, module version = 0.0.2
[    14.597] 	ABI class: X.Org Video Driver, version 24.1
[    14.597] (II) FBTURBO(0): using /dev/fb0
[    14.597] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[    14.597] (II) FBTURBO(0): Meson OSD alpha swap enabled
[    14.597] (II) FBTURBO(0): Creating default Display subsection in Screen section
	"Default Screen Section" for depth/fbbpp 24/32
[    14.597] (==) FBTURBO(0): Depth 24, (==) framebuffer bpp 32
[    14.597] (==) FBTURBO(0): RGB weight 888
[    14.597] (==) FBTURBO(0): Default visual is TrueColor
[    14.597] (==) FBTURBO(0): Using gamma correction (1.0, 1.0, 1.0)
[    14.597] (II) FBTURBO(0): hardware: OSD FB (video memory: 77312kB)
[    14.597] (DB) xf86MergeOutputClassOptions unsupported bus type 0
[    14.598] (**) FBTURBO(0): Option "fbdev" "/dev/fb0"
[    14.598] (**) FBTURBO(0): Option "alpha_swap" "true"
[    14.598] (**) FBTURBO(0): Option "SwapbuffersWait" "true"
[    14.598] (II) FBTURBO(0): processor: Unknown
[    14.598] (II) FBTURBO(0): checking modes against framebuffer device...
[    14.598] (II) FBTURBO(0): checking modes against monitor...
[    14.598] (II) FBTURBO(0): Virtual size is 1280x800 (pitch 1280)
[    14.598] (**) FBTURBO(0):  Built-in mode "current"
[    14.598] (==) FBTURBO(0): DPI set to (96, 96)
[    14.598] (II) Loading sub module "fb"
[    14.598] (II) LoadModule: "fb"
[    14.598] (II) Loading /usr/lib/xorg/modules/libfb.so
[    14.600] (II) Module fb: vendor="X.Org Foundation"
[    14.600] 	compiled for 1.20.13, module version = 1.0.0
[    14.600] 	ABI class: X.Org ANSI C Emulation, version 0.4
[    14.636] (II) FBTURBO(0): using backing store heuristics
[    14.642] (II) FBTURBO(0): enabled VFP/NEON optimizations
[    14.642] (==) FBTURBO(0): Backing store enabled
[    14.644] (==) FBTURBO(0): DPMS enabled
[    14.644] (II) FBTURBO(0): no 3D acceleration because the driver has been compiled without libUMP
[    14.644] (II) FBTURBO(0): if this is wrong and needs to be fixed, please check ./configure log
[    14.644] (II) Initializing extension Generic Event Extension
[    14.645] (II) Initializing extension SHAPE
[    14.645] (II) Initializing extension MIT-SHM
[    14.645] (II) Initializing extension XInputExtension
[    14.646] (II) Initializing extension XTEST
[    14.646] (II) Initializing extension BIG-REQUESTS
[    14.646] (II) Initializing extension SYNC
[    14.647] (II) Initializing extension XKEYBOARD
[    14.647] (II) Initializing extension XC-MISC
[    14.647] (II) Initializing extension SECURITY
[    14.647] (II) Initializing extension XFIXES
[    14.647] (II) Initializing extension RENDER
[    14.648] (II) Initializing extension RANDR
[    14.648] (II) Initializing extension COMPOSITE
[    14.649] (II) Initializing extension DAMAGE
[    14.649] (II) Initializing extension MIT-SCREEN-SAVER
[    14.649] (II) Initializing extension DOUBLE-BUFFER
[    14.649] (II) Initializing extension RECORD
[    14.650] (II) Initializing extension DPMS
[    14.650] (II) Initializing extension Present
[    14.650] (II) Initializing extension DRI3
[    14.650] (II) Initializing extension X-Resource
[    14.650] (II) Initializing extension XVideo
[    14.650] (II) Initializing extension XVideo-MotionCompensation
[    14.650] (II) Initializing extension SELinux
[    14.650] (II) SELinux: Disabled on system
[    14.650] (II) Initializing extension GLX
[    14.651] (II) AIGLX: Screen 0 is not DRI2 capable
[    14.986] (II) IGLX: Loaded and initialized swrast
[    14.986] (II) GLX: Initialized DRISWRAST GL provider for screen 0
[    14.986] (II) Initializing extension XFree86-VidModeExtension
[    14.986] (II) Initializing extension XFree86-DGA
[    14.986] (II) Initializing extension XFree86-DRI
[    14.987] (II) Initializing extension DRI2
[    15.055] (II) config/udev: Adding input device WaveShare WS170120 (/dev/input/event5)
[    15.055] (**) WaveShare WS170120: Applying InputClass "libinput touchscreen catchall"
[    15.055] (II) LoadModule: "libinput"
[    15.055] (II) Loading /usr/lib/xorg/modules/input/libinput_drv.so
[    15.061] (II) Module libinput: vendor="X.Org Foundation"
[    15.061] 	compiled for 1.20.4, module version = 0.29.0
[    15.061] 	Module class: X.Org XInput Driver
[    15.061] 	ABI class: X.Org XInput driver, version 24.1
[    15.061] (II) Using input driver 'libinput' for 'WaveShare WS170120'
[    15.061] (**) WaveShare WS170120: always reports core events
[    15.061] (**) Option "Device" "/dev/input/event5"
[    15.061] (**) Option "_source" "server/udev"
[    15.126] (II) event5  - WaveShare WS170120: is tagged by udev as: Touchscreen
[    15.126] (II) event5  - WaveShare WS170120: device is a touch device
[    15.127] (II) event5  - WaveShare WS170120: device removed
[    15.176] (**) Option "config_info" "udev:/sys/devices/platform/ff500000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.1/1-1.1:1.0/0003:0EEF:0005.0001/input/input5/event5"
[    15.176] (II) XINPUT: Adding extended input device "WaveShare WS170120" (type: TOUCHSCREEN, id 6)
[    15.176] (**) Option "AccelerationScheme" "none"
[    15.176] (**) WaveShare WS170120: (accel) selected scheme none/0
[    15.176] (**) WaveShare WS170120: (accel) acceleration factor: 2.000
[    15.176] (**) WaveShare WS170120: (accel) acceleration threshold: 4
[    15.239] (II) event5  - WaveShare WS170120: is tagged by udev as: Touchscreen
[    15.239] (II) event5  - WaveShare WS170120: device is a touch device
[    15.241] (II) config/udev: Adding input device WaveShare WS170120 (/dev/input/mouse2)
[    15.241] (II) No input driver specified, ignoring this device.
[    15.241] (II) This device may have been added with another device file.
[    15.242] (II) config/udev: Adding input device Logitech M570 (/dev/input/event3)
[    15.242] (**) Logitech M570: Applying InputClass "libinput pointer catchall"
[    15.242] (II) Using input driver 'libinput' for 'Logitech M570'
[    15.242] (**) Logitech M570: always reports core events
[    15.242] (**) Option "Device" "/dev/input/event3"
[    15.242] (**) Option "_source" "server/udev"
[    15.245] (II) event3  - Logitech M570: is tagged by udev as: Mouse Trackball
[    15.245] (II) event3  - Logitech M570: device set to 540 DPI
[    15.245] (II) event3  - Logitech M570: device is a pointer
[    15.245] (II) event3  - Logitech M570: device removed
[    15.288] (**) Option "config_info" "udev:/sys/devices/platform/ff500000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.2/1-1.2:1.2/0003:046D:C52B.0004/0003:046D:1028.0007/input/input3/event3"
[    15.288] (II) XINPUT: Adding extended input device "Logitech M570" (type: MOUSE, id 7)
[    15.288] (**) Option "AccelerationScheme" "none"
[    15.288] (**) Logitech M570: (accel) selected scheme none/0
[    15.288] (**) Logitech M570: (accel) acceleration factor: 2.000
[    15.288] (**) Logitech M570: (accel) acceleration threshold: 4
[    15.291] (II) event3  - Logitech M570: is tagged by udev as: Mouse Trackball
[    15.291] (II) event3  - Logitech M570: device set to 540 DPI
[    15.291] (II) event3  - Logitech M570: device is a pointer
[    15.292] (II) config/udev: Adding input device Logitech M570 (/dev/input/mouse0)
[    15.293] (II) No input driver specified, ignoring this device.
[    15.293] (II) This device may have been added with another device file.
[    15.294] (II) config/udev: Adding input device Logitech M570 (/dev/input/event4)
[    15.294] (**) Logitech M570: Applying InputClass "libinput pointer catchall"
[    15.294] (II) Using input driver 'libinput' for 'Logitech M570'
[    15.294] (**) Logitech M570: always reports core events
[    15.294] (**) Option "Device" "/dev/input/event4"
[    15.294] (**) Option "_source" "server/udev"
[    15.297] (II) event4  - Logitech M570: is tagged by udev as: Mouse Trackball
[    15.297] (II) event4  - Logitech M570: device set to 540 DPI
[    15.297] (II) event4  - Logitech M570: device is a pointer
[    15.297] (II) event4  - Logitech M570: device removed
[    15.340] (**) Option "config_info" "udev:/sys/devices/platform/ff500000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.2/1-1.2:1.2/0003:046D:C52B.0004/0003:046D:1028.0008/input/input4/event4"
[    15.340] (II) XINPUT: Adding extended input device "Logitech M570" (type: MOUSE, id 8)
[    15.340] (**) Option "AccelerationScheme" "none"
[    15.340] (**) Logitech M570: (accel) selected scheme none/0
[    15.340] (**) Logitech M570: (accel) acceleration factor: 2.000
[    15.340] (**) Logitech M570: (accel) acceleration threshold: 4
[    15.342] (II) event4  - Logitech M570: is tagged by udev as: Mouse Trackball
[    15.342] (II) event4  - Logitech M570: device set to 540 DPI
[    15.342] (II) event4  - Logitech M570: device is a pointer
[    15.344] (II) config/udev: Adding input device Logitech M570 (/dev/input/mouse1)
[    15.344] (II) No input driver specified, ignoring this device.
[    15.344] (II) This device may have been added with another device file.
[    15.345] (II) config/udev: Adding input device HID 046a:002b (/dev/input/event1)
[    15.345] (**) HID 046a:002b: Applying InputClass "libinput keyboard catchall"
[    15.345] (II) Using input driver 'libinput' for 'HID 046a:002b'
[    15.345] (**) HID 046a:002b: always reports core events
[    15.345] (**) Option "Device" "/dev/input/event1"
[    15.345] (**) Option "_source" "server/udev"
[    15.348] (II) event1  - HID 046a:002b: is tagged by udev as: Keyboard
[    15.348] (II) event1  - HID 046a:002b: device is a keyboard
[    15.348] (II) event1  - HID 046a:002b: device removed
[    15.380] (**) Option "config_info" "udev:/sys/devices/platform/ff500000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.3/1-1.3:1.0/0003:046A:002B.0005/input/input1/event1"
[    15.380] (II) XINPUT: Adding extended input device "HID 046a:002b" (type: KEYBOARD, id 9)
[    15.380] (**) Option "xkb_model" "pc105"
[    15.380] (**) Option "xkb_layout" "us"
[    15.385] (II) event1  - HID 046a:002b: is tagged by udev as: Keyboard
[    15.385] (II) event1  - HID 046a:002b: device is a keyboard
[    15.389] (II) config/udev: Adding input device HID 046a:002b (/dev/input/event2)
[    15.389] (**) HID 046a:002b: Applying InputClass "libinput keyboard catchall"
[    15.389] (II) Using input driver 'libinput' for 'HID 046a:002b'
[    15.389] (**) HID 046a:002b: always reports core events
[    15.389] (**) Option "Device" "/dev/input/event2"
[    15.389] (**) Option "_source" "server/udev"
[    15.394] (II) event2  - HID 046a:002b: is tagged by udev as: Keyboard
[    15.394] (II) event2  - HID 046a:002b: device is a keyboard
[    15.395] (II) event2  - HID 046a:002b: device removed
[    15.412] (II) libinput: HID 046a:002b: needs a virtual subdevice
[    15.412] (**) Option "config_info" "udev:/sys/devices/platform/ff500000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.3/1-1.3:1.1/0003:046A:002B.0006/input/input2/event2"
[    15.412] (II) XINPUT: Adding extended input device "HID 046a:002b" (type: MOUSE, id 10)
[    15.412] (**) Option "AccelerationScheme" "none"
[    15.412] (**) HID 046a:002b: (accel) selected scheme none/0
[    15.412] (**) HID 046a:002b: (accel) acceleration factor: 2.000
[    15.412] (**) HID 046a:002b: (accel) acceleration threshold: 4
[    15.417] (II) event2  - HID 046a:002b: is tagged by udev as: Keyboard
[    15.417] (II) event2  - HID 046a:002b: device is a keyboard
[    15.419] (II) config/udev: Adding input device cec_input (/dev/input/event0)
[    15.419] (**) cec_input: Applying InputClass "libinput keyboard catchall"
[    15.419] (II) Using input driver 'libinput' for 'cec_input'
[    15.419] (**) cec_input: always reports core events
[    15.419] (**) Option "Device" "/dev/input/event0"
[    15.419] (**) Option "_source" "server/udev"
[    15.421] (II) event0  - cec_input: is tagged by udev as: Keyboard
[    15.421] (II) event0  - cec_input: device is a keyboard
[    15.421] (II) event0  - cec_input: device removed
[    15.440] (**) Option "config_info" "udev:/sys/devices/virtual/input/input0/event0"
[    15.440] (II) XINPUT: Adding extended input device "cec_input" (type: KEYBOARD, id 11)
[    15.440] (**) Option "xkb_model" "pc105"
[    15.440] (**) Option "xkb_layout" "us"
[    15.442] (II) event0  - cec_input: is tagged by udev as: Keyboard
[    15.442] (II) event0  - cec_input: device is a keyboard
[    15.466] (**) HID 046a:002b: Applying InputClass "libinput keyboard catchall"
[    15.467] (II) Using input driver 'libinput' for 'HID 046a:002b'
[    15.467] (**) HID 046a:002b: always reports core events
[    15.467] (**) Option "Device" "/dev/input/event2"
[    15.467] (**) Option "_source" "_driver/libinput"
[    15.467] (II) libinput: HID 046a:002b: is a virtual subdevice
[    15.467] (**) Option "config_info" "udev:/sys/devices/platform/ff500000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.3/1-1.3:1.1/0003:046A:002B.0006/input/input2/event2"
[    15.467] (II) XINPUT: Adding extended input device "HID 046a:002b" (type: KEYBOARD, id 12)
[    15.467] (**) Option "xkb_model" "pc105"
[    15.467] (**) Option "xkb_layout" "us"
root@odroid:~# 

Touch rotation

Depending  on  how  you  want  to rotate  the  display, you  must  enter  the following values :
90°-Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1"
180°-Option "CalibrationMatrix" "-1 0 1 0 -1 1 0 0 1"
270°-Option "CalibrationMatrix" "0 -1 1 1 0 0 0 0 1"

Enabling the On-Screen-Keyboard

  • In applications, where you don't want to use an external keyboard you have the possibility to use an "On-Screen-Keyboard" which could be controlled via the Touch-Screen.

Switch-On the On-Screen-Keyboard on Ubuntu-Mate

  • On Ubuntu-Mate the On-Screen-Keyboard is already installed. You can find it in the ‘Universal Access’ menu. In this menu you find the application "Onboard" -> a click on this menu-point activates the On-Screen-Keyboard.

Adding support for ARM 32-bit code execution

odroid64:$ sudo dpkg --add-architecture armhf

odroid64:$ sudo apt-get update

apt install libc6:armhf

apt install libx11-6:armhf

apt install libfreetype6:armhf

apt install libxext6:armhf

apt install libasound2:armhf

Changing FDT (Flattened Device Tree) to support second UART-Interface for MIDI

Installation of the device tree compiler (dtc)

$ apt install device-tree-compiler

check if second UART is allready enabled

fdtget /media/boot/meson64_odroidn2.dtb /serial@ffd24000 status
 
# returns
disabled
  • "disabled" means that the second native uart is disabled

enabling the second UART

vor UBUNTU 20.04

$ fdtput -t s /media/boot/meson64_odroidn2.dtb /serial@ffd24000 status "okay"
$ fdtget /media/boot/meson64_odroidn2.dtb /serial@ffd24000 status
 
# returns
okay

reboot
  • After the reboot you can list the available UARTs by typing the following command
ls -al /dev/ttyS?
 
# returns
crw--w---- 1 root tty     238, 0 May 28 18:36 /dev/ttyS0
crw-rw---- 1 root dialout 238, 1 Jan 29  2018 /dev/ttyS1
  • Two UARTs are available - /dev/ttyS0 for console usage and /dev/ttyS1 which we will use for MIDI

mit UBUNTU > 20.04

  • mount /boot partition
mount /dev/mmcblk0p1 /mnt
  • edit config.ini file for adding uart1
...

; Device Tree Overlay
overlay_resize=16384
overlay_profile=
overlays="spi0 i2c0 i2c1 uart0 uart1"

...

Enabling 31250 UART-Baud-Rate for Midi-Usage

  • The baud-rate 31250 which is used for MIDI-traffic is normally NOT supported on standard UART drivers.
  • We have to tweek the UART-Kernel-driver for supporting this baud rate. This sounds like a complicated action, but it isn't really complicated - take a look on this article in the Odroid-Magazine -> ODROID-N2 UART Custom Baud Rate for MIDI
linux/drivers/amlogic/uart/meson_uart.c

static void meson_uart_change_speed(struct uart_port *port, unsigned long baud)
{
u32 val;
struct meson_uart_port *mup = to_meson_port(port);
struct platform_device *pdev = to_platform_device(port->dev);

while (!(readl(port->membase + AML_UART_STATUS) & AML_UART_TX_EMPTY))
cpu_relax();

#ifdef UART_TEST_DEBUG
if (port->line != 0)
baud = 115200;
#endif

// this part is added.
// trace_printk() is not neccesarry, it is just for debugging.
trace_printk("Your baudrate: %ld\n", baud);
if(baud == 38400)
{
baud = 31250;
trace_printk("Change to %ld\n", baud);
}

Cross-Compiling or compiling the Kernel natively (on the Odroid-N2 itself)

  • You have the possibility to compile the Kernel external (e.g. on your Desktop-PC/Laptop) where you have to install the Cross-Compiler-Toolchain and the other build utilities) or directly on the Odroid itself.
  • I am a fan of doing it directly on the Odroid-N2 itself. Therefore I describe this procedure first.

compiling the Kernel natively on the Odroid-N2

getting the Kernel-Sources

  • changing the user to be "root"
$ sudo su
--> enter your root password

Attention: Be careful - the root-user can do really everything on the system - also damaging the running OS

  • going to the directory where you want to build the kernel
$ cd /usr/src/
  • install the source code version control system software "git":
$ apt install git
  • going into the kernel-root-path
$ cd /usr/src/linux/
  • getting the kernel-sources (cloning) from github:
$ git clone --depth 1 https://github.com/hardkernel/linux.git -b odroidg12-4.9.y

configuring the kernel

  • configuring the base configuration of the kernel
$ make odroidg12_defconfig
  • edit the uart-driver with an editor of your choice - for me it's the editor "vi" -> $ vi /usr/src/linux/drivers/amlogic/uart/meson_uart.c
  • alter there the function meson_uart_change_speed to the following:
static void meson_uart_change_speed(struct uart_port *port, unsigned long baud)
{
        u32 val;
        struct meson_uart_port *mup = to_meson_port(port);
        struct platform_device *pdev = to_platform_device(port->dev);

        while (!(readl(port->membase + AML_UART_STATUS) & AML_UART_TX_EMPTY))
                cpu_relax();

#ifdef UART_TEST_DEBUG
        if (port->line != 0)
                baud = 115200;
#endif

// this part is added.
// trace_printk() is not neccesarry, it is just for debugging.
        trace_printk("Your baudrate: %ld\n", baud);
        if(baud == 38400)
        {
                baud = 31250;
                trace_printk("Change to %ld\n", baud);
        }
  • save your file!

additional kernel-config

  • if you want to add other stuff to the kernel config you can do this by using the command "make menuconfig"
  • if "make menuconfig" could not be startet because auf missing curses-support you have to install the libncurses-dev package
$ apt install libncurses-dev

$ make menuconfig

compiling the kernel

$ make -j7

install kernel-modules

$ make modules_install

install new kernel and the new flattened device tree

$ cp -f arch/arm64/boot/Image.gz arch/arm64/boot/dts/amlogic/meson64_odroidn2.dtb /media/boot/
$ sync
$ reboot


make a MIDI device out of the ttyS1 by using ttyMIDI

gcc ttymidi.c -o ttymidi -lasound -pthread
  • Warning when compiling ttymidi out-of-the-box:
ttymidi.c:533:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
 main(int argc, char** argv)
  • you can avoid this "compiler-hint" just by adding an "int" bevor "main"
change line 533 to:

int main(int argc, char** argv)

ttyMIDI Aufruf

$ ./ttymidi -s /dev/ttyS1 -b 38400

Adding ADC (Audio-Input) to Odroid N2 - EXPERIMENTAL


> Main Page > Piano Expander based on Pianoteq and Odroid-N2