Difference between revisions of "Google Nexus 5 (lg-hammerhead)"

From postmarketOS
Jump to navigation Jump to search
 
(27 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 
<!-- NOTE at the top. For some reason, the {{note}} template does not work with links inside? -->
 
<!-- NOTE at the top. For some reason, the {{note}} template does not work with links inside? -->
 
<div role="note" class="note" style="padding: 5px 15px; color: #705000; border: 1px solid #fde29b; background-color: #fdf1d1; margin-top: 5px; margin-bottom: 15px;">
 
<div role="note" class="note" style="padding: 5px 15px; color: #705000; border: 1px solid #fde29b; background-color: #fdf1d1; margin-top: 5px; margin-bottom: 15px;">
'''Take a look at the [https://gitlab.com/postmarketOS/pmaports/issues?scope=all&utf8=%E2%9C%93&state=opened&search=hammerhead open hammerhead issues] before starting an installation!'''
+
'''Take a look at the [https://gitlab.com/postmarketOS/pmaports/-/issues?scope=all&utf8=%E2%9C%93&state=opened&search=hammerhead open hammerhead issues] before starting an installation!'''
 
</div>
 
</div>
 
{{Infobox device
 
{{Infobox device
Line 27: Line 27:
 
| status_fde =  
 
| status_fde =  
 
| status_mainline = Y
 
| status_mainline = Y
| status_battery =  
+
| status_battery = P
 
| status_3d = Y
 
| status_3d = Y
| status_accel =  
+
| status_accel = P
 
| status_audio = N
 
| status_audio = N
| status_bluetooth = P
+
| status_bluetooth = Y
 
| status_camera =
 
| status_camera =
 
| status_gps =  
 
| status_gps =  
| status_mobiledata = P
+
| status_mobiledata = Y
 
| status_sms = Y
 
| status_sms = Y
 
| status_otg = Y
 
| status_otg = Y
Line 47: Line 47:
 
* bshah
 
* bshah
 
* opendata
 
* opendata
 +
* JuniorJPDJ
  
 
=== Users owning this device ===
 
=== Users owning this device ===
Line 83: Line 84:
  
 
=== Hardware issues ===
 
=== Hardware issues ===
 +
 +
Graphic subsystem randomly crashes, requiring an hard reboot. {{issue|424|pmaports}}
 +
 +
==== Charge Type ====
 +
 +
In case your phone is always plugged into power outlet 24/7, you can set it to be slow charge mode and reduce the charge voltage and current to minimum (set it at your own risk):
 +
 +
$ cat /etc/local.d/bq24190_charger.start
 +
echo Trickle > /sys/class/power_supply/bq24190-charger/charge_type
 +
echo 3504000 > /sys/class/power_supply/bq24190-charger/constant_charge_voltage
 +
echo 102400 > /sys/class/power_supply/bq24190-charger/constant_charge_current
 +
 +
See https://www.reddit.com/r/GPDPocket/comments/cfyekh/limit_battery_charge/ for some useful information.
 +
 +
See https://www.kernel.org/doc/html/v5.9/power/power_supply_class.html for details.
  
 
==== Power Management ====
 
==== Power Management ====
Line 88: Line 104:
 
At this stage the directory <code>/sys/devices/system/cpu/cpufreq</code> is empty, so it seems there is no integrated power management.
 
At this stage the directory <code>/sys/devices/system/cpu/cpufreq</code> is empty, so it seems there is no integrated power management.
  
There is also no way to turn off touch detection (or turning off the screen through a button). Still, you can
+
There is also no way to turn off touch detection or turning off the screen through a button.  
 +
 
 +
Still, you can
  
 
<pre class="shell">
 
<pre class="shell">
Line 96: Line 114:
 
     echo 250 > /sys/class/backlight/lcd-backlight/brightness
 
     echo 250 > /sys/class/backlight/lcd-backlight/brightness
  
# Force reboot
 
    echo b > /proc/sysrq-trigger
 
 
# Turn off screen and suspend (deepsleep?)
 
# Turn off screen and suspend (deepsleep?)
 
     sudo su -c "echo 0 > /sys/class/backlight/lcd-backlight/brightness" && exec pm-suspend
 
     sudo su -c "echo 0 > /sys/class/backlight/lcd-backlight/brightness" && exec pm-suspend
Line 104: Line 120:
 
     echo 0 > /sys/devices/system/cpu/cpu{2..3}/online
 
     echo 0 > /sys/devices/system/cpu/cpu{2..3}/online
 
</pre>
 
</pre>
 +
 +
[[File:Nexus_5_-_sound_and_input_through_network_on_a_secondary_device_-_thumbnail.png|thumb|right|[https://youtu.be/diYgNXi3zY8 Video]: a working example of postmarketOS sharing sound and input running with a secondary device on top of [[The Mainline Kernel|mainline Linux]].]]
  
 
==== Audio ====
 
==== Audio ====
Line 129: Line 147:
 
==== Bluetooth ====
 
==== Bluetooth ====
  
Bluetooth seems to work somewhat. Power and scan functions in bluetoothctl work but pairing might not.
+
Bluetooth controller works, but Phosh seems to have some problems: https://gitlab.com/postmarketOS/pmaports/-/issues/904
  
 
To test, use instructions at https://wiki.alpinelinux.org/wiki/Raspberry_Pi_3_-_Setting_Up_Bluetooth.
 
To test, use instructions at https://wiki.alpinelinux.org/wiki/Raspberry_Pi_3_-_Setting_Up_Bluetooth.
Line 148: Line 166:
 
$ sudo nmcli radio all on
 
$ sudo nmcli radio all on
 
</source>
 
</source>
 +
 +
[[File:Running_phosh_on_the_Nexus_5_with_PostmarketOS_-_Youtube_thumbnail.png|thumb|right|[https://youtu.be/y8W-G0G8ajg Video]: a working example of postmarketOS running Phosh on top of [[The Mainline Kernel|mainline Linux]].]]
  
 
=== Software issues ===
 
=== Software issues ===
Line 153: Line 173:
 
==== Phosh ====
 
==== Phosh ====
  
Power button does not turn off the screen.
+
If the screen gets locked, since default passcode is unknown you can't go back.
 +
 
 +
Pressing power button will "block" the screen, keeping it turned on with touchscreen working.
 +
 
 +
If the interface hangs, restarting LightDM with <code>sudo rc-service lightdm restart</code> has no effect and you have to force reboot. {{issue|540|pmaports}}
 +
 
 +
'''Browsing'''
  
If the interface hangs (does randomly every few minutes of usage), restarting LightDM with <code>sudo rc-service lightdm restart</code> has no effect.
+
- Epiphany works well, but doesn't load youtube videos and tends to crash after a while;
  
===== Browsing =====
 
- Epiphany does not load content;
 
 
- Chromium crashes;
 
- Chromium crashes;
 +
 
- Firefox works but crashes after a while;
 
- Firefox works but crashes after a while;
 +
 
- Qutebrowser works well but crashes after a while;
 
- Qutebrowser works well but crashes after a while;
 +
 
- Vimb works but crashes after a while;
 
- Vimb works but crashes after a while;
 +
 
- Netsurf never crashed.
 
- Netsurf never crashed.
 +
 
- Dillo will probably work, too.
 
- Dillo will probably work, too.
  
Line 179: Line 208:
 
==== Useful aliases ====
 
==== Useful aliases ====
 
<pre class="shell">
 
<pre class="shell">
 +
# Force reboot
 +
    echo b > /proc/sysrq-trigger
 +
 
# Input devices
 
# Input devices
 
     cat /proc/bus/input/devices
 
     cat /proc/bus/input/devices
Line 229: Line 261:
 
* [https://gitlab.com/unrznbl/gesture/wikis/gesture---handwriting-for-linux-touchscreens shelli-ui: framebuffer console + gesture recognition video demo]
 
* [https://gitlab.com/unrznbl/gesture/wikis/gesture---handwriting-for-linux-touchscreens shelli-ui: framebuffer console + gesture recognition video demo]
 
* [https://www.youtube.com/watch?v=u9zw_ewkBJ0 Demonstration video of a Nexus 5 with postmarketOS and plasma]
 
* [https://www.youtube.com/watch?v=u9zw_ewkBJ0 Demonstration video of a Nexus 5 with postmarketOS and plasma]
* [https://gitlab.com/postmarketOS/pmbootstrap/tree/b1b5acd79d25fedda99dbbbee9050993aec49405/aports/device/linux-lg-hammerhead obsolete downstream kernel packaging]
+
* [https://gitlab.com/postmarketOS/pmbootstrap/-/tree/b1b5acd79d25fedda99dbbbee9050993aec49405/aports/device/linux-lg-hammerhead obsolete downstream kernel packaging]
* [https://gitlab.com/postmarketOS/pmaports/tree/master/device/testing/device-lg-hammerhead Device package]
+
* [https://gitlab.com/postmarketOS/pmaports/-/tree/master/device/testing/device-lg-hammerhead Device package]
 
* [https://gist.github.com/MartijnBraam/57ec370985af341ceb17521183695a3d dmesg from mainline linux with the missing block devices]
 
* [https://gist.github.com/MartijnBraam/57ec370985af341ceb17521183695a3d dmesg from mainline linux with the missing block devices]
 
* [https://github.com/flto/linux/wiki/hammerhead-upstream flto's hammerhead-upstream status page]
 
* [https://github.com/flto/linux/wiki/hammerhead-upstream flto's hammerhead-upstream status page]
Line 251: Line 283:
 
File:Nexus5-02-home.jpg|thumb|Nexus 5 home on desktop
 
File:Nexus5-02-home.jpg|thumb|Nexus 5 home on desktop
 
File:Nexus5-02-wiki.jpg|thumb|Nexus 5 wikipedia on desktop
 
File:Nexus5-02-wiki.jpg|thumb|Nexus 5 wikipedia on desktop
 +
File:K3s_cluster_built_with_hammerhead_and_docker.jpg|thumb|K3s cluster built with Nexus 5
 
</gallery>
 
</gallery>
  
 
== Videos ==
 
== Videos ==
* [https://www.youtube.com/watch?v=y8W-G0G8ajg Running Phosh on the Nexus 5 with postmarketOS - YouTube]
+
* [https://youtu.be/y8W-G0G8ajg Running Phosh on the Nexus 5 with postmarketOS - YouTube]
 +
* [https://youtu.be/diYgNXi3zY8 Stear Prime: input and sound sharing - YouTube]
  
 
== Resources ==
 
== Resources ==
 
* [https://user-images.githubusercontent.com/6033024/26851053-3f5512fe-4af9-11e7-93da-cf9dd94b6b75.jpg Weston running (with the red screen bug)]
 
* [https://user-images.githubusercontent.com/6033024/26851053-3f5512fe-4af9-11e7-93da-cf9dd94b6b75.jpg Weston running (with the red screen bug)]
 
* [https://www.reddit.com/r/postmarketOS/comments/6fovjp/postmarketos_running_on_the_the_nexus_5/ /r/postmarketOS post]
 
* [https://www.reddit.com/r/postmarketOS/comments/6fovjp/postmarketos_running_on_the_the_nexus_5/ /r/postmarketOS post]

Latest revision as of 18:09, 17 January 2021

Take a look at the open hammerhead issues before starting an installation!

LG Nexus 5
Nexus 5 running plasma mobile
Nexus 5 running plasma mobile
Manufacturer LG
Name Nexus 5
Codename lg-hammerhead
Released 2013
Category testing
Original software Android 4.4.4 on Linux 3.4.0
Hardware
Chipset Qualcomm MSM8974 Snapdragon 800
CPU 4x 2.3 GHz Krait 400
GPU Adreno 330
Display 1080x1920 IPS
Storage 16/32 GB
Memory 2 GB
Architecture armv7
Unixbench Whet/Dhry score 840.9
Features
USB Networking
Works
Flashing
Works
Touchscreen
Works
Display
Works
WiFi
Works
Xwayland
Works
FDE
Mainline
Works
Battery
Partial
3D Acceleration
Works
Accelerometer
Partial
Audio
Broken
Bluetooth
Works
Camera
GPS
Mobile data
Works
SMS
Works
Calls
Partial
USB OTG
Works



Contributors

  • MartijnBraam
  • dzervas
  • lawl
  • bshah
  • opendata
  • JuniorJPDJ

Users owning this device


Fastboot Mode

First make sure to enable USB debugging in Android ([1]) Then with device powered off, hold down Volume Down and Power buttons simultaneously for a few seconds, until Fastboot Mode screen appears.

OEM Unlock

Get device into Fastboot Mode, plug in USB cable, then:

$ sudo fastboot oem unlock

When prompted on device, use Volume-Up/Down buttons to highlight choice, then Power button to select it. The Fastboot Mode screen will appear again, and a message regarding flashing will appear briefly.

Installation

First build the image:

$ pmbootstrap init
$ pmbootstrap install

Then in order to flash it put your device in fastboot mode, and plug it in USB. Then do:

$ pmbootstrap flasher flash_rootfs --partition userdata
$ sudo fastboot format system
$ pmbootstrap flasher flash_kernel

Hardware issues

Graphic subsystem randomly crashes, requiring an hard reboot. pmaports#424

Charge Type

In case your phone is always plugged into power outlet 24/7, you can set it to be slow charge mode and reduce the charge voltage and current to minimum (set it at your own risk):

$ cat /etc/local.d/bq24190_charger.start
echo Trickle > /sys/class/power_supply/bq24190-charger/charge_type
echo 3504000 > /sys/class/power_supply/bq24190-charger/constant_charge_voltage
echo 102400 > /sys/class/power_supply/bq24190-charger/constant_charge_current

See https://www.reddit.com/r/GPDPocket/comments/cfyekh/limit_battery_charge/ for some useful information.

See https://www.kernel.org/doc/html/v5.9/power/power_supply_class.html for details.

Power Management

At this stage the directory /sys/devices/system/cpu/cpufreq is empty, so it seems there is no integrated power management.

There is also no way to turn off touch detection or turning off the screen through a button.

Still, you can

# Turn off screen
    echo 0 > /sys/class/backlight/lcd-backlight/brightness
# Turn on screen
    echo 250 > /sys/class/backlight/lcd-backlight/brightness

# Turn off screen and suspend (deepsleep?)
    sudo su -c "echo 0 > /sys/class/backlight/lcd-backlight/brightness" && exec pm-suspend

#disable two cores (not sure if temperature decreases)
    echo 0 > /sys/devices/system/cpu/cpu{2..3}/online
Video: a working example of postmarketOS sharing sound and input running with a secondary device on top of mainline Linux.

Audio

No one has still worked on playback and recording support.

Neverthless you can use another device (like an android device) to stream your audio.

source device

# /etc/profile
  export PULSE_SERVER=<sink_device_ip_address>

sink Device

# etc/pulse/default.pa
  load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1

Don't forget to copy cookie (~/.config/pulse/cookie) to from sink to source!

Bluetooth

Bluetooth controller works, but Phosh seems to have some problems: https://gitlab.com/postmarketOS/pmaports/-/issues/904

To test, use instructions at https://wiki.alpinelinux.org/wiki/Raspberry_Pi_3_-_Setting_Up_Bluetooth.

Cellular modem

Using instructions at https://wiki.postmarketos.org/wiki/Nokia_N900_(nokia-n900)#SMS it seems that SMS and calls likely work.

WiFi

On Phosh session wifi adapter currently starts.

Before, the wifi adapter started in airplane mode and NetworkManager did not detect that. A manual workaround is to disable and re-enable the wifi adapter.

This can easily be done in the graphic shell (Plasma Mobile has an airplane mode switch in the pull-down menu: check it and uncheck it) or through the shell:

$ sudo nmcli radio all off
$ sudo nmcli radio all on
Video: a working example of postmarketOS running Phosh on top of mainline Linux.

Software issues

Phosh

If the screen gets locked, since default passcode is unknown you can't go back.

Pressing power button will "block" the screen, keeping it turned on with touchscreen working.

If the interface hangs, restarting LightDM with sudo rc-service lightdm restart has no effect and you have to force reboot. pmaports#540

Browsing

- Epiphany works well, but doesn't load youtube videos and tends to crash after a while;

- Chromium crashes;

- Firefox works but crashes after a while;

- Qutebrowser works well but crashes after a while;

- Vimb works but crashes after a while;

- Netsurf never crashed.

- Dillo will probably work, too.

Plasma Mobile

Plasma Angelfish does not run. You may want to install another browser, like qtwebbrowser, Firefox and/or Chromium.

Troubleshooting

Fastboot unknown chunk type

Flashing with fastboot seems to fail for some outdated firmware, it prints the message "FAILED (remote: Unknown chunk type)" when trying to flash the rootfs to userdata. This can be solved by updating to the latest baseband firmware and bootloader.

Remote Data Too Large

Sometimes `./pmbootstrap.py flasher flash_kernel` can fail with an error message that includes "Failed (remote: data too large)". This might be solved by updating by reflashing the latest version of the stock Android image for the device.

Useful aliases

# Force reboot
    echo b > /proc/sysrq-trigger

# Input devices
    cat /proc/bus/input/devices

Partition layout

hammerhead:~# fdisk -l -o Device,Start,End,Sectors,Size,Name /dev/mmcblk1

Disk /dev/mmcblk1: 14.7 GiB, 15758000128 bytes, 30777344 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 98101B32-BBE2-4BF2-A06E-2BB33D000C20

Device             Start      End  Sectors  Size Name
/dev/mmcblk1p1      1024   132095   131072   64M modem
/dev/mmcblk1p2    132096   134143     2048    1M sbl1
/dev/mmcblk1p3    134144   135167     1024  512K rpm
/dev/mmcblk1p4    135168   136191     1024  512K tz
/dev/mmcblk1p5    136192   137215     1024  512K sdi
/dev/mmcblk1p6    137216   138239     1024  512K aboot
/dev/mmcblk1p7    138240   142335     4096    2M pad
/dev/mmcblk1p8    142336   144383     2048    1M sbl1b
/dev/mmcblk1p9    144384   145407     1024  512K tzb
/dev/mmcblk1p10   145408   146431     1024  512K rpmb
/dev/mmcblk1p11   146432   147455     1024  512K abootb
/dev/mmcblk1p12   147456   153599     6144    3M modemst1
/dev/mmcblk1p13   153600   159743     6144    3M modemst2
/dev/mmcblk1p14   159744   160767     1024  512K metadata
/dev/mmcblk1p15   160768   193535    32768   16M misc
/dev/mmcblk1p16   193536   226303    32768   16M persist
/dev/mmcblk1p17   226304   232447     6144    3M imgdata
/dev/mmcblk1p18   232448   277503    45056   22M laf
/dev/mmcblk1p19   277504   322559    45056   22M boot
/dev/mmcblk1p20   322560   367615    45056   22M recovery
/dev/mmcblk1p21   367616   373759     6144    3M fsg
/dev/mmcblk1p22   373760   374783     1024  512K fsc
/dev/mmcblk1p23   374784   375807     1024  512K ssd
/dev/mmcblk1p24   375808   376831     1024  512K DDR
/dev/mmcblk1p25   376832  2473983  2097152    1G system
/dev/mmcblk1p26  2473984  2535423    61440   30M crypto
/dev/mmcblk1p27  2535424  3969023  1433600  700M cache
/dev/mmcblk1p28  3969024 30777299 26808276 12.8G userdata
/dev/mmcblk1p29 30777300 30777310       11  5.5K grow

Links

Photos

Videos

Resources