我最近購買了DJI Osmo Mobile 2 (OM2)穩定器。當我在研究如何使用OM2時,發現我的U12+在使用DJI GO app 錄製延時視頻很大機率時會導致DJI GO app 不能保存視頻。經過一連串的測試發現HTC 10 和 HTC U11 都沒這個問題。唯獨U12+例外。我嘗試了恢復原廠設置還是一樣,所以我排除了是第三方app 所導致的。我透過了logcat 取出了手機的日記。相比10 和U11的日記,發現U12+ 在錄製延時視頻時出現不尋常的活動。
以下是三部手機的固件版本:
HTC 10 Android 8.0 (3.16.708.3)
HTC U11 Android 8.0 (2.42.400.3)
HTC U12+ Android 8.0 (1.30.400.2)
以下是我過濾出來的日記:
HTC 10
Line 15115: 12-23 00:52:16.037 1827 15554 I CameraSource: Using encoder format: 0x22
Line 15116: 12-23 00:52:16.037 1827 15554 I CameraSource: Using encoder data space: 0x10c60000
Line 16730: 12-23 00:52:17.210 1827 15555 W CameraSource: Dropping frame with backward timestamp 4010988553 (last 4010988553)
Line 16828: 12-23 00:52:17.243 1827 15555 W CameraSource: Dropping frame with backward timestamp 4010988553 (last 4010988553)
Line 21303: 12-23 00:52:20.771 1827 15546 D CameraSource: reset: E
Line 22176: 12-23 00:52:21.167 1827 15546 D CameraSource: reset: X
Line 22391: 12-23 00:52:21.210 1827 15554 D CameraSource: reset: E
Line 22392: 12-23 00:52:21.210 1827 15554 D CameraSource: reset: X
Line 32759: 12-23 00:39:04.120 2599 27447 I CameraSource: Using encoder format: 0x22
Line 32760: 12-23 00:39:04.120 2599 27447 I CameraSource: Using encoder data space: 0x10c60000
Line 36906: 12-23 00:39:05.199 2599 27451 W CameraSource: Dropping frame with backward timestamp 1985828708799 (last 1985828708799)
Line 46607: 12-23 00:39:07.721 2599 27418 D CameraSource: reset: E
Line 48898: 12-23 00:39:08.141 2599 27418 D CameraSource: reset: X
Line 49087: 12-23 00:39:08.223 2599 27447 D CameraSource: reset: E
Line 49088: 12-23 00:39:08.223 2599 27447 D CameraSource: reset: X
Line 963: 12-22 23:54:43.276 2650 27537 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 964: 12-22 23:54:43.276 2650 8706 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 965: 12-22 23:54:43.277 2650 16954 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 1465: 12-22 23:54:43.887 2650 23200 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 1898: 12-22 23:54:44.496 2650 21156 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 2942: 12-22 23:54:45.785 2650 18875 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 2943: 12-22 23:54:45.787 2650 12020 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 5751: 12-22 23:54:49.277 2650 27537 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 5752: 12-22 23:54:49.277 2650 8706 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 5753: 12-22 23:54:49.280 2650 16954 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 5940: 12-22 23:54:49.496 2650 21156 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 6291: 12-22 23:54:49.887 2650 23200 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 7876: 12-22 23:54:51.786 2650 18875 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 7877: 12-22 23:54:51.787 2650 12020 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 9996: 12-22 23:54:54.496 2650 21156 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 10697: 12-22 23:54:55.278 2650 8706 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 10698: 12-22 23:54:55.278 2650 27537 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 10699: 12-22 23:54:55.281 2650 16954 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 11238: 12-22 23:54:55.888 2650 23200 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 12738: 12-22 23:54:57.457 2650 8276 I CameraSource: Using encoder format: 0x22
Line 12739: 12-22 23:54:57.457 2650 8276 I CameraSource: Using encoder data space: 0x10c60000
Line 13207: 12-22 23:54:57.786 2650 18875 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 13229: 12-22 23:54:57.787 2650 12020 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 14046: 12-22 23:54:58.386 2650 8277 W CameraSource: Dropping frame with backward timestamp 84748488775 (last 84748488775)
Line 14048: 12-22 23:54:58.413 2650 8277 W CameraSource: Dropping frame with backward timestamp 84748488775 (last 84748488775)
Line 14893: 12-22 23:54:59.497 2650 21156 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 16289: 12-22 23:55:01.279 2650 27537 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 16290: 12-22 23:55:01.279 2650 8706 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 16291: 12-22 23:55:01.279 2650 27537 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 16292: 12-22 23:55:01.281 2650 16954 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 16779: 12-22 23:55:01.888 2650 23200 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 17513: 12-22 23:55:02.755 2650 8212 D CameraSource: reset: E
Line 18319: 12-22 23:55:03.786 2650 18875 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 18320: 12-22 23:55:03.788 2650 12020 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
Line 18825: 12-22 23:55:04.497 2650 21156 W CameraSource: Timed out waiting for outstanding frames being encoded: 1
status_t CameraSource::reset() {
ALOGD("reset: E");
{
Mutex::Autolock autoLock(mLock);
mStarted = false;
mEos = false;
mStopSystemTimeUs = -1;
mFrameAvailableCondition.signal();
int64_t token;
bool isTokenValid = false;
if (mCamera != 0) {
token = IPCThreadState::self()->clearCallingIdentity();
isTokenValid = true;
}
releaseQueuedFrames();
while (!mFramesBeingEncoded.empty()) {
if (NO_ERROR !=
mFrameCompleteCondition.waitRelative(mLock,
mTimeBetweenFrameCaptureUs * 1000LL + CAMERA_SOURCE_TIMEOUT_NS)) {
ALOGW("Timed out waiting for outstanding frames being encoded: %zu",
mFramesBeingEncoded.size());
}
}
stopCameraRecording();
if (isTokenValid) {
IPCThreadState::self()->restoreCallingIdentity(token);
}
if (mCollectStats) {
ALOGI("Frames received/encoded/dropped: %d/%d/%d in %" PRId64 " us",
mNumFramesReceived, mNumFramesEncoded, mNumFramesDropped,
mLastFrameTimestampUs - mFirstFrameTimeUs);
}
if (mNumGlitches > 0) {
ALOGW("%d long delays between neighboring video frames", mNumGlitches);
}
CHECK_EQ(mNumFramesReceived, mNumFramesEncoded + mNumFramesDropped);
}
if (mBufferQueueListener != nullptr) {
mBufferQueueListener->requestExit();
mBufferQueueListener->join();
mBufferQueueListener.clear();
}
mVideoBufferConsumer.clear();
mVideoBufferProducer.clear();
releaseCamera();
ALOGD("reset: X");
return OK;
}