[krillin] 1 in 5 images taken by camera corrupted with qtubuntu-camera from RTM silo 0 == trunk rev 132

Bug #1410301 reported by Florian Boucault
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qtubuntu-camera (Ubuntu)
Fix Released
Critical
Jim Hodapp

Bug Description

Steps to reproduce:
1. Flash krillin with latest RTM proposed: ubuntu-device-flash touch --channel=ubuntu-touch/ubuntu-rtm/14.09-proposed --bootstrap
2. Install packages from RTM Silo 0:
   a. Add PPA 0 to /etc/apt/sources.list: deb http://ppa.launchpad.net/ci-train-ppa-service/landing-000/ubuntu-rtm 14.09 main
   b. sudo apt-get update
   c. sudo apt-get install cameraplugin-aal libandroid-properties1 libhybris libhybris-common1 libhybris-test libhybris-utils libmedia1 libhardware2
3. Unplug USB cable
4. Reboot
5. Launch camera and take a dozen pictures of sufficient complexity, ie. not of a blank wall but of a detailed landscape for example that will yield fairly big image files

Current result:
Some pictures are corrupt and cannot be opened.

Expected result:
All pictures can be opened.

description: updated
description: updated
Changed in qtubuntu-camera (Ubuntu):
status: New → Confirmed
importance: Undecided → Critical
description: updated
description: updated
Revision history for this message
Ricardo Salveti (rsalveti) wrote :

Can you provide the logs for the camera-app and also logcat (run as root) while you reproduce the bug?

Revision history for this message
Florian Boucault (fboucault) wrote :

Logs attached

summary: - [krillin] 1 in 5 images taken by camera corrupted with trunk rev 132
+ [krillin] 1 in 5 images taken by camera corrupted with qtubuntu-camera
+ from RTM silo 0 == trunk rev 132
Revision history for this message
Ricardo Salveti (rsalveti) wrote :

This is what I get on .cache/upstart/application-click-com.ubuntu.camera_camera_3.0.0.412.log when I'm able to reproduce the issue:
Warning: Directory Thumbnail, entry 0x0201: Data area exceeds data buffer, ignoring it.
Warning: JPEG format error, rc = 4
Failed to update EXIF timestamps. Picture will be saved as UTC timezone.
Scaling thumbnail failed: Failed to load image '/home/phablet/Pictures/com.ubuntu.camera/image20150113_133512810.jpg': Error interpreting JPEG image file (Invalid JPEG file structure: two SOI markers)
file:///usr/share/click/preinstalled/com.ubuntu.camera/3.0.0.412/PhotogridView.qml:71:13: QML Image: Failed to get image from provider: image://thumbnailer/file:///home/phablet/Pictures/com.ubuntu.camera/image20150113_133512810.jpg
Scaling thumbnail failed: Failed to load image '/home/phablet/Pictures/com.ubuntu.camera/image20150113_133514729.jpg': Error interpreting JPEG image file (JPEG datastream contains no image)
file:///usr/share/click/preinstalled/com.ubuntu.camera/3.0.0.412/PhotogridView.qml:71:13: QML Image: Failed to get image from provider: image://thumbnailer/file:///home/phablet/Pictures/com.ubuntu.camera/image20150113_133514729.jpg
Scaling thumbnail failed: Failed to load image '/home/phablet/Pictures/com.ubuntu.camera/image20150113_133523223.jpg': Error interpreting JPEG image file (JPEG datastream contains no image)
file:///usr/share/click/preinstalled/com.ubuntu.camera/3.0.0.412/PhotogridView.qml:71:13: QML Image: Failed to get image from provider: image://thumbnailer/file:///home/phablet/Pictures/com.ubuntu.camera/image20150113_133523223.jpg
Corrupt JPEG data: 65423 extraneous bytes before marker 0xd9
JPEG datastream contains no image

Revision history for this message
Florian Boucault (fboucault) wrote :
Revision history for this message
Florian Boucault (fboucault) wrote :

The bug is not happening with the previous version of qtubuntu-camera published in RTM which was at bzr rev 119. Therefore this bug is triggered by one of these commits:

131 - Add useful image and thumbnail aspect ratio debugging and a warning when the two ratios don't match.
129 - Added support for getting and setting image encoding quality.
127 - Make sure the client app doesn't freeze after first recording and then taking a still picture.
126 - Make sure that Pulse stops reading the microphone stream when recording stops. Also make sure that the microphone reading worker thread stops cleanly on app termination.
124 - Fix incorrect preview window size bug when the thumbnail aspect ratio and preview window aspect ratio aren't the same
122 - Support outputLocation() when parameter is a directory path, so one can assign external storage path (e.g. SD card) from QML using 'camera.videoRecorder.outputLocation'.
120 - Add thumbnail size selection support.

I verified that adding revision 129 to trunk rev 119 does not trigger the bug.

Revision history for this message
Ricardo Salveti (rsalveti) wrote :

Some useful info from logcat:
120375 I/MtkCam/MtkCamUtils( 918): {CamProfile}[SingleShot::createJpegImg] : (0-th) ===> [start-->now: 6 ms]^M
120376 D/CamShot/SingleShot( 918): [MBOOL NSCamShot::SingleShot::createJpegImg(const NSCamHW::ImgBufInfo&, const NSCamShot::JpegParam&, MUINT32, MUINT32, const NSCamHW::ImgBufInfo&, MUINT32&)] -^M
120377 D/MtkCam/Shot( 918): (200)(NormalShot)[handleJpegData] + (puJpgBuf, jpgSize, puThumbBuf, thumbSize) = (0xb247b000, 3144576, 0xb330a000, 89600)^M
120378 D/MtkCam/Shot( 918): (200)(NormalShot)[makeExifHeader] + (u4CamMode, puThumbBuf, u4ThumbSize, puExifBuf) = (5, 0xb330a000, 89600, 0xb34c5008)^M
120379 W/MtkCam/Shot( 918): (200)(NormalShot)[makeExifHeader] The thumbnail size is large than 63K, the exif header will be broken^M
120380 D/CamExif ( 918): (200)[CamExif] - this:0xb36017f0^M
120381 D/CamExif ( 918): (200)[init] ============================ mCamExifParam ================================
120382 D/CamExif ( 918): ^M
120383 D/CamExif ( 918): (200)[init] u4GpsIsOn: 0, u4GPSAltitude: 0, uGPSLatitude: , uGPSLongitude: , uGPSTimeStamp: , uGPSProcessingMethod:
120384 D/CamExif ( 918): ^M
120385 D/CamExif ( 918): (200)[init] u4Orientation: 0, u4Facing: 0, u4ZoomRatio: 114, u4ImgIndex: 0, u4GroupId: 0, u4FocusH: 0, u4FocusL: 0
120386 D/CamExif ( 918): ^M
120387 D/CamExif ( 918): (200)[init] ============================ mCamDbgParam ================================
120388 D/CamExif ( 918): ^M
120389 D/CamExif ( 918): (200)[init] u4ShotMode: 0, u4CamMode: 5
120390 D/CamExif ( 918): ^M
120391 D/CamExif ( 918): (200)[init] ===========================================================================
120392 D/CamExif ( 918): ^M
120393 D/MEXIF ( 918): (200)[ExifUtils] - this:0xb84acad0, debug.camera.exif.loglevel=1^M

Revision history for this message
Ricardo Salveti (rsalveti) wrote :
Download full text (6.9 KiB)

