Closed Bug 944452 Opened 11 years ago Closed 6 years ago

[Keon] Photos taken with Camera do not get saved to Gallery

Categories

(Firefox OS Graveyard :: Gaia::Camera, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: benfrancis, Unassigned)

References

Details

Tested on a Keon running 1.2, may be specific to this device?

STR:
* Open camera
* Take a photo

Expected:
* Photo saved to gallery

Actual:
* "Picture not saved. An error prevented Camera from saving the picture." displayed on the screen.
I upgraded my Keon to Geeksphone's master build from yesterday. Now I don't see the error message, but pictures taken with the camera are still not saved to the Gallery.
Summary: "Picture not saved. An error prevented Camera from saving the picture." → [Keon] Photos taken with Camera do not get saved to Gallery
David, do you know anything about camera/device storage support on the Keon? Is this bug definitely Keon-specific? It's blocking my dogfooding :(
Flags: needinfo?(dflanagan)
Ben,

I don't know anything about the Keon.  The camera is completely refactored in 1.4, so I guess the message just went away but the underlying problem remains.  The error message is from the Dale era of camera development, and I forget exactly what conditions trigger it.
Flags: needinfo?(dflanagan)
Ben, if you're comfortable making your own Gecko build and flashing it to your Keon, you can add " printf_stderr(__VA_ARGS__)" (without the quotes) to the end of CameraCommon.h line 28[1]. This will dump all of the output from the camera stack to logcat, which might shed some light on where the error is popping up.

1. http://dxr.mozilla.org/mozilla-central/source/dom/camera/CameraCommon.h#28
Hmm, I managed to coax the device into taking pictures and saving them on the SD card by mounting and unmounting file systems and plugging and unplugging USB storage, but then the camera app can see the files and I can see them on the SD card but the Gallery app always insists the device needs to be unplugged, even after the device is unplugged.

Upon reboot the SD card isn't mounted any more. I can get it to remount by enabling USB storage, plugging the device in and then disabling USB storage but the Gallery app still thinks it's plugged in and won't access the SD card. I also notice that in the Settings app it says "Unplug USB cable to disable" under USB storage even after the cable is unplugged.

I think there might be a low level problem with mounting/unmounting the filesystem because I see the following in logcat...

I/VolumeManager(  110): Volume sdcard: changing state from Idle to Checking (4 observers)
D/VoldCmdListener(  106): volume mount sdcard
I/Vold    (  106): /dev/block/vold/179:20 being considered for volume sdcard
D/Vold    (  106): Volume sdcard state changing 1 (Idle-Unmounted) -> 3 (Checking)
W/Vold    (  106): Skipping fs checks
E/Vold    (  106): Unable to create LOST.DIR (I/O error)
I/Vold    (  106): Device /dev/block/vold/179:20, target /mnt/sdcard mounted @ /mnt/secure/staging
E/Vold    (  106): Failed to create /mnt/secure/staging/.android_secure (I/O error)
E/Vold    (  106): Failed to create bindmounts (I/O error)
I think this is a west-coast issue.
Flags: needinfo?(dhylands)
Actually, if I had to guess, I would initially say that the sdcard has probably gone bad.

Can you try replacing the sdcard with another and seeing if the problem persists?
Flags: needinfo?(dhylands)
It would also be useful to see what the output of:

adb shell vdc volume list

is.
I thought that too but I swapped it for another card and got the same result, also tried re-formatting the SD card. I have another Keon which I've just tested and it doesn't display the same symptoms with the same build and the same SD card. It seems one of them has got into a broken state.

|adb shell vdc volume list| looks the same...

Working Keon:
110 sdcard /mnt/sdcard 4
110 emmc /mnt/emmc 4
200 Volumes listed.

Non-working Keon:
110 sdcard /mnt/sdcard 1
110 emmc /mnt/emmc 1
200 Volumes listed.

But running |mount| after boot reveals some more interesting differences...

Working Keon:
rootfs / rootfs ro,relatime 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
/dev/block/mmcblk0p12 /system ext4 ro,relatime,user_xattr,barrier=0,data=ordered 0 0
/dev/block/mmcblk0p13 /data ext4 rw,nosuid,nodev,relatime,user_xattr,barrier=1,data=ordered,noauto_da_alloc 0 0
/dev/block/mmcblk0p14 /persist ext4 rw,nosuid,nodev,relatime,user_xattr,barrier=1,data=ordered 0 0
/dev/block/mmcblk0p15 /cache ext4 rw,nosuid,nodev,relatime,user_xattr,barrier=1,data=ordered 0 0
/dev/block/vold/179:20 /mnt/sdcard vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:20 /mnt/secure/asec vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
tmpfs /mnt/sdcard/.android_secure tmpfs ro,relatime,size=0k,mode=000 0 0
/dev/block/vold/179:33 /mnt/emmc vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0

