Jump to content

Google Pixel 3a (google-sargo)

From postmarketOS Wiki
(Redirected from Google-sargo)
Google Pixel 3a
Google Pixel 3a
Google Pixel 3a
Manufacturer Google
Name Pixel 3a
Codename google-sargo
Released 2019
Type handset
Hardware
Chipset Qualcomm Snapdragon 670 (SDM670)
CPU 2x 2.0 GHz 360 Gold
6x 1.7 GHz Kryo 360 Silver
GPU Adreno 615
Display 1080x2220 OLED
Storage 64 GB
Memory 4 GB
Architecture aarch64
Software
Original software
The software and version the device was shipped with.
Android 9
Extended version
The most recent supported version from the manufacturer.
Android
postmarketOS
Category community
Pre-built images
Whether pre-built images are available here.
yes
Mainline
Instead of a Linux kernel fork, it is possible to run (Close to) Mainline.
yes
pmOS kernel
The kernel version that runs on the device's port.
6.15.2
Unixbench score
Unixbench Whetstone/Dhrystone score. See Unixbench.
4417.7
Device package device-google-sargo
Kernel package linux-postmarketos-qcom-sdm670
Initial MR
Initial merge request.
pmaports!3136
Features
Flashing
It is possible to flash the device with pmbootstrap flasher.
Works
USB Networking
After connecting the device with USB to your PC, you can connect to it via telnet (initramfs) or SSH (booted system).
Works
Internal storage
eMMC, SD cards, UFS, ...
Works
Battery
Charging and battery level reporting works
Partial
Screen
Display works. Ideally with sleep mode and brightness control.
Works
Touchscreen
Works
Multimedia
3D Acceleration
Works
Audio
Audio playback, microphone, headset and buttons.
Partial
Camera
Partial
Camera Flash
Works
Connectivity
WiFi
Partial
Bluetooth
Works
GPS
Partial
NFC
Near Field Communication
Partial
Modem
Calls
Partial
SMS
Works
Mobile data
Works
Miscellaneous
FDE
Full disk encryption and unlocking with unl0kr.
Works
USB OTG
USB On-The-Go or USB-C Role switching
Broken
Sensors
Accelerometer
Auto screen rotation works in desktops e.g. Phosh or Plasma Mobile
Works
Magnetometer
Sensor to measure magnetism
Broken
Ambient Light
Works
Proximity
Works
Haptics
Works

Contributors

Maintainers

  • Flamingradian (releasing kernel upgrades, testing kernel upgrades on non-XL devices)

Users owning this device


How to enter flash mode

Hold Volume Down and Power until device loads into Fastboot

Fastboot commands

Might be convenient for dual boot

  • fastboot getvar current-slot
  • fastboot set_active a and fastboot set_active b

How to unlock the bootloader

Note If you already have a custom ROM installed with the bootloader unlocked, skip this section.

On Android, go to the About phone page in the Settings app. Click on the build number 7 times to enable developer settings. You will be prompted for your PIN or password.

In the Settings main page, go to System, then Developer options. Enable OEM unlocking.

No unlock codes are needed to enable unlocking on this device.

Before flashing anything, you need to unlock the bootloader in fastboot mode with this command:

$ fastboot flashing unlock

Follow the prompts on your device's screen to complete the operation. This will erase your data.

Update firmware

If you plan to use a pre-built image, vbmeta won't be included, which is required on old boot firmware. You will need to ensure the firmware is up-to-date.

Installing an Android 12 OEM update will upgrade the firmware, but only on the slot to which the upgrade is installing. If you wish to leave the latest Android slot in tact, the firmware on the opposite slot can be updated by sideloading the latest OEM image as follows:

1. Enter recovery mode, either by holding Volume Up and Power until device loads into recovery or by booting Android and rebooting into recovery:

$ adb reboot recovery

2. In recovery, select "Apply update from ADB".

3. Sideload the latest image, which can be obtained here.

$ adb sideload /path/to/image.zip

4. Switch to the other slot (where you intend to install postmarketos) and boot Android once before proceeding with installation.

Installation

