28

How to Completely Take Control of Ambient EQ on the Google Pixel 4

 4 years ago
source link: https://www.xda-developers.com/google-pixel-4-ambient-eq-tweak/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

How to Completely Take Control of Ambient EQ on the Google Pixel 4

When Google announced the Pixel 4 last month, one of the features I was most excited to try out was Ambient EQ. Ambient EQ is what Google calls its automatic white balance adjustment feature. Using a sensor capable of measuring the color temperature of the ambient lighting (the TMD3702VC), Ambient EQ “dynamically adjusts the display [white balance] based on surrounding light levels.” Sadly, Ambient EQ on the Pixel 4 barely adjusts the color temperature of the display, leading to what I feel is an underwhelming experience.

Pixel-4-Display-Settings-1024x385.jpg

Ambient EQ toggle in Display settings on the Google Pixel 4

The reason for including such a feature in the first place is because the “perceived white balance of [a] display changes with the color of the ambient lighting around you,” according to Dylan Raga, XDA’s Display Analyst. For example, “screens often appear overly-blue when viewed under warmer lighting.” In order to “[make] the screen appear consistent regardless of the color of ambient lighting,” smartphones “should change [their display] color temperature towards the color of the ambient lighting.”

Google’s first product with an automatic white balance adjustment feature was the Nest Hub, where the feature is also called Ambient EQ. On the Nest Hub, Ambient EQ is nothing short of magic. Looking at images on the Nest Hub display, no matter the current lighting condition, is like looking at printed photos. You don’t get that kind of experience with Ambient EQ on the Pixel 4, which, to be fair, makes sense since smartphones are used for more than just looking at images.

Google-Nest-Hub-Cool-Ambient-Lighting-1024x768.jpg
Google-Nest-Hub-Warm-Ambient-Lighting-1024x768.jpg

Google Nest Hub in different lighting conditions. Ambient EQ is tied to the “automatic brightness” setting on the device. It’s a bit difficult to capture the effect here—you really need to see it for yourself.

The Pixel 4 is far from the only mobile device with automatic white balance adjustment, though, which means we can compare how other tech companies have implemented the feature. Both Apple and Samsung have similar features, though Apple’s True Tone is more well-known thanks to better marketing. From the numerous complaints I’ve seen on online forums like Reddit, not everyone is a fan of how yellow the iPhone display looks with True Tone enabled. This is why I believe Google capped how low Ambient EQ can adjust the white point on the Pixel 4—they wanted the effect to be subtle and more color accurate so people don’t turn it off. That’s also likely why True Tone is disabled by default on the iPhone while Ambient EQ is enabled by default on the Pixel 4.

In their goal to please everybody, though, I think Google was a little too conservative in picking Ambient EQ’s range on the Pixel 4. I’m personally a big fan of how True Tone looks on the iPhone and iPad, so I was disappointed to learn that the Pixel 4’s white point average ranges from a minimum of 6300K to a maximum of 7450K corresponding to ambient color temperatures of 5300K and 8000K respectively. Under these default settings, I barely notice changes in the display when compared to an iPhone or iPad. In comparison, the 2016 9.7″ Apple iPad Pro can dip down to 5388K at 3000K ambient lighting, according to measurements done by AnandTech.

Tweaking Ambient EQ on the Pixel 4

Before the comments start flying that I think I know more than Google, I wanted to explain why I think it’s worth adjusting Ambient EQ. People’s tastes differ when it comes to display quality. Some people like warmer colors while others like cooler colors. Some people want their displays to always be color accurate while others care more about comfort. Like all other features on the Pixel 4, Google designed Ambient EQ to appeal to a majority of users. However, if you want to play around with the feature to get something that you think looks better for you, then that’s what I’m here to show you how to do.

And yes, as is the case with many features on the Pixel 4, it is possible to tweak Ambient EQ on the Pixel 4, provided you have root access. I’ve been using custom parameters for over a week now, and I feel that not only has it made reading text more pleasant in warmer ambient lighting, but it has also reduced eye strain. The Pixel 4 has become the smartphone I’m most comfortable using. Before I show you how to tweak Ambient EQ, though, you’ll need to understand how its parameters are controlled.

Ambient Color TemperatureDisplay Color TemperatureDecrease/Increase Thresholds
530063000.007874
600064000.0075472
700068500.006993
800074500.0067114

