# OTG - USB 'insufficient available bus' tool/thingy



## Dubi (Jan 19, 2012)

Hi guys,

Some of my USB devices (memory stick/ sd reader) fail to be properly mounted due a limitation on the amount of power a usb can get.
I usually get a *'insufficient available bus*' message in the dmesg output when plug-in any of them.

This is easy fixed chaining the *bConfigurationValue *to in in the device config. I used to do that from a terminal, but I got bored of that, so I wrote a simple tool which does it with just a click










I also add a "unmount" button, so I can plug/unplug more than one device without needed to reboot (for some reason, the '/mnt/usbdisk' was left mounted when if I disconnect the device, so I couldn't get another one on)

Anyway, It may be an overkill, but it could save some time for those of you using an OTG cable.

v1 -> http://www.zen24223.zen.co.uk/TPUSBUMount_v1.apk

Don't expect too much,








it is quite simple and does require 'su' access for the 'umount' command.


----------



## Zzed (Oct 20, 2011)

I've been messing around with OTG off and on. I've been using the USBunmount from XDA for some time but was excited to see your offering here. I get constant FC when trying to use this. Any thoughts on what I'm doing wrong? I'm on nightly 0819.

After a reboot the app stays up a couple minutes, then FC. I don't even get a chance to connect a flash drive. After that I get immediate FC.

View attachment 2012-08-25_21-05-46.log.txt


<EDIT> corrected by v1


----------



## Dubi (Jan 19, 2012)

Ummm, that's strange, the app is quite basic, it just does a cat of the "cat /system/kmesg" to get the USB messages (similar to dmesg)
and the two buttons do an unmount and the echo to a file to enable change the bConfiguration proerty (to get rid of the "insufficient power"

will have a look, I', running my "own" built which should be up to date (in line with the 08/19) but I will try installing that and see if it blows

btw, thanks for testing 8)


----------



## Dubi (Jan 19, 2012)

congrats, you found the first bug, hehehehehe,
I was assuming that the output will have at least 20 rows, so if your just started the TP, it may now have that

Anyway, thanks for pointing that out.
I did put a new "revised" version in my ftp, same link as above.
hope this one works 8)


----------



## Zzed (Oct 20, 2011)

Dubi said:


> congrats, you found the first bug, hehehehehe,
> I was assuming that the output will have at least 20 rows, so if your just started the TP, it may now have that
> 
> Anyway, thanks for pointing that out.
> ...


Thanks for the quick response. The changes allow me to use the app with no FC, although I miss the verbose display from before. It seems to clear the screen from time to time and I lose a sense of what its doing.

On my first use, the was an FC: "Unfortunatly, the process andriod.process.media has stopped." Perhaps I removed too soon? On following uses, it seemed to work with no problems. Instead of the the process error & the "SD card unexpectedly removed - unmount SD card before removing to avoid data loss." >>> I now get >>> "Removed SD Card - SD card removed. Insert a new one." Nice work.

It's looking good, I'll do more extensive testing as I think I've had low bus power on some devices. Without your app, these devices would just not be readable or detected?

I'll post an update later and thanks for this effort.


----------



## Dubi (Jan 19, 2012)

Glad it works.

I wrote it beacuse I was tired of having to run:

"echo -n 1 | tee /sys/bus/usb/devices/1-1/bConfigurationValue"

to fix the "insufficient bus power" thingy. Not sure why some of my devices cause that, I guess it is how the device identify itself, because a big multi sd reader works fine, but a small single microsd doesn't so it is clearly not "real" power.

The other annoying thing was the /mnt/usddisk. I think there is code to automaticly unmount the /mnt/usbdisk in CM, so after plug in one device, I had to also do that manually if I wanted to use a second one.

The tool makes it a little easier (and I guess, with the verbose output, it will help to identify if your device it's detected or not)


----------



## Zzed (Oct 20, 2011)

Dubi said:


> Glad it works.
> 
> I wrote it beacuse I was tired of having to run:
> 
> ...


I'm liking it's functionality. The verbose dialog I find useful and I now can see that most of my SD Card USB interfaces couldn't be read by the current state of CM9 nightly 0819. Thank you so much for bringing a much needed utility to our hands. Some of my USB devices would only work on a powered hub, Others refused to work completly... until now.

I think your utility is very serviceable. I would sugest these minor tweeks:

1) taller buttons for unmount & fix buttons. - I'm using DPI 120 and the single row height buttons are a little small and too close together.
2) the verbose status display I like very much, It seems to clear the display from time to time losing the previously displayed text. - I'd prefer it to not lose the text displayed (I guess I don't mind the lose of what has scrolled off).
3) confirm in the status text when unmount has been executed - I know it states when the SU premissions were granted, but would like that extra text status confirm. I'm sure it's outside the scope to close all applications using the mount, I keep triggering the FC: "Unfortunatly, the process andriod.process.media has stopped." & "SD card unexpectedly removed - unmount SD card before removing to avoid data loss." My guess is that I've not closed all mount using applications.

