hey guys came across an interesting discussion! i cant post in dev boards yet... however, this guy provides some answers, maybe some of the elders may want to take a look. EDIT: i cant even post an outside link read code box i guess...
Code:
Hi All,
I've spent some time today dithering on the Nexus S and host mode and I think the way to approach this is different from the Nexus 1 host driver hack.
The Nexus S uses a Fairchild USB switch (fsa8480) to detect device connections. I believe the point is to allow the device to handle multiple functions like charging, UART and USB access simultaneously.
The Switch will detect OTG connections. Plugging in a microB to A convertor with pin 4 grounded to 5 causes the fas9480 driver to wake up and report an OTG attachment. It also calls into the S3C_UDC_OTG driver to configure it up and create a vbus session. (start charging)
The problem is that in the Nexus S kernel, this driver is device mode only. There is no code to put it into Host mode and the chip can only be in Host or device mode. It can't do both at the same time. Also, the few people that have tried to use host drivers have found that they must disable the device code (including charging capability) to get the hubs to enumerate.
It appears that the OTG core in the samsung part is from DesignWare. There are synopsis reference drivers up here:
*************check edit reason for driver link*****************
The register map appears the same, and the code supports host and device mode as well as dynamic switching based on HNP negotiation.
It seems like the best way to approach this would be to integrate this code and use the fsa9480 discovery as the hook to force host mode (when OTG is detected) or device mode when other devices are detected.
The demo we were under the gun to support will probably just use Nexus one, however I thought the rest of you guys would want to see this. I think if done right, you could have host mode, gadget mode and charging all in the same kernel.
Steve
--
Steve Modica
CTO - Small Tree Communications
---not my words, or even me. just though people may want to know!
Related
Hi!
I want to use my G1 to do some special measurements. For this purpose I've created a microcontroller board (Atmel ATmega8) that does that. Now I want to transfer the data the board collected to the Android phone.
Because of the high powerconsumption the G1 has while Bluetooth is on this isn't a real alternative for me - the measurements will last about 2 - 3 hours.
I'm not experienced concerning hardware access within Linux and Android but thought there might be a possibility to gain a kind of low level access to the USB port. I do neither need high bandwith nor real USB functionality - so might it be possible to create an own kind of bus using that interface? Do you have any other idea?
Thank you in advance!
If you use micro linux system, the ones that are like a usb port, a network jack and a vga connecter, you could script some adb commands and have it run every few seconds to upload the data, not an ideal solution. As far as I know the g1 doesn't support host mode. But if you have a micro linux computer in the middle, it could work.
Something like this
http://www.pcpro.co.uk/blogs/2008/08/27/a-real-space-oddity-arrives-at-pc-pro/
I'm sure there are other ways to do it, maybe check there how to make a serial port thread a few pages back in the dev section.
Not sure if this is the right forum or has been asked before but can we
port this option to our USB menu from the Vibrant?
tommi_han said:
Not sure if this is the right forum or has been asked before but can we
port this option to our USB menu from the Vibrant?
Click to expand...
Click to collapse
lol HUH links to what you want are more than helpful....
tommi_han said:
Not sure if this is the right forum or has been asked before but can we port this option to our USB menu from the Vibrant?
Click to expand...
Click to collapse
I'm not exactly sure what Kies is, but as I gather it lets you sync media to the phone and also use the phone as-a-modem to tether.
Anyways, in the kernel USB gadget driver, "KIES" mode is defined as exposing the CDC ACM UART (presumably for tethering), and the Android Media Transfer Protocol (presumably for media syncing). Unfortunately there's two problems with the current Epic USB driver.
First, all MTP modes (KIES, MTPONLY) are functionally disabled by having their USB configurations redefined to mass-storage only mode.
Second, there's a bug in the USB gadget driver that prevents the userland mode switching hooks in /sys from actually working. Amusingly enough, when "USB Debugging" is disabled, the Epic is always in KIES mode, but since this is redefined to provide mass-storage support only, it doens't matter.
Both of these can be fixed in the kernel USB driver and by rebuilding the kernel. However, because the MTP modes are explicitly disabled, and the code pathways used by the USB selection menu on the international version/vibrant aren't used at all on the Epic, makes me worried that this would introduce other bugs. For example, it might simply be the case that userland support (if necessary?) simply isn't present on the Epic.
In any event, it's pretty clear that the sad shape of the USB gadget driver is due to the simultaneous development of the Galaxy S devices with bug fixes not making it across all kernel trees and the presence of different hardware (e.g., WiMAX radio on the Epic) necessitating kludges to make it work.
Unless someone else feels ambitious enough to work on it, probably the simplest thing to do is to wait for the Froyo kernel to come out and see if the driver code for the Galaxy S devices has been unified a bit more. In which case, hopefully "KIES" mode will work as-advertised on the stock kernel, or if not, it would work with a trivial kernel config change.
I was under the impression that Kies was disabled intentionally, as it is also a firmware updater that can easily load unofficial operating systems to the Epic. Can't remember where I read it though.
mattallica76 said:
I was under the impression that Kies was disabled intentionally, as it is also a firmware updater that can easily load unofficial operating systems to the Epic. Can't remember where I read it though.
Click to expand...
Click to collapse
It's definitely the case that it's intentionally disabled, didn't know that's the reason why though.
Odin is still available though. I guess the difference is that Kies is a tool intended to be used by end users.
It's part of twiz 3, which we don't have thanks to the keyboard
Sent from my SPH-D700 using XDA App
Just curious if anybody has thought of or thinks it would be possible to get the linux usb monitor drivers compiled into the kernel and attach a usb monitor since we have a free usb port.
I don't know how current this is, but a quick search brings up this as (at some point) home to the open source usb display drivers..
http://libdlo.freedesktop.org/wiki/
Though for all I know, current kernel sources may have this already all integrated and just need to be flipped on in the config for the kernel compilation. If anybody has a usb monitor I'd be curious to hear your results, if this works I might buy one and make my own "dock" from a usb hub for mouse/keyboard/display
I don't know enough about androids display technology, do you think even if the kernel recognized and supported the device that android could be coerced through configuration to display on it?
04/11/2014 - 01:41AM - Central Time
USB OTG does work on the Motorola Atrix 2.
I post this because there are no defining topics listing all the requirements and caveats of making this work currently as of the date. Just alot of help topics to sift through. I got a little obsessive in my search to make this work so this is pretty much a knowledge dump.
Started from original help threads here on the forums (various many... lots), figured things out from there through conversations with Chainfire. Ultimitely fixed with lots of research and use of his USB Host Diagnostics App.
Requirements:
Motorola Atrix 2 Stock 4.0.4 - Rooted [stock kernel as well]
(what drove me insane on this was that in USB HOST Diagnostics App it showed kernel support, and API support up to Device detected)
USB OTG Y cable, usb 2.0 (I was concerned about this in the beginning however mine appears to be usb 2.0, got it off amazon.)
(Through research it concerned me that a usb 3.0 would not work. Have not tested this)
USB Drive, usb 2.0
- Tested with a Sandisk Cruzer Micro 1gb
(I assume others will work although there have been some help topics mentioning problems with certain usb drives)
[NOTE]
Must be formatted fat32 - I have noticed a few threads I researched mentioning exfat is not supported for certain devices
(have not confirmed as of post date if exfat is supported for Atrix 2 Stock)
[NEEDED] For USB Host AutoMount
Usb 2.0 Hub (I have an old one i cut apart originally. Dont remember the make, and I lost the housing for it, but hey it works)
---------------
USB Host Diagnostics App by Chainfire
(v1.3 as of post date)
Get it at Play Store [link]
Click to expand...
Click to collapse
Instructions (i.e. my exact process)
I came from testing a multitude of custom roms. None of them worked. I have a help thread on it here. Unconfirmed if any of them work at all I had no success. If you are wondering the post thread is here.
- Flash to stock ICS 4.0.4 (if you are not already)
- Root the Atrix 2
Not sure if the relevant (but this is the exact process I took)
-Install BMM
-Installed Busybox (1.22.1)
-Installed USB Host Diagnostics App
(get your host cable and usb drive ready)
-Ran the app
(Follow the instructions it will ask you at the end if you wish to attempt to fix the issue)
- Say yes to try to fix it.
- Follow instructions (go for a reboot)
- Open up usb diagnostics app.
- Run again to confirm
Congrats!
Click to expand...
Click to collapse
This will not make it automount.
- You do not need a separate program to do this.
Grab your USB hub, plug the USB Drive into the hub and plug it in. To my surprise it automounted.
Chainfire had mentioned checking out a certain file when I was trying to find custom roms that would work. The file was there but they did not work. I gather that file was added by his program and made it work on stock ICS 4.0.4.
There are alot of other threads for other devices. Samsung requires shorting the last 2 pins on the USB connection. This is not needed for Motorola, but keep this in mind if you are randomly searching for USB OTG answers.
---------------
Thanks: Chainfire
Couldn't have figured this out without his help. I highly recommend his apps, he definitely has a deep knowledge of the android system.
Hopefully that should clear things up a bit for anyone searching for the Atrix 2 USB OTG help. I'm moving on to hopefully port from ICS USB OTG host features to a custom rom like Cyanogen. Ill update a link if I come up with anything.
Hello, maybe someone can guide me for final results and find solution. My plans was watch Tv on lapdock 500pro, after i find dvb-t reciever for android. the model was ]CSL - mini DVB-T Stick (from amazon)
requriments of device informs that phone needs android 4.0 or high, dual core cpu (neon support) and usb otg
i have atrix2 mb865 with stock 4.0.4 +root and text inside /proc/cpuinfo returns - "Features: swp half thumb fatmult vfp edsp neon vfpv3"
last one what i need must be usb otg support, so after i get device i connect it direct to microusb and run installed Air Dtv app, it returns "Device not found" then i find this topic and install Busybox and USB Host Diagnostics and run app. I rush to make it quickly so when start diagnostics app asks me connect usb device but i have no any usb device and otg cable also. so i just plug charge cable in lapdock`s usb and connect it to phone, app little think then ask me to Fix usb otg support and after ask to reboot system. After reboot i try again connect directly that device but app again returns "Device not found" - then i check topic again and start to build otg cable.
After cable was complete i check it by connecting to external power (wall adaptor) then i have results.I run USB Host Diagnostics, start test connect device by otg cable, and app returns me (see pic)
Also, when i connect device by otg cable now system popup "By which programm you want use device" and give choice to Air Dtv or Idtv Mobile, 2 apps. But Air Dtv returns me "Device initialisation failed, unplug device and connect after few seconds" another app cant find device also. (see pic)
Also i install Usb Device info app, and able to see connected device info, system shows me that stick is connected to phone. (see pic)
Also i able to mount usb stick to phone by otg cable with external power, and can view files in it. Means i suggest that otg cable and otg in system works
My final point was view Tv on lapdock but at this step i cant run it on phone, Air Dtv also returns me "device not found" when i try to connect it to lapdock by microusb female - usb male extension (included in package of Tv stick)
Also that device works on pc, i install windows software and check it. Mean stick works and shows tv channels. can be for sure that device works
Hope for your help and support!
That solves my problem sort of, I'm going to try to install NUMA and see what results I get. Ill update my post once I'm done
Hello.
I have a machine with a USB host and a USB accessory port.
I have successfully got an Android tablet to talk to the machine, using an OTG cable which puts the tablet into Host Mode (using the machine accessory port).
This has a couple of problems, one of which is charging while in host mode.
I am now trying to keep the tablet in accessory mode, and connect to the host port on the machine.
My research suggests that Android has no support for running as the accessory.
The ADK sample code clearly seems to intended to run on a host (as it enumerates accessories).
I know the tablet supports an accessory mode because when I plug it into a PC, it mounts as camera or storage.
I can understand why they would not expect a keyboard or hub to be running Android, but there do seem to be some legitimate use cases.
Can anyone confirm my understanding, that there is no way to run Android as the accessory ?
Thanks.
I have since found the Android Open Accessory Protocol. Using information from ver 1 and 2 of the protocol, I found enough info to switch the android device into the special android-accessory mode. Note that on Linux, you may need to change the adb program so it is owned by root if you want to run the debugger over the new connection.