Android power consumption (4) — standby power analysis process of MTK platform

Time:2020-11-17

Standby power analysis process of MTK platform

1. Purpose

2. Test method of power consumption data for each scene of MTK platform

Many power consumption problems are due to the wrong test methods. List some common scene power consumption test methods.

Before testing power consumption data, please confirm the following configuration:

1. Turn off WiFi / BT / GPS, close data connection and set flight mode. (set according to specific test scenario)

2. Turn off the mobile log / modem log / net log and turn on the log to increase the current. Note: confirm whether log is generated in / sdcard / mtklog (/ data / mtklog), and confirm that the shutdown is successful.

3. Confirm whether each module has been working normally, and each module will affect the power consumption. It is necessary to test the power consumption after the module works well.

4. The test will delete all third-party apks and eliminate the third-party APK problems.

Test methods of each scene:

Test scenario test method notes

Flight mode standby

1. Set flight mode, turn off WiFi / BT / GPS, close data connection

2. Close mobile log, modem log and net log

3. Press the power key to turn off the screen. After 5 minutes, the current test starts. The test time is 5-10 minutes. If the current is abnormal, you need to provide mobile log

4. Close mobile log, modem log and net log

5. Press the power key to turn off the screen. After the screen is turned off for 5 minutes, the current test is started. The test time is 5-10 minutes. The real network standby needs to confirm the network problem and SIM card problem first

6. Do you have the same problem with other contrast machines

7. Is there a problem with the same mobile phone in other places

8. Do other SIM cards have the same problem

Abnormal current provided by mobile log

Dual sim card real network standby

Single SIM card real network standby + data connection

1. Turn off WiFi / BT / GPS

2. Close mobile log, modem log and net log

3. Press the power key to turn off the screen. After the screen is turned off for 5 minutes, the current test starts. The test time is 5-10 minutes

Single SIM card standby + WiFi / BT / GPS

1. Close data connection

2. Close mobile log, modem log and net log

3. Press the power key to turn off the screen. After the screen is turned off for 5 minutes, the current test starts. The test time is 5-10 minutes

Call current

1. Turn off WiFi / BT / GPS, close data connection

2. Close mobile log, modem log and net log

3. After the call, turn off the screen, wait for 2 minutes to start the current test, and the test time is 5 minutes. If the current is abnormal, you need to provide the mobile log

Idle current of home interface

1. Turn off WiFi / BT / GPS, close data connection

2. Close mobile log, modem log and net log

3. Remove SIM card and SD card

4. Keep in the home interface, do not open any applications, set the automatic screen off time to 30 minutes

5. Keep the default backlight

6. Wait for 5 minutes and start to test the current. The test time is 5-10 minutes. The home interface current is related to backlight, TP and LCM. It is necessary to confirm that the backlight, TP and LCM current are removed. Please see the next scene

Home interface idle + remove backlight and TP

1. Turn off WiFi / BT / GPS, close data connection

2. Close mobile log, modem log and net log

3. Remove SIM card and SD card

4. Keep in the home interface, do not open any applications, set the automatic screen off time to 30 minutes

5. Remove LCM and TP

6. Wait for 5 minutes and start to test the current. The test time is 5-10 minutes. If the current on the home interface is abnormal, you need to grasp the CPU information. Please refer to faq04008 and provide mobile log at the same time

FM current (Headset mode)

1. Turn off WiFi / BT / GPS, close data connection

2. Close mobile log, modem log and net log

3. Turn on FM and turn off the screen, wait for 2 minutes to start the current test. The test time is 5 minutes. 1. FM speaker mode and I2S channel current will be too large, which is normal.

4. If the FM current is abnormal, you need to grasp the deepidle data. Please refer to faq04519 and provide mobile log at the same time

BT transmission data

1. Turn off WiFi / GPS, close data connection

2. Close mobile log, modem log and net log

3. Transfer 5m file, turn off screen, test current

4. If BT transmission current is abnormal, please refer to faq04008 and provide mobile log at the same time

Audio – MP3 Play back (headset)

1. Set flight mode

2. Close mobile log, modem log and net log

3. Play the MP3, turn off the screen, wait for 2 minutes after the screen is off, start to test the current, and the test time is 2 minutes

4. Playing MP3 is related to SD card and audio file. It is necessary to change SD card and audio file test

