Tegra3 1080p高清播放时电源管理方式和功耗分析

此案例分析Tegra3(采用vSMP架构,4+1核心)在执行1080p播放时PM的运行情况,使用的平台是ASUA Eee Pad,运行Android 3.2。

先播放少女时代1080p演唱会x264,Japan.First.Tour.Girls'Generation.2011.BluRay.1080p.DTS.x264-CHD

Nvidia 1080p硬件解码:
02-16 23:01:01.170 D/PowerManagerService(  177): @PowerManagement:'KEEP_SCREEN_ON_FLAG' releaseWakeLock when screen locked
02-16 23:01:01.210 W/InputManagerService(  177): Starting input onnon-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@40968630(uid=10044 pid=2515)
02-16 23:01:01.220 I/OMXCodec(  109): [OMX.Nvidia.h264.decode] AVC profile= 100 (High), level = 41
02-16 23:01:01.220 I/OMXCodec(  109): [OMX.Nvidia.h264.decode] allocating20 buffers of size 1566720 on input port
02-16 23:01:01.220 I/OMXCodec(  109): [OMX.Nvidia.h264.decode] allocating6 buffers from a native window of size 3110400 on output port
02-16 23:01:01.320 I/ActivityManager(  177): Displayedafzkl.development.mVideoPlayer/.activity.VideoPlayerActivity: +739ms
02-16 23:01:01.480 W/MediaPlayer( 4236): Attempt to seek to invalid position:-1
02-16 23:01:01.480 I/@@@@    ( 4236): onMeasure
02-16 23:01:01.480 I/@@@@    ( 4236): onMeasure
02-16 23:01:01.620 I/nvos_linux_stub(  109): Allocating new output:1920x1088 (x 8)
02-16 23:01:01.620 I/OMXCodec(  109): [OMX.Nvidia.h264.decode] allocating10 buffers from a native window of size 3133440 on output port
02-16 23:01:09.000 V/Sensors (  177): void cb_onMotion(uint16_t)
02-16 23:01:15.420 V/Sensors (  177): void cb_onMotion(uint16_t)
02-16 23:01:27.250 V/Sensors (  177): void cb_onMotion(uint16_t)
02-16 23:01:35.970 D/PowerManagerService(  177): @PowerManagement:'KEEP_SCREEN_ON_FLAG' releaseWakeLock when screen locked

播放过程中,分析显示CPU利用率很低,仅仅core0是online的:
cpu0:
$ cd cpu0
$ cat online
1

cpu1~cpu3:
$ cd cpu1
$ cat online
0
$ cd cpu2
$ cat online
0
$ cd cpu3
$ cat online
0

分析内核消息,发现core0绝大多数时候运行在LP处理器上,少量时间段会切换至G core的core0,而且切过去G core后,一般很短时间就切换回来了:
<4>[ 8697.741672] nct1008_get_temp: ret temp=24C
<4>[ 8702.748251] tegra_watchdog_touch
<4>[ 8702.752200] nct1008_get_temp: ret temp=24C
<3>[ 8707.190304] LP=>G: prolog 21 us,switch 2133 us, epilog 24 us, total 2178 us
<4>[ 8707.757339] tegra_watchdog_touch
<4>[ 8707.762874] nct1008_get_temp: ret temp=24C
<3>[ 8708.188339] G=>LP: prolog 22 us, switch 160 us, epilog 25 us,total 207 us

