# Kernel 2.6 + Digital Camera [USB Storage, Mount]

## spike_cb

First of all, Happy New Year to all !!

I'm having problem mounting my Panasonic Lumix DMC-LC40 under kernel 2.6. This camera can be mounted directly on USB under usb-storage with kernel 2.4.x. Now, I know that 2.6 isn't supported officially by Gentoo but I would like to hear some suggestions on how to solve this problem.

I'm running kernel 2.6.1-r1 but this problem also occur on 2.6.0 vanilla and 2.6.0 gentoo-dev-sources (I haven't tried the BK patch-set which apparently contains a lot of USB patches). I have udev compiled instead of devfs. So far all of my devices, including my Audigy 2 Platinum EX works flawlessly under udev, ..except my camera   :Confused:   .

After the camera is hot-plugged on USB (ohci), /dev/sdc & /dev/sdc1 appears automatically (I have 2 real SCSI disks on /dev/sda & /dev/sdb). But whenever I try to mount /dev/sdc1, I get mount: No medium found (Windows partitioned fat/vfat/ntfs,etc are all compiled in the kernel). I suspect this could be coreutils/mount problem also, but I don't know..

I've searched the forums but none really matched up with this problem.

Any ideas ?   :Very Happy: 

note: I have no /dev/scsi/... but the SCSI HDs work normally (I have SCSI support, new aic7xxx, etc. compiled in the kernel)

----------

## symbiote

Recompiling libusb and libphoto2 worked for my digital camera.

----------

## spike_cb

I did try to recompile usb libraries but it didn't help. I don't use libgphoto2 because gphoto2 itself doesn't support the camera. The camera is considered a straight USB storage media even without gphoto2/libgphoto2 and it should be able to be mounted and accessed directly.

Unlike some people, I do have /dev/sdc & /dev/sdc1 ...

But when "mount -t auto /dev/sdc1 /mnt/digicam" is executed

I get "mount: No medium found" even thou the camera is connected and /dev/sdc1 exists!  

```

# lsusb -v

 Bus 001 Device 002: ID 04da:2372 Panasonic (Matsushita)

Device Descriptor:

  bLength                18

  bDescriptorType         1

  bcdUSB               1.10

  bDeviceClass            0 Interface

  bDeviceSubClass         0

  bDeviceProtocol         0

  bMaxPacketSize0         8

  idVendor           0x04da Panasonic (Matsushita)

  idProduct          0x2372

  bcdDevice            0.10

  iManufacturer           1 Panasonic

  iProduct                2 DMC-LC40

  iSerial                 0

  bNumConfigurations      1

  Configuration Descriptor:

    bLength                 9

    bDescriptorType         2

    wTotalLength           46

    bNumInterfaces          1

    bConfigurationValue     1

    iConfiguration          0

    bmAttributes         0xc0

      Self Powered

    MaxPower                0mA

    Interface Descriptor:

      bLength                 9

      bDescriptorType         4

      bInterfaceNumber        0

      bAlternateSetting       0

      bNumEndpoints           4

      bInterfaceClass         8 Mass Storage

      bInterfaceSubClass      6 SCSI

      bInterfaceProtocol     80 Bulk (Zip)

      iInterface              0

      Endpoint Descriptor:

        bLength                 7

        bDescriptorType         5

        bEndpointAddress     0x01  EP 1 OUT

        bmAttributes            2

          Transfer Type            Bulk

          Synch Type               none

        wMaxPacketSize         64

        bInterval               0

      Endpoint Descriptor:

        bLength                 7

        bDescriptorType         5

        bEndpointAddress     0x82  EP 2 IN

        bmAttributes            2

          Transfer Type            Bulk

          Synch Type               none

        wMaxPacketSize         64

        bInterval               0

      Endpoint Descriptor:

        bLength                 7

        bDescriptorType         5

        bEndpointAddress     0x83  EP 3 IN

        bmAttributes            3

          Transfer Type            Interrupt

          Synch Type               none

        wMaxPacketSize          2

        bInterval             255

      Endpoint Descriptor:

        bLength                 7

        bDescriptorType         5

        bEndpointAddress     0x84  EP 4 IN

        bmAttributes            3

          Transfer Type            Interrupt

          Synch Type               none

        wMaxPacketSize          2

        bInterval             255

  Language IDs: (length=4)

     0409 English(US)

 

Bus 001 Device 001: ID 0000:0000

Device Descriptor:

  bLength                18

  bDescriptorType         1

  bcdUSB               1.10

  bDeviceClass            9 Hub

  bDeviceSubClass         0

  bDeviceProtocol         0

  bMaxPacketSize0         8

  idVendor           0x0000

  idProduct          0x0000

  bcdDevice            2.06

  iManufacturer           3 Linux 2.6.1 ohci_hcd

  iProduct                2 OHCI Host Controller

  iSerial                 1 0000:00:07.4

  bNumConfigurations      1

  Configuration Descriptor:

    bLength                 9

    bDescriptorType         2

    wTotalLength           25

    bNumInterfaces          1

    bConfigurationValue     1

    iConfiguration          0

    bmAttributes         0x40

      Self Powered

    MaxPower                0mA

    Interface Descriptor:

      bLength                 9

      bDescriptorType         4

      bInterfaceNumber        0

      bAlternateSetting       0

      bNumEndpoints           1

      bInterfaceClass         9 Hub

      bInterfaceSubClass      0

      bInterfaceProtocol      0

      iInterface              0

      Endpoint Descriptor:

        bLength                 7

        bDescriptorType         5

        bEndpointAddress     0x81  EP 1 IN

        bmAttributes            3

          Transfer Type            Interrupt

          Synch Type               none

        wMaxPacketSize          2

        bInterval             255

  Language IDs: (length=4)

     0409 English(US)

```

