70 comments

[ 4.3 ms ] story [ 137 ms ] thread
Interesting, early on with a 4K monitor on a Mac I was having trouble with kernel panics I wonder if this was the cause.
It's a known issue that latest version of Mac OS has problem to connect to external 4k monitors. I did not experience kernel panics, but lagging on display, high memory and cpu usage on the windowserver daemon.
I just changed jobs and they gave me a late model MBP connected to an external 4k display. The lag is palpable, on almost any action. ALT-Tab between windows takes many hundreds of milliseconds. Typing in the terminal is so slow I often times have to go back and correct my commands because I over typed them.

I thought it was just a combination of low-end MBP (cheapest 13" available) and crappy 4K monitor (Sceptre U274K). Are you saying that there is an actual problem with macOS High Sierra that is causing my lag? I've already changed DP cables and that didn't help at all. :(

Seems like this problem could have easily been solved by putting a diode on the device side.
This is the correct solution.
There is a voltage drop on a diode, around 0.2 - 0.7 volts, cannot this become a problem?
Then the supply before the diode supplies 3.3V + the voltage drop; for example 3.6V.
So now you need a 3.6V power regulator, in additition to the 3.3V one you likely already have for all the components built for 3.3V.
Or another diode to put in-line with the DP circuitry. It's probably not ideal from a low-power perspective but if that's what you gotta do to make robust and compliant hardware, you do it.
A Schottky will drop .3V; That's within the range (±10%) specified in the specs
Yes. But now you have given up all of your tolerance so you better have a perfect (or over-voltage) power supply. This means that you now have less choice in power supply.
As a parent commenter said, you could also put a diode for your circuitry. You would then have a single 3.7V supply.
And 10% higher power draw just for this one feature. No, there are better ways to solve this.
(comment deleted)
Diodes incur a voltage drop which may not be desirable, especially if you already have a 3.3V power source that you can use. I would expect high-end equipment to have a dedicated power supply path for the external connector which would avoid these issues but of course cheaper (or size-constrained) circuits might cut corners and just connect whatever 3.3V power source they have lying around.
You can likely get around the diode drop that this would impart by clever use of a P-channel mosfet.

https://hackaday.com/2011/12/06/reverse-voltage-protection-w...

This ends up using the body-diode that's present in all mosfets (it exists because you can't manufacture one without it) to get the initial protection, that then lets you turn on the mosfet fully, getting a much smaller voltage drop. You'd still need to be a bit cleverer to handle both sides but it shouldn't be too hard.

That only solves the problem if you're protecting against backward batteries, not the "two sources" problem
Two sources will look surprisingly the same, this still will require both sides to have the protection but once they do it's exactly the same. The one with the lower voltage will end up looking like it's got a small negative voltage being put on it, shutting off the mosfet. You'd still want over current protection, just like any power source, for devices that don't have protection or a broken cable that's shorting, etc.
No. Try simulating it. It won't work. I mean, if you did exactly what that circuit shows, you're not gonna go anywhere, so you need some modifications (like changing the zener diode to a schottky, etc).

The reason why that thing works is the fact that the body diode puts the input voltage onto the source voltage (sans Vf) which establishes a nice and high Vgs (negative, but you get the point).

Let's assume you have a similar circuit on both sides. The bus voltage is 3.3V, because if it's not, then you don't have a bus. Somehow you need the gate voltage on one to be nearly equal to the bus voltage on one side, but on the other, near to ground. How are you going to do that? That circuit (and any trivial variation thereof) is not going to cut it.

Like, any sort of diode that connects the bus voltage to the gate on either side isn't going to work asymmetrically that pulls one low and one high, so it's not going to work. You need active monitoring of some sort.

I've been seeing a lot of hilariously bad comments regarding electronics that seem to think any of this shit is easy--it's not.

It's actually far easier than you're making it out to be, because you seem to be assuming an ideal voltage source. Most linear regulators can only source current, not sink it. So it is perfectly fine to simply put a LDO at both ends and tie them together. The bus voltage will be the higher of the two. No extra diodes needed, certainly no active monitoring, and no extra current will follow even if the regulators are putting out slightly different voltages. Maybe add a small series resistance to limit initial inrush current as capacitors balance, but that's it.
That's a really interesting and novel way to address it. It does leave a potential issue though, it could lead to double the current being available to a device in the middle which could mean it could overdraw for it's own specs and melt or start a fire. Unlikely though.

I'd also say that with an LDO, the LDO is providing the active monitoring since it'll need to monitor the output anyway in order to regulate properly. You'd definitely need a resistor following it, not as much to limit inrush or anything, but to prevent the two regulators from causing oscillations (one turns off because the voltage looks good, which causes the other to cycle too).