<4>[ 8712.767481] tegra_watchdog_touch
<4>[ 8712.771979] nct1008_get_temp: ret temp=24C
<4>[ 8717.777529] tegra_watchdog_touch
<4>[ 8717.779157] nct1008_get_temp: ret temp=24C
<4>[ 8722.787436] tegra_watchdog_touch
<4>[ 8722.794515] nct1008_get_temp: ret temp=24C
<4>[ 8727.797424] tegra_watchdog_touch
<4>[ 8727.800313] nct1008_get_temp: ret temp=24C
<4>[ 8729.277836] DIDIM check brightness=34
<4>[ 8729.292825] DIDIM check brightness=34
<4>[ 8729.326126] DIDIM check brightness=34
<4>[ 8729.375792] DIDIM check brightness=34
<4>[ 8732.807669] tegra_watchdog_touch
<4>[ 8732.809706] nct1008_get_temp: ret temp=24C
<4>[ 8737.822767] tegra_watchdog_touch
<4>[ 8737.824646] nct1008_get_temp: ret temp=24C
<4>[ 8741.358266] battery_status_poll 120 1
<5>[ 8741.359155] asuspec: [asuspec_send_ec_req] send EC_Request
<5>[ 8741.434190] asuspec: [asuspec_work_function] 0x2 0x81 0x50 0xff
<5>[ 8741.435292] asuspec: [asuspec_smi] ASUSPEC_SMI_HANDSHAKING
<4>[ 8741.640801] pad_get_psp  val->intval=Not charging ret=c0
<4>[ 8741.645947] pad_get_psp voltage_now =7897
<4>[ 8741.650778] pad_get_capacity val->intval=85 ret=84
<4>[ 8741.655638] pad_get_psp  bat_temp=2923
<4>[ 8741.693209] pad_get_capacity val->intval=85 ret=84
<4>[ 8741.697893] pad_get_psp voltage_now =7897
<4>[ 8741.703563] pad_get_psp  bat_temp=2923
<4>[ 8741.708354] pad_get_psp  val->intval=Not charging ret=c0
<5>[ 8742.715015] asuspec: [asuspec_enter_s3_work_function] EC in S3
<4>[ 8742.827629] tegra_watchdog_touch
<4>[ 8742.829447] nct1008_get_temp: ret temp=24C
<4>[ 8747.849204] tegra_watchdog_touch
<4>[ 8747.854043] nct1008_get_temp: ret temp=24C
<4>[ 8752.857607] tegra_watchdog_touch
<4>[ 8752.859700] nct1008_get_temp: ret temp=24C
<4>[ 8757.867500] tegra_watchdog_touch
<4>[ 8757.868567] nct1008_get_temp: ret temp=23C
<4>[ 8762.877467] tegra_watchdog_touch
<4>[ 8762.880267] nct1008_get_temp: ret temp=23C
<4>[ 8763.574114] DIDIM check brightness=34
<3>[ 8767.250183] LP=>G: prolog 22 us, switch 2133 us, epilog 25 us,total 2180 us
<4>[ 8767.887423] tegra_watchdog_touch
<4>[ 8767.888175] nct1008_get_temp: ret temp=24C
<3>[ 8768.255782] G=>LP: prolog 21 us, switch 161 us, epilog 26 us,total 208 us
<4>[ 8772.897999] tegra_watchdog_touch
<4>[ 8772.908079] nct1008_get_temp: ret temp=24C
<4>[ 8777.917609] tegra_watchdog_touch
<4>[ 8777.920335] nct1008_get_temp: ret temp=24C
<4>[ 8782.927459] tegra_watchdog_touch
<4>[ 8782.932624] nct1008_get_temp: ret temp=23C
<4>[ 8787.937530] tegra_watchdog_touch
<4>[ 8787.938876] nct1008_get_temp: ret temp=24C
<4>[ 8792.947739] tegra_watchdog_touch
<4>[ 8792.954198] nct1008_get_temp: ret temp=23C
<4>[ 8797.821783] DIDIM check brightness=34
<4>[ 8797.872428] DIDIM check brightness=34
<4>[ 8797.904626] DIDIM check brightness=34
<4>[ 8797.957424] tegra_watchdog_touch
<4>[ 8797.958548] nct1008_get_temp: ret temp=23C
<4>[ 8802.967704] tegra_watchdog_touch
<4>[ 8802.971416] nct1008_get_temp: ret temp=23C
<4>[ 8807.977642] tegra_watchdog_touch
<4>[ 8807.982341] nct1008_get_temp: ret temp=23C
<4>[ 8812.988330] tegra_watchdog_touch
<4>[ 8812.991635] nct1008_get_temp: ret temp=23C
<4>[ 8817.997661] tegra_watchdog_touch
<4>[ 8818.007342] nct1008_get_temp: ret temp=23C
<4>[ 8823.017612] tegra_watchdog_touch
<4>[ 8823.021855] nct1008_get_temp: ret temp=23C
<4>[ 8828.027860] tegra_watchdog_touch
<4>[ 8828.029863] nct1008_get_temp: ret temp=24C
<4>[ 8832.102683] DIDIM check brightness=34
<4>[ 8833.047674] tegra_watchdog_touch
<4>[ 8833.055387] nct1008_get_temp: ret temp=23C
<4>[ 8838.057766] tegra_watchdog_touch
<4>[ 8838.059161] nct1008_get_temp: ret temp=23C
<4>[ 8843.070562] tegra_watchdog_touch
<4>[ 8843.073387] nct1008_get_temp: ret temp=23C
<4>[ 8848.077551] tegra_watchdog_touch
<4>[ 8848.080379] nct1008_get_temp: ret temp=23C
<4>[ 8853.087668] tegra_watchdog_touch
<4>[ 8853.089758] nct1008_get_temp: ret temp=23C
<4>[ 8858.097613] tegra_watchdog_touch
<4>[ 8858.099259] nct1008_get_temp: ret temp=23C
<4>[ 8861.677498] battery_status_poll 120 1
<5>[ 8861.678295] asuspec: [asuspec_send_ec_req] send EC_Request
<5>[ 8861.758825] asuspec: [asuspec_work_function] 0x2 0x81 0x50 0xff
<5>[ 8861.759922] asuspec: [asuspec_smi] ASUSPEC_SMI_HANDSHAKING
<4>[ 8861.961852] pad_get_psp  val->intval=Not charging ret=c0
<4>[ 8861.966641] pad_get_psp voltage_now =7890
<4>[ 8861.971402] pad_get_capacity val->intval=83 ret=83
<4>[ 8861.976154] pad_get_psp  bat_temp=2919
<4>[ 8861.984047] pad_get_capacity val->intval=83 ret=83
<4>[ 8861.988702] pad_get_psp voltage_now =7890
<4>[ 8862.000177] pad_get_psp  bat_temp=2919
<4>[ 8862.004939] pad_get_psp  val->intval=Not charging ret=c0
<5>[ 8863.005272] asuspec: [asuspec_enter_s3_work_function] EC in S3
<4>[ 8863.107656] tegra_watchdog_touch
<4>[ 8863.109492] nct1008_get_temp: ret temp=23C
<4>[ 8866.350511] DIDIM check brightness=34
<4>[ 8866.400282] DIDIM check brightness=34
<4>[ 8866.433608] DIDIM check brightness=34
<4>[ 8868.124135] tegra_watchdog_touch
<4>[ 8868.125863] nct1008_get_temp: ret temp=23C
<4>[ 8873.127887] tegra_watchdog_touch
<4>[ 8873.136542] nct1008_get_temp: ret temp=23C
<4>[ 8878.151029] tegra_watchdog_touch
<4>[ 8878.155094] nct1008_get_temp: ret temp=23C
<4>[ 8883.157487] tegra_watchdog_touch
<4>[ 8883.161697] nct1008_get_temp: ret temp=23C
<4>[ 8888.167708] tegra_watchdog_touch
<4>[ 8888.169550] nct1008_get_temp: ret temp=23C
<4>[ 8893.177582] tegra_watchdog_touch
<4>[ 8893.193386] nct1008_get_temp: ret temp=23C
<4>[ 8898.197395] tegra_watchdog_touch
<4>[ 8898.198632] nct1008_get_temp: ret temp=23C
<4>[ 8900.615181] DIDIM check brightness=34
<4>[ 8903.207448] tegra_watchdog_touch
<4>[ 8903.208865] nct1008_get_temp: ret temp=23C
<4>[ 8908.217488] tegra_watchdog_touch
<4>[ 8908.219253] nct1008_get_temp: ret temp=23C
<4>[ 8913.228507] tegra_watchdog_touch
<4>[ 8913.232502] nct1008_get_temp: ret temp=23C
<4>[ 8918.245003] tegra_watchdog_touch
<4>[ 8918.255452] nct1008_get_temp: ret temp=23C
<4>[ 8923.257541] tegra_watchdog_touch
<4>[ 8923.259385] nct1008_get_temp: ret temp=23C
<4>[ 8928.277829] tegra_watchdog_touch
<4>[ 8928.291194] nct1008_get_temp: ret temp=23C
<4>[ 8933.297815] tegra_watchdog_touch
<4>[ 8933.299639] nct1008_get_temp: ret temp=23C
<4>[ 8934.896073] DIDIM check brightness=34
<4>[ 8934.913309] DIDIM check brightness=34
<4>[ 8934.945759] DIDIM check brightness=34
<4>[ 8938.307463] tegra_watchdog_touch
<4>[ 8938.311450] nct1008_get_temp: ret temp=23C
<4>[ 8943.337947] tegra_watchdog_touch
<4>[ 8943.349888] nct1008_get_temp: ret temp=23C
<4>[ 8948.357496] tegra_watchdog_touch
<4>[ 8948.361980] nct1008_get_temp: ret temp=23C
<4>[ 8953.367562] tegra_watchdog_touch
<4>[ 8953.371771] nct1008_get_temp: ret temp=23C
<4>[ 8958.377523] tegra_watchdog_touch
<4>[ 8958.379348] nct1008_get_temp: ret temp=23C
<4>[ 8963.387722] tegra_watchdog_touch
<4>[ 8963.415660] nct1008_get_temp: ret temp=23C
<4>[ 8968.417526] tegra_watchdog_touch
<4>[ 8968.418720] nct1008_get_temp: ret temp=23C
<4>[ 8969.110980] DIDIM check brightness=34
<4>[ 8973.427470] tegra_watchdog_touch
<4>[ 8973.431726] nct1008_get_temp: ret temp=23C
<4>[ 8978.437384] tegra_watchdog_touch
<4>[ 8978.440961] nct1008_get_temp: ret temp=23C
<4>[ 8982.010891] battery_status_poll 120 1
<5>[ 8982.011965] asuspec: [asuspec_send_ec_req] send EC_Request
<5>[ 8982.077071] asuspec: [asuspec_work_function] 0x2 0x81 0x50 0xff
<5>[ 8982.077789] asuspec: [asuspec_smi] ASUSPEC_SMI_HANDSHAKING
<4>[ 8982.291991] pad_get_psp  val->intval=Not charging ret=c0
<4>[ 8982.299728] pad_get_psp voltage_now =7884
<4>[ 8982.304485] pad_get_capacity val->intval=83 ret=83


