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 September 2013, 11:04 AM |#131  
ljsh093's Avatar
Member
Flag Guiping
Thanks Meter: 12
 
More
Quote:
Originally Posted by SlugZero

I will not have time to work on this for the next month, so I want to share what I've got until now. I could power and mount an USB stick with the following change:
https://github.com/slugzero/jordan-k...61d13a51ececf1

This is very unstable, seems like power goes down again after a while. I could browse through the directories on the stick but I could not open any files any more. It also works immediately after boot only, disconnect and reconnect of devices does not work.
Since this may possibly damage your device, I recommend not testing this and also will not provide a compiled kernel until I got this working properly. Everyone who knows what he/she is doing, should be able to compile a kernel himself.

Input devices on the other hand work really nicely, see attached image


Btw. I am using the kernel I posted previously for more than one week now and had no issues so far, but I've got the feeling that power consumption is slightly higher. I think this is due to the changes in the musb part, I will have a look at this as soon as I am back.

Hello, mester. Thx for ur kernel. Is this mouse powered by dry cell? And can support wireless mouse?

Sorry for my bad English.
25th September 2013, 10:31 AM |#132  
Quarx's Avatar
Inactive Recognized Developer
Flag Omsk
Thanks Meter: 18,852
 
Donate to Me
More
@SlugZero, thanks for OTG
I looked into it and made some fixes., reconnecting works after boot, but not always... And usb works.
If you not mind, after fully fix i can include it in cm builds.

@ljsh093, wireless mouse works.
The Following 20 Users Say Thank You to Quarx For This Useful Post: [ View ] Gift Quarx Ad-Free
25th September 2013, 04:15 PM |#133  
Member
Thanks Meter: 647
 
More
Quote:
Originally Posted by Quarx

@SlugZero, thanks for OTG
I looked into it and made some fixes., reconnecting works after boot, but not always... And usb works.
If you not mind, after fully fix i can include it in cm builds.

@Quarx, it's me who has to thank you for your awesome work

Of course I do not mind if you merge it. And thanks for fixing it!

Quote:
Originally Posted by ljsh093

Is this mouse powered by dry cell? And can support wireless mouse?

@ljsh093, mouse is powered by phone. USB wireless mouse works, but I would recommend using a Bluetooth wireless mouse.
The Following 5 Users Say Thank You to SlugZero For This Useful Post: [ View ] Gift SlugZero Ad-Free
23rd October 2013, 02:10 PM |#134  
Junior Member
Thanks Meter: 1
 
More
bump! How is it going? I tried latest 2nd boot CM but with USB Host Diagnostics it does not work
23rd October 2013, 08:03 PM |#135  
Junior Member
Flag Liberec
Thanks Meter: 1
 
More
Quote:
Originally Posted by losh1337

bump! How is it going? I tried latest 2nd boot CM but with USB Host Diagnostics it does not work

Have a look at wiki pages: http://forum.xda-developers.com/wiki/Motorola_Defy
23rd October 2013, 11:59 PM |#136  
Junior Member
Thanks Meter: 1
 
More
Quote:
Originally Posted by Milan Kerslager

Have a look at wiki pages: http://forum.xda-developers.com/wiki/Motorola_Defy

Thanks for the answer. I found nothing relevant to usb OTG or USB host, though :/
The Following User Says Thank You to losh1337 For This Useful Post: [ View ] Gift losh1337 Ad-Free
31st October 2013, 07:06 PM |#137  
Member
Thanks Meter: 647
 
More
Storage New OTG Kernel
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.
Attached Files
File Type: zip otg_kernel_new.zip - [Click for QR Code] (3.38 MB, 423 views)
The Following 30 Users Say Thank You to SlugZero For This Useful Post: [ View ] Gift SlugZero Ad-Free
31st October 2013, 10:37 PM |#138  
Member
Thanks Meter: 18
 
More
Just what I was waiting for. THANKS ALOT, SlugZero!!!

EDIT: My USB Competition Pro does work after restarting! Played THE GREAT GIANA SISTERS with an amiga-emulator. GREAT! Plug and unplug serveral times didn't help before, had to restart.

EDIT 2: Somehow I'm not able to mount an USB-stick... the stick is recognized by "usb host controller", but not under "connected mass storange", its under "connected usb-devices" only. See the attached screenshots. Anyone successfully mounted an usb-stick? Any help is appreciated. Thanks alot!
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2013-10-31-23-53-00.png
Views:	395
Size:	49.9 KB
ID:	2362897   Click image for larger version

Name:	Screenshot_2013-10-31-23-53-10.png
Views:	380
Size:	75.0 KB
ID:	2362898  
1st November 2013, 11:14 AM |#139  
Member
Thanks Meter: 647
 
More
Quote:
Originally Posted by hoderer

Just what I was waiting for. THANKS ALOT, SlugZero!!!

EDIT: My USB Competition Pro does work after restarting! Played THE GREAT GIANA SISTERS with an amiga-emulator. GREAT! Plug and unplug serveral times didn't help before, had to restart.

EDIT 2: Somehow I'm not able to mount an USB-stick... the stick is recognized by "usb host controller", but not under "connected mass storange", its under "connected usb-devices" only. See the attached screenshots. Anyone successfully mounted an usb-stick? Any help is appreciated. Thanks alot!

You're welcome

I guess your stick is drawing too much power. I did not find many devices that work with only 100mA (which is what the device appears to provide). Most report that they require at least 200mA, but some of them still worked for me.
As a general recommendation, I would try to connect a new device via externally powered USB hub first, to rule out any driver issues. When this works, try to connect it directly to the phone to see if that works, too.

If the device does not work when you connect it with a hub, enter the following in terminal before connecting, then connect your device and see if the output contains some information that is helpful for you. If not, post the last part of your kmsg.txt here
Code:
su
cat /proc/kmsg |tee /sdcard/kmsg.txt
The Following User Says Thank You to SlugZero For This Useful Post: [ View ] Gift SlugZero Ad-Free
1st November 2013, 12:51 PM |#140  
Junior Member
Thanks Meter: 1
 
More
I'm having trouble getting OTG.
Is the zip provided by slugzero a flashable zip or do I have to copy it anywhere? A short and simple step-by-step would help very much
Thanks alot!
1st November 2013, 01:28 PM |#141  
Member
Thanks Meter: 18
 
More
Quote:
Originally Posted by supernilz

I'm having trouble getting OTG.
Is the zip provided by slugzero a flashable zip or do I have to copy it anywhere? A short and simple step-by-step would help very much
Thanks alot!

No worries, it's flashable. Just copy the zip-file to your sd-card, boot into recovery and install the zip-file. I think the kernel-information in setttings "about the phone" won't be updated, so don't be confused about that.
The Following 2 Users Say Thank You to hoderer For This Useful Post: [ View ] Gift hoderer Ad-Free
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