Yup, pretty tricky thing to debug   :Wink: 

----------

## bisho

I have the same problem, but with gphoto2 for accessing a Canon Rebel 300D.

The 2.6.0-test11-love kernel works well, but when I updated to 2.6.0-love2 stoped working. I have recompiled libgphoto2 and gphoto2.

It's very strange. Something big has changed in USB between test11 and final? And even more strange, I get diferent error messages in each execution:

```
*** Error ***Step #2 of initializtion failed for PowerShot camera! (returned 56, expected 88) Camera not operational

*** Error (-102: 'Corrupted data') ***

*** Error ***

Could not establish initial contact with camera

*** Error (-102: 'Corrupted data') ***

*** Error ***

Initial camera response I/'Unknown (some kind of error))' unrecognized)

1.870682 gphoto2-port(2): Closing port...

*** Error (-102: 'Corrupted data') ***
```

----------

## Regor

I also have this exact same problem with my camera (Nikon Coolpix2000) and have for every version of 2.6 I've tried (various revs of vanilla, mm, and love).

I can communicate with the camera in PTP mode via gphoto2 just fine, but mass storage mode just doesn't work. Like spike_cb the device files appear, but attempts to mount receive "mount: No medium found".

Sorry to not be able to provide anything other than a "me too", but if anyone out there has any ideas for a fix, I'd love to hear about them.

----------

## spike_cb

Hello,

Thanks for the postings guys. I think this is a valid problem then since I'm not the only one here with "Medium not found" problem.  :Wink: 

Btw, I've posted it on linux-usb-devel list. There's a thread on it at the moment that you could follow :

http://marc.theaimsgroup.com/?t=107298347700003&r=1&w=2

I hope it gets solved soon.

Cheers!

----------

## spike_cb

I'm able to mount the device again with the posted patch on the thread.   :Very Happy: 

http://marc.theaimsgroup.com/?l=linux-usb-devel&m=107325816324195&w=2

But it seems like it is not a very good solution, and that the real problem lies with the device not communicating in a standard way.

The new code seems to follow/enforce a more standardized way of communicating, though stricter.

But if you want a quick fix, try it...