5. If MP3 current is abnormal, please refer to faq04519 and provide mobile log at the same time

Video – MP4 (720P) HW mode

1. Set flight mode

2. Close mobile log, modem log and net log

3. Play the video, wait 2 minutes after playing, start to test the current, test time is 2 minutes

4. The video playing current is related to backlight, TP and LCM. It is necessary to confirm that the backlight, TP and LCM currents are removed

5. Playing video is related to the player and video files. You need to use the default player and the video files provided by MTK

6. When playing video with abnormal current, please refer to faq04008 and provide mobile log at the same time

Video – MP4 (1080P) HW mode

Video – H.264 (720P) HW mode

Video – H.264 (1080P) HW mode

Camera – Video Record H264 (720 P)

Camera – Preview (720 P)

1. Set flight mode

2. Close mobile log, modem log and net log

3. Open preview, wait for 2 minutes, start testing current, test time is 2 minutes

4. The camera current is related to the shooting scene and camera related settings. Please try to keep the same shooting scene and the same configuration during the comparison test.

5. Please refer to faq04008 and provide mobile log at the same time

3. Power consumption analysis process

At present, the main power consumption problem we analyze is standby low current or standby average current.

There are three kinds of reasons for the excessive standby bottom current: leakage or non sleep of each peripheral module, leakage of GPIO / subsys / PLL / clock port, failure of sleep due to wakelock, and failure of modem to sleep

Turn off the flight mode and test the standby bottom current to exclude whether the modem is not sleeping. First, determine whether it is AP or modem.

There is no systematic analysis method for modem.

Here is the AP analysis process

3.1 peripheral module analysis method

Peripheral module analysis mainly depends on the hardware to remove one by one, and then check which module after removing the bottom current has dropped, and then determine which module leakage. If dormant, remove the TP camera LCD one by one to determine the troubleshooting.

Find the module and then take the analysis code to solve.

3.2 GPIO / subsys / PLL / clock analysis method

In the AP suspend state, the bottom current will increase due to improper GPIO configuration, the shutdown of subsys / PLL / clock, or other reasons;

In this case, we can find some clues from the kernel log to determine the direction of further analysis

[3.2.1] search for subsys / clock / PLL that is not closed

[6589/6582/6592/6595/6795]

Look for the keyword “PWR_ [7:0] corresponds to one subsys for each bit

If bit is 1, the subsystem is not off

echo 1 > /sys/module/mt_sleep/parameters/slp_ck26m_on
echo 1 > /sys/module/mt_sleep/parameters/slp_dump_regs

The definition of each bit can be seen in Mt_ spm_ mtcmos.c

For example: “define MD1″_ PWR_ STA_ MASK (0x1 << 0)

[6732/6752/6735/6753]

Find the keyword “SLP_ check_ Pm_ mtcmos_ pll”

If a subsystem is not turned off, the next line will see a message similar to the following:


[Power/clkmgr] SYS_AUD: on

Then look down to see the dump information of each subsystem. Take the AUD subsystem as an example to find sys_ The corresponding part of AUD is explained in detail as follows:

CNT is not equal to 0, which means that the clock is not off

In the following brackets (there may be more than one) is the information of one of the users of the clock

“Audio” is the name of the user who uses clock, and the parameter passed in the code

“15” indicates the number of open clocks,

The use of “clock 14” means “close”

[06][CG_AUDIO]* 
[02]state=1, cnt=1 (AUDIO,15,14) 
[08]state=0, cnt=0 (AUDIO,8,8) 
[09]state=0, cnt=0 (AUDIO,8,8) 
[18]state=0, cnt=0 (AUDIO,8,8) 
[19]state=0, cnt=0 (AUDIO,8,8)

[3.2.2] check the status of GPIO

It is closed by default and needs to be opened with the following command

echo 1 > /sys/module/mt_sleep/parameters/slp_dump_gpio

Then you can see the following information in the kernel log:


PIN: [MODE] [PULL_SEL] [DIN] [DOUT] [PULL EN] [DIR] [IES]

It will help in normal and abnormal situations

Focus on [mode] [dir] [pull]_ SEL] is normal even if the status of other fields is changed

For some platforms, this code is commented out and needs to be changed to search for SLP_ dump_ GPIO can find the relevant code