And a camera_service crash:
I/DEBUG ( 5562): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 5562): Build fingerprint: 'bq/Aquaris_E4.5/Aquaris_E45:4.4.2/KOT49H/1420640387:user/dev-keys'
I/DEBUG ( 5562): pid: 28, tid: 200, name: Capture@CmdQue >>> /system/bin/camera_service <<<
I/DEBUG ( 5562): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr b34e6000
I/DEBUG ( 5562): r0 b34e5ff0 r1 b848dc1f r2 00000203 r3 00000007
I/DEBUG ( 5562): r4 b34e5465 r5 00000e0a r6 b84acad0 r7 b53f9493
I/DEBUG ( 5562): r8 b848d058 r9 b53fa37e sl b53fafb5 fp 00000018
I/DEBUG ( 5562): ip e0000000 sp b3600ac8 lr 000000f5 pc b6e9241c cpsr 20030010
I/DEBUG ( 5562):
I/DEBUG ( 5562): backtrace:
V/AudioMTKFilterManager( 2065): +process() insize 4096
I/DEBUG ( 5562): #00 pc 0002641c /system/lib/libc.so (__memcpy_base+112)
I/DEBUG ( 5562): #01 pc 00003825 /system/lib/libcam.exif.so (ExifUtils::exifAppnMake(unsigned int, unsigned char*, unsigned char*, unsigned int, unsigned int*)+48)
I/DEBUG ( 5562): #02 pc 0000343b /system/lib/libcam.exif.so (CamExif::appendDebugInfo(int, int, unsigned char**, unsigned int*)+150)
V/AudioMTKFilterManager( 2065): -process() outsize 0
I/DEBUG ( 5562): #03 pc 000035f1 /system/lib/libcam.exif.so (CamExif::appendDebugExif(unsigned char*, unsigned int*)+324)
I/DEBUG ( 5562): #04 pc 0004f6b5 /system/lib/libcam.camadapter.so (android::NSShot::ImpShot::makeExifHeader(unsigned int, unsigned char*, unsigned int, unsigned char*, unsigned int&, unsigned int, unsigned int, unsigned int, unsigned int)+340)
I/DEBUG ( 5562): #05 pc 00041227 /system/lib/libcam.camadapter.so (android::NSShot::NormalShot::handleJpegData(unsigned char*, unsigned int, unsigned char*, unsigned int)+110)
I/DEBUG ( 5562): #06 pc 000412eb /system/lib/libcam.camadapter.so (android::NSShot::NormalShot::fgCamShotDataCb(void*, NSCamShot::CamShotDataInfo)+38)
I/DEBUG ( 5562): #07 pc 0000ba63 /system/lib/libcam.camshot.so (NSCamShot::CamShotImp::onDataCallback(NSCamShot::CamShotDataInfo const&) const+26)
I/DEBUG ( 5562): #08 pc 0000bc63 /system/lib/libcam.camshot.so (NSCamShot::CamShotImp::handleDataCallback(int, unsigned int, unsigned int, unsigned char*, unsigned int)+32)
W/AudioMTKStreamOut( 2065): filters fail to process
I/DEBUG ( 5562): #09 pc 0000dfbd /system/lib/libcam.camshot.so (NSCamShot::SingleShot::startOne(NSCamHW::ImgBufInfo const&)+504)
I/DEBUG ( 5562): #10 pc 0000e6e1 /system/lib/libcam.camshot.so (NSCamShot::SingleShot::startOne(NSCamShot::SensorParam const&)+456)
I/DEBUG ( 5562): #11 pc 0000ea93 /system/lib/libcam.camshot.so (NSCamShot::ISImagerBridge::setRotation(unsigned int)+26)
I/DEBUG ( 5562): #12 pc 00040f29 /system/lib/libcam.camadapter.so (android::NSShot::NormalShot::onCmd_capture()+184)
I/DEBUG ( 5562): #13 pc 00040f9b /system/lib/libcam.camadapter.so (android::NSShot::EvShot::sendCommand(unsigned int, unsigned int, unsigned int)+28)
I/DEBUG ( 5562): #14 pc 0004f0fb /system/lib/libcam.camadapter.so (android::NSShot::IShot::sendCommand(android::NSShot::ECommand, uns...

Read more...

Changed in qtubuntu-camera (Ubuntu):
assignee: nobody → Jim Hodapp (jhodapp)
Revision history for this message
Ricardo Salveti (rsalveti) wrote :

We found out that the problem is the size of the thumbnail quality set in the android layer (originally as 100).

Using 80 instead was already enough to get this issue fixed (thumbnail always <= 64k), which is also the value used by mako.

Changed in qtubuntu-camera (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Ricardo Salveti (rsalveti) wrote :
information type: Public → Private
information type: Private → Public
Revision history for this message
Ricardo Salveti (rsalveti) wrote :

Fixed on krillin RTM 194.

Changed in qtubuntu-camera (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.