LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (http://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Retrofitting a Device File for a Mass Storage Device? (http://www.linuxquestions.org/questions/linux-hardware-18/retrofitting-a-device-file-for-a-mass-storage-device-780717/)

devdol 01-07-2010 07:11 PM

Retrofitting a Device File for a Mass Storage Device?
 
Dear usb driver experts,

here we have an older digicam (Jenoptik/Exakta Model "DC 22", if someone might want to know) that can be switched between some "PC Camera mode" and "Mass storage mode". Unfortunately, if attached to USB, it is always recognized as
Code:

UDEV  [1262910483.475886] add      /class/video4linux/video0 (video4linux)
lsusb tells:
Code:

Bus 005 Device 008: ID 0d64:3108 DXG Technology Corp. Digicam Mass Storage Device
Hence, there is no way to save the remaining pictures that reside on the internal memory. Using 'hwinfo --usb', i found out:
Code:

  Model: "DXG DIGITAL CAMERA USB"
  Hotplug: USB
  Vendor: usb 0x0d64 "DXG Technology Corp."
  Device: usb 0x3108 "DIGITAL CAMERA USB"
  Revision: "1.00"
  Driver: "zr364xx"
  Driver Modules: "zr364xx"
  Speed: 12 Mbps
  Module Alias: "usb:v0D64p3108d0100dc00dsc00dp00ic08isc05ip00"
  Driver Info #0:
    Driver Status: zr364xx is active
    Driver Activation Cmd: "modprobe zr364xx"
  Driver Info #1:
    Driver Status: usb_storage is active
    Driver Activation Cmd: "modprobe usb_storage"
  Config Status: cfg=new, avail=yes, need=no, active=unknown
  Attached to: #6 (Hub)

The first thing to try was an "rmmod zr364xx". Next try was to temporarily remove '/lib/modules/.../zr364xx.ko' in order to prevent it from being loaded. As expected, the result is:
Code:

  Driver Info #0:
    Driver Status: zr364xx is not active
    Driver Activation Cmd: "modprobe zr364xx"
  Driver Info #1:
    Driver Status: usb_storage is active
    Driver Activation Cmd: "modprobe usb_storage"
  Config Status: cfg=new, avail=yes, need=no, active=unknown
  Attached to: #6 (Hub)

However, what we still miss is a device file that could be mounted (to get access to the files). So the remaining questions is:
How can one manually recreate it, or: Can udev's recognition be changed in order to "find" something like '/class/scsi_disk/' instead of
'/class/video4linux/video0' only?

It still seems quite promising, but out of ideas now we would appreciate any advice.

Simon Bridge 01-07-2010 07:19 PM

the message seems to be saying that your camera can act as a webcam as well as ums.
udev will usually put a ums device in /media - have you looked?

before adding the camera do

dmesg > before.log

after adding camera do

dmesg > after.log

diff before after > changes.log

look at the changes.log file. It should tell you what is going on.

devdol 01-07-2010 07:54 PM

Hello Simon,
thanks for your quick reply!
Well, diff before.log after.log gives us:
Code:

> ap: 60000000:9ec00000)
650a630,651
> usb 5-2: new full speed USB device using uhci_hcd and address 10
> usb 5-2: configuration #1 chosen from 1 choice
> scsi3 : SCSI emulation for USB Mass Storage devices
> usb 5-2: New USB device found, idVendor=0d64, idProduct=3108
> usb 5-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
> usb 5-2: Product: DIGITAL CAMERA USB
> usb 5-2: Manufacturer: DSC
> usb-storage: device found at 10
> usb-storage: waiting for device to settle before scanning
> usb-storage: device scan complete
> scsi 3:0:0:0: Direct-Access    IDIGAT L ACEMAR          .100 PQ: 0 ANSI: 0 CCS
> sd 3:0:0:0: [sdb] 32000 512-byte hardware sectors (16 MB)
> sd 3:0:0:0: [sdb] Write Protect is off
> sd 3:0:0:0: [sdb] Mode Sense: 00 06 00 00
> sd 3:0:0:0: [sdb] Assuming drive cache: write through
> sd 3:0:0:0: [sdb] 32000 512-byte hardware sectors (16 MB)
> sd 3:0:0:0: [sdb] Write Protect is off
> sd 3:0:0:0: [sdb] Mode Sense: 00 06 00 00
> sd 3:0:0:0: [sdb] Assuming drive cache: write through
>  sdb: sdb1
> sd 3:0:0:0: [sdb] Attached SCSI removable disk
> sd 3:0:0:0: Attached scsi generic sg2 type 0

And, the strange thing with it is: I did not change anything since my posting above besides leaving the PC for about half an hour. Continuing session, no reboot - but now it workes! What happenes on hotplug is the long awaited normal behaviour: Automount in /media and desktop's device notification. And, as I would have expected (but constantly missed till then), also a device file:
Code:

brw-rw---- 1 root floppy 8, 17  8. Jan 02:28 /dev/sdb1
is there.

Bottom line: _ s t r a n g e _ ... (but all right for us ,-) )

Simon Bridge 01-07-2010 09:59 PM

Well done - now you have a powerful new trick.

devdol 07-10-2010 02:22 PM

Solution for missing mass storage devices
 
Just to summarize: if you have a digital camera recognized as video for linux device and miss it as mass storage device, just unload/remove its v4l driver.


All times are GMT -5. The time now is 01:20 PM.