FORUMS
Remove All Ads from XDA

USB Host mode on Defy

16 posts
Thanks Meter: 17
 
By MAPGPS, Junior Member on 19th February 2011, 01:51 PM
Post Reply Email Thread
14th December 2013, 08:47 AM |#151  
Senior Member
Thanks Meter: 87
 
More
That's great news for us. Hoping that this will be implemented in the coming builds. However it's not clear from your post if the devices work with or without external power.

Sent from my MB526 using xda app-developers app
14th December 2013, 01:09 PM |#152  
kHron0S's Avatar
Member
Flag Trento
Thanks Meter: 28
 
More
Talking More Power findings
All of my test where done only with the power from the defy without an external powered hub and i did more tests to see if the devices power req was detected correctly and you can get that from sys/bus/usb/devices/2-1/bMaxPower , if you open it will show the power reported by the device that was detected trough UsbCore scheme method and if you check sys/bus/usb/devices/2-1/power/ depending on the devices reporting power system you can find in there:

Code:
        autosuspend
                -1 or 0 means off, depending on kernel,
                otherwise it is the number of seconds to
                autosuspend

        level 
                with the settings:

                on      - suspend is disabled, device is fully powered
                auto    - suspend is controlled by the kernel (default)
                suspend - suspend is enabled permanently

                You can write these strings to the file to control
                behaviour on a per-device basis.

                echo on > /sys/usb_device/.../device/power/level

        state
                current state of device
                0 - fully powered
                2 - suspended

                You can write these numbers to control behaviour, but
                any change you make here might change automatically
                if autosuspend is on.

                echo -n 0 > /sys/usb_device/.../device/power/state

        wakeup
                unknown
This is a part fom the larger description here.

All of the power management is controlled by the CONFIG_USB_SUSPEND kernel module and ours is working with suspend on, atm i cant build a kernel with autosuspend off , @SlugZero , @Quarx or @Blechd0se could build a kernel with it off(how to configure autosuspend i found here and some more details about the usb controller that we have in our defy here and here) to see how the devices work with it off, ofc that will be only a test kernel because that might worsen the battery consumption.
The Following 4 Users Say Thank You to kHron0S For This Useful Post: [ View ] Gift kHron0S Ad-Free
15th December 2013, 09:11 PM |#153  
Senior Member
Thanks Meter: 1,094
 
More
Hi,

combining SlugZeros OTG patch and kHron0S kernel cmdline extension I
sucessfully compiled a CM 10.2 ROM and mounted an USB stick using
the USB OTG helper app Attached you will find the patch file I used.
Attached Files
File Type: diff 10.2-usb_otg.diff - [Click for QR Code] (23.8 KB, 129 views)
The Following 3 Users Say Thank You to sevenrock For This Useful Post: [ View ] Gift sevenrock Ad-Free
4th February 2014, 07:25 PM |#154  
Member
Thanks Meter: 10
 
More
Thanks for otg kernel.its great
can we make it to wirking with moto RAZR xt910?
what we need to do that?
10th September 2014, 05:24 AM |#155  
Junior Member
Thanks Meter: 6
 
More
doesnt work
should "USB OTG Power Y Cable" on ebay work for me (by the seller novotm) ?
sorry im a newbie so it doesnt let me put links

i flashed the zip and it didnt work. im not sure if something wrong with the cable or something else
my defy doesn't detect the flash drive.
rom is CM9
15th September 2014, 08:58 AM |#156  
linolino's Avatar
Member
Flag Nuremberg
Thanks Meter: 7
 
More
Quote:
Originally Posted by Wolfensteinor

should "USB OTG Power Y Cable" on ebay work for me (by the seller novotm) ?
sorry im a newbie so it doesnt let me put links

i flashed the zip and it didnt work. im not sure if something wrong with the cable or something else
my defy doesn't detect the flash drive.
rom is CM9

Hi Wolfensteinor,