The installation process is similar to other well-supported Android phones, as documented here. This section documents some quirks in installation.

There is also a device-specific installation guide which is a work-in-progress but is more detailed in some respects and covers additional installation options.

Using pmbootstrap

Follow Installation/Using pmbootstrap. When asked for the device's vendor/codename, select Google as the vendor and sargo as the codename.

To flash the image to the device:

  • Enter flashing mode (see #How to enter flash mode)
  • Run pmbootstrap flasher flash_rootfs
  • Run pmbootstrap flasher flash_kernel to flash the kernel
  • (if device says Bootloader version: b4s4-0.2-XXXXXXX) Run pmbootstrap flasher flash_vbmeta

Using pre-built images

Follow Installation/Using_a_pre-built_image. There is no pre-built vbmeta image, so you first need to update your bootloader on the slot for postmarketOS, documented in the #Update firmware section.

Pre-built images are available in edge channel and in stable (v25.06).

For a typical installation, flash to the userdata partition, e.g.:

$ fastboot flash boot 20241017-1407-postmarketOS-edge-phosh-22.4-google-sargo-boot.img
	
$ fastboot flash userdata 20241017-1407-postmarketOS-edge-phosh-22.4-google-sargo.img

Bootloader configuration

The bootloader on the Pixel 3a appends console=null to the kernel cmdline by default, but this can cause issues with the boot process. A custom manufacturer fastboot command can configure console=tty0:

$ fastboot oem uart enable

Dual-boot installation

Notice When requesting support, you should state your intention of dual-booting and accepting the reduced drive space. Users are generally assumed to not want this option.

A dual-boot installation will only provide up to 4.0 GB of storage.

Dual booting can allow you to use Android for missing features, check on the project occasionally from the comfort of a device running your main OS, and attempt to replicate the remaining Android-only features. It will normally keep all data stored on your device (it may erase data if you or the software make mistakes). However, an increasing number of users are buying Pixels for the sole purpose of exclusively running postmarketOS. The option to dual boot has been a source of confusion for these users.

Directions to install for dual-boot

This device uses Android dynamic partitions and Android AB Slots.

For dual-boot (important for developing without affecting your phone's normal usability), you can flash to the system_b dynamic partition.

$ fastboot set_active a
$ fastboot reboot fastboot # this will change the UI shown on the device

Once in the fastboot screen, you can flash.

$ fastboot delete-logical-partition vendor_b # optional, for more space
$ fastboot delete-logical-partition product_b # optional, for more space
$ fastboot delete-logical-partition system_ext_b # optional, for more space
$ pmbootstrap flasher flash_rootfs --partition system_b
$ fastboot resize-logical-partition system_b 4068474880 # or 1176113152, if you skip deleting the other partitions
$ fastboot set_active b
$ pmbootstrap flasher flash_kernel # this defaults to boot_<slot>, so it should run after the active slot is changed
$ fastboot reboot

It is also possible to flash to the GPT-defined (GUID Partition Table-defined) system_b partition with 3.1 GB, which may be required in the future (see pmaports#3219). This can be done with pmbootstrap export and fastboot flash --force system_b /tmp/postmarketOS-export/google-sargo.img.

DTBO

Thanks to a hack in the kernel fork, you do not need to erase the DTBO partition. Keeping the DTBO comes with a side effect. Instead of seeing "Google Pixel 3a" as the machine name, you might see something like "Google Inc. MSM sdm670 S4 PVT v1.0".

If you don't like this side effect, erasing the DTBO is simple and normal for most mainline device ports:

$ fastboot erase dtbo

Safety

The developers want to make it safe to enjoy the entire phone with postmarketOS, but some work is either not started or incomplete. These are known missing protections that would normally be present on Android. Even outside of this list, anything can happen.

Battery

There could be a power surge when charging or inside the phone. The overcurrent protection hardware currently has no driver.

Overcurrent protection is expected to intervene anyway, even though this hasn't been fully verified against the hardware registers.

Calls

Call audio may be loud unless you manually adjust it on the command line. Call audio goes directly from the modem to the ADSP via proprietary firmware, so volume cannot be applied in software.

These commands let you set the hardware volume (the numbers are the default values at -0dB, or full volume):

$ amixer -c 0 cset name='Top Digital PCM Volume' 816 # Earpiece
$ amixer -c 0 cset name='Bottom Digital PCM Volume' 816 # Speaker
$ amixer -c 0 cset name='Digital RX1 Digital Volume' 84 # Headphones Left
$ amixer -c 0 cset name='Digital RX2 Digital Volume' 84 # Headphones Right
# alsactl store # Make this configuration persist across reboots

Pending changes (built-in speakers):

Emergency calls and alerts

Smartphones are normally expected to have working emergency calls and emergency/presidential alerts. The developers have limited influence on carriers so it's difficult to simulate these situations for reverse engineering.

To mitigate this risk, you might need to have access to another phone.

Pending changes (emergency alerts):

Camera

Camera apps with automatic exposure may show rapidly flashing lights. The automatic exposure used in libcamera oscillates in bright environments, making the preview flash between bright and dark.

If you are sensitive to flashing lights, the only safe camera app is Megapixels which doesn't have automatic exposure.

Verified boot

Anyone with physical access to your phone can install their own custom ROM or boot image. Android Verified Boot (AVB) with a custom key is unimplemented.

Each boot image is paired to the installation so only backups of the boot.img from the installation make it possible to reflash. If you suspect someone else flashed a custom boot.img, you can flash your backup boot.img.

WiFi

A lot of heat can be generated by uploading or transferring data from the phone over WiFi. There is currently no thermal mitigation to slow WiFi transmission.

When uploading lots of data at high speeds, check the temperature periodically. Other activities with the phone can pose a greater risk of overheating.

Hardware support

This section supplements the feature table with details and information about hardware not in the table. The best solution to problems described here is to contribute (or to find pending contributions).

Audio

You can get audio over Bluetooth, on the built-in speakers, on the built-in microphone, and on the 3.5 mm headphone jack. The built-in speakers and headphone jack only support 16-bit audio.

Battery

Support for charging was developed by the SDM845 mainlining community. Currently, some extra drivers are missing to get more than 1.5 Amps (7.5 Watts).

Calls

Notice Support for VoLTE is currently experimental and is managed by 81voltd. Calls may or may not work for you.

It is possible to make calls with the 3.5 mm jack, the built-in speakers, and built-in microphone. It is also possible to play music during calls.

Switching between audio devices will take effect when starting a call. In a call, audio will stop when switching until the next call.

Camera

Both cameras are supported to different extents.

The front camera (IMX355) can be used with libcamera/Pipewire-based programs (e.g. Snapshot) and with Megapixels.

The rear camera (IMX363) has a reverse-engineered driver and can be used with libcamera. On Snapshot, the purple tint and low field of vision may make its pictures unusable. The accompanying image stabilizer and focus actuator are not supported.

Fingerprint sensor

This device has the FPC1020 fingerprint sensor which is accessible through QSEECOM. There is no support for it.

GNSS

GPS is supported with manual intervention. It can take long to get a location because there is no A-GPS.

Location data from other GNSS systems (Galileo, GLONASS) might be discarded due to hardcoding in Geoclue and ModemManager.

NFC

NFC card detection works. Nothing else was tested. The embedded secure element seems to have no driver support.

Thermals

The CPU throttles at high temperatures. The Pixel 3a and Pixel 3a XL share thermal profiles. Throttling on the GPU has not been tested yet.

WiFi

WiFi is tested regularly in North America. In Europe, 5 GHz has been reported to not work (pmaports#3134).

You don't get the same MAC address as on Android, even though it is possible to detect the MAC address that Android uses (somewhere in /sys/firmware/devicetree/base/chosen/cdt/cdb2/wlan_mac1). Instead, it is generated with the serial number.

WiFi hotspots are on the same interface as the one used to connect to WiFi, so a hotspot cannot be set up over a WiFi connection, unlike on Android.

WoWLAN does not seem to work.

Tips and Tricks

Battery

Some settings to read and adjust the charging current and to enable/disable charging are exposed via sysfs.

Charging current limit in microamps:

$ cat /sys/class/power_supply/pm660-charger/current_max
1500000

Charging current in microamps:

$ cat /sys/class/power_supply/pm660-charger/current_now
1418183

Current going to the battery in microamps (negative for charging, positive for discharging):

$ /sys/class/power_supply/qcom-battery/current_now
-1327147

Set the current limit:

# tee /sys/class/power_supply/pm660-charger/current_max
500000
500000

Stop charging:

# tee /sys/class/power_supply/pm660-charger/status
Not charging
Not charging

Calls

Call audio goes directly from the modem to the ADSP via proprietary firmware, so volume cannot be applied in software. Volume can be controlled by hardware, but it is not hooked up to the normal volume controls. They are in the command line:

$ amixer -c 0 cset name='Top Digital PCM Volume' 70% # Earpiece
$ amixer -c 0 cset name='Bottom Digital PCM Volume' 70% # Speaker
$ amixer -c 0 cset name='Digital RX1 Digital Volume' 70% # Headphones Left
$ amixer -c 0 cset name='Digital RX2 Digital Volume' 70% # Headphones Right
# alsactl store # Make this configuration persist across reboots

You may need to enable software for VoLTE depending on your carrier. The 81voltd service is installed by default, but dormant until you run (as root) and reboot:

# rc-update add 81voltd

Camera

Megapixels doesn't control the exposure automatically. Camera apps with libcamera might not control the digital gain automatically. You can control the exposure, digital gain, and analog gain on the command line:

$ v4l2-ctl -d /dev/v4l-subdev18 -l
$ v4l2-ctl -d /dev/v4l-subdev18 -c exposure=65515
$ v4l2-ctl -d /dev/v4l-subdev18 -c digital_gain=4096
$ v4l2-ctl -d /dev/v4l-subdev18 -c analogue_gain=480
$ v4l2-ctl -d /dev/v4l-subdev19 -l
$ v4l2-ctl -d /dev/v4l-subdev19 -c exposure=2605
$ v4l2-ctl -d /dev/v4l-subdev19 -c digital_gain=4095
$ v4l2-ctl -d /dev/v4l-subdev19 -c analogue_gain=960

Audio

You can choose between Pipewire and Pulseaudio for audio.

Pulseaudio is the default. You have to manually switch to headphones.

Pipewire has extra features like automatic headphone switching, but can be unstable. By default, it is the camera provider, but not the audio provider. You make it the audio provider by installing the postmarketos-base-ui-audio-pipewire package with apk.

GPS

GPS currently requires manual intervention. By default, the engine lock prevents the device from getting a useful position and the modem only outputs proprietary GPS NMEA messages. You need to manually reconfigure the lock and disable the proprietary NMEA messages on every boot.

$ qmicli -d qrtr://0 --loc-set-engine-lock=mt
Successfully set engine lock
$ qmicli -d qrtr://0 --loc-set-nmea-types=all
Successfully set NMEA types

Sensors

FastRPC delivers sensor-related files to the modem to allow iio-sensor-proxy to discover sensors hosted by the ADSP.

The ADSP (Audio DSP, with the additional role as the SSC on this device) crashes and the device hangs after resuming from suspend if FastRPC continues while the device is suspended. A pre-suspend hook for elogind is installed to stop FastRPC communication and prevent this. In case your UI doesn't use elogind for suspend, you may need to disable FastRPC.

Disabling FastRPC:

# rc-update del hexagonrpcd-adsp-sensorspd

Enabling FastRPC:

# rc-update add hexagonrpcd-adsp-sensorspd

See (pmaports#3052).

Sensors hardware
Name Vendor Type
BMI160 Bosch IMU (combined accelerometer and gyroscope)
AK0991X AKM Magnetometer
TMD2725 AMS Proximity and Ambient Light Sensor
BMP380 Bosch Barometer
MAX11261 Maxim Unknown

Trusted Platform Module

The Pixel 3a's TPM, the Titan M, controls verified boot and is capable of performing cryptographic operations. It is currently not supported.

See also