not mountable digital camera (Sony Cybershot DSC-S40)

Bug #569332 reported by Maciej Pilichowski on 2010-04-24
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Undecided
Unassigned
linux (openSUSE)
Unknown
High

Bug Description

First time I found out that this camera is not mountable in OpenSuse. It seems a lot of Linux distributions while moving up to newer kernels dropped support for valid, connected via USB, cameras.

Facts:
* Sony Cybershot DSC-S40
* new Ubuntu 10.04 RC

The camera should be seen as external "drive" for the system, and it is is listed in connected devices list, for example:
dir /dev/disk/by-id/

But when you try to mount it, it gives an error that user is supposed to give filesystem (it is vfat), when this parameter is added to mount (-t vfat) then mount complains it cannot read superblock.

Please note, that all older Linux distribution could mount and use this camera, I don't which version for Ubuntu it was though.

please run:

hwinfo --disk
hwinfo --usb

Created an attachment (id=265568)
hwinfo.usb

Created an attachment (id=265569)
hwinfo.disk

I don't know if I have the same issue but plugging in any digital camera leads to no response by my system. In opensuse 11.0 I was used to an automount of everything. The only automount which works now with 11.1 is usb-sticks, even cd's or dvd's don't work when not mounted manually. The only thing I can remember that my system hung when I installed the last hal update. After the restart the new hal package showed up in yast so I didn't heed this hang-up.

Please provide full lshal output with the affected device attached to your machine. Also the part of /var/log/messages since plugging in the device would be useful.

And please check if it makes a difference if you stop hal before plugging in the camera. Do you get a mountable device?

For the latter -- no, it says:
mount: I could not determine the filesystem type, and none was specified

In 10.3 I made the same steps (without shutting down HAL) and it worked.

Logs follow.

Created an attachment (id=276516)
messages

Created an attachment (id=276517)
lshal

Danny, maybe it is somehow common:
https://bugzilla.novell.com/attachment.cgi?id=276443
This is from report you took look at already;
https://bugzilla.novell.com/show_bug.cgi?id=467174

With all those errors in /var/log/messages, it looks to me like a kernel or Hardware problem. And since a manual mount isn't possible (because of a not detectable filesystem type) it is no HAL, but a system problem. Reassign to kernel.

Ugh, sony still hasn't fixed the firmware in these devices. I'll go knock up a patch for this...

Can you test a kernel patch? Or do you need a fully built kernel rpm to test with?

Greg, I would very much prefer built kernel (3 files, right?) -- I am pretty scared of installing test kernels, so patching it myself... ;-) heart attack. Thank you in advance.

Ok, will get you a kernel build...

Ok, this is now checked into the SLE11_BRANCH and HEAD kernel branches. A pre-built kernel will show up in the kernel-of-the-day repository tomorrow with this change in it.

You can find the repo at:
  http://ftp.suse.com/pub/projects/kernel/kotd/