[3.2.3] check whether 26m clock is off

Search keyword “debug”_ Flag “is on the same line as wake up by,

Bit [3:2] can show whether 26m has been turned off,

If bit [3:2] = 0b’11, 26m is normally closed during sleep;

If bit [3:2] = 0b’00, it means that 26m is not off during sleep;

  • If this kind of case happens, you need to see it by case
  • In addition, if the previous one is wake up by GPU, please ignore this line of log information (deepdile state, not suspend state)

3.3 wakelock analysis

If the kernel or system holds wakelock, the system will not be able to enter deep sleep, which will directly lead to high standby bottom current

[step1 – find wakelock of kernel layer and user layer]

Use the command to view the kernel or the upper wakelock

cat /proc/wakelock 
dumpsys power`

The relevant weaklocks will be printed out

[Step2 – find the wakesource of user layer]

The weaklock applied by the m-server will no longer be shown above. You must use the command to view the script of the weaksource to grab these two kinds of information. The source code of the script is as follows:

#!/system/bin/sh
echo "Start monitor power..." > /sdcard/power.txt
while echo "====================================================================================" >> /sdcard/power.txt
do
    date >> /sdcard/power.txt
    echo "**********dumpsys power**********" >> /sdcard/power.txt
    dumpsys power | cat >> /sdcard/power.txt
    echo "" >> /sdcard/power.txt
    echo "**********cat /sys/kernel/debug/wakeup_sources**********" >> /sdcard/power.txt
    cat /sys/kernel/debug/wakeup_sources >> /sdcard/power.txt
    echo "" >> /sdcard/power.txt
    sleep 10
done

4.FAQ

[faq09542] [power] standby current problem, how to find wakelock

[instructions for use]

(1) The following is a list of the log key points of the whole key wake-up, each of which has bold words to explain its meaning and the key words to be noticed;

(2) The red one is kernel log, and the others are main log;

(3) Check one by one until you find that a log cannot be found, the problem lies in this place;

(4) It is limited to Android version after jb2, and the process before jb2 is relatively simple;

Kernel check point [1]: key interrupt

<5>[ 78.721504] 1)[Power/PMIC] [pwrkey_ int_ handler] Press pwrkey

Phenomenon: under fly mode, there will be leakage of several Ma, and it is very likely that the bottom current of fly mode will be reduced. If the UART connection between 6290 / 65×2 can be disconnected, the current will return to normal

Cause: in the fly mode mode mode, 6339 / 6290 is not powered, so the UART level state on 6290 will be low level; if the UART configuration between AP side and 6290 is high level, leakage will be caused.

Note: 6582 + 6290 is different from 6592 + 6290. This problem may occur in both projects, but the specific error points are different. The reason is that when the modem is closed in 6582 UART code, the pull state of GPIO will be switched to pull enable / pull low, while 6592 does not have this code. Therefore, 6582 + 6290 needs to pay attention to the VaR of UART pin in DWS Name must be configured, otherwise the software will not have any action; and 6592 + 6290 should not only focus on VAR name, but also the pull setting in front

[SOLUTION]

Solution:

The configuration of release is correct, but the customer may configure UART as pull enable / pull high according to previous experience, which may cause problems. If this problem really occurs, please configure UART correctly according to the following methods:

Special attention: UART2 on the hardware schematic diagram corresponds to uart3 in DWS. Do not misplace it

[faq1917] [LTE power consumption] pay attention to the influence of auto mode in real network standby power test

[question type 1]-

Phenomenon: even with cmu500 and 4G standby current of 200mA +, it has been unable to come down, but it is normal under 4G real network

Cause: the cmu500 instrument is configured with “keep RRC connection” by default, which will cause the modem to work all the time

Note: the 8820c does not have this configuration enabled by default, so it is OK

Solution:

Remove the “keep RRC connection” option on the instrument. If you don’t know how to do it, please contact the instrument manufacturer

[question type 2]-

Phenomenon: even with the instrument, 4G standby current is 70ma +, which can’t come down all the time, but it is normal under 4G real network

In the kernel log, it can be seen that EINT 7 (LTE) wakes up regularly every 10s or 7S

Reason: the “DRX disconnect” is not checked

Solution:

Check“

If you don’t know how to do it, please contact the instrument manufacturer