Active Topics

 


Reply
Thread Tools
Posts: 179 | Thanked: 90 times | Joined on Dec 2007
#1
Hello All,
I've heard of a few people running into USB host mode issues on the n810, and have run into it myself...
Basically, when using sysfs to change to host mode via-
'echo host>/sys/devices/platform/musb_hdrc/mode'
The command only works if I'm currently plugged into a PC as a client. If I'm not plugged in, status is stuck at 'b_idle'. If I'm plugged into the PC, then I'm at a_wait_vrise' and the peripheral works correctly when plugged in.
I've heard of a bunch of people getting stuck in 'b_idle'. When it happened to me, I was excited to find a fix. But it seems like a kernel bug. doing the 'echo...' command does disable peripheral mode but does not enable host mode.
Worse yet, I must be plugged in but not as a peripheral. So If I plug the n810 into the computer and it mounts the drives, I'm screwed. I have to-
1. switch to host mode.
2. plug into a computer (host)
3. switch to host mode (again)
4. Unplug the n810 from PC and plug into peripheral...

As I said, to me it looks like a kernel bug, either with the usb-otg driver or with sysfs. I'm just looking for someone else who's having this issue before I file a bug report.

So if you gave up on usb host mode because it wouldn't work, try 1->4 above, and post back...

cheers,
kernelpanic

p.s.- I have already reflashed (50.2 and 51.3), have run a stock kernel and the one from fanoush'es site and have done various backflips trying to get this reliable. Just to eliminate some possibilities. I'm just wondering if I'm the only one who's seeing this ;-)
 
Posts: 74 | Thanked: 5 times | Joined on Dec 2005 @ San Jose
#2
I haven't gone into as much depth as you. But I did install the usb-otg package and I've been having issues with getting it to recognize a usb keyboard, and a thumb drive. I'll reboot 3-4 times and sometimes it works, and sometimes it doesn't. I thought maybe it was just part of it being flaky and new software. I've no idea where to poke around at. But hey, this makes two of us! Maybe someone else can figure it out. I'm also using it on a N810 as well.
 
