Author Topic: How To Use Usb Host?  (Read 5126 times)

cg110

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • http://
How To Use Usb Host?
« on: May 16, 2005, 05:46:22 pm »
Hi,

I've just recieved a lovely new C3000.  I've been playing with the USB host functionality, with the hope of being able to sync my camera to it.  The camera is a Sony Cybershot DSC-P200.

At the moment the C3000 is running as shipped by trisoft.

My problem is that while the camera is seen, it's not mounted.  Doing some digging on here pointed me to the /etc/hotplug/usb.distmap file, and seemed to suggest by updating it extra devices could be made to work.

I updated the line for the sony cameras to what I think should work, based on:
http://www.qbik.ch/usb/devices/showdev.php?id=3079
But it doesn't seem to have helped.

Do I need an updated kernel module for this to work?  Would using cacko help (does it have newer kernel drivers?)

oddly though lsusb does seem to work:
Bus 001 Device 002: ID 054c:0010 Sony Corp. DSC-S30/S70 etc etc

The error from dmesg is:
hub.c: USB new device connect on bus1, assigned device number 2
usb.c: kmalloc IF c3c31260, numif 1
usb.c: new device strings: Mfr=1, Product=2, SerialNumber=0
usb.c: USB device number 2 default language ID 0x409
Manufacturer: Sony
Product: Sony DSC
usb.c: unhandled interfaces on device
usb.c: USB device 2 (vend/prod 0x54c/0x10) is not claimed by any active driver.
  Length              = 18
  DescriptorType      = 01
  USB version         = 2.00
  Vendor:Product      = 054c:0010
  MaxPacketSize0      = 64
  NumConfigurations   = 1
  Device version      = 5.00
(and then lots more config info)

Thanks,
Chris
« Last Edit: May 16, 2005, 07:40:20 pm by cg110 »

gtJormungand

  • Newbie
  • *
  • Posts: 38
    • View Profile
How To Use Usb Host?
« Reply #1 on: May 16, 2005, 06:01:55 pm »
By default, there isn't an automounter installed, so you have to do it yourself.

If it's using the USB drive system, then use
Code: [Select]
mount -t vfat /dev/sda1 /mnt/yourfavoritemountpoint/

cg110

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • http://
How To Use Usb Host?
« Reply #2 on: May 16, 2005, 06:37:55 pm »
Quote
If it's using the USB drive system, then use
Code: [Select]
mount -t vfat /dev/sda1 /mnt/yourfavoritemountpoint/[div align=\"right\"][a href=\"index.php?act=findpost&pid=80082\"][{POST_SNAPBACK}][/a][/div]

I should have said, I tried that:
Code: [Select]
bash-2.05$ su
# mount -t vfat /dev/sda1 /mnt/test
mount: Mounting /dev/sda1 on /mnt/test failed: No such device or address

also tried sdb1 and sdc1, still no luck.

Thanks,
Chris

TRIsoft

  • Sr. Member
  • ****
  • Posts: 332
    • View Profile
    • http://www.trisoft.de
How To Use Usb Host?
« Reply #3 on: May 16, 2005, 06:39:40 pm »
Quote
By default, there isn't an automounter installed, so you have to do it yourself.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=80082\"][{POST_SNAPBACK}][/a][/div]
Hi all,
if it's running in our delivery state, then the automounter is
for sure installed and running  
Anyhow, some devices are not recognized automatically.
Have you tried to mount it manually (like described in our
manual) ?
This worked with all crazy cameras / USB-sticks we tested.

///TRIsoft

Marc Stephan

cg110

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • http://
How To Use Usb Host?
« Reply #4 on: May 16, 2005, 07:06:07 pm »
Quote
if it's running in our delivery state, then the automounter is
for sure installed and running   
Anyhow, some devices are not recognized automatically.
Have you tried to mount it manually (like described in our
manual) ?
This worked with all crazy cameras / USB-sticks we tested.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=80090\"][{POST_SNAPBACK}][/a][/div]

Hi Marc,

The automounter appears to be running, but even following the instructions in the quick start guide doesn't help

I guess this sony camera is even quirkier than others.

Trying the camera on a NetBSD 2.0.2 system and it detects it ok, and but fails to find the disk, claiming:
umass0: CBI reset failed, STALLED

Doing some searching shows that it seems that sony kit has some known issues   I might see if Fedora Core 2 works with the camera tomorrow.  If it doesn't I'll return the camera as faulty, it doesn't do USB as it should.

Thanks,
Chris

gtJormungand

  • Newbie
  • *
  • Posts: 38
    • View Profile
How To Use Usb Host?
« Reply #5 on: May 17, 2005, 03:14:51 am »
If you have a linux pc available, you could try to plug it up to that and see what modules get loaded.

It could be that the device only has proprietary windows drivers.  Do you know if you have to specifically install drivers for windows?

cg110

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • http://
How To Use Usb Host?
« Reply #6 on: May 17, 2005, 04:54:55 am »
Quote
If you have a linux pc available, you could try to plug it up to that and see what modules get loaded.

It could be that the device only has proprietary windows drivers.  Do you know if you have to specifically install drivers for windows?
[div align=\"right\"][{POST_SNAPBACK}][/a][/div]

I don't have Linux at home, but there's a box or two at work.  (90% of my home machines run NetBSD of some form)  It did need drivers installed, except for WinXP and Mac, where it just plugs in and works.  So I'll try when I get into the office.

I'm actually wondering if I setup a cross compile environment, and just build a new usb-storage module, using the addition for the P100 from:
[a href=\"http://www.qbik.ch/usb/devices/showdev.php?id=3079]http://www.qbik.ch/usb/devices/showdev.php?id=3079[/url]
if it might just work.

Thanks,
Chris

cg110

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • http://
How To Use Usb Host?
« Reply #7 on: May 17, 2005, 05:21:58 pm »
Just to close this thread off, after setting up a cross compile arm-linux environment on my NetBSD x86 box, I've now managed to build the sharp spitz-j 2.4.20 kernel, with the following changes to drivers/usb/storage:
Code: [Select]
diff -rup linux/drivers/usb/storage/transport.h ../arm-linux/drivers/usb/storage/transport.h
--- linux/drivers/usb/storage/transport.h    2004-08-21 01:48:57.000000000 +0100
+++ ../arm-linux/drivers/usb/storage/transport.h    2005-05-17 21:15:10.000000000 +0100
@@ -75,6 +75,8 @@
 #define US_PR_JUMPSHOT  0xf3            /* Lexar Jumpshot */
 #endif
 
+#define US_PR_DEVICE    0xff  /* Use device's value */
+
 /*
  * Bulk only data structures
  */
diff -rup linux/drivers/usb/storage/unusual_devs.h ../arm-linux/drivers/usb/storage/unusual_devs.h
--- linux/drivers/usb/storage/unusual_devs.h    2004-08-21 01:48:57.000000000 +0100
+++ ../arm-linux/drivers/usb/storage/unusual_devs.h    2005-05-17 21:42:30.000000000 +0100
@@ -228,6 +228,12 @@ UNUSUAL_DEV(  0x054c, 0x0010, 0x0106, 0x
      US_SC_SCSI, US_PR_CB, NULL,
      US_FL_SINGLE_LUN | US_FL_START_STOP | US_FL_MODE_XLATE ),
 
+UNUSUAL_DEV(  0x054c, 0x0010, 0x0500, 0x0500,
+  "Sony",
+  "DSC-P100/P200",
+  US_SC_8070, US_PR_DEVICE, NULL,
+  US_FL_SINGLE_LUN | US_FL_START_STOP | US_FL_MODE_XLATE ),
+
 /* Reported by wim@geeks.nl */
 UNUSUAL_DEV(  0x054c, 0x0025, 0x0100, 0x0100,
      "Sony",
diff -rup linux/drivers/usb/storage/usb.c ../arm-linux/drivers/usb/storage/usb.c
--- linux/drivers/usb/storage/usb.c    2004-08-21 01:48:58.000000000 +0100
+++ ../arm-linux/drivers/usb/storage/usb.c    2005-05-17 21:14:42.000000000 +0100
@@ -620,7 +620,9 @@ static void * storage_probe(struct usb_d
 
  /* Determine subclass and protocol, or copy from the interface */
  subclass = unusual_dev->useProtocol;
-    protocol = unusual_dev->useTransport;
+    protocol = (unusual_dev->useTransport == US_PR_DEVICE) ?
+      altsetting->bInterfaceProtocol :
+      unusual_dev->useTransport;
  flags = unusual_dev->flags;
 
  /*

It now works (well dmesg shows some messages, but it copies files).  Note that Hotplug needed a tweak, the setup as shipped used /mnt/usbhdd, which didn't exist, creating the dir and it all seems to be happy    Note this might just be a quirk of the Trisoft setup.

Now I just need to load up some apps and I'm all set for my holiday in US/Canada  

Thanks,
Chris

PS the rough guide to setting up a cross build env is here:
http://www.qtopia.net/modules/developers/q...Chain_For_Win32
with glibc and sharp kernel source taken from here:
http://translate.google.com/translate?hl=e...ficial%26sa%3DG
« Last Edit: May 17, 2005, 05:24:10 pm by cg110 »

TRIsoft

  • Sr. Member
  • ****
  • Posts: 332
    • View Profile
    • http://www.trisoft.de
How To Use Usb Host?
« Reply #8 on: May 17, 2005, 06:36:40 pm »
cg110,
glad it's working now.
Quote
... the setup as shipped used /mnt/usbhdd, which didn't exist, creating the dir and it all seems to be happy    Note this might just be a quirk of the Trisoft setup.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=80250\"][{POST_SNAPBACK}][/a][/div]
Ooooops. Looks like we have to check this asap  

///TRIsoft

Marc Stephan