Jump to content


Photo

USB Host on ZTE Blade 3?

- - - - -

  • Please log in to reply
18 replies to this topic

#1
mchalakov

mchalakov

    Newbie

  • Members
  • Pip
  • 6 posts
  • Gender:Male
  • Location:Sofia,Bulgaria
  • Devices:HTC Desire , ZTE Blade 3
Is it possible to enable it?
I already have tried "USB Host Diagnostics" tool on the Play Store but that didn't work.
From the things that I read it has something to do with the kernel supporting it,but I don't know anything about modifying the kernel.

  • 0

#2
KonstaT

KonstaT

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 2,760 posts
  • Gender:Male
  • Location:Finland
  • Devices:Moto G, ZTE Open C
  • Twitter:@konstatuomio
With a quick look it seems that most things needed for USB host/OTG are already enabled in our kernel. It wouldn't be a big surprise if the actual drivers needed some hacking to make it work though. There's of course plenty of necessary changes to framework/vold/ramdisk/etc if you want external devices to be available for Android. Command line access should be possible as is.

Common problem with phones and external USB devices is that phones don't output power from the USB port. You'll need an active USB-hub or an y-cable with a 5V power input. This also means that there really isn't any practical use case scenario for this.

  • 0

#3
mchalakov

mchalakov

    Newbie

  • Members
  • Pip
  • 6 posts
  • Gender:Male
  • Location:Sofia,Bulgaria
  • Devices:HTC Desire , ZTE Blade 3
I need it for connecting my Canon 600D to my phone so I can control it/view pictures on a larger screen.(with DSLR Controler from the Play Store).
And probably for a card reader or a flash memory stick - and all those things do not need an external power source.
Is this to difficult to code and can you do it?

  • 0

#4
KonstaT

KonstaT

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 2,760 posts
  • Gender:Male
  • Location:Finland
  • Devices:Moto G, ZTE Open C
  • Twitter:@konstatuomio
Like said, there already might be all the necessary support for DSLR Controller enabled. It's said to work on even non-rooted stock firmware just as long it's Honeycomb (Android 3.1) or higher. Card readers and flash memory sticks most definitely need outside power source.

Could I do it? Probably. Am I going to do it? No, because I have none of the necessary equipment to test this and no use for this anyway. It's like everything else in open source communities. You want something for yourselves - you better do it yourself. And if you're feeling generous enough you can share it with other people as well. ;)

  • 0

#5
topias231

topias231

    Newbie

  • Members
  • Pip
  • 5 posts
KonstaT would you try to do it if i gave you the needed hardware? i would do it but i only have experience in coding os files on iPhone and... it's completely different thing...

  • 0

#6
KonstaT

KonstaT

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 2,760 posts
  • Gender:Male
  • Location:Finland
  • Devices:Moto G, ZTE Open C
  • Twitter:@konstatuomio

KonstaT would you try to do it if i gave you the needed hardware? i would do it but i only have experience in coding os files on iPhone and... it's completely different thing...

There's always a problem with donated hardware. It might not be able to deliver what you're requesting. That's why I usually refuse. Cables like this cost practically nothing anyway so I might include one in my next buyincoins/dealextreme order.

  • 0

#7
topias231

topias231

    Newbie

  • Members
  • Pip
  • 5 posts
i tried myself and only thing to really do is the s3c usb host driver. at least i think so because my blade 3 notices a usb host cable but complains about the driver. (USB Host Helper)

  • 0

#8
KonstaT

KonstaT

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 2,760 posts
  • Gender:Male
  • Location:Finland
  • Devices:Moto G, ZTE Open C
  • Twitter:@konstatuomio
It seems that s3c driver is something for Exynos devices. You should look into how this is done on Qualcomm devices.

  • 0

#9
topias231

topias231

    Newbie

  • Members
  • Pip
  • 5 posts
ok. thank you :D (they really should add a thanks button like xda :D)

  • 0

#10
KonstaT