Non-working Keon:
rootfs / rootfs ro,relatime 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
/dev/block/mmcblk0p12 /system ext4 ro,relatime,user_xattr,barrier=0,data=ordered 0 0
/dev/block/mmcblk0p13 /data ext4 rw,nosuid,nodev,relatime,user_xattr,barrier=1,data=ordered,noauto_da_alloc 0 0
/dev/block/mmcblk0p14 /persist ext4 rw,nosuid,nodev,relatime,user_xattr,barrier=1,data=ordered 0 0
/dev/block/mmcblk0p15 /cache ext4 rw,nosuid,nodev,relatime,user_xattr,barrier=1,data=ordered 0 0

I can manually mount the SD card with...

$ mount -t vfat /dev/block/vold/179:33 /mnt/emmc

and the card seems to work fine on the command line or mounted via USB mass storage.

Am I right in thinking there isn't an /etc/fstab on Android, that it's hard coded in the boot image or something? I'm flashing these Keons with Geeksphone's nightly build from yesterday with their ./flash.sh script and saying no to keeping user data. I'm not sure which partitions that flashes.
Related to the recent device-storage thread on dev-gaia?  The reporter there was also using a Keon.
(In reply to Ben Francis [:benfrancis] from comment #9)
> I thought that too but I swapped it for another card and got the same
> result, also tried re-formatting the SD card. I have another Keon which I've
> just tested and it doesn't display the same symptoms with the same build and
> the same SD card. It seems one of them has got into a broken state.
> 
> |adb shell vdc volume list| looks the same...
> 
> Working Keon:
> 110 sdcard /mnt/sdcard 4
> 110 emmc /mnt/emmc 4
> 200 Volumes listed.

The 4 tells me that the sdcard is mounted.

> Non-working Keon:
> 110 sdcard /mnt/sdcard 1
> 110 emmc /mnt/emmc 1
> 200 Volumes listed.

The 1 here tells me that the sdcard is not mounted.

> But running |mount| after boot reveals some more interesting differences...

The differences seem to be that the working one with the sdcard mounted shows:

> /dev/block/vold/179:20 /mnt/sdcard vfat ...
> /dev/block/vold/179:20 /mnt/secure/asec vfat ...
> tmpfs /mnt/sdcard/.android_secure tmpfs ...
> /dev/block/vold/179:33 /mnt/emmc vfat ...

> I can manually mount the SD card with...
> 
> $ mount -t vfat /dev/block/vold/179:33 /mnt/emmc
> 
> and the card seems to work fine on the command line or mounted via USB mass
> storage.

Hmm. So the volume manager does a bunch of other stuff before doing the mount (including a chkdsk).

What about:

adb shell vdc volume mount sdcard

This will do the checks and then the mount. You might want to try the above with b2g stopped. The AutoMounter in b2g reacts to changes in the volume state, and then issues vdc commands to mount, share, unmount, etc.

From an adb shell with b2g stopped, you should be able to do:

vdc volume list

The states can be found here: http://dxr.mozilla.org/mozilla-central/source/dom/system/gonk/nsIVolume.idl#13

From an idle state (1), you should be able to 

vdc volume mount sdcard

This should then change the volume to the mounted state (4)

From the mounted state, you can unmount it to take back to the idle state.

vdc volume unmount sdcard

Also from the idle state, you should be able share the volume with the PC:

vdc volume share sdcard ums

and unshare it:

vdc volume unshare sdcard ums

(note that depending on the phone, unsharing may require ejecting or safely removing from the host), or even unplugging the usb cable.

The vold process (from android) is what does all of the real work, and vdc just communicates with it over a named pipe, exactly like the AutoMounter does.

> Am I right in thinking there isn't an /etc/fstab on Android, that it's hard
> coded in the boot image or something? I'm flashing these Keons with
> Geeksphone's nightly build from yesterday with their ./flash.sh script and
> saying no to keeping user data. I'm not sure which partitions that flashes.

The sdcard mounting information used by android can be found in /system/etc/vold.conf and /system/etc/vold.fstab

The other mounts are typically hard-coded in the /init.rc script.

It almost sounds like the card is being treated as if it were write-protected.

So is it true, that you can use the exact same sdcard in a good keon and everything works fine, but you can move the same sdcard to the "bad" keon and you get the misbehaviours?
Ben, have you had a chance to play with your Keon recently? Is this issue still happening?
Flags: needinfo?(bfrancis)
I haven't, but I suspect it may be something specific to my device. I still don't know how it got into that state and I haven't seen it on other devices since.
Flags: needinfo?(bfrancis)
I have a Keon with this very bug on Nightly.

Please let me know what do you need me to collect to get this fixed?
Flags: needinfo?(mhabicher)
Alex, you can capture the logcat output and the output while running (and capturing the output of) the commands in comment 8 and 10, then attach those to this bug and ni? dhylands.
Flags: needinfo?(mhabicher)
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.