USB mass storage digital camera

USB mass storage digital camera

Post by David Per » Mon, 07 Apr 2003 13:14:52



Hi,

I'm having a problem with using my Benq DC1500 digital camera under
Linux, specifically RedHat 8.

The camera works under the USB mass storage drivers (at least in
windows 98SE) but something a little strange happens in Linux. The
camera seems to be recognized, but shows up as /mnt/cdrom1 and can't
be mounted because it seems to be looking for media (ie. a CD).

The device shows up under /proc/bus/usb/devices with
Driver=usb-storage so I don't know what is going on - it appears in
/etc/fstab with parameters like my cdrom drive. Changing the fstab
entry makes no difference, and if i remove then plug the camera back
in, fstab returns to what it was.

I'd appreciate any help in getting this working.

Regards,

David Perry

 
 
 

USB mass storage digital camera

Post by e.. » Mon, 07 Apr 2003 17:46:29




> The camera works under the USB mass storage drivers (at least in
> windows 98SE) but something a little strange happens in Linux. The
> camera seems to be recognized, but shows up as /mnt/cdrom1 and can't
> be mounted because it seems to be looking for media (ie. a CD).

Whatever's trying to mount it, thinks that it's a CD (or something... not
a camera, in any case), probably because it is presented the same way a
SCSI disk would be.  Convince it otherwise.

Quote:> Changing the fstab
> entry makes no difference, and if i remove then plug the camera back
> in, fstab returns to what it was.

Wow.  That sound like something that thinks it knows better than you,
gone overboard.

--

       "You're one of those condescending Unix computer users!"
   "Here's a nickel, kid.  Get yourself a better computer" - Dilbert.

 
 
 

USB mass storage digital camera

Post by Tauno Voipi » Tue, 08 Apr 2003 02:32:41



Quote:> Hi,

> I'm having a problem with using my Benq DC1500 digital camera under
> Linux, specifically RedHat 8.

> The camera works under the USB mass storage drivers (at least in
> windows 98SE) but something a little strange happens in Linux. The
> camera seems to be recognized, but shows up as /mnt/cdrom1 and can't
> be mounted because it seems to be looking for media (ie. a CD).

> The device shows up under /proc/bus/usb/devices with
> Driver=usb-storage so I don't know what is going on - it appears in
> /etc/fstab with parameters like my cdrom drive. Changing the fstab
> entry makes no difference, and if i remove then plug the camera back
> in, fstab returns to what it was.

> I'd appreciate any help in getting this working.

Check your USB setup.

Usually USB mass storage comes up as a SCSI drive. My Minolta Dimage X comes
up as /dev/sda1 with a garden-variety VFAT file system.

Are you running hotplug?

Which kernel?

Tauno Voipio

 
 
 

USB mass storage digital camera

Post by Eric Wilhel » Tue, 08 Apr 2003 03:21:39



> Hi,

> I'm having a problem with using my Benq DC1500 digital camera under
> Linux, specifically RedHat 8.

> The camera works under the USB mass storage drivers (at least in windows
> 98SE) but something a little strange happens in Linux. The camera seems
> to be recognized, but shows up as /mnt/cdrom1 and can't be mounted
> because it seems to be looking for media (ie. a CD).

> The device shows up under /proc/bus/usb/devices with Driver=usb-storage
> so I don't know what is going on - it appears in /etc/fstab with
> parameters like my cdrom drive. Changing the fstab entry makes no
> difference, and if i remove then plug the camera back in, fstab returns
> to what it was.

fstab is changing?  (AFAIK) That is supposed to be a static config file.  Do you
mean mtab?

You should be mounting it as a vfat filesystem (cd-rom would be iso9660).
Maybe put an entry in fstab?

--Eric

 
 
 

USB mass storage digital camera

Post by David Per » Wed, 09 Apr 2003 19:58:14


Hello,

I have a bit more information...

At /var/log/messages (when i disconnect and reconnect camera)