KonstaT

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 2,760 posts
  • Gender:Male
  • Location:Finland
  • Devices:Moto G, ZTE Open C
  • Twitter:@konstatuomio
Ok, so I just received some cables. Good news, OTG-cable is recognized by the usb host controller out of the box.
<6>[07-19 07:55:32.613] [5726: kworker/0:1]msm_hsusb_host msm_hsusb_host.0: Qualcomm On-Chip EHCI Host Controller
<6>[07-19 07:55:32.613] [5726: kworker/0:1]msm_hsusb_host msm_hsusb_host.0: new USB bus registered, assigned bus number 1
<6>[07-19 07:55:32.613] [5726: kworker/0:1]msm_hsusb_host msm_hsusb_host.0: irq 47, io base 0xa0800000
<6>[07-19 07:55:32.613] [5726: kworker/0:1]usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
<6>[07-19 07:55:32.613] [5726: kworker/0:1]usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
<6>[07-19 07:55:32.613] [5726: kworker/0:1]usb usb1: Product: Qualcomm On-Chip EHCI Host Controller
<6>[07-19 07:55:32.613] [5726: kworker/0:1]usb usb1: Manufacturer: Linux 3.0.8-CyanogenMod-perf-gf491622 ehci_hcd
<6>[07-19 07:55:32.613] [5726: kworker/0:1]usb usb1: SerialNumber: msm_hsusb_host.0
<6>[07-19 07:55:32.613] [5726: kworker/0:1]hub 1-0:1.0: USB hub found
<6>[07-19 07:55:32.613] [5726: kworker/0:1]hub 1-0:1.0: 1 port detected
Bad news, as expected there is no power output to power plugged devices.
<6>[07-19 07:55:35.096] [5984: kworker/0:0]msm_otg_suspend: usb in low power mode

I guess I have to figure out next what kind of Y-cable is needed (2 male ends, 1 female end?) and where to get one. Or do craftwork myself and cut some cables... :P

  • 0

#11
peetu20

peetu20

    Addict

  • Members
  • PipPipPipPipPip
  • 927 posts
  • Gender:Male
  • Location:Finland
  • Devices:Zte Blade, Zte Blade III

Ok, so I just received some cables. Good news, OTG-cable is recognized by the usb host controller out of the box.

<6>[07-19 07:55:32.613] [5726: kworker/0:1]msm_hsusb_host msm_hsusb_host.0: Qualcomm On-Chip EHCI Host Controller
<6>[07-19 07:55:32.613] [5726: kworker/0:1]msm_hsusb_host msm_hsusb_host.0: new USB bus registered, assigned bus number 1
<6>[07-19 07:55:32.613] [5726: kworker/0:1]msm_hsusb_host msm_hsusb_host.0: irq 47, io base 0xa0800000
<6>[07-19 07:55:32.613] [5726: kworker/0:1]usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
<6>[07-19 07:55:32.613] [5726: kworker/0:1]usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
<6>[07-19 07:55:32.613] [5726: kworker/0:1]usb usb1: Product: Qualcomm On-Chip EHCI Host Controller
<6>[07-19 07:55:32.613] [5726: kworker/0:1]usb usb1: Manufacturer: Linux 3.0.8-CyanogenMod-perf-gf491622 ehci_hcd
<6>[07-19 07:55:32.613] [5726: kworker/0:1]usb usb1: SerialNumber: msm_hsusb_host.0
<6>[07-19 07:55:32.613] [5726: kworker/0:1]hub 1-0:1.0: USB hub found
<6>[07-19 07:55:32.613] [5726: kworker/0:1]hub 1-0:1.0: 1 port detected
Bad news, as expected there is no power output to power plugged devices.
<6>[07-19 07:55:35.096] [5984: kworker/0:0]msm_otg_suspend: usb in low power mode

I guess I have to figure out next what kind of Y-cable is needed (2 male ends, 1 female end?) and where to get one. Or do craftwork myself and cut some cables... :P

Cutting and modding usb-cables is easy. Would be nice to get usb host support :)