播放70分钟后,改播apple发布的经典风景1080p测试片cornell_m1080p.mov,下载地址:
http://images.apple.com/movies/us/hd_gallery/gl1800/1080p/cornell_m1080p.mov

02-17 00:08:38.330 I/AwesomePlayer(  109):setDataSource_l('/sdcard/Movies/cornell_m1080p.mov')
02-17 00:08:38.330 I/@@@@    ( 4236): onMeasure
02-17 00:08:38.330 I/@@@@    ( 4236): onMeasure
02-17 00:08:38.350 W/MPEG4Extractor(  109): Identified supported mpeg4through LegacySniffMPEG4.
02-17 00:08:38.390 I/MPEG4Extractor(  109):  QT MODE DECIDED
02-17 00:08:38.390 I/MPEG4Extractor(  109): atoms_path: -1: 1836069985-2:1937011556 -3:1937007212
02-17 00:08:38.390 I/MPEG4Extractor(  109): qtmode/ver=1 , extradataread16
02-17 00:08:38.390 I/MPEG4Extractor(  109): (qtmode) its wave prebnode.mp4a. so break here...
02-17 00:08:38.390 D/TabletStatusBar(  292): lights on
02-17 00:08:38.430 I/SampleTable(  109): There are reordered framespresent.
02-17 00:08:38.460 I/OMXCodec(  109): [OMX.Nvidia.h264.decode] AVC profile= 77 (Main), level = 41
02-17 00:08:38.460 I/OMXCodec(  109): [OMX.Nvidia.h264.decode] allocating20 buffers of size 1566720 on input port
02-17 00:08:38.460 I/OMXCodec(  109): [OMX.Nvidia.h264.decode] allocating6 buffers from a native window of size 3110400 on output port
02-17 00:08:38.710 W/OMXCodec(  109): Codec outputs a different number ofchannels than the input stream contains (contains 2 channels, codec outputs 2channels) (44100 48000).
02-17 00:08:38.710 I/OMXCodec(  109): [OMX.Nvidia.eaacp.decoder]allocating 5 buffers of size 24000 on input port
02-17 00:08:38.710 I/OMXCodec(  109): [OMX.Nvidia.eaacp.decoder]allocating 15 buffers of size 18432 on output port
02-17 00:08:38.800 I/nvos_linux_stub(  109): Allocating new output:1920x1088 (x 7)
02-17 00:08:38.800 I/OMXCodec(  109): [OMX.Nvidia.h264.decode] allocating9 buffers from a native window of size 3133440 on output port
02-17 00:08:40.990 I/dalvikvm( 4236): Jit: resizing JitTable from 4096 to 8192

看到的CPU利用情况与少女时代演唱会相似。播放至02-17 05:54:10.050,电池耗尽,关机:
02-17 05:54:09.530 I/MountService(  177):Shutting down
02-17 05:54:09.540 I/PackageManager(  177): Updating external media statusfrom unmounted to unmounted
02-17 05:54:09.550 W/ShutdownThread(  177): Result code 0 fromMountService.shutdown
02-17 05:54:09.550 W/ShutdownThread(  177): Result code 0 fromMountService.shutdown
02-17 05:54:09.560 D/VoldCmdListener(  103): storage users /mnt/sdcard
02-17 05:54:09.770 W/ActivityManager(  177): Killing processes unmountmedia at adjustment 7
02-17 05:54:09.770 W/ActivityManager(  177): KillingProcessRecord{40b07ed8 1003:com.google.android.apps.maps/10071} (adj 11):unmount media
02-17 05:54:09.770 D/VoldCmdListener(  103): storage users /mnt/sdcard
02-17 05:54:09.970 D/dalvikvm(  177): GC_EXPLICIT freed 844K, 36% free20568K/31943K, paused 2ms+5ms
02-17 05:54:09.980 I/PackageManager(  177): Updating external media statusfrom unmounted to unmounted
02-17 05:54:09.980 W/ShutdownThread(  177): Result code -1 fromMountService.shutdown
02-17 05:54:09.980 D/VoldCmdListener(  103): volume unmount /mnt/sdcardforce
02-17 05:54:09.990 D/WindowManager(  177): readLidState, sw:1
02-17 05:54:09.990 D/WindowManager(  177): adjustConfigurationLw,config:{1.0 0mcc0mnc (no locale) sw800dp w1280dp h752dp xlrg land ?uimode?night finger qwerty/v/v -nav/v} mLidOpen:1 mHasDockFeature:truemHasHallSensorFeature:true config.hardKeyboardHidden:1
02-17 05:54:10.050 I/ShutdownThread(  177):Performing low-level shutdown...

由此,统计,在只有平板电池有电,且LCD和背光一直亮着播放1080p的场景下,华硕tegra3平板电脑累计播放电源6小时53分电池耗尽。 且此过程CPU利用率很低,绝大多数情况下,只有低功耗的core在运行。

你可能感兴趣的:(output,c,function,input,codec,linux,Android系统架构)