help - Linux desktop connect via USBSupport


  1. m27315

    m27315 Member

    Hi,

    I am a new Android user, who just purchased a Samsung Captivate a few days ago. .... My desktop runs Linux (Gentoo, specifically).

    I am trying to connect my phone via USB to transfer pictures, music, and video. However, the phone is not recognized (no auto-mount options), regardless if I choose Kries, Media, Storage, PC Internet, or USB Debugging. The phone says there is a connection, but my computer seems completely unaware of it. Nothing every happens. ... BTW, I don't have this problem, if I plug in my iPod or a generic USB device.

    I have downloaded and installed the Adroid SDK, but I don't know what to do with it, or if that is even relevant.

    Any suggestions? Google is not helping me, because everybody else is having trouble with Windows, not Linux.

    Thanks!

    Advertisement
    :
  2. Sharkonwheels

    Sharkonwheels Well-Known Member

    You need to set USB to Mass Storage, or to ask every time.

    Once you plug the phone in, you need to open the notification bar, and select the USB section, and then click on the "Mount" button.

    When done, on the linux desktop right-click to "safely remove" or "unmount" and then bring the notification bar on the phone down again, click on the USB line, and then click the "unmount" button.

    The mount and unmount steps are not needed using windows.

    T
  3. m27315

    m27315 Member

    I have tried each of those things. However, none of that helps. I can see that the device is recognized on my Linux box:

    /var/log/everything/current:
    (plug device in "Mass Storage" mode and "Mount")
    Code (Text):
    1. Aug 24 12:33:38 [kernel] usb 2-5: new high speed USB device using ehci_hcd and address 3
    2. Aug 24 12:33:38 [kernel] usb 2-5: New USB device found, idVendor=04e8, idProduct=681d
    3. Aug 24 12:33:38 [kernel] usb 2-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    4. Aug 24 12:33:38 [kernel] usb 2-5: Product: SAMSUNG_Android
    5. Aug 24 12:33:38 [kernel] usb 2-5: Manufacturer: SAMSUNG
    6. Aug 24 12:33:38 [kernel] usb 2-5: SerialNumber: blah-blah
    7. Aug 24 12:33:38 [kernel] scsi6 : usb-storage 2-5:2.0
    8. Aug 24 12:33:39 [kernel] scsi 6:0:0:0: Direct-Access     SAMSUNG  SGH-I897 Card    0000 PQ: 0 ANSI: 2
    9. Aug 24 12:33:39 [kernel] sd 6:0:0:0: Attached scsi generic sg3 type 0
    10. Aug 24 12:33:39 [kernel] sd 6:0:0:0: [sdc] Attached SCSI removable disk
    11. ...
    12. Aug 24 12:34:49 [kernel] usb 2-5: USB disconnect, address 3
    (plug in device in "Media Player" mode)
    Code (Text):
    1. Aug 24 12:42:54 [kernel] usb 2-5: new high speed USB device using ehci_hcd and address 4
    2. Aug 24 12:42:54 [kernel] usb 2-5: New USB device found, idVendor=04e8, idProduct=68a9
    3. Aug 24 12:42:54 [kernel] usb 2-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    4. Aug 24 12:42:54 [kernel] usb 2-5: Product: SAMSUNG_Android
    5. Aug 24 12:42:54 [kernel] usb 2-5: Manufacturer: SAMSUNG
    6. Aug 24 12:42:54 [kernel] usb 2-5: SerialNumber: blah-blah
    7. ...
    8. Aug 24 12:48:00 [kernel] usb 2-5: USB disconnect, address 4
    For some reason the device is not being automounted. Any suggestions?

    Incidentally, when I boot into WindowsXP (dual-boot box), I also have trouble unless I plug the USB cable into the back and unplug my Logitech Keyboard+mouse combo. :confused: Even then, I can only connect in "Mass Storage" mode. Kies and Media Player mode fail because the MTP driver cannot be loaded (or, service cannot be found/started). Could this be a voltage and USB 2.0 issue? See:

    http://http://gigamegatech.com/2009/07/19/simple-fix-to-iphoneipod-dropped-usb-connections/

    and

    http://androidforums.com/samsung-captivate/124548-windows-cant-find-captivate-2.html#post1209509

    Other suggestions? Maybe I am going the wrong direction?

    Thanks!
  4. agentdr8

    agentdr8 New Member

    Check your udev/hal rules. It's possible they're not catching the proper attributes from the usb devices (you should see 2 mounts; one for the internal storage, and one for the external sd card if present).

    The android sdk page that you downloaded it from should have a section on modifying the udev rules to properly recognize the Captivate.
  5. m27315

    m27315 Member

    Based on this link:

    Developing on a Device | Android Developers

    I have this file for my Samsung Captivate:

    /etc/udev/rules.d/51-android.rules
    Code (Text):
    1. #SUBSYSTEM=="usb",SYSFS{idVendor}=="04e8",MODE="0666"
    2. SUBSYSTEM=="usb",ATTR{idVendor}=="04e8",MODE="0666"
    Using the first line (which is commented out), I see this error in the syslog:

    Code (Text):
    1. Aug 26 08:02:19 [udevd] SYSFS{}= will be removed in a future udev version, please use ATTR{}= to match the event device, or ATTRS{}= to match a parent device, in /etc/udev/rules.d/51-android.rules:1_
    2.  
    3.                 - Last output repeated twice -
    Unfortunately, using just the second line still does not make a difference. I still only see this in syslog, after connecting:

    Code (Text):
    1. Aug 26 08:03:52 [kernel] usb 2-5: new high speed USB device using ehci_hcd and address 4
    2. Aug 26 08:03:52 [kernel] usb 2-5: New USB device found, idVendor=04e8, idProduct=681d
    3. Aug 26 08:03:52 [kernel] usb 2-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    4. Aug 26 08:03:52 [kernel] usb 2-5: Product: SAMSUNG_Android
    5. Aug 26 08:03:52 [kernel] usb 2-5: Manufacturer: SAMSUNG
    6. Aug 26 08:03:52 [kernel] usb 2-5: SerialNumber: blah-blah-serial
    7. Aug 26 08:03:52 [kernel] scsi7 : usb-storage 2-5:2.0
    8. Aug 26 08:03:53 [kernel] scsi 7:0:0:0: Direct-Access     SAMSUNG  SGH-I897 Card    0000 PQ: 0 ANSI: 2
    9. Aug 26 08:03:53 [kernel] sd 7:0:0:0: Attached scsi generic sg3 type 0
    10. Aug 26 08:03:53 [kernel] sd 7:0:0:0: [sdc] Attached SCSI removable disk
    If I use the proper rules, I am able to see this though:

    Code (Text):
    1. $ adb devices
    2. * daemon not running. starting it now *
    3. * daemon started successfully *
    4. blah-blah-serial    device
    Which I could not see without the proper udev rules.

    Unfortunately, I still cannot see the "Mass storage". At least, I cannot see how to mount it, even directly:

    Code (Text):
    1. # mkdir /captivate
    2. # mount /dev/sdc /captivate
    3. (15 second pause)
    4. mount: /dev/sdc: unknown device
    Any other suggestions? I don't know what else to try.

    Thanks!
  6. Galroc

    Galroc Active Member

    I wonder if it is a power issue on your USB ports since you have to unplug your keyboard and mice. Some motherboards have a jumper to increase the power to your USB if your power supply supports it.
  7. gnac

    gnac Member

    Just wanted to chime in to say that I am having the same issue. I can see the device registering in dmesg when its gets plugged in, but I cannot mount it. I tried setting the device to be used as mass storage automatically, and ask every time.

    I am running Sabayon, which a derivative of Gentoo, so maybe we have a gentoo specific issue.
  8. gnac

    gnac Member

    Second note. On a whim, I switched from the usb cable I got with a nexus one to the one I got with the captivate. Now when I plug in the captivate, in addition to the connection message, I get a continuing list of usb reset messages:

    Code (Text):
    1. #dmesg
    2. ...
    3. [1493882.906798] scsi 32:0:0:0: Direct-Access     SAMSUNG  SGH-I897 Card    0000 PQ: 0 ANSI: 2
    4. [1493882.907167] scsi 32:0:0:1: Direct-Access     SAMSUNG  SGH-I897         0000 PQ: 0 ANSI: 2
    5. [1493882.907900] sd 32:0:0:0: Attached scsi generic sg7 type 0
    6. [1493882.908053] sd 32:0:0:1: Attached scsi generic sg8 type 0
    7. [1493882.909672] sd 32:0:0:0: [sdg] Attached SCSI removable disk
    8. [1493882.910275] sd 32:0:0:1: [sdh] Attached SCSI removable disk
    9. [1493883.269016] usb 1-3: reset high speed USB device using ehci_hcd and address 2
    10. [1493883.534013] usb 1-3: reset high speed USB device using ehci_hcd and address 2
    11. [1493883.534013] usb 1-3: reset high speed USB device  ... repeating
    12.  
    Does this lead us further into a potential usb2.0 voltage issue?
  9. m27315

    m27315 Member

    I have seen posts in other threads, where several people resolved similar issues, on Windows at least, by plugging into the main USB ports on the back, instead of the expansion ports on the front or the lower-back. A few others had problems from conflicting devices (external USB HDD, for example). Their problems seemed to stem from low voltages or other conflicts.

    Based on these posts and this link:

    GigaMegaBlog Simple fix to iPhone/iPod dropped USB connections

    I ordered this externally powered USB hub:

    Amazon.com: Apc 7 Port Hi-Speed Powered Usb 2.0 Hub: Electronics

    If it makes a difference, I'll let you know. If anybody finds a better one, which solves their problem, please let me know. ... I also ordered another mini-USB cable to see if that makes a difference.

    Thanks!
  10. m27315

    m27315 Member

    Ok, after bashing my head against the wall for too long, I finally resolved most of my problems. My box dual-boots into Windows, so I debugged the problem in Windows first, because of the proliferation of data in Google on it. There can be lots of causes that produce the same error, unrecognized MTP device, so I am posting my condensed trouble-shooting cookbook here:

    For Windows Users:


    1. Put the device in "Kies" or "Media Player" mode, which makes the device appear as an MTP (Windows proprietary combo, media device). Then plug it in and wait up to 1 minute. It takes longer than usual to discover this device versus a USB Mass Storage device (flash card).
    2. If that fails, try using a USB port on the back. These often have better voltage supply and signal integrity than the front panel or other expansion ports.
    3. If that fails, consider trying a powered (with external power plug) USB hub, again plugged into the back. Maybe your device is not getting enough power? It happens...
    4. If that fails, in the "Device Manager", uninstall all the USB devices, hubs, Samsung USB Modems (under modems), composite USB devices, and MTP devices (under portable devices). Reboot your computer and phone. (It's Windows - enough said.) Plug your phone back in, after Windows as finished rebooting and rerecognized all the devices.
    5. If that fails, install the Samsung USB Modem drivers. You may have to try step #4 again.
    6. Then, try installing Samsung's Kies player. You may have to do step #4 again.
    7. If that fails, try exploring (and forcing) the underlying driver choices in the Device manager. In other words, force MTP, Samsung, etc by using "Update driver" or "Add Hardware" wizards. On occasion, Windows picks the wrong driver... You will have to try step #4 again.
    8. MTP is built into Windows Media Player, so trying install Windows Media Player again. It gets corrupted on occasion. (Try #4 again.)
    9. Make sure all your Windows software is up to date (no old drivers, latest .NET stuff, etc.)
    10. Try installing the latest version of your motherboard's (manufacture's) chipset drivers (for USB hosts) again.

    My problem was resolved after step #10! :rolleyes:

    Once I knew the phone was fine and the problem was software related, I renewed my Linux efforts:

    For Linux Users:



    1. Make sure you are using a good cable plugged into a good port, just like Windows users.
    2. Use the "Mass Storage" USB mode on the phone.
    3. Don't forget to actually "Mount" the card in the phone's drop down.
    4. Make sure you have at least thes necessary kernel modules:
      Device Drivers ---> SCSI device suport -->
    5. legacy /proc/scsi/ support
      <*> SCSI disk support
      <*> SCSI generic support
      <*> SCSI media changer support
    6. Probe all LUNs on each SCSI device (*critical*)
      Device Drivers ---> USB support --->
      most of the EHCI, OHCI, and UHCI stuff - built-in, where possible
    7. If you are missing modules, then rebuild the kernel, reboot, and try again.

    If only one device is detected, then the problem is that you are not probing all the LUNs (devices inside the phone). The first one is the empty card slot, which is why nothing pops up (I am guessing). Anyway, once I started probing for all the LUNs, now I see this:

    Code (Text):
    1. Aug 31 11:22:11 [kernel] usb 2-4: new high speed USB device using ehci_hcd and address 5
    2. Aug 31 11:22:12 [kernel] usb 2-4: New USB device found, idVendor=04e8, idProduct=681d
    3. Aug 31 11:22:12 [kernel] usb 2-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    4. Aug 31 11:22:12 [kernel] usb 2-4: Product: SAMSUNG_Android
    5. Aug 31 11:22:12 [kernel] usb 2-4: Manufacturer: SAMSUNG
    6. Aug 31 11:22:12 [kernel] usb 2-4: SerialNumber: blah-blah
    7. Aug 31 11:22:12 [kernel] scsi6 : usb-storage 2-4:2.0
    8. Aug 31 11:22:13 [kernel] scsi 6:0:0:0: Direct-Access     SAMSUNG  SGH-I897 Card    0000 PQ: 0 ANSI: 2
    9. Aug 31 11:22:13 [kernel] sd 6:0:0:0: Attached scsi generic sg3 type 0
    10. Aug 31 11:22:13 [kernel] scsi 6:0:0:1: Direct-Access     SAMSUNG  SGH-I897         0000 PQ: 0 ANSI: 2
    11. Aug 31 11:22:13 [kernel] sd 6:0:0:1: Attached scsi generic sg4 type 0
    12. Aug 31 11:22:13 [kernel] sd 6:0:0:0: [sdc] Attached SCSI removable disk
    13. Aug 31 11:22:13 [kernel] sd 6:0:0:1: [sdd] Attached SCSI removable disk
    14. Aug 31 11:22:29 [kernel] sd 6:0:0:1: [sdd] 27328448 512-byte logical blocks: (13.9 GB/13.0 GiB)
    15. Aug 31 11:22:29 [kernel] sd 6:0:0:1: [sdd] Assuming drive cache: write through
    16.                 - Last output repeated twice -
    17. Aug 31 11:22:29 [kernel]  sdd:
    18. Aug 31 11:22:36 [hald] mounted /dev/sdd on behalf of uid XXXX
    And, now my automounter pops up, just as you would expect.

    Now, my only remaining problem is finding an audio player that can sync my stuff to the phone. SongBird has all my ratings and playlists, but for some reason, it can't see the phone. I guess that's another thread...

    Thanks to all for the suggestions.

    Additional, useful links I found:


    HTH
  11. Dr. Dom

    Dr. Dom New Member

    As a total Android newbie (day one!) wanting to mount from Linux, the bit that took me forever to figure out was that you need additionally to allow the mount from within the phone's notification bar drop-down.

    This seems profoundly nebulous to me, but maybe it makes sense to Android veterans.

    For newbies:
    1. Put phone in USB mass storage mode
      • From primary home screen, push menu button.
      • Select "Settings", then "Applications" -> "USB settings"
      • Choose either "Mass storage" or "Ask on connection"
    2. Plug in USB cable
      • If you set phone to "Ask on connection", you'll need to choose "Mass storage" at this point
    3. Expand notification bar
      • Touch notification bar at top of screen
      • Slide your finger down the screen
      • Notification area should expand.
    4. Tap "USB connected" area of notification drop-down
    5. Press "Mount" button
    6. That's it.
      • Depending on your Linux installation/configuration, both internal and external SD cards should automount and file browser windows should appear

    If that doesn't work, then you need to do a lot of the complicated Linux debugging detailed in the other posts above.
  12. m27315

    m27315 Member

    @Dr. Dom, Thanks for the tip! I have seen that problem in a lot of posts. I think it is a very common problem, and your explanation was very thorough. :)
  13. Bastich3169

    Bastich3169 Member

    Im having the same issue, but my phone is a Huawei Ascend and im using Zorin OS 5. New to linux but im not stupid. Any ideas or fingers pointing me in the right direction would be great.
  14. Bastich3169

    Bastich3169 Member

    nevermind i got the mount unmount option to finally work for me
Loading...

Share This Page