Apr  8 19:49:28 localhost kernel: usb.c: USB disconnect on device 4
Apr  8 19:49:39 localhost kernel: keyboard.c: can't emulate rawmode for
keycode 272
Apr  8 19:49:39 localhost kernel: keyboard.c: can't emulate rawmode for
keycode 272
Apr  8 19:49:45 localhost kernel: hub.c: USB new device connect on bus2/2,
assigned device number 5
Apr  8 19:49:48 localhost /etc/hotplug/usb.agent: Setup usb-storage for USB
product 4a5/3005/100
Apr  8 19:50:03 localhost su(pam_unix)[1419]: session opened for user root by
(uid=500)
Apr  8 19:50:16 localhost kernel: usb-uhci.c: interrupt, status 3, frame# 1171
Apr  8 19:50:16 localhost kernel: SCSI device (ioctl) reports ILLEGAL REQUEST.
Apr  8 19:50:16 localhost kernel: SCSI device sda: 59392 512-byte hdwr sectors
(30 MB)
Apr  8 19:50:16 localhost kernel: sda: test WP failed, assume Write Enabled
Apr  8 19:50:16 localhost kernel:  sda: I/O error: dev 08:00, sector 0
Apr  8 19:50:16 localhost kernel:  I/O error: dev 08:00, sector 0
Apr  8 19:50:16 localhost kernel:  unable to read partition table
Apr  8 19:50:16 localhost kernel: SCSI device (ioctl) reports ILLEGAL REQUEST.
Apr  8 19:50:16 localhost kernel: Device busy for revalidation (usage=1)
Apr  8 19:50:16 localhost kernel:  I/O error: dev 08:00, sector 0
Apr  8 19:50:16 localhost kernel: FAT: unable to read boot sector
Apr  8 19:50:17 localhost kernel: SCSI device (ioctl) reports ILLEGAL REQUEST.
Apr  8 19:50:17 localhost kernel: SCSI device sda: 59392 512-byte hdwr sectors
(30 MB)
Apr  8 19:50:17 localhost kernel: sda: test WP failed, assume Write Enabled
Apr  8 19:50:17 localhost kernel:  sda: I/O error: dev 08:00, sector 0
Apr  8 19:50:17 localhost kernel:  I/O error: dev 08:00, sector 0
Apr  8 19:50:17 localhost kernel:  unable to read partition table

At /proc/bus/usb/devices

