Difference between revisions of "Motorola Moto G4 Play (motorola-harpia)"

From postmarketOS
Jump to navigation Jump to search
 
(47 intermediate revisions by 15 users not shown)
Line 1: Line 1:
[[Category:Not booting]]
 
 
{{Infobox device
 
{{Infobox device
 
| manufacturer = Motorola
 
| manufacturer = Motorola
| name = Moto G4 Play
+
| name = Moto G4 Play
| codename = harpia
+
| codename = motorola-harpia
 
| image = File:Motorola_Moto_G4_Play.png
 
| image = File:Motorola_Moto_G4_Play.png
 
| imagecaption = Moto G4 Play running Weston
 
| imagecaption = Moto G4 Play running Weston
 
| releaseyear = 2016
 
| releaseyear = 2016
 +
| category = community
 
| originalsoftware = Android 6.0.1
 
| originalsoftware = Android 6.0.1
 
| chipset = Qualcomm MSM8916 Snapdragon 410
 
| chipset = Qualcomm MSM8916 Snapdragon 410
| cpu = Quad-core 1.21GHz Cortex A53
+
| cpu = Quad-core 1.21 GHz Cortex-A53
 
| gpu = Adreno 306
 
| gpu = Adreno 306
 
| storage = 8GB or 16GB
 
| storage = 8GB or 16GB
 
| display = HD (720x1280)
 
| display = HD (720x1280)
 
| memory = 1GB or 2GB
 
| memory = 1GB or 2GB
| architecture = armhf
+
| architecture = aarch64
 
| status_usbnet = Y
 
| status_usbnet = Y
 
| status_flashing = Y
 
| status_flashing = Y
 
| status_touch = Y
 
| status_touch = Y
 
| status_screen = Y
 
| status_screen = Y
| status_wifi =  
+
| status_wifi = Y
| status_xwayland =  
+
| status_xwayland = Y
| status_fde =  
+
| status_fde = Y
| status_mainline =  
+
| status_mainline = Y
| status_battery =
+
| status_battery = Y
| status_3d =  
+
| status_3d = Y
| status_accel =  
+
| status_accel = Y
| status_audio =  
+
| status_audio = Y
| status_bluetooth =
+
| status_bluetooth = Y
 
| status_camera =
 
| status_camera =
| status_gps =  
+
| status_gps = Y
| status_mobiledata =  
+
| status_mobiledata = Y
| status_sms =  
+
| status_sms = Y
| status_calls =  
+
| status_calls = Y
 
| booting = yes
 
| booting = yes
 
}}
 
}}
 +
 +
== Users owning this device ==
 +
{{Device owners}}
  
 
== Contributors ==
 
== Contributors ==
* the-returning-void
+
* Sorixelle
 
 
== Maintainer(s) ==
 
 
 
== What works ==
 
* USB Networking
 
* Graphical display
 
* Xorg
 
* Modem (partially?)
 
* SMS
 
 
 
== What does not work ==
 
* Wifi (wlan0 device comes up with firmware and custom kernel)
 
 
 
  
 
== How to enter flash mode ==
 
== How to enter flash mode ==
Hold down POWER + Vol Down while booting to enter Flash Mode.
+
Hold down {{Button|Power}} + {{Button|Volume Down}} while booting to enter Flash Mode.
  
 
== Installation ==
 
