getTime crash with RAW enabled
Mate 9 / OmniROM 9 0.5.3-alpha
Crash on press CAPTURE
22160 22179 E AndroidRuntime: Process: com.tyroneil.[01;31m[Klong[m[Kshootalpha, PID: 22160
22160 22179 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method '[01;31m[Klong[m[K java.util.Date.getTime()' on a null object reference
22160 22179 E AndroidRuntime: at com.tyroneil.[01;31m[Klong[m[Kshootalpha.MainActivity$7.onImageAvailable(MainActivity.java:964)
936 6266 W ActivityManager: Force finishing activity com.tyroneil.[01;31m[Klong[m[Kshootalpha/.MainActivity
936 1029 W InputDispatcher: channel '7c14681 com.tyroneil.[01;31m[Klong[m[Kshootalpha/com.tyroneil.longshootalpha.MainActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9
936 1029 E InputDispatcher: channel '7c14681 com.tyroneil.[01;31m[Klong[m[Kshootalpha/com.tyroneil.longshootalpha.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
Also the About button doesn't seem to do anything.
null when java.util.Date.getTime()??? This doesn't make sense. I will make some test build for you, please tell me which one still has this problem.
As to the About button, it's normal to do nothing, because I didn't write that part yet.
[test][date_crash] 0.5.4-alpha please try these three builds, tell me which one will crash.
They all crash, when pressing CAPTURE, same error message.
Disable RAW capture and then it doesn't crash anymore.
They all crash, when pressing CAPTURE, same error message.
Disable RAW capture and then it doesn't crash anymore.
Disable RAW then all of it won't crash?
Oh, there is corrupted characters in the logcat you pasted, I don't know if it's just on my end.
That's my ROM, it outputs some fancy styling, not an issue,
Can you get the stack trace? It should be in the logcat.
There's nothing more in the log.
There's nothing more in the log.
Oh, my bad. Didn't see the stack trace before because the corrupted characters.
The bad news is, the only thing related to date around line 964 is simpleDateFormat.format(imageTimeStamp), then the null exception must comes from imageTimeStamp; but if imageTimeStamp is a null reference, this bug must happen to both JPEG and RAW, and it should not occur in one of the test build I made for you before.
Yet, they all behave the same, crash there or no crash without RAW.
Later I will make a test build with simpleDateFormat.format(imageTimeStamp) replaced by a fixed string, see if it can prevent crash
0.5.5-alpha.test.getTime.null.apk.zip GitHub only support some format as attachments...
I just discovered something, and I think the build above may still gonna crash, but try it.
I change the DNG file name to a fixed string, didn't change it for JPEG.
So as expected?
AndroidRuntime: at com.tyroneil.[01;31m[Klong[m[Kshootalpha.MainActivity$7.onImageAvailable(MainActivity.java:980)
Right, I know what's the problem now.
But, it should crash first at line 1051 if I'm correct...
0.5.5-alpha.test.totalCaptureResult.null.apk.zip
Try this, if it did not crash, look for log with tag LSA_WARNING, level warning.
Not sure what warning were you expecting, I don't have those.
Only the crash: AndroidRuntime: at com.tyroneil.[01;31m[Klongshoot[m[Kalpha.MainActivity$7.onImageAvailable(MainActivity.java:977)
It's really imageTimeStamp, then deeper totalCaptureResult.get(CaptureResult.SENSOR_TIMESTAMP).
Try this 0.5.5-alpha.test.totalCaptureResult.null.1.apk.zip
The problem though, is that, as to the documents, totalCaptureResult.get(CaptureResult.SENSOR_TIMESTAMP) shouldn't be null.
As to the warning, I mean something like this: adb logcat LSA_WARNING:W.
~~Can't download: "This page is taking way too long to load."~~
I use logcat -i longshoot, your line has too much noise.
/LE: it worked to download later
You mean it didn't crash? Did you see any logcat with LSA_WARNING tag?
~I tried my line, you are right; but it should filter only log with that tag, I don't know what's wrong.~
Figured out, should use adb logcat LSA_WARNING:W *:S
Still crashes:
E AndroidRuntime: at com.tyroneil.[01;31m[Klongsh[m[Kootalpha.MainActivity$7.onImageAvailable(MainActivity.java:977)
What??? Try this build 0.5.5-alpha.test.fixedName.noTimeStampVerification.apk.zip. This should produce RAW with a fixed file name and without time stamp verification (nothing related to time now).
Expected behaviour:
- JPEG behave same as before
- RAW will not crash, but save every photo with the same name
Because I can't reproduce it on my phone, all I can do is guess based on your log. Now I'm getting confused what really cause the crash.
The same:
AndroidRuntime: at com.tyroneil.[01;31m[Klongsh[m[Kootalpha.MainActivity$7.onImageAvailable(MainActivity.java:987)
The error is still getTime() null? Line 987 is:
DngCreator dngCreator = new DngCreator(cameraCharacteristics, totalCaptureResult);
totalCaptureResult is the metadata comes straight out form capture, it is essential to save the DNG file, and I did not modify it.
It looks like your ROM has RAW support (actually I should check it from cameraCharacteristics), but the support has some problem.
One thing more I can do is to check the cameraCharacteristics. if it says the device has RAW support, and it crash like you described, then it is a problem with the ROM.
@licaon-kter I just realized there is a simple way to see if it is a bug with my app.
Try this googlesamples_android-Camera2Raw.zip. It's a camera2 RAW capture sample made by Google.
If it works, takes photos and save them under DCIM directory, it means RAW support has no problem.
Try this googlesamples_android-Camera2Raw.zip.
Works fine, it captures DNGs.
Well, then I will try to find the difference between my app and the sample