you should put more details which ROM you are on.
In case you have:
http://forum.xda-developers.com/show....php?t=2515036
it may work - in my case it does.
But keep in mind the Y-Cable doesn't charge your phone, the same time it is a USB host.
It just adds more power to USB client device (eg HDD).
I have a USB Y-Cable but never actually tried if it powers a HDD;
also have a tiny little USB OTG cable which is sufficient for my pendrive

nevertheless more details about your ROM may be needed to help in any way...
20th September 2014, 12:12 AM |#157  
Junior Member
Thanks Meter: 6
 
More
Quote:
Originally Posted by linolino

Hi Wolfensteinor,

you should put more details which ROM you are on.
In case you have:
http://forum.xda-developers.com/show....php?t=2515036
it may work - in my case it does.
But keep in mind the Y-Cable doesn't charge your phone, the same time it is a USB host.
It just adds more power to USB client device (eg HDD).
I have a USB Y-Cable but never actually tried if it powers a HDD;
also have a tiny little USB OTG cable which is sufficient for my pendrive

nevertheless more details about your ROM may be needed to help in any way...

already said its CM9
http://forum.xda-developers.com/show....php?t=1353003
its the last build by Epsylon3

and thanks
12th January 2015, 12:18 AM |#158  
Junior Member
Thanks Meter: 0
 
More
Defy Plus OTG
Quote:
Originally Posted by SlugZero

Here is a new version of the OTG kernel based on the latest AeroKernel for Android 4.2/4.3.
I integrated Quarx's fixes and made some more stability fixes which focus on not breaking existing kernel functionality. So as long as you do not connect an OTG cable, you should not notice any difference to the latest AeroKernel.

OTG Features:

  • Switch from regular mode to OTG mode any time by plugging/unplugging cable.
  • Connect devices with power consumption up to 100mA without an external power supply.
  • Connect devices with power consumption up to 200mA without external power supply at your own risk. They might work or might not, or they may break your device. I tried a few USB devices and my Defy is still ok, however some of the devices disconnected after some time, possibly due to voltage drop.
  • Connect any USB device which is supported by Android/Linux Kernel via USB hub with external power supply (might need additional Kernel modules)


Working devices: (i.e. devices I plugged in that worked)
  • Mouse, Keyboard
  • Cordless Mouse
  • USB Flash Drives
  • Camera
  • Joystick

Issues in OTG mode:
  • Disconnecting USB devices does not work properly. After unplugging a USB device, the next thing you connect to the USB port will not be detected (no matter if it is a charger, USB cable or USB device). You have to unplug and replug the cable at least once more (sometimes more often). Afterwards, everything works as usual.
  • After unplugging the USB device without removing the OTG cable, other USB devices will not be detected. Always unplug the OTG cable when changing devices
.

Please keep in mind that this feature is not officially supported by Motorola or by anyone, so if it does not work as you'd expect, chances are high that it will never work. I will not work any further on this because I ran out of ideas how to fix the remaining issues (maybe hardware related) and because it works good enough for my purposes already.

If some people here give me positive feedback that this kernel works good for them, I will ask Quarx to merge it.

Edit:
For anyone who is interested in this, I recompiled the OTG kernel with the latest (final?) changes for the 2.6.32 kernel. As development on the 2.6.32 kernel has stopped, there is no point in merging it into Quarx's repository any more. Quarx's 3.0 kernel will support OTG by default

Some people reported that connecting works for them only after a fresh boot. Reconnect works as described on my device (MB525 green lens), but it could be different on other devices.

------------------------------------------------------------------------------------------------------------------------------------------------------
Hello SlugZero, I would like to thank you for the great job, we really appreciate your work. I am a new user, and not really into mobile mod, so I kindly ask your support. I have a question, the attach OTG_kernel_new is compatible also with Defy Plus - Android 2.3.6 - kernel 2.6.36? I need just to put it on the sd and install after booting on safe mode correct? Thanks a lot - DK
12th January 2015, 07:27 AM |#159  
lohtse's Avatar
Senior Member
Flag Where ever they send Me!!
Thanks Meter: 127
 
More
am on quarks 4.2 rom and wondering if the kernel here is OC'ed , tweaked etc as would like OTG mode but like kernel already using..
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes