User:Alexey Vazhnov/PinePhone notes

From postmarketOS Wiki

Hardware

My version: 3 GB RAM, 32 GB eMMC + dock, Mobian edition — hardware revision is probably https://wiki.pine64.org/wiki/PinePhone_v1.2b

USB OTG works (tested with SparkFun GPS-RTK-SMA ZED-F9P).

eMMC state:

 # mmc extcsd read /dev/mmcblk2 | { head -n3; grep -i life; }
=============================================
  Extended CSD rev 1.8 (MMC 5.1)
=============================================
eMMC Life Time Estimation A [EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_A]: 0x01
eMMC Life Time Estimation B [EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_B]: 0x01

lscpu:

Architecture:                    aarch64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
CPU(s):                          4
On-line CPU(s) list:             0-3
Thread(s) per core:              1
Core(s) per socket:              4
Socket(s):                       1
Vendor ID:                       ARM
Model:                           4
Model name:                      Cortex-A53
Stepping:                        r0p4
CPU max MHz:                     1152,0000
CPU min MHz:                     480,0000
BogoMIPS:                        48.00
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Spec store bypass: Not affected
Vulnerability Spectre v1:        Mitigation; __user pointer sanitization
Vulnerability Spectre v2:        Not affected
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected
Flags:                           fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid

PMIC AXP803

See also: AXP803/PMIC control Linux.

Common for Mobian and postmarketOS (but postmarketOS has no modules, they are probably compiled into the kernel).

 $ lsmod| grep axp
axp20x_adc             20480  0
axp20x_pek             16384  0
axp20x_battery         16384  0
axp20x_usb_power       16384  0
industrialio           86016  10 stk3310,axp20x_battery,industrialio_triggered_buffer,st_sensors,inv_mpu6050,kfifo_buf,st_magn_i2c,st_magn,axp20x_usb_power,axp20x_adc
 $ ls -lAF /sys/class/power_supply/axp20x-battery/
total 0
-r--r--r-- 1 root root 4096 May 15 21:47 capacity
-rw-r--r-- 1 root root 4096 May 16 01:12 constant_charge_current
-rw-r--r-- 1 root root 4096 May 16 01:12 constant_charge_current_max
-r--r--r-- 1 root root 4096 May 15 21:47 current_now
lrwxrwxrwx 1 root root    0 May 16 01:12 device -> ../../../axp20x-battery-power-supply/
-r--r--r-- 1 root root 4096 May 16 01:12 health
drwxr-xr-x 3 root root    0 May 15 21:47 hwmon4/
-r--r--r-- 1 root root 4096 May 16 01:12 online
drwxr-xr-x 2 root root    0 May 16 01:11 power/
-r--r--r-- 1 root root 4096 May 15 21:47 present
-r--r--r-- 1 root root 4096 May 15 21:47 status
lrwxrwxrwx 1 root root    0 May 15 21:47 subsystem -> ../../../../../../../../class/power_supply/
-r--r--r-- 1 root root 4096 May 15 21:47 type
-rw-r--r-- 1 root root 4096 May 15 21:47 uevent
-rw-r--r-- 1 root root 4096 May 15 21:47 voltage_max_design
-rw-r--r-- 1 root root 4096 May 16 01:12 voltage_min_design
-r--r--r-- 1 root root 4096 May 15 21:47 voltage_now
drwxr-xr-x 2 root root    0 May 15 21:47 wakeup10/
 $ cat /sys/class/power_supply/axp20x-battery/status
Discharging
 $ cat /sys/class/power_supply/axp20x-battery/type
Battery
 $ cat /sys/class/power_supply/axp20x-battery/voltage_max_design
4200000
 $ cat /sys/class/power_supply/axp20x-battery/voltage_min_design
2900000
 $ cat /sys/class/power_supply/axp20x-battery/voltage_now
4161000
 $ cat /sys/class/power_supply/axp20x-battery/current_now
117000
 $ cat /sys/class/power_supply/axp20x-battery/capacity
98

Software

Mobian

Debian 11 Bullseye + Wayland + Phosh (Gnome).

/boot = ~500 MB, ext4. / = f2fs, auto-resize on first boot.

After installation, it took about 3.5 GB space in /. ~480 MB RAM used after boot.

Using swap on zram by default:

 $ sudo swapon --summary
Filename				Type		Size	Used	Priority
/dev/zram0                             	partition	1500816	0	100
 $ free -m
               total        used        free      shared  buff/cache   available
Mem:            2931         659        1621          57         649        2070
Swap:           1465           0        1465

Repositories:

deb http://deb.debian.org/debian bullseye main
deb http://repo.mobian-project.org/ bullseye main non-free

Linux kernel:

Linux mobian 5.10-sunxi64 #2 SMP PREEMPT Tue Jan 12 09:55:56 UTC 2021 aarch64 GNU/Linux

Default /proc/cmdline:

root=UUID=fd176ea7-64ed-4a9b-adc8-f7f890d5e253 console=ttyS0,115200 consoleblank=0 loglevel=7 rw splash plymouth.ignore-serial-consoles vt.global_cursor_default=0

Is using Phosh:

 $ ps -eF|grep -i phosh
mobian       498       1  0 126594 123580 1 15:35 tty7     00:02:12 /usr/bin/phoc -C /usr/share/phosh/phoc.ini -E bash -lc 'gnome-session --builtin --disable-acceleration-check --session=phosh'
mobian       658     498  0   516   496   1 15:35 tty7     00:00:00 /bin/sh -c bash -lc 'gnome-session --builtin --disable-acceleration-check --session=phosh'
mobian       659     658  0 110857 15576  2 15:35 tty7     00:00:01 /usr/libexec/gnome-session-binary --systemd --builtin --disable-acceleration-check --session=phosh
mobian       705     659  0 220653 114348 1 15:35 tty7     00:01:12 /usr/libexec/phosh

Mobian Phosh

Mobian Phosh additional software

See also: User:Knuxfanwin8/Phosh Apps.

Applications I tried with Mobian Phosh:

App Short description Mobile Notes
clementine Audio player, Qt5 No It is possible to use in both portrait and landscape modes
foxtrotgps Mapping and GPS application, GTK No
Mobian Phosh pros and cons

Advantages/pros:

Disadvantages/drawbacks/cons:

  • Camera clicks 4 times after OS boot up, when login page appears;
  • Only one system button, no "back" button;
  • No button to close applications;
  • Scaling is only 100% and 200%;
  • Virtual keyboard squeekboard is not comfortable;
  • Application Settings can forget about screen size and show only part of self;
  • Automatic brightness works too fast;
  • Automatic rotation works instantly without a delay — bad when sensor is between of two states + noise, need at least some Schmitt trigger;
  • No automatic night mode;
  • Alarm in gnome-clocks didn't give me a notification at morning (workaround: Wake Mobile, apt install wake-mobile);
  • Long start of applications from SD card;
  • Spend full battery for only one day;

postmarketOS

Alpine + Phosh / Plasma Mobile / Sxmo (and also Plasma Desktop, Gnome 3, Kodi, XFCE4, … ?).

Logs: By default postmarketOS uses the busybox logging daemon for the syslog and it's configured to log to memory only. The logread command is used to read the in-memory log.

BusyBox as default shell.

After install:

sudo apk add -i zsh vim
chsh -s /bin/zsh
sudo rc-update add sshd default
sudo apk add -i avahi
sudo rc-update add avahi-daemon default

Default /etc/apk/repositories:

http://mirror.postmarketos.org/postmarketos/v21.03
http://dl-2.alpinelinux.org/alpine/v3.13/main
http://dl-2.alpinelinux.org/alpine/v3.13/community

Plasma mobile

See also: Plasma Mobile.

tinydm-openrc, plasma-phone-components, postmarketos-ui-plasma-mobile (customizations).

/boot = ~250 MB, ext2. / = ~2.1 GB, ext4, auto-resize on first boot. /tmp not in tmpfs!

No swap by default.

Linux kernel:

Linux pine64-pinephone 5.11.0 #1-postmarketos-allwinner SMP Sat Mar 27 14:48:00 UTC 2021 aarch64 Linux

/proc/cmdline:

init=/init.sh rw console=tty0 console=ttyS0,115200 earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1 cma=256M PMOS_NO_OUTPUT_REDIRECT PMOS_FORCE_PARTITION_RESIZE pmos_boot=/dev/mmcblk0p1 pmos_root=/dev/mmcblk0p2

I installed VVAVE as audio player. But: VVAVE makes use of multiple web APIs of music knowledge to collect data.

Plasma mobile pros and cons

Advantages/pros:

  • Automatic night mode works;
  • Default virtual keyboard is more comfortable than in Phosh;
  • Interface logic is similar to Android and even better;
  • Automatic rotation has small delay, which is good, but anyway too fast;

Disadvantages/drawbacks/cons:

  1. Graphical interface as a whole works not as smooth as Phosh in Mobian;
  2. No automatic connection to Wi-Fi after restart;
  3. Lost Wi-Fi card after night;
  4. Alarm in Clock 0.3.0 didn't give me a notification at morning;
  5. Disabling the alarm requires entering PIN;
  6. No possibility to switch off/reboot system from menu, the only way is to hold the power button for about three seconds
  7. Unexpected reboots (crashes?) of graphical interface;
     $ grep 'KCrash: Application Name' ~/.cache/tinydm.log
    KCrash: Application Name = klauncher path = /usr/lib/libexec/kf5 pid = 3090
    KCrash: Application Name = polkit-kde-authentication-agent-1 path = /usr/lib/libexec pid = 3178
    KCrash: Application Name = kded5 path = /usr/bin pid = 3118
    KCrash: Application Name = DiscoverNotifier path = /usr/lib/libexec pid = 3184
    KCrash: Application Name = org_kde_powerdevil path = /usr/lib/libexec pid = 3171
    KCrash: Application Name = plasmashell path = /usr/bin pid = 3176
    

Sxmo

Simple X Mobile, is a collection of simple and suckless X programs and scripts.

The core of the Sxmo UI is based on the dwm window manager, the dmenu menu system, the lisgd gesture daemon and the svkbd keyboard.

+ feh (wallpaper), conky (desktop clock), clickclack (audio/vibration feedback on keypress).

Must read: https://git.sr.ht/~mil/sxmo-docs/tree/master/USERGUIDE.md — you have to learn all the gestures to use it.

/boot = ~250 MB, ext2. / = ext4, auto-resize on first boot.

After installation, it took about 1 GB space in /. ~120 MB RAM used after boot.

No swap by default.

Linux kernel:

Linux pine64-pinephone 5.11.0 #1-postmarketos-allwinner SMP Sat Mar 27 14:48:00 UTC 2021 aarch64 GNU/Linux

/proc/cmdline:

init=/init.sh rw console=tty0 console=ttyS0,115200 earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1 cma=256M PMOS_NO_OUTPUT_REDIRECT PMOS_FORCE_PARTITION_RESIZE pmos_boot=/dev/mmcblk0p1 pmos_root=/dev/mmcblk0p2

Important settings are in ~/.config/sxmo/xinit.

A lot of useful scripts are in /usr/bin/sxmo*.

Apps menu list don't need to restart after package installation.

Sxmo additional software

Applications I tried with Sxmo:

App Short description Mobile Notes
audacious Audio player No no controls in GUI, in WinAmp mode can't work without mouse — controls are too small
vlc Video/audio player No has app menu, can't start
thunar File manager Yes is in list of apps, but no app menu
Sxmo pros and cons

Advantages/pros:

  • Low resources usage for own needs (~1 GB flash space and ~120 MB RAM);
  • Wi-Fi works before login/unlock!
  • It is possibly to switch off/reboot system from menu;

Disadvantages/drawbacks/cons:

  • USB mouse not works by default,

License

It is allowed to share content of this page under CC-BY international 4.0 or newer (in addition to CC-BY-SA 4.0, which is a little more strict, which is used for whole this wiki).