```

--- 2.6/drivers/scsi/sd.c.orig  Mon Nov 10 10:26:50 2003

+++ 2.6/drivers/scsi/sd.c       Sun Jan  4 15:30:59 2004

@@ -606,9 +606,13 @@

         * by sd_spinup_disk() from sd_revalidate_disk(), which happens whenever

         * sd_revalidate() is called.

         */

+#if 0

        retval = -ENODEV;

        if (scsi_block_when_processing_errors(sdp))

                retval = scsi_ioctl(sdp, SCSI_IOCTL_TEST_UNIT_READY, NULL);

+#else

+       retval = 0;

+#endif

  

        /*

         * Unable to test, unit probably not ready.   This usually

```

Hope it helps..

Cheers!

----------

## Regor

Yeah, that works for me too. You might mention to the devs you've been swapping emails with that it's not just you and that one model of camera.

Thanks for following up on this and getting devs involved!   :Very Happy: 

----------

## Mick

Any update on this problem ?

I have the same issue with a Panasonic DMC-LC33

Using Genkernel

kernel-2.6.3-gentoo-r1

Same story, just "No medium found"

Mick

----------

## Regor

Sadly no real fix has made its way into kernel sources AFAIK. I'm still applying the patch myself as needed.

I get the feeling this isn't really getting any attention.  :Sad: 

----------

## Mick

Regor

How do I apply the patch ?

Sorry if its a dumb question !

Mick

----------

## Regor

Actually the patch I've been using is different from the one posted above. Here's what I've been using.

```
--- 1.59/drivers/scsi/sd.c      Fri Oct 24 14:53:37 2003

+++ edited/drivers/scsi/sd.c    Tue Jan  6 11:16:41 2004

@@ -431,8 +431,10 @@

                goto error_out;

 

        if (!sdkp->openers++ && sdev->removable) {

+#if 0

                if (scsi_block_when_processing_errors(sdev))

                        scsi_set_medium_removal(sdev, SCSI_REMOVAL_PREVENT);

+#endif

        }

 

        return 0;

@@ -462,8 +464,10 @@

        SCSI_LOG_HLQUEUE(3, printk("sd_release: disk=%s\n", disk->disk_name));

 

        if (!--sdkp->openers && sdev->removable) {

+#if 0

                if (scsi_block_when_processing_errors(sdev))

                        scsi_set_medium_removal(sdev, SCSI_REMOVAL_ALLOW);

+#endif

        }

 

        /*

```

Save that patch to some filename and do the following steps:

```
# cd /usr/src/linux

# patch -p1 < /some/path/to/patchfile
```

substitute wherever you saved the patch for /some/path/to/patchfile

Then recompile/install your kernel and it should be ok.

----------

## Mick

Thanks for the info, Camera now works fine.

Code is slightly diferent in gentoo-dev-sorces-2.6.3-r1

Below is a version of your patch for anone else using this kernel:

```

--- drivers/scsi/sd.c.orig   2004-04-09 09:44:11.000000000 +0000

+++ drivers/scsi/sd.c   2004-04-09 17:53:20.000000000 +0000

@@ -433,8 +433,10 @@

       goto error_out;

 

    if (supermount_usage_count(inode->i_bdev, sdkp->openers++) == 0 && sdev->removable) {

+#if 0

       if (scsi_block_when_processing_errors(sdev))

          scsi_set_medium_removal(sdev, SCSI_REMOVAL_PREVENT);

+#endif

    }

 

    return 0;

@@ -464,8 +466,10 @@

    SCSI_LOG_HLQUEUE(3, printk("sd_release: disk=%s\n", disk->disk_name));

 

    if (supermount_usage_count(inode->i_bdev, --sdkp->openers) == 0 && sdev->removable) {

+#if 0

       if (scsi_block_when_processing_errors(sdev))

          scsi_set_medium_removal(sdev, SCSI_REMOVAL_ALLOW);

+#endif

    }

 

    /*

```

Cannot claim I did this myself, had help from my brother.

This one should be applied with

```

# cd /usr/src/linux

# patch -p0 < /path_to_file

```

----------