Can you try the kernel there and let me know if it solves your problem or not? Make sure you see the following in the changelog entry to verify that the patch is in there:
  - patches.drivers/usb-storage-increase-the-bcd-range-in-sony-s-bad-device-table.patch:
      USB: storage: increase the bcd range in Sony's bad device
      table. (bnc#466554).

Things got worse -- with this special kernel (thank you!) camera is not even seen in /dev/disk/by-id/ _BUT_ when I "came back" not to the kernel I used before installing special one, but to the downloaded from regular repo (right now), I don't see camera either.

So now it is not only it is not mountable, but it is not even seen.

I checked USB modem, pendrive -- those work.

I messed up with the regular repo, so the above report once again:

* kernel from HEAD (containing sony patch) does not even list the camera

* regular kernel (2.6.27.29-0.1.1) does not mount camera, but it is listed as device and partition (sdb and sdb1)

PS. I use kernel-default, *-base, *-extra, but in HEAD repo the extra package is missing. Could it be the cause?

no, extra is not needed anymore.
but the device should still show up.

What does the kernel log show when you plug your device into the system?

You mean
/var/log/messages
right?

No, 'dmesg' output.

Before you plug in your device, as root run:
  dmesg -c
which clears the log out.

then plug your device in and attach the output of 'dmesg'

Created an attachment (id=315381)
regular kernel -- just for comparison

Created an attachment (id=315383)
and testing kernel

Very wierd, I'm confused here.

Can you send this info to the <email address hidden> mailing list? They will also want you to use the usbmon tool to try to figure out the problem. I'd recommend using a kernel without my fix. I'll post my proposed patch to the list after you send your report so that the developers there can see what we tried to do to fix this issue.

Done. What is the usbmon, I cannot find this utility --
http://software.opensuse.org/search?q=usbmon
0 hits.

Also nothing in Yast/SM.

Created an attachment (id=315848)
opensuse 11.1 sony camera usb trace

Created an attachment (id=315849)
opensuse 10.3 all usb devices trace

Created an attachment (id=315858)
opensuse 11.1 ext. trace

Created an attachment (id=315859)
opensuse 10.3 ext. trace

Just for the record:

"
Okay, this shows the source of the problem.  In fact it's a combination
of things: a bug in the camera and changes in udev and hal -- which
explains why OpenSuSE 10.3 worked and 11.3 doesn't.

The camera reports initially that it has 63424 sectors of storage (31.7
MB).  Although old versions of udev and hal didn't do this, newer
versions try reading the sectors near the end to check for a RAID
signature.  In your case, udev tried to read 8 sectors starting at
sector 63408.  Although this should have worked, it didn't -- the
camera reported a Medium Error (unrecoverable read error) and then
basically stopped working.  Every attempted read after that got a Not
Ready (medium not present) error; even reads for sectors nowhere near
the end.  Presumably the same thing would have happened with the older
OS if it had tried to read sectors so close to the end.

That's the reason the mount failed.  You'd think by now Sony could use
properly-designed USB interfaces for their cameras, but apparently they
can't.
"
-- Alan Stern

Ok, this is a udev issue in accessing these types of devices.

Kay, is there some way to blacklist these devices from being probed for raid?

No, there is no such list. Today we have no single entry for usb storage devices in userspace, they are all in the kernel.

We have just released a SLE11/openSUSE 11.1 kernel update fixing/mentioning this bugreport, which has the version 2.6.27.37-0.1.1.

Update released for: cluster-network-kmp-default, cluster-network-kmp-xen, ext4dev-kmp-default, ext4dev-kmp-xen, kernel-default, kernel-default-base, kernel-default-debuginfo, kernel-default-debugsource, kernel-default-extra, kernel-ec2, kernel-ec2-base, kernel-ec2-debuginfo, kernel-ec2-debugsource, kernel-ec2-extra, kernel-source, kernel-source-debuginfo, kernel-syms, kernel-xen, kernel-xen-base, kernel-xen-debuginfo, kernel-xen-debugsource, kernel-xen-extra
Products:
SLE-DEBUGINFO 11 (x86_64)
SLE-DESKTOP 11 (x86_64)
SLE-HAE 11 (x86_64)
SLE-SDK 11 (x86_64)
SLE-SERVER 11 (x86_64)
SLE-SERVER 11-EC2 (x86_64)

Closing as fixed. Thanks!

linux-kernel-headers-2.6.27-2.28
kernel-default-base-2.6.27.37-0.1.1
kernel-default-extra-2.6.27.37-0.1.1
kernel-default-2.6.27.37-0.1.1
kernel-source-2.6.27.37-0.1.1

Unfortunately there is no change in behaviour with camera -> reopening.

PS. "No change" comparing to the test kernel (#17) -- camera currently is not even visible in the system. In original report I couldn't mount it but it was detected and listed as device.

Opensuse 11.2 KDE Live 64bit -- camera is visible in the system, yet it is not mountable. So generally it is the same state as in 11.1.

Btw. I changed the importance to Major = "Major loss of function" (here it is complete loss of function).

Has there been any updates to the kernel fix for this? I just switched my sister-in-law from windoze XP to OpenSUSE 11.2 and her Sony SureShot digital Cam wouldn't mount also. Same symptoms as above.

Appreciate an update as to when/if it'll be fixed.

Not sure if this issue still exists with current systems. I'm not working on this issue, and sorry, have no idea what to fix. Reassigning to default.

What about info I got from kernel-usb ML?

Maciej Pilichowski (bluedzins) wrote :

First time I found out that this camera is not mountable in OpenSuse. It seems a lot of Linux distributions while moving up to newer kernels dropped support for valid, connected via USB, cameras.

Facts:
* Sony Cybershot DSC-S40
* new Ubuntu 10.04 RC

The camera should be seen as external "drive" for the system, and it is is listed in connected devices list, for example:
dir /dev/disk/by-id/

But when you try to mount it, it gives an error that user is supposed to give filesystem (it is vfat), when this parameter is added to mount (-t vfat) then mount complains it cannot read superblock.

Please note, that all older Linux distribution could mount and use this camera, I don't which version for Ubuntu it was though.

Maciej Pilichowski (bluedzins) wrote :

Just in case the link to the counterpart report for opensuse with some info from kernel usb ML
https://bugzilla.novell.com/show_bug.cgi?id=466554

11.3 M5 fails too. Could the part responsible for mounting be compared between 10.3 and 11.1? After all, it worked, so the solution is out there.

Can you provide the kernel log messages for 11.3 Milestone whatever-is-latest?

Just in case -- I've read your comment right away, but I am simply waiting for M7 (it was scheduled at 05-21, nomen omen).

Created an attachment (id=365658)
dmesg output

11.3 M7.

Fabio Marconi (fabiomarconi) wrote :

Hello
Is this problem present with the latest updated Lucid's or Maverick's packages?
Thanks in advance
Fabio

Changed in ubuntu:
status: New → Incomplete
Maciej Pilichowski (bluedzins) wrote :

I tried Ubuntu 10.10, no change in behaviour.

Changed in ubuntu:
status: Incomplete → New
tags: added: lucid maverick regression-release
affects: ubuntu → linux (Ubuntu)

Are you able to reproduce this with kernel-vanilla or with the Factory kernel?

Changed in linux (openSUSE):
importance: Unknown → High
status: Unknown → Incomplete

Yes, openSUSE 11.4 RC1. Only the error is changed:

can't read superblock

The effect is the same, I cannot mount it.

Changed in linux (openSUSE):
status: Incomplete → Confirmed

Just for the record -- to fix this bug NO new code is required, all the code required to mount the digital camera is within 10.3 kernel.

Brad Figg (brad-figg) on 2011-04-05
tags: removed: maverick

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 569332

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete

Yes, this is not a kernel problem. At least on 11.3. But to be sure we should check 11.4 fails for the same reason. Could you provide the output of dmesg on 11.4?

Created an attachment (id=479770)
dmesg 11.4

@Oliver, "Yes, this is not a kernel problem." -- what are you referring to ("yes")?

Your device reports that no medium is present. The kernel reacts to that like it should. Your device has a buggy firmware. The bug in the firmware is not triggered by the kernel. It is triggered by udev as Alan showed in comment#31. The trace you provided shows that the problem in 11.4 is the same problem as in 11.3

I could introduce a kernel quirk to reduce the disk size reported to user space, but I don't know by how much. The clean fix would be introduce a blacklist for udev to stop probing for raid devices.

Does your camera have internal memory or does it use an external medium?

> The clean fix would be introduce a
> blacklist for udev to stop probing for raid devices.

I didn't know I have raid device :-) Of course any general workaround would be better, because the more hardware is supported, the better for Linux.

> Does your camera have internal memory or does it use an external medium?

This type of camera in general uses both, but my camera has only internal memory.

(In reply to comment #53)

> This type of camera in general uses both, but my camera has only internal
> memory.

Good, then I'll make a patch to cut off a bit off the space on your camera. But I need to determine how much. Could you do:

killproc /sbin/udevd
fdisk -l /dev/sdc

I tested it on OS 12.1 -- nothing happened.

In order to test it on OS 11.4 I need to know how this affects other disks in the system, and if I can continue working, or should I restart my computer.

(In reply to comment #55)
> I tested it on OS 12.1 -- nothing happened.

There was no output from fdisk?

> In order to test it on OS 11.4 I need to know how this affects other disks in
> the system, and if I can continue working, or should I restart my computer.

It does nothing to the other disks. But hotplugging will be disabled by such a test. You need to restart udev after the test.

> There was no output from fdisk?

Nope. Same story with 11.4 -- no output, just next command prompt.

> You need to restart udev after the test.

How to do it?

I executed "udevd &" as root, and quit the shell. I hope it was OK.

The output of "fdisk -l" please

I already wrote this twice. There is no output. Output is none. Output is empty. There is no data in output. Null. Zero.

Thus, I cannot attach any output, because there is no output -- see above.

(In reply to comment #60)
> I already wrote this twice. There is no output. Output is none. Output is
> empty. There is no data in output. Null. Zero.
>
> Thus, I cannot attach any output, because there is no output -- see above.

Can you try a LiveCD of the release that could read from the device?

I have 10.3 installed on USB flash memory card for such purpose. It is minimal system (console only), and can mount the camera.

I hope USB is still working.

What should I do with it.

(In reply to comment #62)
> I have 10.3 installed on USB flash memory card for such purpose. It is minimal
> system (console only), and can mount the camera.
>
> I hope USB is still working.
>
> What should I do with it.

Please provide the output of "fdisk -l /dev/sdX" with sdX replaced with the device name of your camera

Disk /dev/sdb: 32MB, 32473088 bytes
4 heads, 16 sectors/track, 991 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 990 31670+ 1 FAT12

With the coming release of openSUSE 12.2, openSUSE kernel developers are focusing their efforts there. Reports against openSUSE 11.4 and prior will not get the attention needed to resolve them before openSUSE 12.2 is release and openSUSE 11.4 becomes unmaintained.

Please re-test with openSUSE 12.1 or openSUSE RC2+ and re-open with an updated Product if you still encounter your issue.

We apologize for this issue not getting the attention it deserves but we are focusing our resources in the area where they will have the most impact for our users. We're working hard to make openSUSE 12.2 the best openSUSE release yet!

openSUSE 11.4 is the oldest distro with this bug, 12.1 also has this bug, and I guess 12.2 will also have this bug, but since I don't have a spare machine to test it (virtual one is no good here), I have to wait for stable release.

Please note, this bug is regression. openSUSE supported those cameras once.

Please update the product field on re-opened bugs or they will be automatically re-closed as outdated.

Created an attachment (id=501804)
patch to shrink device

Could you test the kernel patch in comment#68 ?

I would be happy to do so, but please tell me what _exactly_ should I do (steps). Thank you in advance.

Install the kernel sources: zypper in kernel-source
You may already have them installed.

Apply the patch:
cd /usr/src/linux
patch -p1 < $HOME/name_you_saved_patch_as

you install gcc: zypper in gcc
You may already have installed it

You compile the kernel:
make

You install the kernel as root:
make modules_install ; make install ; sync

And then you reboot the test kernel

I am testing this on openSUSE 12.1 with kernel 3.1.9 and 3.1.10, in both cases I cannot pass patch step. Here is the error:

patching file drivers/scsi/sd.c
Hunk #1 succeeded at 1869 (offset -99 lines).
patching file drivers/usb/storage/scsiglue.c
Hunk #1 succeeded at 203 (offset 11 lines).
patching file drivers/usb/storage/unusual_devs.h
patching file include/linux/usb_usual.h
Hunk #1 FAILED at 66.
1 out of 1 hunk FAILED -- saving rejects to file include/linux/usb_usual.h.rej
patching file include/scsi/scsi_device.h
Hunk #1 succeeded at 144 (offset -2 lines).

Created an attachment (id=503118)
patch to shrink device

Against the correct kernel tree this time

Can you try with the patch of comment#73 ?

Sure, this time I managed to move some steps forward. So, I applied the patch, I executed 'make' but it complained about missing config file, so I executed 'make menuconfig', I switched some option on and then off, to make sure, the config will be created. I executed 'again'.

After quite some time, it hit error however:

drivers/usb/storage/scsiglue.c: In function ‘slave_configure’:
drivers/usb/storage/scsiglue.c:207:20: error: ‘US_FL_FIX_CAPACITY12’ undeclared (first use in this function)
drivers/usb/storage/scsiglue.c:207:20: note: each undeclared identifier is reported only once for each function it appears in

Kernel, and all other related files with 3.1.10 version.

Created an attachment (id=515588)
fixed version of last patch

Please try the patch from comment#75

Changed in linux (openSUSE):
status: Confirmed → Incomplete

Thank you for the patch, however soon I will stop using this camera, so I will no longer be able to test it. Maybe we should close it for now, until other user will appear interested in OS and the same camera (or with the same issue, because I guess there would be several models affected, not just one).

Changed in linux (openSUSE):
status: Incomplete → Unknown
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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