Google Pixel 3a (google-sargo)

== Contributors ==
* BlackEyedSquid
== Maintainer(s) ==
* Flamingradian (non-XL devices)
== Users owning this device ==
== Entering Fastboot ==
Hold and 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
== Installation ==
Pre-built images are available in edge channel and in stable (v24.12).
You can follow a relatively typical installation using pmbootstrap as documented here or using the device-specific Installation guide. This section documents some quirks in installation.
=== 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
=== Flashing ===
Like most devices, the Pixel 3a has internal storage with partitions.
==== As main OS ====
For a normal installation with access to the majority of internal storage (53 GB), flashing can be done with simple commands:
$ pmbootstrap flasher flash_rootfs
$ pmbootstrap flasher flash_kernel
or:
$ xz -d 20241017-1407-postmarketOS-edge-phosh-22.4-google-sargo-boot.img.xz
$ fastboot flash boot 20241017-1407-postmarketOS-edge-phosh-22.4-google-sargo-boot.img
$ xz -d 20241017-1407-postmarketOS-edge-phosh-22.4-google-sargo.img.xz
$ fastboot flash userdata 20241017-1407-postmarketOS-edge-phosh-22.4-google-sargo.img
==== As dual-boot installation ====
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 ). 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
=== Audio provider ===
Pipewire is recommended for audio, but Pulseaudio is still the default audio provider. On the device, the audio provider is implemented as a package:
google-sargo:~# apk add postmarketos-base-ui-audio-pipewire
== Features ==
=== Battery ===
Support for charging was developed by the SDM845 mainlining community, with no thermals and only 1 A. There was passive cooling logic but it has been removed due to being faulty.
If you wish to run resource-intensive programs for long periods of time, you can manually monitor the battery temperature and adjust the charging current as appropriate.
Temperature in tenths of a degree Celsius (example: 22.5 degrees):
$ cat /sys/class/power_supply/qcom-battery/temp
225
Charging current limit in microamps (further limited by the driver to 1A):
$ cat /sys/class/power_supply/pm660-charger/current_max
1500000
Set the current limit:
# tee /sys/class/power_supply/pm660-charger/current_max
500000
500000
=== Fingerprint sensor ===
This device has the FPC1020 fingerprint sensor which is accessible through QSEECOM. There is no support for it.
=== NFC ===
NFC card detection works. Nothing else was tested. The embedded secure element seems to have no driver support.
=== WiFi ===
WiFi is tested regularly in North America. In Europe, 5 GHz has been reported to not work ().
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.
The WiFi firmware has no support for thermal throttling, although this may be handled by the unsupported Thermal Mitigation Device interface over QMI. Transmitting at high bandwidths from the device while charging can cause a reboot due to overheating.
=== Calls ===
It is possible to initiate calls and hear them on the 3.5 mm jack, and on speakers. Call audio on the microphone is implemented but may be tested less regularly.
Switching between audio devices will take effect when starting a call. In a call, audio will stop when switching until the next call.
Warning: Call audio may be loud. 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. Please change the hardware volume if you wish to hear calls at a reasonable level:
$ 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
=== Camera ===
Taking pictures with Megapixels using the front camera is supported, but the results are dark. With the v4l-utils package, the exposure can be set to 2605, the maximum value, using:
$ v4l2-ctl -d /dev/v4l-subdev18 -c exposure=2605
Applications using libcamera can read from both cameras.
=== 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.
You will need to install if you want automatic headphones switching.
=== 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 ().
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
=== 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.
=== 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 ==
* LineageOS Linux 4.9 kernel for sargo (3a) and bonito (3a XL)
* GSMArena
* Initial merge request
* Device package
* Kernel package
* Kernel release notes
* TPM: Android kernel driver
* TPM: Userspace libraries
* TPM: Android HAL