Posts: 179 | Thanked: 90 times | Joined on Dec 2007
#3
Originally Posted by ElGatoFlojo View Post
I'll reboot 3-4 times and sometimes it works, and sometimes it doesn't. I thought maybe it was just part of it being flaky and new software. I've no idea where to poke around at.
Try, using usbcontrol with the n810 plugged into the computer. (Don't forget to use the 'Safely Remove Hardware' tray icon to unmount the drive before switching to host mode.) If the status goes to 'a_wait_vrise' while plugged in but stays at 'b_idle' You're experiencing the same thing as I am.

Weird thing is, it used to work for me. But I'd swear when it did work, it went to 'a_idle'?!

I really think is a bug in the kernel usb driver. The only reason I didn't post this in the os2008 forum is I've only heard of n810 users having this problem...

cheers,
kernelpanic
 
Posts: 157 | Thanked: 96 times | Joined on Nov 2007 @ Oxford, UK
#4
Originally Posted by kernelpanic View Post
So if you gave up on usb host mode because it wouldn't work, try 1->4 above, and post back...
Exactly as you describe. Just setting USB to host mode had no effect for me; following your instructions and it works.

Thanks

Edit: Mind you, while I was writing this I had left it opening a pdf file off a flash drive but it just rebooted. Oh well.

Last edited by Duncan; 2008-03-14 at 18:37.
 
Posts: 345 | Thanked: 467 times | Joined on Nov 2007 @ Germany
#5
Originally Posted by kernelpanic View Post
Try, using usbcontrol with the n810 plugged into the computer.
ARGHHH, DON'T DO THAT!!!

If you switch your tablet into host mode while it's being connected to another host (e.g. your PC) you'll connect both USB ports power supplys! This may very well damage your tablets USB port. Just think a minute about the fact that both devices are e.g. able to power a USB memory stick if in host mode. This means both provide power to the USB. And you are connecting two of them them!

There's a reason why the USB guys invented all those different connectors: Some things should not be directly connected. By using tools like usb-control you can circumvent these protections and connect things using operation modes that aren't meant to be used that way.

That's also the reason why i hate these Micro-USB-A-to-standard-A cables. They don't make sense and can also be used to connect both machines in host mode. These cables just shouldn't exist ...

Please be careful with these tools since as you can do things that aren't meant to be done.

MoG
 
Posts: 179 | Thanked: 90 times | Joined on Dec 2007
#6
Originally Posted by Master of Gizmo View Post
ARGHHH, DON'T DO THAT!!!

If you switch your tablet into host mode while it's being connected to another host (e.g. your PC) you'll connect both USB ports power supplys! This may very well damage your tablets USB port. Just think a minute about the fact that both devices are e.g. able to power a USB memory stick if in host mode. This means both provide power to the USB. And you are connecting two of them them!

MoG
MoG-
Common sense would say you're right.

But, actually OTG hardware is designed for both devices to provide voltage to Vbus at the same time. In fact, it's necessary. USB OTG controllers send the HNP and SRP signals (to switch mode on the fly) over the Vbus wire. The signal is recovered on the device by comparing the different Vbus voltages.

No OTG compliant device should be damaged by being plugged into a powered line, host mode or not. It should simply not power the line until it's unplugged.

[disclaimer- Whether the n810 is fully OTG compliant in this regard I don't know. caveat emptor..]

cheers,
kernelpanic
 
Posts: 179 | Thanked: 90 times | Joined on Dec 2007
#7
Hello All,

I looked at the driver code and recompiled the kernel a few times...

I was able to get the driver to behave by forcing a vbus interrupt at the end of the mode change function. (Apparently the id change interrupt isn't totally doing it's job?)

Since only one other person has posted to this thread with this problem, I may wait on a bug report. I'm loathe to file a bug report if it's a bad silicon on my n810 or some such thing causing it...

I'm just happy one line of code in my kernel fixed it for me...

Cheers,
kernelpanic
 
Posts: 179 | Thanked: 90 times | Joined on Dec 2007
#8
Hello All,

Final fix was 2 lines to stop and start USB (to reinitialize) when changing roles. The ID pullup was getting stuck on somehow?!

Now it works perfectly.

I'm going to submit a bug report here in the next day or two...

I have a patched kernel if anyone wants it...

Cheers,
kernelpanic
 

The Following User Says Thank You to kernelpanic For This Useful Post:
Posts: 18 | Thanked: 0 times | Joined on Dec 2007
#9
Im having exactly the same problem. If I flip it to USB-HOST while connected to a pc, it will work until I change it back to OTG (Or Peripheral, depending on the tool). Then, if I change it back to HOST mode, it does not work. In any other case, it fails to do anything and stays in b_idle.

So, if you have that patch (and possibly how to install it, as I fail at Linux in general), itd be great.

Thanks,
Borgel
 
Posts: 179 | Thanked: 90 times | Joined on Dec 2007
#10
Originally Posted by Borgel View Post
Im having exactly the same problem. If I flip it to USB-HOST while connected to a pc, it will work until I change it back to OTG (Or Peripheral, depending on the tool). Then, if I change it back to HOST mode, it does not work. In any other case, it fails to do anything and stays in b_idle.

So, if you have that patch (and possibly how to install it, as I fail at Linux in general), itd be great.

Thanks,
Borgel
The image is too large to attach to this post, but I'd be happy to email it to you. Just PM me your email address. As for how to install, you'll need to either have access to a linux computer to use the linux kernel flasher, or use fanoushes onboard kernel flasher.
The linux flasher is explained in detail here But you basically-
1. From a linux PC, download and extract the flasher and the kernel image into the same directory.
2. Open a terminal as root and do-
# flasher-3.0 -f -k zImage
3. Turn off your tablet, unplug it from the charger, plug it in to USB and turn it on while holding the 'home' key.
4. boot the tablet...

If you don't run linux, Fanoushes flasher can flash the kernel from the tablet itself It's available here. You'll basically-
1. download the flasher and extract to your home directory(/home/user). Don't try to run it from a memory card as they are formatted fat32, so programs can't run from them.
2. put the zImage into the same directory.
3. Open an xterm and get a root prompt, either by using sudo gainroot or SSH. Then do-

# ./kernel_flasher zImage

and reboot the tablet.

Also, once you've got it fixed please visit bugs.maemo.org and vote for bug #3026 so we can get this patch upstream...

hope this helps,
kernelpanic

p.s.- If you're not a 'linux person' some of this may sound cryptic as I've glossed over things like extracting archives and gaining root. both of these topics are things you'll want to know and are covered well elsewhere on ITT and maemo.org.
 

The Following User Says Thank You to kernelpanic For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 03:45.