Edited by peetu20, 19 July 2013 - 11:26 AM.

  • 0

#12
KonstaT

KonstaT

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 2,760 posts
  • Gender:Male
  • Location:Finland
  • Devices:Moto G, ZTE Open C
  • Twitter:@konstatuomio
USB OTG works out of the box just fine. You just need the right kind of cable (USB OTG Y-cable with 5V power source).

<6>[07-19 18:55:06.917] [4: kworker/0:0]msm_hsusb_host msm_hsusb_host.0: Qualcomm On-Chip EHCI Host Controller
<6>[07-19 18:55:06.917] [4: kworker/0:0]msm_hsusb_host msm_hsusb_host.0: new USB bus registered, assigned bus number 1
<6>[07-19 18:55:06.917] [4: kworker/0:0]msm_hsusb_host msm_hsusb_host.0: irq 47, io base 0xa0800000
<6>[07-19 18:55:06.917] [4: kworker/0:0]usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
<6>[07-19 18:55:06.917] [4: kworker/0:0]usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
<6>[07-19 18:55:06.917] [4: kworker/0:0]usb usb1: Product: Qualcomm On-Chip EHCI Host Controller
<6>[07-19 18:55:06.917] [4: kworker/0:0]usb usb1: Manufacturer: Linux 3.0.8-CyanogenMod-perf-gf491622 ehci_hcd
<6>[07-19 18:55:06.917] [4: kworker/0:0]usb usb1: SerialNumber: msm_hsusb_host.0
<6>[07-19 18:55:06.917] [4: kworker/0:0]hub 1-0:1.0: USB hub found
...
<6>[07-19 18:55:07.237] [12: khubd]usb 1-1: new high speed USB device number 2 using msm_hsusb_host
<6>[07-19 18:55:07.387] [12: khubd]usb 1-1: New USB device found, idVendor=0951, idProduct=1607
<6>[07-19 18:55:07.387] [12: khubd]usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
<6>[07-19 18:55:07.387] [12: khubd]usb 1-1: Product: DataTraveler 2.0
<6>[07-19 18:55:07.387] [12: khubd]usb 1-1: Manufacturer: Kingston
<6>[07-19 18:55:07.387] [12: khubd]usb 1-1: SerialNumber: 5B7A11970009
<6>[07-19 18:55:07.387] [12: khubd]scsi0 : usb-storage 1-1:1.0
<5>[07-19 18:55:08.388] [3042: scsi_scan_0]scsi 0:0:0:0: Direct-Access Kingston DataTraveler 2.0 PMAP PQ: 0 ANSI: 0 CCS
<5>[07-19 18:55:08.388] [3042: scsi_scan_0]sd 0:0:0:0: Attached scsi generic sg0 type 0
<5>[07-19 18:55:11.321] [5: kworker/u:0]sd 0:0:0:0: [sda] 7823360 512-byte logical blocks: (4.00 GB/3.73 GiB)
<5>[07-19 18:55:11.331] [5: kworker/u:0]sd 0:0:0:0: [sda] Write Protect is off
<7>[07-19 18:55:11.331] [5: kworker/u:0]sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00
<3>[07-19 18:55:11.331] [5: kworker/u:0]sd 0:0:0:0: [sda] No Caching mode page present
<3>[07-19 18:55:11.331] [5: kworker/u:0]sd 0:0:0:0: [sda] Assuming drive cache: write through
<3>[07-19 18:55:11.331] [5: kworker/u:0]sd 0:0:0:0: [sda] No Caching mode page present
<3>[07-19 18:55:11.331] [5: kworker/u:0]sd 0:0:0:0: [sda] Assuming drive cache: write through
<6>[07-19 18:55:11.331] [5: kworker/u:0] sda: sda1
<3>[07-19 18:55:11.331] [5: kworker/u:0]sd 0:0:0:0: [sda] No Caching mode page present
<3>[07-19 18:55:11.331] [5: kworker/u:0]sd 0:0:0:0: [sda] Assuming drive cache: write through
<5>[07-19 18:55:11.331] [5: kworker/u:0]sd 0:0:0:0: [sda] Attached SCSI removable disk

You can use 'lsusb' to list plugged usb devices. You still need to manually mount usb storage but I'll look into if vold can auto mount it in CM10/CM10.1.

Mount:
mkdir /sdcard/usb
chmod 777 /sdcard/usb
mount -t vfat /dev/block/sda1 /sdcard/usb

Unmount:
umount /sdcard/usb

Copying files from and to usb storage works fine. I also tested an usb mouse which worked fine. Keyboard is still untested but I can't see any reason why it wouldn't work as well.

  • 0

#13
Something Wierd

Something Wierd

    Enthusiast

  • Members
  • PipPipPip
  • 178 posts
  • Devices:ZTE Blade III
Do I have to do anything to the rom/kernel to make this work or it works just as it is.I'll try to find that kind of cable in the next week or try to make one myself.

  • 0

#14
peetu20

peetu20

    Addict

  • Members
  • PipPipPipPipPip
  • 927 posts
  • Gender:Male
  • Location:Finland
  • Devices:Zte Blade, Zte Blade III

Do I have to do anything to the rom/kernel to make this work or it works just as it is.I'll try to find that kind of cable in the next week or try to make one myself.

As KonstaT says, you need just USB-OTG cable and command line skills.

  • 0

#15
peetu20

peetu20

    Addict

  • Members
  • PipPipPipPipPip
  • 927 posts
  • Gender:Male
  • Location:Finland
  • Devices:Zte Blade, Zte Blade III

Do I have to do anything to the rom/kernel to make this work or it works just as it is.I'll try to find that kind of cable in the next week or try to make one myself.

As KonstaT says, you need just USB-OTG cable and command line skills.

  • 0

#16
peetu20

peetu20

    Addict

  • Members
  • PipPipPipPipPip
  • 927 posts
  • Gender:Male
  • Location:Finland
  • Devices:Zte Blade, Zte Blade III

Do I have to do anything to the rom/kernel to make this work or it works just as it is.I'll try to find that kind of cable in the next week or try to make one myself.

As KonstaT says, you need just USB-OTG cable and command line skills.

  • 0

#17
peetu20

peetu20

    Addict

  • Members
  • PipPipPipPipPip
  • 927 posts
  • Gender:Male
  • Location:Finland
  • Devices:Zte Blade, Zte Blade III

Do I have to do anything to the rom/kernel to make this work or it works just as it is.I'll try to find that kind of cable in the next week or try to make one myself.

As KonstaT says, you need just USB-OTG cable and command line skills.

  • 0

#18
KonstaT

KonstaT

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 2,760 posts
  • Gender:Male
  • Location:Finland
  • Devices:Moto G, ZTE Open C
  • Twitter:@konstatuomio

Do I have to do anything to the rom/kernel to make this work or it works just as it is.I'll try to find that kind of cable in the next week or try to make one myself.

No need to mess with kernels or anything, OTG cable with external power source is the key. This should even work on stock ROMs but I've obviously only tested it with CM10.1. Of course you'll need root access to manually mount usb storage but mouse/keyboard/etc should work even on unrooted stock.

Here's information on what kind of cable you need and how to make one.
http://forum.xda-dev...d.php?t=1828032

Mine came out pretty. :P
Attached File  IMG_20130719_213041.jpg   65.62KB   38 downloads

  • 0

#19
KonstaT

KonstaT

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 2,760 posts
  • Gender:Male
  • Location:Finland
  • Devices:Moto G, ZTE Open C
  • Twitter:@konstatuomio
Vold also seems to play nicely with this. Support for external USB storage coming to CyanogenMod builds. USB storage is automatically mounted when plugged in and can be unmounted/mounted under Settings -> Storage.

Attached File  Screenshot_2013-07-20-12-34-23.png   72.02KB   20 downloads Attached File  Screenshot_2013-07-20-12-35-52.png   59.53KB   20 downloads

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users