Or, you know, make sure cables are ratifying standards, or if you're a GPU manufacturer, make sure the 3V3 supply is tolerant to being externally driven and doesn't backpower anything in the GPU (not exactly hard).
> if you're a GPU manufacturer, make sure the 3V3 supply is tolerant to being externally driven and doesn't backpower anything in the GPU

That's exactly what a "diode on the device side" does.

Which adds loss. There are better ways to solve this than the "Undergrad Freshman" approach.
So, cables shouldn't have a wire on pin 20.

This means that you could have a dongle (say, a DP-to-VGA converter) that works when plugged into the source, but doesn't work when plugged into a cable and a gender-changer to effectively form an extension cable.

I'd argue, therefore, that extension cables (purpose-built with M-to-F connectors) should wire pin 20, and only M-M cables should omit it.

That would be my expectation then, since an extension cable should behave (as much as possible) as the original port you'd be using.
I've been having problems connecting an external monitor to my MacBook for a long time.

I'm using a MiniDP to DP cable and sometimes the external monitor just wouldn't get any signal after sleeping the laptop with the cable plugged in. Unplugging the cable or power cycling the monitor doesn't help at all. I have to completely restart the laptop to get a monitor signal again. I wonder if that's due to the pin 20 issue.

The funny thing is that I actually bought 4 different cables already and all of them have the same problem.

I've been having a similar issue, across multiple different DP cables, (DP -> DP).

My screen will just shut off, and refuse to turn back on for minutes at a time. It will also randomly flicker once every 10-15 minutes (for like 3-4s, then back to normal). I've tried two different DP cables, and two different DP ports, but its the same issue, and the HDMI ports I have don't support 144hz 1440p =\.

Such a frustrating interface. Would love if someone could weigh in with advice.

Perhaps unrelated, but I have a similar problem with my hackintosh and a monitor connected via HDMI. The other monitor (same model) connected to the same GPU via DisplayPort has no such issues. Restarting the machine seems to be the only way to get the HDMI monitor to start working again.
Putting the computer to sleep resets it for me. Only happens on anything that isn’t DP (HDMI and DVI->DP)

Annoying for sure.

Same here! My computer is a Mac mini and also using a mini DP to DP cable. There’s a 20% chance that the monitor will get stuck in power-saving mode when turning it on. When this happens, rebooting my Mac is the only way I’ve found to make it come back. I’ve tried many cables :(
try unplugging/re-plugging the monitor's power cable. i have this same issue every now and then and the only solution i've found is a hard power cycle of my monitor.
Again shows the brilliance of the "have you tried turning it off and on again?" line :]
This explains so much. I have a feeling this is why the Surface Dock generally won't work with dongles, for instance.
Yes you’ll want to use active dongles with the Surface Dock, those will run off the 3.3v supply.
What's the easiest way to tell whether pin 20 is wired, if you don't have a very very expensive cable tester?
A multimeter in continuity mode?

Pinout for DP: https://en.wikipedia.org/wiki/File:DisplayPort_Connector.svg

Mini-DP (female, reverse in cable): https://en.wikipedia.org/wiki/File:Mini_DisplayPort_(connect...

Given the size of most multimeter probes i have seen, i can't shake the feel that it could get very fiddly very fast.
I keep a set of probe cables with the ends clipped off, and just a couple of wires left unclipped, twisted and tinned together for strength/rigidity. Works great for tiny trace testing.
Seems like if you leave it up to the cable manufacturers to implement parts of a standard (beyond X wires at Y gauge minimum) they are bound to fuck something up.

Just look at the amount of screw-ups over the resistors used in USB C cable variants, in particular the one used to indicate that the cable is an A to C converter.