Stock Ambient EQ parameters on the Pixel 4 and Pixel 4 XL.

The above table shows the most important parameters for Ambient EQ on the Pixel 4. The first two columns show the Pixel 4’s base display color temperature (column #2) with respect to the ambient color temperature (column #1). Using a calculation involving the decrease/increase thresholds as well as some other parameters, the Pixel 4 can adjust its display color temperature to any value in-between the minimum (6300K) and maximum (7450K). If you’re interested in reading how these in-between values are calculated, I recommend reading the descriptions for each setting in AOSP. Search for “config_displayWhiteBalance” to find all of the relevant Ambient EQ parameters and their descriptions.

With this knowledge, I tweaked Ambient EQ to use a mix of known Apple True Tone values (thanks to Anandtech) and stock Pixel 4 values to create the following changes:

Ambient Color TemperatureDisplay Color TemperatureDecrease/Increase Thresholds
300053880.008
500064040.0076981
600067000.0075472
700068500.006993
800074500.0067114

Custom Ambient EQ parameters on my Pixel 4.

Are these values perfect? No, of course not—quality is subjective. Do I personally prefer how the Pixel 4 looks with these values? You bet. If I could get a full list of True Tone ambient/display color values, I would expand my tweak to better match the iPhone. If I had better display equipment with me, I could create a set of values that makes the Pixel 4 appear color-accurate in all ambient lighting conditions. And if I wanted to, I could expand Ambient EQ’s color range to make it a total replacement for Night Light. All it takes is a bit of trial and error, and that’s why I’m sharing what I’ve learned with the community.

Here’s a Magisk Module I made containing the custom Ambient EQ values in the table shown above. Simply download it from the link below and install the Module in Magisk Manager.

Download AmbientEQTweak Magisk Module

If you’re interested in customizing Ambient EQ on your own, you’ll need to do the following:

  1. Create a Runtime Resource Overlay (RRO) targeting the Android Framework (package name: “android”). Here’s the AndroidManifest.xml from my overlay.
    • Create an arrays.xml with the custom parameters you want. For example, config_displayWhiteBalanceAmbientColorTemperatures is the integer array that corresponds to column #1 in the above table while config_displayWhiteBalanceBaseThresholds and config_displayWhiteBalanceDisplayColorTemperatures correspond to column #2 in the above table. Note that config_displayWhiteBalanceDecreaseThresholds and config_displayWhiteBalanceIncreaseThresholds must be the same length as config_displayWhiteBalanceBaseThresholds. Here’s the arrays.xml I used in my overlay.
    • Create an integers.xml file if you want to have a new minimum or maximum display color temperature. Set your minimum in config_displayWhiteBalanceColorTemperatureMin and your maximum in config_displayWhiteBalanceColorTemperatureMax. Here’s the integers.xml I used in my overlay.
    • Create a dimens.xml if you want to change what color temperature Ambient EQ will bias toward in low-lighting conditions. This is done by changing the value of config_displayWhiteBalanceLowLightAmbientColorTemperature. Note that the low-light threshold is a range of lux values in the array config_displayWhiteBalanceLowLightAmbientBrightnesses which can be overridden in arrays.xml. (I overrode the default 10-50 range with 10 so the Pixel 4 would drop down to 5388K when the ambient brightness was below 10 lux.) Here’s the dimens.xml I used in my overlay.
  2. Compile and sign your overlay package and create a Magisk Module to place this overlay in /vendor/overlay.

You can use the Substratum and Magisk Module templates or you can just extract my Magisk Module and decompile the overlay I made to use as a base. If you come up with a set of values you’re happy with, please do share your work in the comments below or on the XDA forums.

Google Pixel 4 Forums ||| Google Pixel 4 XL Forums

Lastly, if you want to go the trial-and-error route, I recommend using the following two adb shell commands:

  • adb shell dumpsys color_display – Use this to see if your minimum and maximum color temperature overrides are working and to see what the current display color temperature is set to.
  • adb shell dumpsys display – Look for the “AmbientColorTemperatureSensor” output to see what the TMD3702VC color sensor is reporting the current ambient color temperature as. The events history lists the recorded ambient color temperature and the time, in Unix epoch milliseconds, that the value was recorded.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK