• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

[Q] Nexus 5 OTG Support

Search This thread

ritchea

Senior Member
Sep 6, 2011
829
173
okeechobee
OTG works fine on my Nexus 5, used DSLR Controller with it. Wonder if it has the same issue as the new Nexus 7 though and that's why it's not working for some ...

EDIT: Did some further testing, seems the Nexus 5 doesn't suffer from the localisation issues like the new Nexus 7. USB host support is working both in kernel and framework. That being said, it seems there is an issue with StickMount, though :)

So we no longer need it? Or you'll fix it :D

Sent from my Nexus 4 using Tapatalk
 

Chainfire

Moderator Emeritus / Senior Recognized Developer
Oct 2, 2007
11,442
87,708
www.chainfire.eu
I've just uploaded a new version of StickMount that fixes the issues that I've found.

I don't understand your question though - as Android does not include a stock file manager, nor any normal API to access externally mounted devices (though arguably with KitKat this is now a possibility thanks to official support for multiple external storages - only 3 years late), there's no reason for the device to automagically mount. As such, for the time being tools like StickMount are needed.

It seems like a lot of people are (still!) confusing USB host compatibility with actually "coming preloaded with all the software you need to use it as an end-user"
 

jlmcr87

Senior Member
Apr 18, 2011
902
791
I've just uploaded a new version of StickMount that fixes the issues that I've found.

I don't understand your question though - as Android does not include a stock file manager, nor any normal API to access externally mounted devices (though arguably with KitKat this is now a possibility thanks to official support for multiple external storages - only 3 years late), there's no reason for the device to automagically mount. As such, for the time being tools like StickMount are needed.

It seems like a lot of people are (still!) confusing USB host compatibility with actually "coming preloaded with all the software you need to use it as an end-user"

Uploaded on the play store? Thanks
 

Mikulec

Senior Member
Oct 19, 2007
3,914
1,358
Sereď
OTG works fine on my Nexus 5, used DSLR Controller with it. Wonder if it has the same issue as the new Nexus 7 though and that's why it's not working for some ...

EDIT: Did some further testing, seems the Nexus 5 doesn't suffer from the localisation issues like the new Nexus 7. USB host support is working both in kernel and framework. That being said, it seems there is an issue with StickMount, though :)

That means not only flashdrives but also devices like mouse, gamepads work?
 

ziddey

Senior Member
Aug 26, 2007
1,814
1,561
Although Android does support mounting of usb storage, a lot of roms don't make use of this feature. This post documents the changes necessary for 4.2 and 4.3. I'm not sure if anything has changed in 4.4. The first part deals with a workaround necessary for host mode on the N4 and is irrelevant. As well, a good part of it has to do with enabling host mode support in the framework itself, which Chainfire has mentioned should already be in place on the N5.

Specifically, storage_list.xml (compiled in framework-res.apk) needs to be modified. This will add usb storage to settings->storage. In 4.3, the actual "mountpoint" is defined in the fstab file, which resides in ramdisk. From here, the framework/vold should take care of the rest and automatically mount your usb drive. Media scanning will automatically occur on mount.

I haven't done any research on 4.4 yet, but Chainfire mentioned multiple partition support in 4.4. In that case, the exact procedure may be different, but the idea should be the same.

Note, I'm not too familiar with the stock vold, but it might only support fat (and possibly ext?) partitions. I know CM extended it to work in conjunction with ntfs-3g and fuse-exfat.

Either way, unless you really want that native "experience", StickMount is probably the best option. Plus, it doesn't require a workaround to permit write access to apps (see Chainfire's post).
 

Sultanxda

Recognized Developer
Aug 18, 2012
6,474
37,693
California
www.kerneltoast.com
Although Android does support mounting of usb storage, a lot of roms don't make use of this feature. This post documents the changes necessary for 4.2 and 4.3. I'm not sure if anything has changed in 4.4. The first part deals with a workaround necessary for host mode on the N4 and is irrelevant. As well, a good part of it has to do with enabling host mode support in the framework itself, which Chainfire has mentioned should already be in place on the N5.

Specifically, storage_list.xml (compiled in framework-res.apk) needs to be modified. This will add usb storage to settings->storage. In 4.3, the actual "mountpoint" is defined in the fstab file, which resides in ramdisk. From here, the framework/vold should take care of the rest and automatically mount your usb drive. Media scanning will automatically occur on mount.

I haven't done any research on 4.4 yet, but Chainfire mentioned multiple partition support in 4.4. In that case, the exact procedure may be different, but the idea should be the same.

Note, I'm not too familiar with the stock vold, but it might only support fat (and possibly ext?) partitions. I know CM extended it to work in conjunction with ntfs-3g and fuse-exfat.

Either way, unless you really want that native "experience", StickMount is probably the best option. Plus, it doesn't require a workaround to permit write access to apps (see Chainfire's post).

The device-specific modifications for native OTG aren't too difficult (I have it working on my old HTC); make a simple change to storage.xml, enable MSM host support (and regular OTG support) in the kernel, and add the path of the MSM host sysfs interface to fstab.
 

kamranhaghighi

Senior Member
Apr 8, 2012
952
34
22
Orgrimmar
The device-specific modifications for native OTG aren't too difficult (I have it working on my old HTC); make a simple change to storage.xml, enable MSM host support (and regular OTG support) in the kernel, and add the path of the MSM host sysfs interface to fstab.
whit stick mount u can watch movies whit out copying to my future n5:) not bought yet:)!
 

Chainfire

Moderator Emeritus / Senior Recognized Developer
Oct 2, 2007
11,442
87,708
www.chainfire.eu
What reason are you on about?

I also downloaded files from the device to the internal storage. I will try other applications and let the board know my findings.

What I'm on about is that for some purposes you can indeed use an app like that (or Nexus Media Importer) and for some purposes you actually do need root. It all depends on what you're trying to do.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 32
    OTG works fine on my Nexus 5, used DSLR Controller with it. Wonder if it has the same issue as the new Nexus 7 though and that's why it's not working for some ...

    EDIT: Did some further testing, seems the Nexus 5 doesn't suffer from the localisation issues like the new Nexus 7. USB host support is working both in kernel and framework. That being said, it seems there is an issue with StickMount, though :)
    15
    I've just uploaded a new version of StickMount that fixes the issues that I've found.

    I don't understand your question though - as Android does not include a stock file manager, nor any normal API to access externally mounted devices (though arguably with KitKat this is now a possibility thanks to official support for multiple external storages - only 3 years late), there's no reason for the device to automagically mount. As such, for the time being tools like StickMount are needed.

    It seems like a lot of people are (still!) confusing USB host compatibility with actually "coming preloaded with all the software you need to use it as an end-user"
    4
    Root NOT required!!!!!!!!

    Downloaded OTG Disk explorer lite from the play store on my brand new stock Nexus 5, Plugged my micro usb device in and I'm now listening to my external music

    Root is NOT, I repeat, NOT needed
    4
    Input devices (keyboard, mice, gamepads...) works also without root and without any app ;)

    Stickmount is needed to mount USB mass storage devices only.
    2
    It appears that OTG isn't enabled by default in the kernel. I went ahead and enabled OTG but my N5 hasn't shipped yet (haven't even received a shipping confirmation yet :crying:), so I can't test the kernel I built right now