Applies to software too. Standards need to be strongly defined with no leeway. Parsing should be tight and leave no room for creativity. (Text protocols like HTTP I'm looking at you!) Anything that deviates should be rejected by reference implementations instead of trying to be "robust" by accepting junk.
"Standards need to be strongly defined with no leeway."

Actually, I think there should be leeway - but only in one direction.

Specifically, I am thinking of the suggestion: "be conservative in what you send and liberal in what you receive".

I think that this is what the parent was arguing about: Being liberal about what you receive often leads to every different implementation handing the undefined cases in their own particular way, which leads to incompatibilities or one of the implementation becoming the de-facto standard.
Liberal in what you receive should only apply for human user interfaces.

If you apply the rule on machine to machine interfaces it eventually leads to all applications having to be bug-for-bug compatible with the most popular implementation. (Internet explorer 6 usually being the prime example of this)

Wow. I think I am going to build a test device for this. It would be very simple: Two female DP ports with pins 20 wired together through a battery, resistor, and LED. For good measure, it should be four ports so we can test mini-DP as well. If the bulb lights up when you plug both cable ends in, then the cable is bad.
They should have used different pins for source and sink power.
(comment deleted)
A display port cable is ghe same in both ends.

Maybe they should've designed display port to have different connecrors for source and sink, but I must imagine they had compelling reasons to not do that.

They could crossover in the cable. So both sides provide power on pin 20, and leave pin 21 notconnected, then have the cable wire pin 20 to pin 21.

Then, when a device needs to draw power, they connect pin 21 as the source and leave 20 notconnected. If both devices supply power, then both power circuits are open.

This still isn't ideal, as extension cables would need to be non-crossover and you would have a problem if you ever tried using an extension cable in place of a normal cable.

> This still isn't ideal, as extension cables would need to be non-crossover and you would have a problem if you ever tried using an extension cable in place of a normal cable.

I don't think that's really a big problem:

1. If your device has a female port (most devices), supply power on pin 20, source power on pin 21

2. If your device has a male port ('dongle' type devices), supply power on pin 21, source power on pin 20.

3. M-F (extension) cables are non-crossover

4. M-M and F-F cables/adapters are crossover

With that configuration I don't think there's any way to plug something in incorrectly or accidentally use the wrong cable. You can't use an extension cable in place of a normal cable without using a M-F adapter, which would do the crossover for you. It gets a bit fuzzier when involving converters to other port types, but I think it's actually less complicated then the current model in that case. As long as you just supply or source power on the right pins for the DP port type you have (male or female), then there is nothing else to worry about when creating a converter.

At the very least, I can't imagine it would be any worse then the current situation. With the current setup extension cables should have pin-20 connected (Though it sounds like they might not), but M-M/F-F cables should not, which IMO is much messier then the above.

That seems like it should work, although it is a different (and better) proposal than what I had.

Essentially, your proposal is to have the invariant that males supply power on pin 20 and source on pin 21, while females supply on 21 and source on 20. It is easy to see that this invariant is maintained by all of your proposed cables. And, since the only way to plug ports together is male-female you are guaranteed to always be matching supply with source.

Since this invariant is maintained at every terminal, there is, as you identify, no added difficulty in creating converters, as they would only target one gender of the port anyway.

Out of curiosity, is there any port that takes this approach (either for power or data pins)?

"Traditional" USB does that: USB-A ports source power, USB-B ports sink power. (Also, USB-A ports are always towards the host, which controls the bidirectional serial link.) The standard cable has a USB-A plug on one end, and a USB-B plug on the other end. There can be no USB-A to USB-A (or USB-B to USB-B) cable, since they're forbidden by the standard, so you can't connect two sources (or two sinks) together.

And of course it didn't work: there are many standard-breaking USB cables with identical plugs on both ends, and standard-breaking devices which require them.

That's not quite what I described. With my design either port can source or sink power, they just do it on opposite pins. And it wouldn't be USB-A vs USB-B, but male vs female

So for USB, you would need a 5-pin port, where two are devoted to power. And both USB-A and USB-B would have the same wiring, but male ports source and supply on opposite pins as the female ones. Then M-M or F-F cables crossover the power lines.

For Ethernet, we have inexpensive cable testers which show whether a cable is wired correctly (and expensive cable testers which also check the electrical characteristics). Is there anything like that for DisplayPort or USB-C (or both, since DisplayPort can also use USB-C cables)?
I've only seen high end scopes and signal generators used for such a purpose.
A while ago I has a MiniDP->DVI adapter on my macbook air that would cause the wifi card to lose all signal. I wonder if this is why?
More likely a de-sense issue. Poor grounding/shielding on either the connector or the adaptor can impact the performance of the antennas.
But that's not a short circuit, like the article mentions, is it? The voltage difference means some current will flow, but that's generally harmless.
for even a small voltage differential, with a resistance of near-zero, the current could be very large. basically until one of the regulators gives way, which is likely way passed the point at which damage can occur.
It is clearly a short circuit. The amount of current that flows depends on the output impedance which I imagine isn't specified.
> If you happen to have such a cable, your best advice is to throw it away and buy a new one that doesn't have this issue

Why throw it away if I can happen to get a DP-powered device in future? And why has the FAQ article been removed?

Change the cable, not the device.
I've been bitten by this with almost every cable. I couldn't find a shop that would be able to tell me whether they sell cables that don't do this.

I simply destroyed the pin and isolated it with some paper...

So USB-C isn’t the only standard that requires cables to do something non-obvious to avoid subtle breakage.

Damn it, spec designers, stop screwing this up. In DP’s case, it sounds like it would have been straightforward to require ports to put a diode on pin 20. (Heck, any reasonable implemention should be protected against short circuits and overcurrent. Protecting against backfeeding seems like it should add negligible expense on top.