Hacker News new | ask | show | jobs
by mbell 4687 days ago
I think you're missing the issue here. The examples you've given are all with the 'host' powering the 'device'. e.g. Your computer powering your USB keyboard. 'Host' and 'Device' are specific modes of operation in the USB spec, it isn't multi-master.

The problem is when you want the 'device' to power the 'host', as is often the case when the 'host' is something with a battery, such as a tablet. There is no support built into the USB spec for this, it is always assumed that the 'host' provides power to the 'device'. An example of something that isn't supported would be a tablet 'dock' with a bunch of device connectors that could also charge the tablet, all via a single USB link.

1 comments

> I think you're missing the issue here. The examples you've given are all with the 'host' powering the 'device'. e.g. Your computer powering your USB keyboard. 'Host' and 'Device' are specific modes of operation in the USB spec, it isn't multi-master.

That's the only way you'd ever want to power a USB device though. It makes no sense to power the host from the device. Plus this isn't even the case with iPod docks - they're all powered in the mains.

> The problem is when you want the 'device' to power the 'host', as is often the case when the 'host' is something with a battery, such as a tablet.

The host on an iPod dock isn't the iPod; it's the dock.

> There is no support built into the USB spec for this, it is always assumed that the 'host' provides power to the 'device'. An example of something that isn't supported would be a tablet 'dock' with a bunch of device connectors that could also charge the tablet, all via a single USB link.

In this example, the dock is the host and the tablet is the device. So the tablet would still be charged.

The thing with USB is, it doesn't matter which device is the server and which is the client at the software end as that's just an arbitrary software paradigm. You can have the USB host act as the client at the software end and the device as the sever (eg a music dock will be the host, but the phone is the server and the dock the client), all you need is the two devices to be able to speak to each other. And since USB is a two way protocol (else USB storage wouldn't work), it's pretty easy to have the host as the power source and the device as the item requiring USB power even when the device is the one sending signals back to the host (eg how USB mice and keyboards work).

> That's the only way you'd ever want to power a USB device though. It makes no sense to power the host from the device. Plus this isn't even the case with iPod docks - they're all powered in the mains.

You're still not getting it. I want the dock to power the tablet so it charges, the dock gets power from mains does not change that at all.

> The host on an iPod dock isn't the iPod; it's the dock.

You can't make this statement definitively. If one of the features of the dock is a keyboard, it's going to be acting as a HID interface device and will be acting in device mode....

> The thing with USB is, it doesn't matter which device is the server and which is the client at the software end as that's just an arbitrary software paradigm.

This is wrong. A 'device' can never initiate a transfer, all transfers are negotiated by the 'host'. The 'host' is the bus master and manages all transfers regardless of what they are or where they are going. e.i. USB is a 'polling' interface, not a 'pushing' interface. You can not have more than 1 host on a USB bus.

> You're still not getting it. I want the dock to power the tablet so it charges, the dock gets power from mains does not change that at all.

Actually it's you who's missing the point. I've already told you that that does happen, it's just some handsets require a higher charge than others - and docks will only ever output the lowest required volts/amps because they wouldn't want to damage other hardware that is designed to pull less power. IIRC iPod/iPhone users had similar problems when Apple changed the input power rating for newer devices a few years ago.

> You can't make this statement definitively. If one of the features of the dock is a keyboard, it's going to be acting as a HID interface device and will be acting in device mode....

lol How many music docks act as a keyboard? Plus there's a contingency for that in the spec anyway as you can run more than one USB interface concurrently over a single USB port.

> This is wrong. A 'device' can never initiate a transfer, all transfers are negotiated by the 'host'. The 'host' is the bus master and manages all transfers regardless of what they are or where they are going. e.i. USB is a 'polling' interface, not a 'pushing' interface. You can not have more than 1 host on a USB bus.

You're missing the point. It's just a software specification. Once the devices have linked, you can programmatically design the software to work whichever way you want. As I pointed out before, there's plenty of USB devices that behave this way already; devices that -from the user perspective- both initiate and receive data.