S:  Manufacturer=BenQ    Co Ltd
S:  Product=Sunplus Co Ltd ?01.00.0
S:  SerialNumber=01.00.00
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=87(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=08(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=89(I) Atr=03(Int.) MxPS=   1 Ivl=1ms
T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 6
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS= 8 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 2.04

Kernel is 2.4.18

Hotplug appears to be installed.

I've tried adding a new entry to fstab, but all I get when trying to mount it
is:
mount: wrong fs type, bad option, bad superblock on /dev/sda,
       or too many mounted file systems
What parameters should I be using in fstab? I mainly just have:

/dev/sda   /mnt/camera vfat  

... and then a bunch of stuff I do not understand, so I've just been trying
various commands shown on the web tutorials for setting this up.

Is it worth installing newer USB drivers?

  --David Perry

 
 
 

USB mass storage digital camera

Post by Eric Wilhel » Wed, 09 Apr 2003 21:58:13



> Hello,

> I have a bit more information...
> Kernel is 2.4.18

> Hotplug appears to be installed.

> I've tried adding a new entry to fstab, but all I get when trying to
> mount it is:
> mount: wrong fs type, bad option, bad superblock on /dev/sda,
>        or too many mounted file systems
> What parameters should I be using in fstab? I mainly just have:

> /dev/sda   /mnt/camera vfat

I have the following in /etc/fstab:
/dev/sdb1 /mnt/cam vfat noauto,user 0 0

my camera shows up as my second scsi disk because of my hpt ata
controller, so yours should probably be sda1

try doing it manually (be root):
insmod usb-storage      (should disable hotplug)
mount -t vfat /dev/sda1 /mnt/camera
ls /mnt/camera
umount /mnt/camera

if that works, it is just the fstab entry or something wrong with hotplug

do you have a file:  /etc/hotplug/usb/camera or usb-storage ?
if so, it is probably running when hotplug loads the module (hence the
message "session opened for user root")

--Eric

 
 
 

USB mass storage digital camera

Post by Robert Grizzar » Thu, 10 Apr 2003 09:51:46



> Hello,
> I have a bit more information...

[...]

Quote:> /dev/sda   /mnt/camera vfat  

s/sda/sda1/

You're trying to mount the complete emulated SCSI hard drive when you
should be trying to mount just the first partition.  Edit /etc/fstab to
add the "1" after the "a" in "/dev/sda" then try it and report back what
happens.

--
The appearance of my E-mail address in any venue does not in and of itself
constitute a solicitation of bulk or commercial E-mail.

I don't want unsolicited commercial E-mail.

 
 
 

USB mass storage digital camera

Post by David Per » Thu, 10 Apr 2003 18:31:13


Quote:> You're trying to mount the complete emulated SCSI hard drive when you
> should be trying to mount just the first partition.  Edit /etc/fstab to
> add the "1" after the "a" in "/dev/sda" then try it and report back what
> happens.

I tried manually mounting the drive, using /dev/sda1, without any
luck. I just get:-
mount: /dev/sda1 is not a valid block device

Also modified /etc/fstab with /dev/sda1 instead of sda, now mount
declares this line to be bad.

I also tried /dev/sdb1, with the same result. Is there any way I can
check just where the camera should be?

I don't have /etc/hotplug/usb/camera but i do have a "usbcam" file
there.

 --David

 
 
 

USB mass storage digital camera

Post by Eric Wilhel » Fri, 11 Apr 2003 00:52:56



>> You're trying to mount the complete emulated SCSI hard drive when you
>> should be trying to mount just the first partition.  Edit /etc/fstab to
>> add the "1" after the "a" in "/dev/sda" then try it and report back
>> what happens.

> I tried manually mounting the drive, using /dev/sda1, without any luck.
> I just get:-
> mount: /dev/sda1 is not a valid block device

> Also modified /etc/fstab with /dev/sda1 instead of sda, now mount
> declares this line to be bad.

> I also tried /dev/sdb1, with the same result. Is there any way I can
> check just where the camera should be?

> I don't have /etc/hotplug/usb/camera but i do have a "usbcam" file
> there.

that is probably the script getting executed when you plug in the camera,
what is it doing? trying to mount the device? to do things manually, you
might try renaming that script for now.  
Then check "tail -f /var/log/messages" as you plug-in the camera to see
if it is still getting setup.

what do you get from "ls /proc/scsi" ?
what about "fdisk -l /dev/sda" ? (should list the partitions)

the only way I know to list scsi devices is "cdrecord -scanbus"
if you see your camera listed there, show us what it says

--Eric

 
 
 

USB mass storage digital camera

Post by David Per » Fri, 11 Apr 2003 16:35:51



> that is probably the script getting executed when you plug in the camera,
> what is it doing? trying to mount the device? to do things manually, you
> might try renaming that script for now.  
> Then check "tail -f /var/log/messages" as you plug-in the camera to see
> if it is still getting setup.

> what do you get from "ls /proc/scsi" ?
> what about "fdisk -l /dev/sda" ? (should list the partitions)

> the only way I know to list scsi devices is "cdrecord -scanbus"
> if you see your camera listed there, show us what it says

> --Eric

I renamed the script to _usbcam. It doesn't appear to mount anything,
but I can post it if that would help. Here is what it says it does:-

# Sets up newly plugged in USB camera so that the user who owns
# the console according to pam_console can access it from user space
#
# Note that for this script to work, you'll need all of the following:
# a) a line in the file /etc/hotplug/usermap that corresponds to the
#    camera you are using. You can get the correct lines for all
cameras
#    supported by gphoto2 by running "gphoto2 --print-usb-usermap".
# b) a setup using pam_console creates the respective lock files
#    containing the name of the respective user. You can check for
that
#    by executing "echo `cat /var/{run,lock}/console.lock`" and
#    verifying the appropriate user is mentioned somewhere there.
# c) a Linux kernel supporting hotplug and usbdevfs
# d) the hotplug package (http://linux-hotplug.sourceforge.net/)
#
# In the usermap file, the first field "usb module" should be named
# "usbcam" like this script.

Upon plugging in camera (tail -f /var/log/messages):-

Apr 10 17:21:02 localhost kernel: hub.c: USB new device connect on
bus2/2, assigned device number 7
Apr 10 17:21:05 localhost /etc/hotplug/usb.agent: Setup usb-storage
for USB product 4a5/3005/100

Although the first time I did it I got:-

Apr 10 17:09:24 localhost kernel: hub.c: USB new device connect on
bus2/2, assig
ned device number 3
Apr 10 17:09:24 localhost kernel: usb.c: USB device 3 (vend/prod
0x4a5/0x3005) i
s not claimed by any active driver.
Apr 10 17:09:27 localhost /etc/hotplug/usb.agent: Setup usb-storage
for USB prod
uct 4a5/3005/100
Apr 10 17:09:27 localhost kernel: Initializing USB Mass Storage
driver...
Apr 10 17:09:27 localhost kernel: usb.c: registered new driver
usb-storage
Apr 10 17:09:27 localhost kernel: scsi1 : SCSI emulation for USB Mass
Storage de
vices
Apr 10 17:09:27 localhost kernel:   Vendor: BenQ      Model: DC1500  
        R
ev: 1.00
Apr 10 17:09:27 localhost kernel:   Type:   Direct-Access            
        A
NSI SCSI revision: 02
Apr 10 17:09:27 localhost kernel: USB Mass Storage support registered.

Looks more encouraging.

I don't know how I managed that... Upon "ls /proc/scsi" I get:-
ide-scsi  scsi  usb-storage-0

"fdisk -l /dev/sda" returns nothing whatsoever.

"cdrecord -scanbus" returns:-

Linux sg driver version: 3.1.24
Using libscg version 'schily-0.5'
scsibus0:
        0,0,0     0) 'LITE-ON ' 'LTR-48246S      ' 'SS0B' Removable
CD-ROM
        0,1,0     1) *
        0,2,0     2) *
        0,3,0     3) *
        0,4,0     4) *
        0,5,0     5) *
        0,6,0     6) *
        0,7,0     7) *
scsibus1:
        1,0,0   100) 'BenQ    ' 'DC1500          ' '1.00' Removable
Disk
        1,1,0   101) *
        1,2,0   102) *
        1,3,0   103) *
        1,4,0   104) *
        1,5,0   105) *
        1,6,0   106) *
        1,7,0   107) *

  --David

 
 
 

USB mass storage digital camera

Post by Eric Wilhel » Fri, 11 Apr 2003 23:09:15




>> that is probably the script getting executed when you plug in the
>> camera, what is it doing? trying to mount the device? to do things
>> manually, you might try renaming that script for now. Then check "tail
>> -f /var/log/messages" as you plug-in the camera to see if it is still
>> getting setup.

>> what do you get from "ls /proc/scsi" ? what about "fdisk -l /dev/sda" ?
>> (should list the partitions)

>> the only way I know to list scsi devices is "cdrecord -scanbus" if you
>> see your camera listed there, show us what it says

>> --Eric

> I renamed the script to _usbcam. It doesn't appear to mount anything,
> but I can post it if that would help. Here is what it says it does:-

Yes, I don't think this script is doing anything as it is (still getting
run, so it is probably the source of the "session opened for root..."
message).

- Show quoted text -

Quote:

> Upon plugging in camera (tail -f /var/log/messages):-

> Apr 10 17:21:02 localhost kernel: hub.c: USB new device connect on
> bus2/2, assigned device number 7
> Apr 10 17:21:05 localhost /etc/hotplug/usb.agent: Setup usb-storage for
> USB product 4a5/3005/100

> Although the first time I did it I got:-

> Apr 10 17:09:24 localhost kernel: hub.c: USB new device connect on
> bus2/2, assig
> ned device number 3
> Apr 10 17:09:24 localhost kernel: usb.c: USB device 3 (vend/prod
> 0x4a5/0x3005) i
> s not claimed by any active driver.

The extra messages you see the first time are (I think) because the
usb-storage and other modules are not loaded yet.

Quote:> Looks more encouraging.

> I don't know how I managed that... Upon "ls /proc/scsi" I get:- ide-scsi
>  scsi  usb-storage-0

It seems to be there.  I can't see where to find which disk it is from
/proc, but it seems like it must be there somewhere.

Quote:> "fdisk -l /dev/sda" returns nothing whatsoever.

That should indicate that there is no disk (no block device).
Try more /proc/partitions

Quote:> "cdrecord -scanbus" returns:-
> scsibus1:
>         1,0,0   100) 'BenQ    ' 'DC1500          ' '1.00' Removable
> Disk

That is your camera.  This should make it /dev/sda.

I'm perplexed on this one.

--Eric

 
 
 

USB mass storage digital camera

Post by Robert Grizzar » Sat, 12 Apr 2003 08:38:39


[...]

Quote:> I'm perplexed on this one.

It *is* a poser, isn't it?

When I installed my camera I set the camera up to emulate a SCSI drive,
modprobed usb-storage, and plugged the camera in and I was golden.  Adding
the line "/dev/sda1 /mnt/camera vfat noauto,user 0 0" to /etc/fstab let me
mount it as an unprivileged user, and everything's been copacetic since.

--
The appearance of my E-mail address in any venue does not in and of itself
constitute a solicitation of bulk or commercial E-mail.

I don't want unsolicited commercial E-mail.

 
 
 

USB mass storage digital camera

Post by David Per » Mon, 14 Apr 2003 16:27:15


Quote:> That should indicate that there is no disk (no block device).
> Try more /proc/partitions

> > "cdrecord -scanbus" returns:-
> > scsibus1:
> >         1,0,0   100) 'BenQ    ' 'DC1500          ' '1.00' Removable
> > Disk
> That is your camera.  This should make it /dev/sda.

more /proc/partitions returns:-
8     0       8192 sda 29 78 211 37 0 0 0 0 0 37 37
   3     0   78150744 hda 7220 15675 181390 69578 5548 7176 102242
521955 -2 1750041 5461010
   3     1      80293 hda1 23 71 188 125 8 1 18 50 0 167 175
   3     2    2048287 hda2 48 96 216 91 0 0 0 0 0 91 91
   3     3    1020127 hda3 9 25 104 25 0 0 0 0 0 25 25
   3     4          1 hda4 0 0 0 0 0 0 0 0 0 0 0
   3     5   74999421 hda5 7137 15474 180858 69314 5540 7175 102224
521904 0 49126 591222

This looks good, as this is what is returned when I don't have a SD
card in the camera (so it has 8mb storage). If I put my 32MB mem card
in and try to mount the camera manually, it gives the block error
still, but /proc/partitions now reads this for sda:-

8     0      29696 sda 55 144 391 37 0 0 0 0 0 37 37

What causes a "mount: /dev/sda1 is not a valid block device
" error?

 -- David

 
 
 

USB mass storage digital camera

Post by Eric Wilhel » Tue, 15 Apr 2003 01:07:03



>> That should indicate that there is no disk (no block device). Try more
>> /proc/partitions

>> > "cdrecord -scanbus" returns:-
>> > scsibus1:
>> >         1,0,0   100) 'BenQ    ' 'DC1500          ' '1.00' Removable
>> > Disk
>> That is your camera.  This should make it /dev/sda.

> more /proc/partitions returns:-
> 8     0       8192 sda 29 78 211 37 0 0 0 0 0 37 37
>    3     0   78150744 hda 7220 15675 181390 69578 5548 7176 102242
> 521955 -2 1750041 5461010
>    3     1      80293 hda1 23 71 188 125 8 1 18 50 0 167 175 3     2
>    2048287 hda2 48 96 216 91 0 0 0 0 0 91 91 3     3    1020127 hda3 9
>    25 104 25 0 0 0 0 0 25 25 3     4          1 hda4 0 0 0 0 0 0 0 0 0 0
>    0 3     5   74999421 hda5 7137 15474 180858 69314 5540 7175 102224
> 521904 0 49126 591222

> This looks good, as this is what is returned when I don't have a SD card
> in the camera (so it has 8mb storage).

Does mount work with the built-in storage?

Quote:>If I put my 32MB mem card in and
> try to mount the camera manually, it gives the block error still, but
> /proc/partitions now reads this for sda:-

> 8     0      29696 sda 55 144 391 37 0 0 0 0 0 37 37

> What causes a "mount: /dev/sda1 is not a valid block device " error?

The partition is not there.  My /proc/partitions shows:
8    16      16000 sdb 1 3 8 90 0 0 0 0 0 90 90
8    17      15979 sdb1 0 0 0 0 0 0 0 0 0 0 0

It looks like there is something wrong with the camera's partition.  How
does this work under windows (I think you said it did)?

--Eric

 
 
 

USB mass storage digital camera

Post by David Per » Tue, 15 Apr 2003 20:10:09


Quote:> Does mount work with the built-in storage?

Nope. Pulls the exact same trick as when using a SD card.

Quote:> >If I put my 32MB mem card in and
> > try to mount the camera manually, it gives the block error still, but
> > /proc/partitions now reads this for sda:-

> > 8     0      29696 sda 55 144 391 37 0 0 0 0 0 37 37

> > What causes a "mount: /dev/sda1 is not a valid block device " error?

> The partition is not there.  My /proc/partitions shows:
> 8    16      16000 sdb 1 3 8 90 0 0 0 0 0 90 90
> 8    17      15979 sdb1 0 0 0 0 0 0 0 0 0 0 0

> It looks like there is something wrong with the camera's partition.  How
> does this work under windows (I think you said it did)?

Yes it works under windows, although with win98 I had to install some
drivers off the included CD, however for win2000 upwards this isn't
supposed to be necessary.

I'm stabbing in the dark here, but it seems to me that linux has the
device /dev/sda, knows theres a mass-storage device there but can't
translate that to an actual partition (ie. sda1). Or there is no
partition table in the cameras memory and perhaps windows can overlook
that but linux can't...

Could it just be some innoculous gap in the driver software? Could I
try installing some later version drivers?

 --David