Difference between revisions of "Motorola Droid 4"

From Maemo Leste Wiki
Jump to navigationJump to search
(infobox device changes)
 
(94 intermediate revisions by 11 users not shown)
Line 1: Line 1:
{{Stub}}
{{Infobox Device
{{Infobox Device
|image=[[File:Motorola Droid 4 - Leste pre-alpha.jpg|250px]]
|image=[[File:Motorola Droid 4 - Leste pre-alpha.jpg|250px]]
|manufacturer=Motorola
|manufacturer=Motorola
|codename=Maserati
|codename=Maserati XT894
|dimensions=
|dimensions=127x67.3x12.7mm
|release_date=
|release_date=2012-02-10
|soc=
|soc=TI OMAP4430 <br>Cortex-A9 <br>Armv7‑A
|dram=
|dram=1024MB DDR2
|power=
|power=
|lcd=
|lcd=960x540 4"
|video=
|video=PowerVR SGX540
|audio=
|audio=
|network=
|network=
|storage=
|storage=16GB flash
|usb=
|usb=
|camera=
|camera=
|sensors=
|sensors=AK8975 compass, <br>LIS3DH accelerometer, <br>TMP105 temperature, <br>ISL29030 proximity and illuminance
|other=
|other=
|category=Supported
|sw_kernel=5.18.x
|sw_serial=Yes, [[#Serial Cable|special cable]]
|sw_charging=Yes
|sw_usb_slave=Yes
|sw_usb_host=Yes
|sw_touchscreen=Yes
|sw_keyboard=Yes
|sw_screen=Yes
|sw_hdmi=Yes
|sw_tv=
|sw_3daccel=Yes [https://github.com/maemo-leste/pvr-omap4] (closed)
|sw_vibration=Yes
|sw_audio=Yes
|sw_calls=Yes
|sw_sms=Yes
|sw_wifi=Yes
|sw_ethernet=
|sw_irda=
|sw_2g3gdata=Yes
|sw_4g=No
|sw_bluetooth=Yes,  [[#Bluetooth|see notes]]
|sw_fmtx=No, but apparently exists, needs serdev kernel modules/drivers
|sw_fmrx=
|sw_nfc=
|sw_accelerometer=Yes
|sw_compass=Yes, no integration
|sw_gyro=
|sw_proximity=Yes
|sw_als=Yes
|sw_gps=Yes
|sw_agps=No
|sw_frontcam=No
|sw_backcam=No
|sw_idlepower=120mW
|sw_standbytime=
}}
}}
== Status ==
{| class="wikitable"
! Feature
! Leste supported
! Notes
|-
| Kernel version || 5.4 || Mainline + some patches not yet in mainline - see https://github.com/maemo-leste/droid4-linux/tree/maemo-5.4
|-
| Serial || Yes || On MicroUSB port, requires [[#Serial Cable|special cable]]
|-
| Charging || Yes ||
|-
| Wireless || Yes ||
|-
| Ethernet || N/A ||
|-
| Micro USB || Yes || OTG
|-
| Keyboard || Yes || Slightly modified keyboard layout, see https://www.spinics.net/lists/linux-omap/msg135137.html (TLDR; Shift key produces CTRL, SYM produces ALT, and Caps lock produces SHIFT)
|-
| Screen || Yes ||
|-
| 3D Acceleration || Not yet || PowerVR SGX540 (closed driver) - see [[Motorola Droid 4/PowerVR]]
|-
| Touchscreen || Yes || Capacitive
|-
| Audio || Yes ||
|-
| 2G/3G data || WIP || Reported to work, no UI yet - see https://github.com/maemo-leste/connui-cellular/
|-
| SMS || WIP || Reported to work, no UI yet
|-
| Phone calls || WIP || Reported to work, no UI yet
|-
| Bluetooth || Yes || Needs firmware - see [[#Bluetooth|below]].  See also https://github.com/maemo-leste/bugtracker/issues/290.
|-
| FM Transmitter || N/A ||
|-
| FM Receiver || Not yet ||
|-
| Accelerometer || ? || Available as input device, needs MCE work
|-
| Proximity sensor || ? ||
|-
| HDMI-out || WIP || works, but not with hildon-desktop
|-
| TV-out || N/A ||
|-
| Vibration Motor || Yes ||
|-
|Compass || No || Mainline supports it, so Leste needs to add config - see https://github.com/maemo-leste/bugtracker/issues/294
|}


== Installation ==
== Installation ==
Line 94: Line 73:


# VRZ_XT894_9.8.2O-72_VZW-18-8_CFC.xml.zip
# VRZ_XT894_9.8.2O-72_VZW-18-8_CFC.xml.zip
# Latest maemo-leste-1.0-armhf-droid4-*.img.xz (NOTE: 20200112 image may have issues with WiFi)
# flash-droid-4-fw.sh
# Latest maemo-leste-1.0-armhf-droid4-*.img.xz


Download from https://github.com/tmlind/droid4-kexecboot.git
Download from https://github.com/tmlind/droid4-kexecboot.git
Line 100: Line 80:
# utags-mmcblk1p13.bin
# utags-mmcblk1p13.bin
# droid4-kexecboot.img
# droid4-kexecboot.img
Check what kernel version your Android OS runs.
For this go to Settings -> About phone. Slide to the bottom, where you can see "Kernel version".
If you have at least 3.0.8, you may skip "Updating Android" step below.


Installation:
Installation:
Line 108: Line 92:
# Start the device in fastboot mode. For this press power button and bottom volume key simultaneously and release them after a second.
# Start the device in fastboot mode. For this press power button and bottom volume key simultaneously and release them after a second.


Now go to the working directory and run:
=== Updating Android ===
 
This will reinstall the Android OS on your device, deleting all user data. Do a backup, if you want to save something. When everything is ready, go to the working directory mentioned above and run:
<pre>
pushd VRZ_XT894_9.8.2O-72_VZW-18-8_CFC.xml
sudo bash ../flash-droid-4-fw.sh
popd
</pre>
 
=== Setting up kexecboot ===
 
Now, assuming you are in the working directory, install kexecboot:


<pre>
<pre>
Line 118: Line 113:
</pre>
</pre>


The device should reboot and show kexecboot menu for a few seconds before it boots to Android.
If you did "Updating Android" the device should run the firstboot steps.
If you didn't, the device should reboot and show kexecboot menu for a few seconds before it boots to Android.
 
=== Install Maemo Leste to the sdcard ===


Now, flash the Maemo Leste image to your sdcard:
Now, flash the Maemo Leste image to your sdcard:
Line 124: Line 122:
On Linux:
On Linux:
<pre>
<pre>
xzcat maemo-leste-1.0-armhf-droid4-20190227.img.xz | sudo dd of=/dev/MICROSDCARD-DEVICE
xzcat maemo-leste-1.0-armhf-droid4-20190227.img.xz | sudo dd status=progress bs=1M of=/dev/MICROSDCARD-DEVICE
sync
sync
</pre>
</pre>
Line 132: Line 130:
Wait for sync to complete and insert MicroSD card into Droid4. Reboot the device and select Maemo Leste from the kexecboot menu.
Wait for sync to complete and insert MicroSD card into Droid4. Reboot the device and select Maemo Leste from the kexecboot menu.


You should now see Maemo Leste booting up, and it will show you unaccelerated hildon-desktop after a minute.
You should now see Maemo Leste booting up, and it will show you hildon-desktop after a minute.
 
== Postinstall notes for 20200112 image ==
 
=== Wifi ===
 
Requires wpasupplicant and firmware-ti-connectivity from ascii-backports (needs to get added to sources.list)
 
deb http://pkgmaster.devuan.org/merged ascii-backports main contrib non-free
 
apt install -t ascii-backports wpasupplicant
apt install -t ascii-backports firmware-ti-connectivity
 
Installing Bluetooth firmware in order to have working Wi-Fi is also required.
 
=== Bluetooth ===
 
Requires https://github.com/TI-ECS/bt-firmware/blob/master/TIInit_10.6.15.bts to go in /lib/firmware/ti-connectivity/
 
$ sha256sum TIInit_10.6.15.bts
85dc6539436319fa1301277c171f9fd65b716279900bc686a76578ab24cc7793  TIInit_10.6.15.bts


=== Sound ===
== Updating ==


This needs to be executed after each boot by hand ;
Normally you can just apt update && apt dist-upgrade to update to the latest version. If for some reason this fails:


modprobe snd-soc-cpcap
* Poweroff device, grab the SD card
modprobe snd-soc-motmdm
* Backup any important files
modprobe snd-soc-audio-graph-card
* Grab the latest image from https://phoenix.maemo.org/view/Images/
* Write it as before : xzcat maemo-leste-1.0-armhf-droid4-20190227.img.xz | sudo dd status=progress bs=1M of=/dev/MICROSDCARD-DEVICE


== Notes ==
== Notes ==
Line 167: Line 146:


If Maemo is still running, you can also hold just the power button for ~10 seconds, and the device will run poweroff.
If Maemo is still running, you can also hold just the power button for ~10 seconds, and the device will run poweroff.
Some users reported that Bluetooth kernel module interfere badly with the WiFi driver on their devices.
Blacklisting the module may help if you have such problems:
echo "blacklist hci_uart" >> /etc/modprobe.d/blacklist.conf


Also see [[Motorola_Droid_4/Modem]] [[Motorola_Droid_4/PowerVR]]
Also see [[Motorola_Droid_4/Modem]] [[Motorola_Droid_4/PowerVR]]


Also see: http://elektranox.org/droid4/ and http://muru.com/linux/d4/
Also see: http://elektranox.org/droid4/ and http://muru.com/linux/d4/
The keyboard layout is extended to provide more standard keys.
[[File:Maemo-leste-droid4-kbd-2021-07.png|center|620px|thumb|maemo-leste droid4 keyboard]]
Key mapping can be tested with the 'xev' program.
It may be necessary to run the follow commands as root in order to get the OK key to function correctly (see [https://github.com/maemo-leste/bugtracker/issues/510#issuecomment-815618591 here]):
udevadm hwdb --update
udevadm trigger


== Serial Cable ==
== Serial Cable ==
Line 183: Line 175:
18:45 < tmlind> try plugging in a pc usb cable then back to uart cable in case that might help
18:45 < tmlind> try plugging in a pc usb cable then back to uart cable in case that might help
</pre>
</pre>
== Bluetooth ==
Needs firmware - install latest firmware-ti-connectivity - See also https://github.com/maemo-leste/bugtracker/issues/290. Due to interference with WiFi, load driver manually, AFTER wifi module loaded. So you should do:
<pre>
sudo apt install firmware-ti-connectivity
sudo modprobe hci_uart
sudo hciconfig hci0 up
sudo hcitool lescan
</pre>
== Stuff to try ==
==== Using a battery without temperature sensor ====
Modprobe the pmic driver as follows:
<pre>
cpcap-battery ignore_temperature_probe=1
</pre>
==== Flashing the boot logo ====
More info: https://github.com/xsetiadi/droid4-kexecboot/blob/master/LOGO
<pre>
15:04 < tmlind> Wizzup: i think the logo on droid4 can be flashed with fastboot flash logo logo.bin or something, can also be just written to logo partition from m-l
[snip]
09:24 < xsetiadi> https://github.com/xsetiadi/droid4-kexecboot/blob/master/logo.bin
09:25 < xsetiadi> becarefull, you can bootloop droid4 if you wrong flash partition
09:26 < xsetiadi> like i do last year
09:26 < xsetiadi> instead of flashing using command: fastboot flash logo.bin logo.bin i just flash it with command: fastboot flash logo logo.bin
</pre>
==== Blinkenlights ====
Adding this in rc.local above the ''exit 0'' gets you some blinkenlights to watschen und relaxen.
echo cpu > /sys/class/leds/lm3532::kbd_backlight/trigger # gets you a cpu activity monitor on the keyboard backlight
echo mmc0 > /sys/class/leds/shift-key-light/trigger      # gets you a 'hdd led' of the SD card on the capslock light
==== USSD ====
<pre>
22:45 < tmlind> fyi, here's how to send USSD to query balance for example: printf "AT+CUSD=1,#999#,0\r" > /dev/motmdm1
22:47 < tmlind> fyi, for parsing incoming USSD, this web interface works if set to utf-8:
                https://www.mobilefish.com/services/latin_utf_base64_to_hex/latin_utf_base64_to_hex.php#text_hex_output
</pre>
==== HDMI ====
Move output to external 1080p monitor.  Disabling DSI-1 output gets xorg pointer displayed on HDMI, for use with a mouse or barrier. 
<pre>
xrandr --output HDMI-1 --mode 1920x1080 --output DSI-1 --off
</pre>
Return to internal touchscreen display.
<pre>
xrandr --output DSI-1 --auto --rotate right --output HDMI-1 --off
</pre>
If one wants to mirror the screen on HDMI, this can be done like so, for landscape:
<pre>
xrandr --newmode "960x540_60.00"  40.75  960 992 1088 1216  540 543 548 562 -hsync +vsync
xrandr --addmode HDMI-1 "960x540_60.00"
xrandr --output HDMI-1 --mode "960x540_60.00" --same-as DSI-1
</pre>
For rotation, something like this might or might not work:
<pre>
xrandr --newmode "960x540_60.00ROT" 43.00  544 576 632 720  960 963 973 996 -hsync +vsync
xrandr --addmode HDMI-1 "960x540_60.00ROT"
xrandr --output HDMI-1 --mode "960x540_60.00" --same-as DSI-1 --rotate right
</pre>
==== Keyboard / Mouse sharing with PC ====
To use droid4 while working at desktop it can be convenient to share mouse and keyboard of the host pc with droid4. 
<pre>
[https://github.com/debauchee/barrier Barrier software-KVM switch]
</pre>
Developers and testers may wish to disable the googley bits before compiling.
==== BT Audio headset ====
sudo apt install pulseaudio-module-bluetooth blueman bluez
sudo modprobe hci_uart
pactl load-module module-bluetooth-discover
blueman-manager
Pair & trust your device in blueman, connect audiosink. You can close blueman now. The quality seems a bit better in 'offline mode'.
==== Torch ====
The Droid 4 has a TI LM3559 flash torch controller. This provides flash functionality when taking pictures, usage as a torch, and provides privacy indication (in this mode, the LED flashes in a fast heartbeat pattern). A driver for it exists in mainline, but it requires some DTS work, since it is tied to a camera device.
If you want to use it in the meantime, direct i2c access can be used as follows (since this is direct access, be careful about each of the commands below):
<source>
##Install the prerequisites
$ sudo apt install i2c-tools
## Turn LED on in torch mode
$ sudo i2cset -y 2 0x53 0x10 0x1a
## Turn LED on in privacy indication mode
$ sudo i2cset -y 2 0x53 0x10 0x19
## Turn LED off (in any mode)
$ sudo i2cset -y 2 0x53 0x10 0x18
## Use LED for doing a hella bright flash for some time once and then turn off
$ sudo i2cset -y 2 0x53 0x10 0x1b
</source>
== Using a configured Leste sdcard in a different Droid4 ==
A configured Droid4 Leste installation is unique to the device that it was calibrated on.  Particularly the wlan firmware calibration will be incorrect if an existing Leste installation is transferred to a different device. 
The wifi calibration script requires a system set to stock settings to calibrate-from.  It cannot just be re-run on an already calibrated system.
To recalibrate the wifi firmware on a different Droid4, you must reset the FEM parameters to stock settings on the new device, then recalibrate. 
If you can get the device online (usb networking or moving close to the WLAN AP) this can be done with.
apt reinstall firmware-ti-connectivity
If not, you can download the firmware-ti-connectivity_[version]_all.deb on another Leste device
apt download firmware-ti-connectivity
Then copy the .deb to your new device and install that (as root) with
dpkg -i firmware-ti-connectivity_[version]_all.deb
Then (as root) re-calibrate the wifi chip by running
/usr/bin/maserati-calibrate
Then reboot.


== Gallery ==
== Gallery ==
Line 191: Line 314:
Droid4_htop.jpg
Droid4_htop.jpg
Droid4_leste_logo.jpg
Droid4_leste_logo.jpg
Cant_have_2_much_leste.jpg
Leste-neverball.jpg
Statsfun.jpg
Leste-glmatrix.png
Droid4-leste-utox2.jpg
Droid4-leste-pcsx.jpg
Droid4-leste-surf_master.jpg
Droid4_Daimonin_Hdmi.jpg
</gallery>
</gallery>
== Old status overview ==
{| class="wikitable"
! Feature
! Leste supported
! Notes
|-
| Kernel version || 5.9.0 || Mainline + some patches not yet in mainline - see https://github.com/maemo-leste/droid4-linux
|-
| Serial || Yes || On MicroUSB port, requires [[#Serial Cable|special cable]]
|-
| Charging || Yes ||
|-
| Wireless || Yes ||
|-
| Ethernet || N/A ||
|-
| Micro USB || Yes || OTG and USB network
|-
| Keyboard || Yes || Slightly modified keyboard layout, see https://www.spinics.net/lists/linux-omap/msg135137.html (TLDR; Shift key produces CTRL, SYM produces ALT, and Caps lock produces SHIFT)
|-
| Screen || Yes ||
|-
| 3D Acceleration || Yes || PowerVR SGX540 (closed driver) - https://github.com/maemo-leste/pvr-omap4/
|-
| Touchscreen || Yes || Capacitive
|-
| Audio || Yes || Implemented with Pulseaudio and UCM files
|-
| 2G/3G data || Yes || Works with ofono, no UI yet - see https://github.com/maemo-leste/connui-cellular/
|-
| 4G data || No || Needs kernel work
|-
| SMS || Yes || Works with ofono. Needs Leste UI
|-
| Phone calls || Yes || Works with ofono (good call quality, too), needs Leste UI
|-
| Bluetooth || Yes || Needs firmware - install latest firmware-ti-connectivity - See also https://github.com/maemo-leste/bugtracker/issues/290. Due to interference with WiFi, load driver manually, AFTER wifi module loaded
|-
| FM Transmitter || No || Apparently exists, and will need serdev kernel modules/drivers
|-
| FM Receiver || Not yet ||
|-
| Accelerometer || Yes || Available in /sys, and as input device via iio-uinput
|-
| Compass || Yes || Available in /sys (after loading ak8975 module. No Leste integration applications using it yet)
|-
| Gyro || N/A ||
|-
| Proximity sensor || Yes ||
|-
| Ambient Light Sensor || Yes ||
|-
| Vibration Motor || Yes ||
|-
| HDMI-out || Yes || No UI integration
|-
| TV-out || N/A ||
|-
| GPS || Yes || Works with gpsd but is not integrated yet, see [[#GPS|GPS]]
|-
| Infrared || N/A || Missing in hardware
|-
| Camera || No || See https://elektranox.org/2018/02/0025-droid-camera/
|-
| Idle power consumption || ~120mW || Needs sim inserted
|}


[[Category:Device]]
[[Category:Device]]

Latest revision as of 11:04, 20 October 2023

Motorola Droid 4
Motorola Droid 4 - Leste pre-alpha.jpg
Manufacturer Motorola
Codename Maserati XT894
Dimensions 127x67.3x12.7mm
Release Date 2012-02-10
Category Supported
Specifications
SoC TI OMAP4430
Cortex-A9
Armv7‑A
DRAM 1024MB DDR2
Hardware Features
LCD 960x540 4"
Video PowerVR SGX540
Storage 16GB flash
Sensors AK8975 compass,
LIS3DH accelerometer,
TMP105 temperature,
ISL29030 proximity and illuminance
Software Features
Kernel 5.18.x
Serial Yes, special cable
Charging Yes
USB Slave Yes
USB Host Yes
Touchscreen Yes
Keyboard Yes
Screen Yes
HDMI-out Yes
3D acceleration Yes [1] (closed)
Vibration motor Yes
Audio Yes
Phone calls Yes
SMS Yes
Wifi Yes
2G/3G data Yes
Bluetooth Yes, see notes
FM transmitter No, but apparently exists, needs serdev kernel modules/drivers
Accelerometer Yes
Compass Yes, no integration
Proximity Sensor Yes
Ambient Light Sensor Yes
GPS Yes
A-GPS No
Front Camera No
Back Camera(s) No
Idle Power Consumption 120mW

Installation

Hardware requirements:

  • Droid4 with fully charged battery
  • MicroUSB cable
  • MicroSD card

Software requirements:

  • Host Linux or Windows system
  • Android Tools: fastboot
  • Flashing tools:
    • XZ Utils and coreutils for Linux
    • Etcher[2] for Windows

Download from https://maedevu.maemo.org/images/droid4/

  1. VRZ_XT894_9.8.2O-72_VZW-18-8_CFC.xml.zip
  2. flash-droid-4-fw.sh
  3. Latest maemo-leste-1.0-armhf-droid4-*.img.xz

Download from https://github.com/tmlind/droid4-kexecboot.git

  1. utags-mmcblk1p13.bin
  2. droid4-kexecboot.img

Check what kernel version your Android OS runs. For this go to Settings -> About phone. Slide to the bottom, where you can see "Kernel version". If you have at least 3.0.8, you may skip "Updating Android" step below.

Installation:

  1. Create a working directory with above mentioned files in it
  2. unzip VRZ_XT894_9.8.2O-72_VZW-18-8_CFC.xml.zip
  3. Power off Droid4 and connect it to the host machine with MicroUSB cable
  4. Start the device in fastboot mode. For this press power button and bottom volume key simultaneously and release them after a second.

Updating Android

This will reinstall the Android OS on your device, deleting all user data. Do a backup, if you want to save something. When everything is ready, go to the working directory mentioned above and run:

pushd VRZ_XT894_9.8.2O-72_VZW-18-8_CFC.xml
sudo bash ../flash-droid-4-fw.sh
popd

Setting up kexecboot

Now, assuming you are in the working directory, install kexecboot:

sudo fastboot flash mbm VRZ_XT894_9.8.2O-72_VZW-18-8_CFC.xml/allow-mbmloader-flashing-mbm.bin
sudo fastboot reboot-bootloader
sudo fastboot flash bpsw droid4-kexecboot.img
sudo fastboot flash utags utags-mmcblk1p13.bin
sudo fastboot reboot

If you did "Updating Android" the device should run the firstboot steps. If you didn't, the device should reboot and show kexecboot menu for a few seconds before it boots to Android.

Install Maemo Leste to the sdcard

Now, flash the Maemo Leste image to your sdcard:

On Linux:

xzcat maemo-leste-1.0-armhf-droid4-20190227.img.xz | sudo dd status=progress bs=1M of=/dev/MICROSDCARD-DEVICE
sync

On Windows: Use Etcher

Wait for sync to complete and insert MicroSD card into Droid4. Reboot the device and select Maemo Leste from the kexecboot menu.

You should now see Maemo Leste booting up, and it will show you hildon-desktop after a minute.

Updating

Normally you can just apt update && apt dist-upgrade to update to the latest version. If for some reason this fails:

  • Poweroff device, grab the SD card
  • Backup any important files
  • Grab the latest image from https://phoenix.maemo.org/view/Images/
  • Write it as before : xzcat maemo-leste-1.0-armhf-droid4-20190227.img.xz | sudo dd status=progress bs=1M of=/dev/MICROSDCARD-DEVICE

Notes

The battery in Droid4 is not easily removable. If you got the device stuck, use this combo: power button + bottom volume key. You should hold them for about 7 seconds. Droid4 will then reboot.

If Maemo is still running, you can also hold just the power button for ~10 seconds, and the device will run poweroff.

Some users reported that Bluetooth kernel module interfere badly with the WiFi driver on their devices. Blacklisting the module may help if you have such problems:

echo "blacklist hci_uart" >> /etc/modprobe.d/blacklist.conf

Also see Motorola_Droid_4/Modem Motorola_Droid_4/PowerVR

Also see: http://elektranox.org/droid4/ and http://muru.com/linux/d4/


The keyboard layout is extended to provide more standard keys.

maemo-leste droid4 keyboard

Key mapping can be tested with the 'xev' program.

It may be necessary to run the follow commands as root in order to get the OK key to function correctly (see here):

udevadm hwdb --update
udevadm trigger

Serial Cable

As explained at http://muru.com/linux/d4 , the Droid 4 exposes a serial console on the USB port. You can construct the required cable easily by following the instructions there. If you have old Nokia CA-42 or DKU-5 cables, then you can use them with the Droid 4, using instructions at https://jethomson.wordpress.com/2010/02/21/diy-usb-to-serial-cable-for-3usd/

While using the serial cable, if you lose the connection, the following may help:

18:43 < tmlind> sicelo: hmm the uart debug cable multiplexing still has issues, if the uart disappears during boot it should come back with 
                the console login propt later
18:45 < tmlind> try plugging in a pc usb cable then back to uart cable in case that might help

Bluetooth

Needs firmware - install latest firmware-ti-connectivity - See also https://github.com/maemo-leste/bugtracker/issues/290. Due to interference with WiFi, load driver manually, AFTER wifi module loaded. So you should do:

sudo apt install firmware-ti-connectivity
sudo modprobe hci_uart
sudo hciconfig hci0 up
sudo hcitool lescan


Stuff to try

Using a battery without temperature sensor

Modprobe the pmic driver as follows:

cpcap-battery ignore_temperature_probe=1

More info: https://github.com/xsetiadi/droid4-kexecboot/blob/master/LOGO

15:04 < tmlind> Wizzup: i think the logo on droid4 can be flashed with fastboot flash logo logo.bin or something, can also be just written to logo partition from m-l
[snip]
09:24 < xsetiadi> https://github.com/xsetiadi/droid4-kexecboot/blob/master/logo.bin
09:25 < xsetiadi> becarefull, you can bootloop droid4 if you wrong flash partition
09:26 < xsetiadi> like i do last year
09:26 < xsetiadi> instead of flashing using command: fastboot flash logo.bin logo.bin i just flash it with command: fastboot flash logo logo.bin

Blinkenlights

Adding this in rc.local above the exit 0 gets you some blinkenlights to watschen und relaxen.

echo cpu > /sys/class/leds/lm3532::kbd_backlight/trigger # gets you a cpu activity monitor on the keyboard backlight
echo mmc0 > /sys/class/leds/shift-key-light/trigger      # gets you a 'hdd led' of the SD card on the capslock light

USSD

22:45 < tmlind> fyi, here's how to send USSD to query balance for example: printf "AT+CUSD=1,#999#,0\r" > /dev/motmdm1
22:47 < tmlind> fyi, for parsing incoming USSD, this web interface works if set to utf-8: 
                https://www.mobilefish.com/services/latin_utf_base64_to_hex/latin_utf_base64_to_hex.php#text_hex_output

HDMI

Move output to external 1080p monitor. Disabling DSI-1 output gets xorg pointer displayed on HDMI, for use with a mouse or barrier.

xrandr --output HDMI-1 --mode 1920x1080 --output DSI-1 --off

Return to internal touchscreen display.

xrandr --output DSI-1 --auto --rotate right --output HDMI-1 --off


If one wants to mirror the screen on HDMI, this can be done like so, for landscape:

xrandr --newmode "960x540_60.00"   40.75  960 992 1088 1216  540 543 548 562 -hsync +vsync
xrandr --addmode HDMI-1 "960x540_60.00"
xrandr --output HDMI-1 --mode "960x540_60.00" --same-as DSI-1

For rotation, something like this might or might not work:

xrandr --newmode "960x540_60.00ROT" 43.00  544 576 632 720  960 963 973 996 -hsync +vsync
xrandr --addmode HDMI-1 "960x540_60.00ROT"
xrandr --output HDMI-1 --mode "960x540_60.00" --same-as DSI-1 --rotate right

Keyboard / Mouse sharing with PC

To use droid4 while working at desktop it can be convenient to share mouse and keyboard of the host pc with droid4.

[https://github.com/debauchee/barrier Barrier software-KVM switch]

Developers and testers may wish to disable the googley bits before compiling.

BT Audio headset

sudo apt install pulseaudio-module-bluetooth blueman bluez
sudo modprobe hci_uart
pactl load-module module-bluetooth-discover
blueman-manager

Pair & trust your device in blueman, connect audiosink. You can close blueman now. The quality seems a bit better in 'offline mode'.

Torch

The Droid 4 has a TI LM3559 flash torch controller. This provides flash functionality when taking pictures, usage as a torch, and provides privacy indication (in this mode, the LED flashes in a fast heartbeat pattern). A driver for it exists in mainline, but it requires some DTS work, since it is tied to a camera device.

If you want to use it in the meantime, direct i2c access can be used as follows (since this is direct access, be careful about each of the commands below):

##Install the prerequisites
$ sudo apt install i2c-tools

## Turn LED on in torch mode
$ sudo i2cset -y 2 0x53 0x10 0x1a

## Turn LED on in privacy indication mode
$ sudo i2cset -y 2 0x53 0x10 0x19

## Turn LED off (in any mode)
$ sudo i2cset -y 2 0x53 0x10 0x18

## Use LED for doing a hella bright flash for some time once and then turn off
$ sudo i2cset -y 2 0x53 0x10 0x1b

Using a configured Leste sdcard in a different Droid4

A configured Droid4 Leste installation is unique to the device that it was calibrated on. Particularly the wlan firmware calibration will be incorrect if an existing Leste installation is transferred to a different device.

The wifi calibration script requires a system set to stock settings to calibrate-from. It cannot just be re-run on an already calibrated system.

To recalibrate the wifi firmware on a different Droid4, you must reset the FEM parameters to stock settings on the new device, then recalibrate. If you can get the device online (usb networking or moving close to the WLAN AP) this can be done with.

apt reinstall firmware-ti-connectivity 

If not, you can download the firmware-ti-connectivity_[version]_all.deb on another Leste device

apt download firmware-ti-connectivity

Then copy the .deb to your new device and install that (as root) with

dpkg -i firmware-ti-connectivity_[version]_all.deb 

Then (as root) re-calibrate the wifi chip by running

/usr/bin/maserati-calibrate

Then reboot.

Gallery

Old status overview

Feature Leste supported Notes
Kernel version 5.9.0 Mainline + some patches not yet in mainline - see https://github.com/maemo-leste/droid4-linux
Serial Yes On MicroUSB port, requires special cable
Charging Yes
Wireless Yes
Ethernet N/A
Micro USB Yes OTG and USB network
Keyboard Yes Slightly modified keyboard layout, see https://www.spinics.net/lists/linux-omap/msg135137.html (TLDR; Shift key produces CTRL, SYM produces ALT, and Caps lock produces SHIFT)
Screen Yes
3D Acceleration Yes PowerVR SGX540 (closed driver) - https://github.com/maemo-leste/pvr-omap4/
Touchscreen Yes Capacitive
Audio Yes Implemented with Pulseaudio and UCM files
2G/3G data Yes Works with ofono, no UI yet - see https://github.com/maemo-leste/connui-cellular/
4G data No Needs kernel work
SMS Yes Works with ofono. Needs Leste UI
Phone calls Yes Works with ofono (good call quality, too), needs Leste UI
Bluetooth Yes Needs firmware - install latest firmware-ti-connectivity - See also https://github.com/maemo-leste/bugtracker/issues/290. Due to interference with WiFi, load driver manually, AFTER wifi module loaded
FM Transmitter No Apparently exists, and will need serdev kernel modules/drivers
FM Receiver Not yet
Accelerometer Yes Available in /sys, and as input device via iio-uinput
Compass Yes Available in /sys (after loading ak8975 module. No Leste integration applications using it yet)
Gyro N/A
Proximity sensor Yes
Ambient Light Sensor Yes
Vibration Motor Yes
HDMI-out Yes No UI integration
TV-out N/A
GPS Yes Works with gpsd but is not integrated yet, see GPS
Infrared N/A Missing in hardware
Camera No See https://elektranox.org/2018/02/0025-droid-camera/
Idle power consumption ~120mW Needs sim inserted