== Installation ==
<!-- add more sections below as necessary, e.g. Wifi, photos, ... -->
 
  
== Wifi ==
+
=== Preparation ===
Configure your kernel and enable the prima wifi staging driver
+
If necessary, unlock your bootloader by following the instructions on the [http://motorola-global-portal.custhelp.com/app/standalone/bootloader/unlock-your-device-a Motorola Support page].
  
<code> pmbootstrap menuconfig linux-motorola-harpia </code>
+
Install the [https://github.com/msm8916-mainline/lk2nd/releases/latest lk2nd bootloader], as it is required to handle some quirks
 +
with msm8916 devices on mainline kernels. Flash the <code>lk2nd.img</code> image to the boot partition with <code>fastboot flash boot /path/to/lk2nd.img</code>. lk2nd
 +
also provides a fastboot interface that allows for flashing kernels without overwriting lk2nd itself. To enter it, power on the device, then hold down Vol Down as soon
 +
as you see the boot splash. You should be presented with a menu that looks like the following:
  
<code>pmbootstrap build linux-motorola-harpia </code>
+
[[File:Motorola-harpia_lk2nd_example.jpeg|x500px]]
  
On the device
+
When you have lk2nd installed and running, follow [[Qualcomm_Snapdragon_410/412_(MSM8916)#Installation]].
  
<code> apk add wcnss-wlan</code>
+
== Usage ==
 +
=== Audio ===
 +
See [[Qualcomm_Snapdragon_410_(MSM8916)#Audio]].
  
<code>/etc/init.d/wcnss-wlan start</code>
+
=== Modem ===
 +
Follow the directions on [[Qualcomm_Snapdragon_410_(MSM8916)#Modem|this wiki page]] to use the modem. If you have a device model other than what is listed here, please edit the list below
 +
with the results of modem functionality testing.
  
== Firmware {Wifi/Modem} (TODO: package it) ==
+
* '''XT1602:''' Modem working, can send and receive text messages. Can initiate and answer phone calls. Mobile data does not work.
On the device extract firmware
+
* '''XT1604:''' Modem working, can send but not receive text messages. Can make phone calls and receive. The Modem doesn't always start on boot, you need to run mmcli -S for it to start working.
<code>cd /lib/firmware</code>
+
* '''XT1607:''' Modem working, can send text messages. Earpiece and Mic1 work with phone calls. Had to manually load RETUS_6.0.1 NON-HLOS firmware, will document and maybe package alternate firmware.
  
<code>mkdir postmarketos</code>
+
=== Touchscreen ===
 +
synaptics s3203b: works ; others: unknown
  
<code>cd postmarketos</code>
+
== See also ==
 
+
* {{Device package|motorola-harpia|community}}
<code>mount /dev/disk/by-partlabel/system /mnt</code>
+
* [https://github.com/msm8916-mainline/linux Development kernel tree]
 
 
<code>cp -ap /mnt/etc/firmware/* /lib/firmware/postmarketos</code>
 
 
 
<code>umount /mnt</code>
 
 
 
<code>mount /dev/disk/by-partlabel/fsg /mnt</code>
 
 
 
<code>cp -ap /mnt/* /lib/firmware/postmarketos</code>
 
 
 
<code>umount /mnt</code>
 
 
 
<code>mount /dev/disk/by-partlabel/modem /mnt</code>
 
 
 
<code>cp -ap /mnt/image/* /lib/firmware/postmarketos</code>
 
 
 
<code>umount /mnt</code>
 
 
 
<code>mount /dev/disk/by-partlabel/persist /mnt</code>
 
 
 
<code>mkdir -p wlan/prima</code>
 
 
 
<code>cp -ap /mnt/WCNSS_wlan_dictionary.dat wlan/prima/</code>
 
 
 
<code>umount /mnt</code>
 
 
 
Make a link in case the firmware path doesn't include /lib/firmware/postmarketos
 
 
 
<code>cd /lib/firmware</code>
 
 
 
<code>ln -s /lib/firmware/postmarketos/* /lib/firmware/</code>
 
  
 
+
[[File:Motorola-harpia-uart-pins.jpg|200px|thumb|left|motorola-harpia UART pins location]]
== Modem ==
 
Make the necesary links for qcom_rmtfs
 
 
 
<code>cd /boot</code>
 
 
 
<code>ln -s /dev/disk/by-partlabel/modemst1 modem_fs1</code>
 
 
 
<code>ln -s /dev/disk/by-partlabel/modemst2 modem_fs2</code>
 
 
 
<code>ln -s /dev/disk/by-partlabel/fsg modem_fsg</code>
 
 
 
 
 
Install necessary software
 
 
 
<code>
 
apk add modem-qcom-msm-downstream-common qcom_rmtfs libsmdpkt_wrapper libqipcrtr4msmipc ofono
 
</code>
 
 
 
Start the wcnss-wlan service to initialize the wifi card (helps the modem?)
 
<code>/etc/init.d/wcnss-wlan start</code>
 
 
 
Start a tmux for multiple windows
 
<code>tmux</code>
 
 
 
Start qcom_rmtfs on a terminal
 
 
 
<code>export LD_PRELOAD=/usr/lib/preload/libqipcrtr4msmipc.so</code>
 
 
 
<code>qcom_rmtfs -v</code>
 
 
 
Start ofonod on another terminal
 
 
 
<code>export LD_PRELOAD=/usr/lib/preload/libsmdpkt_wrapper.so</code>
 
 
 
<code>ofonod -d -n</code>
 
 
 
Send an SMS!
 
 
 
<code>export PHONE_NUMBER="<number to send sms to ex: 1234567890>"</code>
 
 
 
<code>sudo dbus-send --print-reply --system --dest=org.ofono /gobi_0 org.ofono.Modem.SetProperty string:"Powered" variant:boolean:"true"</code>
 
 
 
<code>sudo dbus-send --print-reply --system --dest=org.ofono /gobi_0 org.ofono.Modem.GetProperties</code>
 
 
 
<code>sudo dbus-send --print-reply --system --dest=org.ofono /gobi_0 org.ofono.Modem.SetProperty string:"Online" variant:boolean:"true"</code>
 
 
 
<code>sudo dbus-send --system --print-reply --dest=org.ofono /gobi_0 org.ofono.MessageManager.SendMessage string:"$PHONE_NUMBER" string:"Hello world! -postmarketOS"</code>
 
 
 
Receive SMS like this (might be spammy if you have other DBus apps):
 
<code>sudo dbus-monitor</code>
 
 
 
== See also ==
 
* Device requires msm-refresher to get a display past the boot splash, even though <code>cat /sys/class/graphics/fb0/modes > /sys/class/graphics/fb0/mode</code> doesn't fix the display
 
* Steps outlined for [[Troubleshooting:display#Screen_is_blank_outside_of_Weston|Screen is blank outside of Weston]] is still required to get a display after the boot splash
 
* Xorg starts with a blank display, to make the screen show ssh into the device and run <code>sudo osk-sdl -t</code> to fix display
 

Latest revision as of 00:00, 25 May 2021

Motorola Moto G4 Play
Moto G4 Play running Weston
Moto G4 Play running Weston
Manufacturer Motorola
Name Moto G4 Play
Codename motorola-harpia
Released 2016
Category community
Original software Android 6.0.1
Hardware
Chipset Qualcomm MSM8916 Snapdragon 410
CPU Quad-core 1.21 GHz Cortex-A53
GPU Adreno 306
Display HD (720x1280)
Storage 8GB or 16GB
Memory 1GB or 2GB
Architecture aarch64
Features
USB Networking
Works
Flashing
Works
Touchscreen
Works
Display
Works
WiFi
Works
Xwayland
Works
FDE
Works
Mainline
Works
Battery
Works
3D Acceleration
Works
Accelerometer
Works
Audio
Works
Bluetooth
Works
Camera
GPS
Works
Mobile data
Works
SMS
Works
Calls
Works
USB OTG
NFC



Users owning this device

  • ChexM1xstar (Notes: XT1601)
  • Ityt (Notes: XT1602; Plasma-mobile unstable, Phosh stable)
  • Libertus (Notes: XT1600)
  • Minecrell
  • R31k0
  • Sorixelle
  • Thejsa (Notes: 16GB/1GB XT1604; loaned to family)
  • Timbz
  • Unrznbl (Notes: XT1607, need firmware-from-device updater in order for my modem to work, shelli ui works well, needs mms then daily driver!)
  • VR25 (Notes: XT1607; date and time get messed up on reboot; need help to get modem working)


Contributors

  • Sorixelle

How to enter flash mode

Hold down Power + Volume Down while booting to enter Flash Mode.

Installation

Preparation

If necessary, unlock your bootloader by following the instructions on the Motorola Support page.

Install the lk2nd bootloader, as it is required to handle some quirks with msm8916 devices on mainline kernels. Flash the lk2nd.img image to the boot partition with fastboot flash boot /path/to/lk2nd.img. lk2nd also provides a fastboot interface that allows for flashing kernels without overwriting lk2nd itself. To enter it, power on the device, then hold down Vol Down as soon as you see the boot splash. You should be presented with a menu that looks like the following:

Motorola-harpia lk2nd example.jpeg

When you have lk2nd installed and running, follow Qualcomm_Snapdragon_410/412_(MSM8916)#Installation.

Usage

Audio

See Qualcomm_Snapdragon_410_(MSM8916)#Audio.

Modem

Follow the directions on this wiki page to use the modem. If you have a device model other than what is listed here, please edit the list below with the results of modem functionality testing.

  • XT1602: Modem working, can send and receive text messages. Can initiate and answer phone calls. Mobile data does not work.
  • XT1604: Modem working, can send but not receive text messages. Can make phone calls and receive. The Modem doesn't always start on boot, you need to run mmcli -S for it to start working.
  • XT1607: Modem working, can send text messages. Earpiece and Mic1 work with phone calls. Had to manually load RETUS_6.0.1 NON-HLOS firmware, will document and maybe package alternate firmware.

Touchscreen

synaptics s3203b: works ; others: unknown

See also

motorola-harpia UART pins location