I'm making this utility one of my must have on the HP Touchpad. Bravo, well done.


----------



## Dubi (Jan 19, 2012)

Can you try this one:










http://www.zen24223.zen.co.uk/TPUSBUMount_v1.apk

I've add some code which "hopefully" should avoid the FC in the android.process.media

If you have lots of usb related entries in the dmesg, it may take a while to start, have to find a way to deal with that.


----------



## Zzed (Oct 20, 2011)

Dubi said:


> Can you try this one:
> 
> http://www.zen24223....SBUMount_v1.apk
> 
> ...


- The buttons are more than large enough!








- Operations in the message text are working awesome. 
- I can access all of my Camera & Video Recorder SD cards on USB interfaces with thanks to the Bus Power fix option. These without resorting to a powered hub, which is a problem if I don't have AC for it. Previously, even with the powered hub, some devices were not recognizable. 
- I have access to all but NTFS volumes (a seperate issue entirely).

This is truly a vast improvement over the state of CM9 on HP Touchpads using OTG Host mode. As CM9 is not likely to receive any further improvements in this feature, I'm glad for your success in this effort.

Thanks again on another rapid turn around on changes. This apps gets my highest recomendation as a "Must have!" for anyone using OTG on HP Touchpads.


----------



## cobjones (Jun 21, 2011)

Awesome!

Sent from my Galaxy Nexus using Tapatalk 2


----------



## Dubi (Jan 19, 2012)

Thanks guys, glad you like it.
I wasn't planning to do anything ultra special, I prefer to keep things simple and functional
One day, I may put some nice icons rather than the crappy text, It may look more "professional"









Does the android.process.media still FCs when you unplug a device?
I have to dig into the services code to find a way to "safety" unmount the device, one of my USB sticks was causing that all the time.


----------



## Zzed (Oct 20, 2011)

Dubi said:


> Thanks guys, glad you like it.
> I wasn't planning to do anything ultra special, I prefer to keep things simple and functional
> One day, I may put some nice icons rather than the crappy text, It may look more "professional"
> 
> ...


After a fresh boot, first launch, first Red fix... that SD card gets a android.proess.media FC on eject. If I re-connect, Red fix, and eject... it works as expected. I've even made sure to Kill All from a task manager in the hopes of closing the user app, but I see this on first use of a insufficient bus power device. That seems to indicate the OS is holding onto some process (wild a$$ guess on my part).

I'll have to do more methodical testing to be sure of a reproducable error flow. I'll post later.


----------



## eZaCx (Feb 11, 2012)

Okay, I tried this and it didn't work.
Info: I own a Galaxy nexus, with a OTG Cable. For my HP Touchpad with CM9, rooted/overclocked at 1.7 ghz, I was trying my wireless mouse dongle which didn't seem to give it any power at all. (This worked fine with my Nexus, without any apps necessary). On my Nexus, however, I need an App called "Stick Mount," which allowed me to connect a usb flash drive without problems, again, this doesn't work with my Touchpad. 
Note: I also tried clocking my tablet at the normal speed, 1.2 ghz and nothing happened.

I tested both the original, and the v1 tools you posted on the first page.

First one:

```
http://i45.tinypic.com/73cwuf.jpg
```
All I did was install the tool, give it superuser permission, plug in my OTG capable with dongle attached, and that's what it gave me. I was still not able to use my mouse, as there was no power given to the dongle. I Unmounted it, and removed the OTG cable and that's what the screen shot looks like. I tried multiple times, but nothing happened.

v1 Tool (second one):

```
http://i46.tinypic.com/2cpqo0j.jpg
```
I did the same thing here, but in this one it actually indicated in yellow if pressed "unmount." I didn't get anything in red, which is required to fix the "insufficient power" error. In my case, it only says exiting msn_otg_suspend, and entering usb in low power mode after connection, so it's different in my case.

Any help? I am getting a new flash drive soon (64 gb sd card + usb 3.0 card reader), which I know will work with my galaxy nexus + laptop, but it would have been great if I could plug it into my Hp Touchpad as well.

Any help??


----------



## Zzed (Oct 20, 2011)

eZaCx said:


> Okay, I tried this and it didn't work.
> Info: I own a Galaxy nexus, with a OTG Cable. For my HP Touchpad with CM9, rooted/overclocked at 1.7 ghz, I was trying my wireless mouse dongle which didn't seem to give it any power at all. (This worked fine with my Nexus, without any apps necessary). On my Nexus, however, I need an App called "Stick Mount," which allowed me to connect a usb flash drive without problems, again, this doesn't work with my Touchpad.
> Note: I also tried clocking my tablet at the normal speed, 1.2 ghz and nothing happened.
> 
> ...


You didn't state you are using a power "Y" cable. HP Touchpad has no power support and the hardware is not fully OTG compliant. See this Rev Kyle YouTube for details:






The video describes the hardware solution. Did you purchase or build the "Y" cable?

I have had success with various USB flash drives, USB SD card adapters and USB HDDs. Also USB Mice & Keyboards to include Logitec wireless mouse, and wireless mouse/keyboard combination. All these needed the power "Y" cable after the OTG, which I have connected to a battery pack, or a powered USB hub.

This utility app provided the bridge I needed to clean unmount, as well as correcting low bus power mis-detection of hardware. It cannot correcet the hardware missing if you are not using the power "Y" cable.

Based on your .jpg, it also would appear that button text is too large for the buttons on your display dpi (160dpi)? It is dispayed ok on my 120dpi.


----------



## eZaCx (Feb 11, 2012)

Zzed said:


> You didn't state you are using a power "Y" cable. HP Touchpad has no power support and the hardware is not fully OTG compliant. See this Rev Kyle YouTube for details:
> 
> 
> 
> ...


I am aware of the Y cable, but I was under the impression this tool renders that useless. Oh man, ;(. I am more of the "on the go" type of guy, I was looking forward to using just the OTG cable and flash drive, as the combo is very small. I can't be on a plane/bus etc, with a huge cable and a power hub for just 1 flash drive.

Can't believe the touchpad doesn't have power support. I wish in this situation, my nexus didn't while my touchpad did, as I watch a lot of media requiring quite a lot of space.

Edit: Yes, it is 160 dpi.


----------



## Dubi (Jan 19, 2012)

Zzed is 100% right.








There is no way to get USB devices working without an additional 5v. You can get that from a power USB hub, a Y cable, the internal hack (which I'm thinking about it)
or a external backup battery.
What I use is a 2400 mamps phone battery (from my old HTC HD2) and a conversor from 3.7v to 5v, so I can use it on the go (if I needed it). I also did my own cable which is couple of centimeters long









Even with a power USB hub, there are some devices which don't work, that's what this thingy tries to fix (and also do a clean unmount of the device)

Will look at the button size, see if I can "accommodate" all dpis


----------



## Pixel (Aug 29, 2012)

My 64 GB FAT32 USB flash drive works now! Thank you.


----------



## obo678 (Mar 5, 2012)

Great tool my new 32gig usb stick now works too!

Also discovered that if i connect this stick via a very cheap usb hub (that takes its power from the y cable) it will mount without any problem... maybe the hub overrides the stick's power requirements?


----------



## Zzed (Oct 20, 2011)

Dubi said:


> Anyway, It may be an overkill, but it could save some time for those of you using an OTG cable.
> 
> http://www.zen24223....TPUSBUMount.apk
> 
> ...


@dubi,

Need to update the OP to reflect your current masterpiece on this post: http://rootzwiki.com/topic/33033-otg-usb-insufficient-available-bus-toolthingy/#entry921473


----------



## Dubi (Jan 19, 2012)

your wish is my command


----------



## Zzed (Oct 20, 2011)

I'm still trying to make time to do a very complete shakedown of this utility. I'm having issues with my homebrew hardware and an waiting on other parts.

From the app perspective, I'm very pleased. I do find that I still have SD card gets a FC android.proess.media on initial eject. This is confirmed to be only on first use. Not sure if I need to have TPUSBmount in startup? It doesn't amtter if I need to "Fix" due to insufficient bus power.

On fresh boot, first use, first eject... I get the FC, even without opening any app to utilize the mount.


----------



## Grooves1210 (Jun 3, 2012)

Hi
I was going crazy trying to get OTG working on my Touchpad. All the info I could find was saying that it "just works" (with the correct cable/power of course).
I found that my USB mouse would work, but nothing else - and I was really wanting flash drives to work, so I was so glad to find your app and now all my flash drives are working 
Some one mentioned the problem of using USB OTG actually on-the-go (ie no mains power).
My solution is this box that uses 2x AA batteries to provide the necessary 5v http://www.amazon.co...wms_ohs_product

Thanks again for making this tool. It's going to be great to be able to check my photographs on the Touchpad's screen when I'm out taking pics


----------



## nevertells (Oct 29, 2011)

Grooves1210 said:


> Hi
> I was going crazy trying to get OTG working on my Touchpad. All the info I could find was saying that it "just works" (with the correct cable/power of course).
> I found that my USB mouse would work, but nothing else - and I was really wanting flash drives to work, so I was so glad to find your app and now all my flash drives are working
> Some one mentioned the problem of using USB OTG actually on-the-go (ie no mains power).
> ...


So what kind of run time do you get from hooking this up as your power source on the OTG cable?

Also, go have a read here: http://rootzwiki.com/topic/38529-running-out-of-storage-what-are-my-options/page__st__20


----------



## Dubi (Jan 19, 2012)

I also use external power, I did a "contraction" with an old battery phone (HD2) and a step-up circuit to increase the v from 3.3 to 5.v
It's nice to have "real" USB OnTheGo


----------

