Jump to content


Photo

External USB Devices

- - - - -

  • Please log in to reply
40 replies to this topic

#1
forforum

forforum

    Newbie

  • Members
  • Pip
  • 43 posts
  • Devices:Desire HD, ZTE V9, Huawei S7
I have started an attempt to connect external USB devices to the V9 and had some success. There are still some issues and I hope someone with more Android/Linux experience can help to resolve them.

The story so far is
  • I recompiled the kernel (pulled from Kallt_Kaffe's github) with USB host/OTG support, flashed on the V9 with no problems
  • It will not work with non-powered USB devices, looks like the V9 is not supplying power to the micro USB port
  • If I plugged a powered device in after booting, the V9 reboots
  • I need to connect a powered USB hub (I guess any powered USB devices will do) and restart the V9 for it to use any of the devices plugged into the hub. So far USB flash stick, USB hard disk mouse, and keyboard worked.
  • I used the Q5_USB_Memory_Manager.apk to mount USB disks. It works with FAT32 drives. To mount NTFS drive, i need to mount it in terminal (and I can use an USB keyborad to type) because the umask wasn't set correctly by the app.
  • I also have the Huawei S7 (a similar grade device), Other than the NTFS mounting issue, it does not have the other problems.
Any help or suggestions will be much appreciated.

Edit: Now, I can use a powered device without re-starting the tab. All I have to do is to plug the hub in first and then supply power to the hub. Main hurdle now is how to get the V9 to supply power to the USB devices.

Edited by forforum, 31 July 2011 - 08:50 AM.

  • 2

#2
solidtudor

solidtudor

    Newbie

  • Members
  • Pip
  • 2 posts
Nice to hear. I really want to test this out
So.. are you going to post the modified files?

Edited by solidtudor, 25 July 2011 - 12:01 PM.

  • 0

#3
forforum

forforum

    Newbie

  • Members
  • Pip
  • 43 posts
  • Devices:Desire HD, ZTE V9, Huawei S7

Nice to hear. I really want to test this out
So.. are you going to post the modified files?


I was trying to sort out the power issue first. I still have intermittent reboot problem when plugging power into the USB hub. You are welcome to try, but, I am not responsible for any problem this kernel may cause. To be safe, i would recommend you to plug the USB hub with power prior to power on the tab. Of course, you will need an OTG cable to connect the USB hub to the tab.

The kernel is based on Kallt_Kaffe's kernel source as at 17/7/2011, therefore, you must have his CM7 20110711 or later installed for this to work. You should have clock work recovery (4.0.0.8 or later) installed and KK's latest kernel on your SD card, in case you need to load KK's original kernel. Thanks to KK for his work and his help when I started on this.

The kernel install file is here.

You can find Q5 USB Memory Manger here.

To use the mouse
left click - press the screen
right click - back button
middle click - menu button
scroll wheel - up/down button

Enjoy!

Edited by forforum, 25 July 2011 - 12:34 PM.

  • 0

#4
solidtudor

solidtudor

    Newbie

  • Members
  • Pip
  • 2 posts

I was trying to sort out the power issue first. I still have intermittent reboot problem when plugging power into the USB hub. You are welcome to try, but, I am not responsible for any problem this kernel may cause. To be safe, i would recommend you to plug the USB hub with power prior to power on the tab. Of course, you will need an OTG cable to connect the USB hub to the tab.

The kernel is based on Kallt_Kaffe's kernel source as at 17/7/2011, therefore, you must have his CM7 20110711 or later installed for this to work. You should have clock work recovery (4.0.0.8 or later) installed and KK's latest kernel on your SD card, in case you need to load KK's original kernel. Thanks to KK for his work and his help when I started on this.

The kernel install file is here.

You can find Q5 USB Memory Manger here.

To use the mouse
left click - press the screen
right click - back button
middle click - menu button
scroll wheel - up/down button

Enjoy!


Thanks foforum! I installed the modified kernel files without any problem. As you said, the device reboots when plugging power into the USB hub..
I will try my USB mouse and USB memory when I get time to do that, thanks again foforum I've been waiting long time for thisPosted Image

  • 0

#5
larsanders

larsanders

    Newbie

  • Members
  • Pip
  • 1 posts
  • Devices:ZTE Light, X8
Thanks for working on this. I just bought a battery powered USB hub (http://www.dealextre...-port-hub-13526 and an external battery) in addition to a host cable (http://cgi.ebay.com/...=item1e64fd9df5) in case you don't get power-out working.

  • 0

#6
kallt_kaffe

kallt_kaffe

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 1,185 posts
  • Gender:Male
  • Devices:Nexus 4 + 10 + Asus Fonepad

I have started an attempt to connect external USB devices to the V9 and had some success. There are still some issues and I hope someone with more Android/Linux experience can help to resolve them

I've now bought two different OTG adapters and a powered USB hub and I will start experiment with USB host mode when time allows.

Would you mind sharing the source files on what you've done so far?
EDIT: Nevermind. Just realized our source has what is needed allready and borrowed the config from your kernel... Looking good so far. :)

  • 0
Blog - App

#7
kallt_kaffe

kallt_kaffe

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 1,185 posts
  • Gender:Male
  • Devices:Nexus 4 + 10 + Asus Fonepad

Edit: Now, I can use a powered device without re-starting the tab. All I have to do is to plug the hub in first and then supply power to the hub. Main hurdle now is how to get the V9 to supply power to the USB devices.

I used your config on the latest kernel source and it works without reboots for me. There was an usb rebooting issue on the ZTE Blade that Tom solved by removed some cdrom emulation code and I added those change to the kernel repo 2011-07-15. It's possible that those changes fixed this issue.

  • 0
Blog - App

#8
forforum

forforum

    Newbie

  • Members
  • Pip
  • 43 posts
  • Devices:Desire HD, ZTE V9, Huawei S7

I used your config on the latest kernel source and it works without reboots for me. There was an usb rebooting issue on the ZTE Blade that Tom solved by removed some cdrom emulation code and I added those change to the kernel repo 2011-07-15. It's possible that those changes fixed this issue.


You are right, the v9 kernel has built in otg support. The config file I used basically is borrowed from the Huawei S7. You may also noticed that I leave most of the driver in the kernel rather than compile them as modules, this was just for quick upload of the kernel for testing. At 4MB, it is a bit big.

I've been comparing the otg driver (msm72kotg.c) sources between the V9, the Blade and Huawei S7 to try to work out how the various bits work. My kernel hacking skill is very basic at best. So far, the changes I made did not make improve the situation a lot. The blade otg driver also works with the v9, no rebooting problem, but, you lost the USB peripheral mode. I haven't try your 2011-7-15 kernel, so not too sure whether it has the same issue. Hope you can work it out.

  • 0

#9
kallt_kaffe

kallt_kaffe

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 1,185 posts
  • Gender:Male
  • Devices:Nexus 4 + 10 + Asus Fonepad
I've only tested (and only added support for) usb hid and storage support and seems to work fine. The keyboard layout is US (or perhaps GB) but other than that it works as it should. I also tested to mount an USB flash drive.

Sometimes the tablet freezes when I insert the USB HUB or a device to the HUB but disconnecting and reconnecting usually helps. No reboots so far. The batterymeter got pretty much badword up once and claimed it only had 1% battery left (which wasn't true) and not even a restart resolved it so I was a bit worried that I had fried something but removing the battery and then booting into clockwork to wipe batterystats seems to have resolved it.

Any suggested uses for this other than storage and mouse/keyboard? What are you using on your tablets?

  • 0
Blog - App

#10
forforum

forforum

    Newbie

  • Members
  • Pip
  • 43 posts
  • Devices:Desire HD, ZTE V9, Huawei S7

Sometimes the tablet freezes when I insert the USB HUB or a device to the HUB but disconnecting and reconnecting usually helps. No reboots so far. The batterymeter got pretty much badword up once and claimed it only had 1% battery left (which wasn't true) and not even a restart resolved it so I was a bit worried that I had fried something but removing the battery and then booting into clockwork to wipe batterystats seems to have resolved it.


I do not have battery issues. Actually, the powered hub charges the V9! I read that some powered hub does not pass power back to the host, may be that's why you did not have the rebooting issue. Can you check whether yours does? When I get a chance, I may disable the power from the USB A cable to see if I can duplicate your results. Also, do you have the peripheral mode back once you unplug the OTG cable?

Any suggested uses for this other than storage and mouse/keyboard? What are you using on your tablets?


As you know, the sound output of the V9 leaves a lot to be desired, the other thing I was trying to get working is USB sound. I have a Creative USB sound card, it half worked. The control knob on the sound card controls the volume of the V9, but, sound still comes out of the 3.5mm jack. May be the standard class 1 sound driver is not compatible or may be it is not possible. I've been busy lately with work and haven't look at it again.

The V9 is essentially a toy, to learn more about Android. Does get a bit of use when I am out and about or lying in bed, GPS, RDP, email, video, web browsing etc.

Edit: Un-soldered the power from the USB A side of the hub, and the V9 is not restarting when plugging and unpluging t he hub. But, the V9 won't be charged anymore! May be it is better to have the charging facility?

Edited by forforum, 16 August 2011 - 11:13 PM.

  • 0

#11
kallt_kaffe

kallt_kaffe

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 1,185 posts
  • Gender:Male
  • Devices:Nexus 4 + 10 + Asus Fonepad

I do not have battery issues. Actually, the powered hub charges the V9! I read that some powered hub does not pass power back to the host, may be that's why you did not have the rebooting issue. Can you check whether yours does? When I get a chance, I may disable the power from the USB A cable to see if I can duplicate your results. Also, do you have the peripheral mode back once you unplug the OTG cable?

Yes, my HUB does not power the tablet. Found a USB harddisk cable with an extra USB connect (for extra power) that I was able to use to get it to charge the tablet and with this I get reboots on connect too.

And yes, when I unplug the cable it switches back to peripheral mode automaticly.

As you know, the sound output of the V9 leaves a lot to be desired, the other thing I was trying to get working is USB sound. I have a Creative USB sound card, it half worked. The control knob on the sound card controls the volume of the V9, but, sound still comes out of the 3.5mm jack. May be the standard class 1 sound driver is not compatible or may be it is not possible. I've been busy lately with work and haven't look at it again.

The control knob propably uses USB HID but I doubt Android supports USB Audio out-of-the-box. That would propably need some tweaking in the audio libs.

But yes, the internal speakers are painfully bad. I bought a Creative D80 (BT speaker) and while the D80 likely isn't the best BT speaker it sure beats using the internal sound.

EDIT: I've managed to get USB disks to automount by looking at how it is setup for the Nook Color and the Advent Vega in CM7. Only tried with FAT32 so far. Going to compile a flash disk with NTFS and try that too.

  • 0
Blog - App

#12
forforum

forforum

    Newbie

  • Members
  • Pip
  • 43 posts
  • Devices:Desire HD, ZTE V9, Huawei S7

Yes, my HUB does not power the tablet. Found a USB harddisk cable with an extra USB connect (for extra power) that I was able to use to get it to charge the tablet and with this I get reboots on connect too.

May be you can replace the msm72k_otg.c with the one from blade, it stops the reboot, but, I seemed to have lost peripheral mode. In the V9 driver, it handles the connection differently to the blade and those mods were done only late last year. May be you can look at the few routines at the end of the driver source to see if you can tweak it.

EDIT: I've managed to get USB disks to automount by looking at how it is setup for the Nook Color and the Advent Vega in CM7. Only tried with FAT32 so far. Going to compile a flash disk with NTFS and try that too.

When you mount ntfs, make sure you use the -o umask=000 option, otherwise, you can only see the files in terminal with su. File explorers won't see the disk without that option.

  • 0

#13
kallt_kaffe

kallt_kaffe

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 1,185 posts
  • Gender:Male
  • Devices:Nexus 4 + 10 + Asus Fonepad
Here's what I'm using right now: http://www.mediafire...cmy93ncr4no9fso

This is a complete CM7 install as it has changes also to vold.fstab, init.v9.rc and build.prop.

USB disks (FAT) are automaticly mounted to /mnt/usbdisk. They can also be safely unmounted in Settings->Storage.

USB-storage and HID support are compiled into the kernel. NTFS is also supported by the kernel but not by vold.

EDIT: Attached a vold where I've added support for automounting NTFS. Just replace /system/bin/vold with the new version.

Attached Files

  • Attached File  vold.zip   27.68KB   33 downloads

  • 0
Blog - App

#14
kallt_kaffe

kallt_kaffe

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 1,185 posts
  • Gender:Male
  • Devices:Nexus 4 + 10 + Asus Fonepad
New version using the new vold (se above) and also codepage i kernel has been changed to UTF8 (fixes swedish character problems with both NTFS and also CIFS mounts for me, not sure if it messes up something else for others?)

http://www.mediafire...4v7mcdgjb5bfqy7

  • 0
Blog - App

#15
forforum

forforum

    Newbie

  • Members
  • Pip
  • 43 posts
  • Devices:Desire HD, ZTE V9, Huawei S7

New version using the new vold (se above) and also codepage i kernel has been changed to UTF8 (fixes swedish character problems with both NTFS and also CIFS mounts for me, not sure if it messes up something else for others?)

http://www.mediafire...4v7mcdgjb5bfqy7


Fantastic, will give it a try tonight..

BTW, is this kernel still having the reboot problem when plugging in a powered hub?

  • 0

#16
kallt_kaffe

kallt_kaffe

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 1,185 posts
  • Gender:Male
  • Devices:Nexus 4 + 10 + Asus Fonepad

BTW, is this kernel still having the reboot problem when plugging in a powered hub?

Yes it still does that, haven't changed anything except the kernel config so far. It also seems to freeze when recovering from suspend. A workaround is to go into the development settings and check "always on" to make sure it doesn't go into sleep while recieving power.

Btw, your Huawei S7, does it provide power through the USB-port. In other words, can it use USB devices directly without using a self-powered HUB?

  • 0
Blog - App

#17
forforum

forforum

    Newbie

  • Members
  • Pip
  • 43 posts
  • Devices:Desire HD, ZTE V9, Huawei S7

Yes it still does that, haven't changed anything except the kernel config so far. It also seems to freeze when recovering from suspend. A workaround is to go into the development settings and check "always on" to make sure it doesn't go into sleep while recieving power.

Btw, your Huawei S7, does it provide power through the USB-port. In other words, can it use USB devices directly without using a self-powered HUB?


I noticed that too, if you have devices connected, it freezes everynow and then if the device goes to sleep. Please try the ZTE Blade msm72k_otg.c from here. It fixes reboot and freeze problems for me, but as I said before, I lost peripherals mode completely. Here is the compiled kernel based on your latest kernel soruce I always make sure I have your standard kernel on my SD card to recover from.

The Huawei S7 supplies enough power to drive keyboard, mouse and USB sticks. USB hard disks need to be powered. I think the OTG spec says power out should be between 8MA and 100MA. The difference between the Huawei S7 and the ZTE V9 is that the S7 has a dedicated charge port (a 2.5mm jack), therefore it can safely supply power to micro USB port when host mode is enabled. At the moment, my S7 is mounted in my car, I can play media easily by plugging in a FAT formatted USB stick.

  • 0

#18
kallt_kaffe

kallt_kaffe

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 1,185 posts
  • Gender:Male
  • Devices:Nexus 4 + 10 + Asus Fonepad
The freezing after suspend is propably the biggest show-stopper right now. I'll do some source comparing to see what I can find. One solution could be to add a wakelock when it switches to OTG mode to prevent it from going to sleep when host mode is active.

I've posted the NTFS vold patch up for review here: http://review.cyanog...om/#change,7457

  • 0
Blog - App

#19
sane?

sane?

    Regular

  • Members
  • PipPip
  • 110 posts
  • Gender:Male
  • Devices:LG Optimus 2X, Pulse, ZTE v9

But yes, the internal speakers are painfully bad. I bought a Creative D80 (BT speaker) and while the D80 likely isn't the best BT speaker it sure beats using the internal sound.

Just a quick note for the those in Australia (where most MyTab owners will be). Aldi will be doing the Creative Bluetooth Speaker (D100 I think) for $49.99 next Thursday. Seems like a good price in comparison with other Oz prices for the unit.

http://www.aldi.com..../2827_18836.htm

I now return you to your regularly scheduled ROM hacking discussions...

  • 0

#20
kallt_kaffe

kallt_kaffe

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 1,185 posts
  • Gender:Male
  • Devices:Nexus 4 + 10 + Asus Fonepad

I noticed that too, if you have devices connected, it freezes everynow and then if the device goes to sleep. Please try the ZTE Blade msm72k_otg.c from here.

Reboot problem seems to be fixed (mostly) by using that version, however the suspend problem remained but I added a wake lock to prevent suspend when in host mode and it seems to do the trick.

I did not lose peripheral mode using the older msms72k_otg.c. It still happily accepts adb and usb mounting through normal USB connection if I switch cables.

I'll compile a new, complete, cm7 with the new changes for you to try.

  • 0
Blog - App




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users