音频播放不能深度睡眠のAudioOutLock

android流程中,在AudioHardware::AudioStreamOutALSA::write的时候,会acquire_wake_lock (PARTIAL_WAKE_LOCK, "AudioOutLock"),这个锁如果没有释放,在睡眠前的检测环节中,将导致不能进入深度睡眠;不使用这个锁,可以在播放的时候,进入深度睡眠,唤醒睡眠后继续播放。
# cat proc/wakelocks //暂停播放,可以进入深度睡眠
name    count   expire_count    wake_count      active_since    total_time      sleep_time      max_time        last_change
"power-supply"  605     0       0       0       151670894       0       10133543        2417770315032
"KeyEvents"     506     0       0       0       54258153        0       28258959        2401090715490
"event0-90"     1       0       0       0       223208  0       223208  2401090314073
"usb_pcd"       1       0       0       0       2383999974653   0       2383999974653   2401080031865
"usb_mass_storage"      0       0       0       0       0       0       0       0
"PowerManagerService"   50      0       0       0       7929628021      0       3698752126      2371362561191
"alarm" 43      0       0       0       429276278       0       18711000        2371353584775
"AudioOutLock"  1       0       0       0       163863869111    0       163863869111    721185809963
"event1-90"     504     0       0       0       18517589        0       154084  718186723127
"i2c0"  62      0       0       0       105757791       0       22611958        557359764975
"radio-interface"       1       0       0       0       1000224126      0       1000224126      15442378166
"ApmCommandThread"      10      0       0       0       2537126 0       1651292 13275112709
"event2-90"     0       0       0       0       0       0       0       0
"mmc_delayed_work"      1       0       0       0       54929460        0       54929460        1868635686
"power-supply"  1       0       0       0       10109959        0       10109959        1781967683
"rtc_hym8563"   0       0       0       0       0       0       0       0
"alarm_rtc"     0       0       0       0       0       0       0       0
"power-supply"  1       0       0       0       237500  0       237500  1706312808
"vmac"  0       0       0       0       0       0       0       0
"bb_wakeup_ap"  0       0       0       0       0       0       0       0
"fb"    0       0       0       0       0       0       0       0
"unknown_wakeups"       0       0       0       0       0       0       0       0
"deleted_wake_locks"    0       0       0       0       0       0       0       0
"main"  1       0       0       2418315539317   2418315539317   0       2418315539317   60000005
"usb_detect"    1       1       0       0       9999057875      0       9999057875      2400990950239

# cat proc/wakelocks//正在播放,不能进入深度睡眠
name    count   expire_count    wake_count      active_since    total_time      sleep_time      max_time        last_change
"PowerManagerService"   54      0       0       0       7948937313      0       3698752126      2551358474842
"alarm" 47      0       0       0       465811110       0       18711000        2551355229801
"i2c0"  69      0       0       0       109810291       0       22611958        2549824073675
"KeyEvents"     589     0       0       0       58064399        0       28258959        2549775434093
"event1-90"     587     0       0       0       21659841        0       154084  2549775399593
"power-supply"  638     0       0       0       159990726       0       10133543        2549770377635
"event0-90"     1       0       0       0       223208  0       223208  2401090314073
"usb_pcd"       1       0       0       0       2383999974653   0       2383999974653   2401080031865
"usb_mass_storage"      0       0       0       0       0       0       0       0
"radio-interface"       1       0       0       0       1000224126      0       1000224126      15442378166
"ApmCommandThread"      10      0       0       0       2537126 0       1651292 13275112709
"event2-90"     0       0       0       0       0       0       0       0
"mmc_delayed_work"      1       0       0       0       54929460        0       54929460        1868635686
"power-supply"  1       0       0       0       10109959        0       10109959        1781967683
"rtc_hym8563"   0       0       0       0       0       0       0       0
"alarm_rtc"     0       0       0       0       0       0       0       0
"power-supply"  1       0       0       0       237500  0       237500  1706312808
"vmac"  0       0       0       0       0       0       0       0
"bb_wakeup_ap"  0       0       0       0       0       0       0       0
"fb"    0       0       0       0       0       0       0       0
"unknown_wakeups"       0       0       0       0       0       0       0       0
"deleted_wake_locks"    0       0       0       0       0       0       0       0
"AudioOutLock"  2       0       0       2475893045      166339762156    0       163863869111    2549779566676
"main"  1       0       0       2552195473466   2552195473466   0       2552195473466   60000005
"usb_detect"    1       1       0       0       9999063982      0       9999063982      2400990950239

你可能感兴趣的:(音频播放不能深度睡眠のAudioOutLock)