Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
I have a Mac Studio with dual BenQ PD2700U's. Exact same story as everyone else. Keep waking the computer to find the monitors flipped around, requiring manually going in and changing it back. I can't figure out any logic to it either. I did just check the serial numbers on the displays and confirmed what might be my one suspicion. The monitor that MacOS keeps making the primary is in fact the lower serial number (1826 vs 1829 on the left). I have them mounted on an arm and all the cables are managed and zip tied. Swapping them around on the off chance it MIGHT fix something would be a monumental pain in the ass. And others in this thread have said that made no difference for them.
Wanted to follow up on my own suspicion from months ago. I finally decided to unplug everything and swap the two monitors around on the VESA arm, and so far it seems to have fixed my problem. I now have the lower serial number on the left, and higher one on the right, which I assume MacOS is assuming to be the arrangement, which it merely falls back on.

I still consider this a major bug in the OS, and I've submitted a bug report to Apple. But for what it's worth, perhaps check your monitors' serial numbers and see which one would come first? Maybe it'll at least do the trick for matching models :/
 
  • Like
Reactions: Basic75
There definitely seems to be a bug or workaround lost in Monterey. Actually, I think this may have started in Big Sur or Ventura.

This problem did not happen on earlier versions of Mac OS. I had a 2019 iMac with 2 external Samsung U28E590D monitors that always stayed in place. Same with previous iMac 2015. When I upgraded MacOS the monitors would come up randomly swapped. What changed?

I now have a Mac Studio M1 Max Monterey that has the same issue with the 2 Samsung 4k monitors.

I purchased 3 HP x27q monitors and they have the same issues.

Definitely related to MacOS versions.
FIX - Appears that Ventura 13.3.1 (22E261) fixes this problem. I upgraded Friday 4/7/23 and my 3 external monitors have remained in the correct order through at least a dozen reboots.

Can anyone confirm?
 
+1 to 13.3 fixing it. And the fix persists into 13.3.1. I haven't seen this problem in over a week! :D

This said, I do still have one hanging weird thing: if I use BetterDisplay or MonitorControl to enable DDC brightness, the hardware brightness is swapped vs. software brightness. So i.e., if I lower the brightness of the left monitor, the software dimming applies to the left monitor while the DDC hardware dimming applies to the right monitor. If anybody has a tip for that...
 
+1 to 13.3 fixing it. And the fix persists into 13.3.1. I haven't seen this problem in over a week! :D

This said, I do still have one hanging weird thing: if I use BetterDisplay or MonitorControl to enable DDC brightness, the hardware brightness is swapped vs. software brightness. So i.e., if I lower the brightness of the left monitor, the software dimming applies to the left monitor while the DDC hardware dimming applies to the right monitor. If anybody has a tip for that...
Unfortunately the system gives us no way of getting the DDC port of a specific display.

In Lunar I use heuristics to match a DDC port to a display using the EDID UUID and various EDID data like width, height, week of manufacture etc. MonitorControl and BetterDisplay do something similar as they were inspired by Lunar’s M1 DDC code.

That matching will fail if all the available EDID fields are the same between monitors, and DDC ports will be assigned semi-randomly, causing the commands of one monitor to go to the other.

There is no possible fix for this. I have been trying to code a solution for the last 5 years when even ddcctl had this problem, but it’s not completely solvable.
 
This is becoming quite a read beyond troubleshooting a nasty problem, especially with @alinpanaitiu's input. Do any of you think we can overcome this identical EDID problem with the help of an "EDID Emulator" like these ones?

By the way, I connected two Mateview 28.2 displays one via USBC and the other HDMI through an OWC Thunderbolt hub (I convert to HDMI using an old USBC to HDMI converted connected to the Thunderbolt Hub) thus the displays should be easily identifiable thanks to the connection type but, I got to rearrange them almost 3-4 times every day. So the plot thickens, at least for me.
 
As an Amazon Associate, MacRumors earns a commission from qualifying purchases made through links in this post.
Unfortunately "should" is not the same as "guaranteed", and devs usually code around guarantees. Apple has millions of users and they have to make the software work best for the largest group of users.
Well obviously it's not the case that it works best for the largest group of users. Apple used to be class-leading in multi-display support, now it's worse than Windows. "The perfect is the enemy of the good."
 
I'll just add one more to the 13.3 fixed it count. When I would plug into my work at dock I would have to fix the monitors every time and usually even when waking up from sleep. I haven't had to do that a single time since the update.
 
  • Like
Reactions: Basic75
@lasyos asked me to put a link to my thread here, so here it goes:

https://forums.macrumors.com/thread...about-it.2386218/?post=32132820#post-32132820

Now, there is a chance that I was wrong, so I'm not sure if it's worth anybody's time reading through all that. If it turns out that I'm wrong, I'm machine enough to admit it. (About one BSG die hard fan laughed at that)

@alinpanaitiu says (and he knows a lot more about these things than I do so I'm inclined to think he's right) that most likely the UID numbers I see in the System Information app when I select the Thunderbolt section is not an ID the monitors have, at least not as displays, but instead as Thunderbolt/USB-C/USB 3 hubs.

He saw my EDID reports, and says that there are two serial numbers. One is the EDID serial number, which is part of the spec and (this is me talking, not Alin) stupid manufacturers like Samsung who should know better, manufacture whole batches with the same serial number. But what can you expect from the idiots who sell the largest number of TV sets in the US and still refuse to put Dolby Vision in them because they have to pay Dolby like 8 bucks per unit or something like that. Not that they give a damn, I sent them two messages on their contact form two weeks ago, one to ask them why my two monitors have the same EDID serial number, and also why DDC/CI is read-only, so apps like Lunar and BetterDisplay can't communicate with it to adjust brightness and other things.

Now, back to what Alin was saying, there's another serial number, and at least in my case that one is different, and he says it's called AlphanumericSerialNumber, which is not part of the EDID spec, but at least in my case, it's different. But, it's not mandatory for Apple or Lenovo or whatever computer maker to identify monitors that way.

However, they could do that if they wanted, and Alin thinks that that may be the case here, because for the last couple of weeks, this problem has disappeared for me completely. At first I thought it was just luck, but days went by, then weeks, and nothing. I even swapped them myself when I needed to have my work Mac in my front monitor and my personal Mac on the side, then put them back, and they stay.

It's been several reboots, sleep cycles, switching inputs to Displayport or HDMI for other machines, and it keeps staying where I tell it to stay.

My first thought was that it was Lunar because this stopped happening right about the time I bought it and it boots up with the OS every time, but Alin told me there's nothing in his code that could possibly fix this.

So my other clue, which he agrees with, is that Apple fixed the display management whatever thingie inside macOS to look for that AlphanumericSerialNumber as a way to tell them apart. And I think that would've been Ventura 13.3.1, but there's nothing in the version notes about this.

But that seems the likely situation here, if it's anything else, I have no clue what it might be.
 
@lasyos asked me to put a link to my thread here, so here it goes:

https://forums.macrumors.com/thread...about-it.2386218/?post=32132820#post-32132820

Now, there is a chance that I was wrong, so I'm not sure if it's worth anybody's time reading through all that. If it turns out that I'm wrong, I'm machine enough to admit it. (About one BSG die hard fan laughed at that)

@alinpanaitiu says (and he knows a lot more about these things than I do so I'm inclined to think he's right) that most likely the UID numbers I see in the System Information app when I select the Thunderbolt section is not an ID the monitors have, at least not as displays, but instead as Thunderbolt/USB-C/USB 3 hubs.

He saw my EDID reports, and says that there are two serial numbers. One is the EDID serial number, which is part of the spec and (this is me talking, not Alin) stupid manufacturers like Samsung who should know better, manufacture whole batches with the same serial number. But what can you expect from the idiots who sell the largest number of TV sets in the US and still refuse to put Dolby Vision in them because they have to pay Dolby like 8 bucks per unit or something like that. Not that they give a damn, I sent them two messages on their contact form two weeks ago, one to ask them why my two monitors have the same EDID serial number, and also why DDC/CI is read-only, so apps like Lunar and BetterDisplay can't communicate with it to adjust brightness and other things.

Now, back to what Alin was saying, there's another serial number, and at least in my case that one is different, and he says it's called AlphanumericSerialNumber, which is not part of the EDID spec, but at least in my case, it's different. But, it's not mandatory for Apple or Lenovo or whatever computer maker to identify monitors that way.

However, they could do that if they wanted, and Alin thinks that that may be the case here, because for the last couple of weeks, this problem has disappeared for me completely. At first I thought it was just luck, but days went by, then weeks, and nothing. I even swapped them myself when I needed to have my work Mac in my front monitor and my personal Mac on the side, then put them back, and they stay.

It's been several reboots, sleep cycles, switching inputs to Displayport or HDMI for other machines, and it keeps staying where I tell it to stay.

My first thought was that it was Lunar because this stopped happening right about the time I bought it and it boots up with the OS every time, but Alin told me there's nothing in his code that could possibly fix this.

So my other clue, which he agrees with, is that Apple fixed the display management whatever thingie inside macOS to look for that AlphanumericSerialNumber as a way to tell them apart. And I think that would've been Ventura 13.3.1, but there's nothing in the version notes about this.

But that seems the likely situation here, if it's anything else, I have no clue what it might be.
@sebalvarez - Has the issue stayed permanently resolved for for you? I'm on Ventura 13.4.1 and still experience the swapping problem on my identical Samsung LF32TU872VNXGO (TU872) monitors. I experience the same symptoms (display logical location swapping) on my M1 MacBook Pro (16-inch, 2021).

The EDID data on each monitor have the same problem as has been described already by you: the `SerialNumber` field is identical (I bought them at the same time) while there is a non-standard `AlphanumericSerialNumber` field that contains a unique but not-exactly-matching-the-rear-sticker S/N string. What absolutely drives me nuts is that they were kind enough to include a unique non-standard field that contains a partial (and, I suepect, unique) serial number string, but could not be bothered to do that for the actually-standard (as per EDID v1.4 that the display's EDID data claims to be) `SerialNumber` field. I can't believe it'd be less work to do what they did. It just seems like negligence/ignorance of the standard's fields.

I've tried to overwrite the EDID data on the monitors, but it claims to be write-protected. There doesn't seem to be a way to put the monitor into any sort of "service mode" to force it to accept new EDID data. I tried every input port.

I've called Samsung and complained. I got rerouted a couple times with one T1 support person claiming "lol you need to talk to a firmware engineer". I told them I'd gladly hop on the phone with one and would feel like "a pig in ****" if they would let me. Ultimately, I've been escalated to T3 (skipping T2) support, and am waiting to hear back.

They asked me: "What would you like the resolution to be?" Monitor joke aside (lol "resolution"), I told them I'd like the monitors to correctly report their serial numbers in the `SerialNumber` field in the EDID data transferred from the monitor.

I see two ways of making that happen:

* They inform me of a way to make the EDID data writable, and I overwrite the `SerialNumber` field.
* They issue a firmware update for my monitors that will result in the correct value residing in the `SerialNumber` field (if this is even something that _can_ be fixed via a firmware update

They wanted to know if this also happens on Windows. I told them that I don't know and that it was my opinion that it did not matter. They have, seemingly, incorrectly utilized an EDID v1.4 standard field, and that results in scenarios like those we all have experienced. Obviously, it'd be nice if both Apple AND Samsung addressed the issue, since very few people out there will actually seek out firmware updates for their monitors. Though, I'd argue that anybody experiencing this on macOS _would_, in fact, end up finding that a firmware update fixes it (if it would) since it is an incredibly frustrating issue.

We'll see where I land. They want me to forward along all that I've experienced to an email I just received from them. You can bet a link to this thread will be in there (hi, Samsung!).
 
Last edited:
@lasyos asked me to put a link to my thread here, so here it goes:

https://forums.macrumors.com/thread...about-it.2386218/?post=32132820#post-32132820

Now, there is a chance that I was wrong, so I'm not sure if it's worth anybody's time reading through all that. If it turns out that I'm wrong, I'm machine enough to admit it. (About one BSG die hard fan laughed at that)

@alinpanaitiu says (and he knows a lot more about these things than I do so I'm inclined to think he's right) that most likely the UID numbers I see in the System Information app when I select the Thunderbolt section is not an ID the monitors have, at least not as displays, but instead as Thunderbolt/USB-C/USB 3 hubs.

He saw my EDID reports, and says that there are two serial numbers. One is the EDID serial number, which is part of the spec and (this is me talking, not Alin) stupid manufacturers like Samsung who should know better, manufacture whole batches with the same serial number. But what can you expect from the idiots who sell the largest number of TV sets in the US and still refuse to put Dolby Vision in them because they have to pay Dolby like 8 bucks per unit or something like that. Not that they give a damn, I sent them two messages on their contact form two weeks ago, one to ask them why my two monitors have the same EDID serial number, and also why DDC/CI is read-only, so apps like Lunar and BetterDisplay can't communicate with it to adjust brightness and other things.

Now, back to what Alin was saying, there's another serial number, and at least in my case that one is different, and he says it's called AlphanumericSerialNumber, which is not part of the EDID spec, but at least in my case, it's different. But, it's not mandatory for Apple or Lenovo or whatever computer maker to identify monitors that way.

However, they could do that if they wanted, and Alin thinks that that may be the case here, because for the last couple of weeks, this problem has disappeared for me completely. At first I thought it was just luck, but days went by, then weeks, and nothing. I even swapped them myself when I needed to have my work Mac in my front monitor and my personal Mac on the side, then put them back, and they stay.

It's been several reboots, sleep cycles, switching inputs to Displayport or HDMI for other machines, and it keeps staying where I tell it to stay.

My first thought was that it was Lunar because this stopped happening right about the time I bought it and it boots up with the OS every time, but Alin told me there's nothing in his code that could possibly fix this.

So my other clue, which he agrees with, is that Apple fixed the display management whatever thingie inside macOS to look for that AlphanumericSerialNumber as a way to tell them apart. And I think that would've been Ventura 13.3.1, but there's nothing in the version notes about this.

But that seems the likely situation here, if it's anything else, I have no clue what it might be.
Unless something in the standards has changed (it's been a while since I worked with this) there are 2 places for serial numbers in the EDID. The first is a 4-Byte optional area near the beginning of EDID Block Zero, the other is in the final Descriptor that follows the Timing Descriptor(s), Monitor Range Descriptor, and Monitor Name Descriptor. That is the "official serial number" given in ASCII character format. It sounds like that is what you may be describing as the AlphanumericSerialNumber?

If the serial number in the Descriptor is present, the first serial number in EDID Block Zero should be ignored by the Source (if it is even present - it may be 0000, or it's often the same in all monitors of a given model). I could be wrong, but it seems like you may have them backwards in your thinking?

In my experience over a dozen years, using different HP monitors several times, with 2 identical model HP monitors, Mac OS's going back a dozen years, have read the Descriptor serial numbers to be the SAME even when they are different in the EDID's, and hence cause the confused identification problem. This problem has never been completely fixed from Mac to Mac, Mac OS to Mac OS, in at least that dozen years (I first noticed it on my 2010 Mac Pro with two video cards, and it still happens with my Mac Studio Ultra). The only absolute fix, for all Mac OS settings, I've ever found for the problem is to run ONE of 2 identical model monitors in a DVI mode so that the EDID Block 1 is not presented to the Source (the Mac). Only then does the Mac OS not become confused (and again that is over multiple Macs, and multiple Mac OS's, with multiple HP monitor models). I currently run 3 monitors (one is 43" Sony) and that makes no difference. The problem still exists between the 2 HP monitors unless one is run in DVI input mode.

And yes, I've reported this to Apple multiple times, along with diagnostic information multiple times, over a dozen years and it has never to my knowledge been fixed in any version of Mac OS (although once I fix it as I described it stays fixed so I wouldn't notice it again until I changed monitors or Macs again although Mac OS versions are updated in the interim). And yes, Apple always seems extremely interested in the problem, and I talk to higher levels of their engineering support, and then .... they never get back to me and it's never fixed.
 
  • Like
Reactions: lasyos
Unless something in the standards has changed (it's been a while since I worked with this) there are 2 places for serial numbers in the EDID. The first is a 4-Byte optional area near the beginning of EDID Block Zero, the other is in the final Descriptor that follows the Timing Descriptor(s), Monitor Range Descriptor, and Monitor Name Descriptor. That is the "official serial number" given in ASCII character format. It sounds like that is what you may be describing as the AlphanumericSerialNumber?

If the serial number in the Descriptor is present, the first serial number in EDID Block Zero should be ignored by the Source (if it is even present - it may be 0000, or it's often the same in all monitors of a given model). I could be wrong, but it seems like you may have them backwards in your thinking?

In my experience over a dozen years, using different HP monitors several times, with 2 identical model HP monitors, Mac OS's going back a dozen years, have read the Descriptor serial numbers to be the SAME even when they are different in the EDID's, and hence cause the confused identification problem. This problem has never been completely fixed from Mac to Mac, Mac OS to Mac OS, in at least that dozen years (I first noticed it on my 2010 Mac Pro with two video cards, and it still happens with my Mac Studio Ultra). The only absolute fix, for all Mac OS settings, I've ever found for the problem is to run ONE of 2 identical model monitors in a DVI mode so that the EDID Block 1 is not presented to the Source (the Mac). Only then does the Mac OS not become confused (and again that is over multiple Macs, and multiple Mac OS's, with multiple HP monitor models). I currently run 3 monitors (one is 43" Sony) and that makes no difference. The problem still exists between the 2 HP monitors unless one is run in DVI input mode.

And yes, I've reported this to Apple multiple times, along with diagnostic information multiple times, over a dozen years and it has never to my knowledge been fixed in any version of Mac OS (although once I fix it as I described it stays fixed so I wouldn't notice it again until I changed monitors or Macs again although Mac OS versions are updated in the interim). And yes, Apple always seems extremely interested in the problem, and I talk to higher levels of their engineering support, and then .... they never get back to me and it's never fixed.
Now there is some interesting info. I'll have to take another look. I could definitely be wrong. This problem is like riding a rollercoaster.

Maybe @alinpanaitiu can comment on what you have said. They certainly seem to know more than me.
 
  • Like
Reactions: lasyos
Ah, I see there is a "Display Descriptors" section further down the EDID 1.4 Wikipedia page.

It calls out FF being a descriptor type that denotes "Display serial number (ASCII text)".

I'm going to have to read the VESA spec to look for flow logic based on field presence.

Man... I have flip-flopped so many times who I'm mad at: Apple or Samsung.
 
Ah, I see there is a "Display Descriptors" section further down the EDID 1.4 Wikipedia page.

It calls out FF being a descriptor type that denotes "Display serial number (ASCII text)".

I'm going to have to read the VESA spec to look for flow logic based on field presence.

Man... I have flip-flopped so many times who I'm mad at: Apple or Samsung.
I'm not near a copy of the standard now so I can't give you the exact location of the optional serial number. But that is official location for the serial number. The location near the very start of Block 0 is the optional location, and it is supposed to be ignored by the Source (Mac) when the Descriptor Serial Number is used.

With 2 identical monitors, with different serial numbers, both connected with HDMI inputs, the Mac will read them as the same serial number and it's random as to which is read first and therefore becomes "the common" serial number. And then the display location will flip flop depending on the order they were read. If one monitor is connected with DVI, the Mac reads both serial numbers correctly every time and there is no problem.

The last time I verified this was with Monterey when I got my Mac Studio Ultra. The first time I verified it was in 2010 with a Mac Pro (don't remember the OS). I reverified it 2 other times in the interim when I switched monitors and the problem reoccured.

I almost hate to mention this because I don't want to lead anyone down a wrong path, BUT with Monterey there was a Mission Control setting workaround that seemed to eliminate the display swapping problem. This was a year ago when I last had to deal with the problem, so I may be remembering the wrong setting - but I believe it was "Displays have separate Spaces". When turned off I believe the problem went away, but I didn't like that mode so it wasn't a fix for me. Very sorry if I'm pointing at the wrong setting, but it was for sure one of the Mission Control settings and I believe it was that one.
 
Last edited:
I'm reading through the VESA document for 1.4, and I think you're correct. The "first" serial number is optional, but so is the one further down the spec? I see no requirement for including a serial number at all.

That said, if the "first" SerialNumber field is optional and explicitly numeric only (not alphanumeric), then the later descriptor specifically carved out for an alphanumeric SN is where you'd put it! I actually am thinking Samsung is doing an okay thing and it is, in fact, an Apple issue.

Specifically, when calling CGDisplaySerialNumber in the Quartz Display Services on macOS, it should be more intelligent and return the most relevant field. And sometimes that field is not the earlier SN bytes. I've actually written a small Swift snippet to call the function, and it returns the same "bogus" serial number from the earlier SN field for both displays.
 
  • Like
Reactions: lasyos
I'm reading through the VESA document for 1.4, and I think you're correct. The "first" serial number is optional, but so is the one further down the spec? I see no requirement for including a serial number at all.

That said, if the "first" SerialNumber field is optional and explicitly numeric only (not alphanumeric), then the later descriptor specifically carved out for an alphanumeric SN is where you'd put it! I actually am thinking Samsung is doing an okay thing and it is, in fact, an Apple issue.

Specifically, when calling CGDisplaySerialNumber in the Quartz Display Services on macOS, it should be more intelligent and return the most relevant field. And sometimes that field is not the earlier SN bytes. I've actually written a small Swift snippet to call the function, and it returns the same "bogus" serial number from the earlier SN field for both displays.
Not only is that first serial number optional, but somewhere in the CEA spec (again I don't have it in front of me) you will see that it should be ignored by the Source (Mac) if the Descriptor serial number is present. That is very important here if somehow it is fooling the OS.

But nevertheless, the OS can read the Descriptor serial number and does, but it reads the serial number of 1 of the monitors and that gets assigned to both monitors if they are both connected via HDMI (or USB and HDMI too I believe, but that should be checked). But when the OS is certain there are 2 or more different types of monitors (which I believe is what happens when one of 2 identical monitors are connected via DVI and therefore Block 1 of the EDID will be missing for the DVI connection - since Block 1 doesn't exist for DVI) then it reads both monitors serial numbers and assigns them correctly. You can verify all that by reading the serial numbers with HDMI/HDMI versus HDMI/DVI connections.
 
Last edited:
Not only is that first serial number optional, but somewhere in the spec (again I don't have it in front of me) you will see that it should be ignored by the Source (Mac) if the Descriptor serial number is present. That is very important here.
Yeah. I'm going to see if I can find it after the kids are in bed.

I can't thank you enough for taking the time to reply. This is such a nuanced problem. I'm sure I'll be pissing into the wind, but I'll likely contact Apple about it. You have to be laughing at me. What's especially frustrating are all the people on Venture past a certain version claiming it fixed the issue, where I just had it happen today.
 
  • Like
Reactions: lasyos
@PianoPro - Sorry for the absolute dump that is about to happen.

EDID Dumps

I took one of the monitors and plugged it into my PC across the room again. I did this last night, but I only did it to dump the EDID with EDID/DisplayID Writer Beta 2. Here is a link to a OneDrive share of the EDID dump from the monitor using the aforementioned tool. Password is "samsung".

Opening the EDID dump in Deltacast E-EDID shows the following with regard to the serial number:
  • "809585720" in the "Serial Number" field under "Vendor and Product ID"
    • this would correspond to the early, optional serial number
    • this is also the serial number that is identical between my two identical monitor models that were purchased at the same time
  • "HCPR200957" in the "Display Product Serial Number" field under "Block 4 - Display Descriptor" coded as "Display"->"Serial Number"
    • I believe this to be the field that shows as "AlphanumericSerialNumber" when doing an `ioreg` command on my MacBook
    • This is a unique serial number (at least between my two monitors) and partially matches the sticker on the back of each respective monitor.
So that is what a EDID tool says is in the direct EDID bin dump. Ok... so what about what Windows thinks?

I quickly found a Powershell script to dump what Windows sees the monitor serial numbers to be. I do not know whether the actual display driver installed (AMD vs. Nvidia vs. Intel vs. whatever) would affect the outcome, here. It gives the following serial number: HCPR200957. Note that that matches what is in the "AlphanumericSerialNumber" field when querying via`ioreg` on macOS. The Powershell I ran is below:

Code:
Get-WmiObject WmiMonitorID -Namespace root\wmi |
    ForEach-Object {
        $Manufacturer   = [System.Text.Encoding]::ASCII.GetString($_.ManufacturerName).Trim(0x00)
        $Name           = [System.Text.Encoding]::ASCII.GetString($_.UserFriendlyName).Trim(0x00)
        $Serial         = [System.Text.Encoding]::ASCII.GetString($_.SerialNumberID).Trim(0x00)
        echo $Manufacturer,$Name,$Serial
    }

When using a simple Swift program in Xcode to call `CGDisplaySerialNumber`, the serial number returned is the "bogus" one of "809585720". This is why I suggested in a previous post that it would appear that Apple should, at a minimum, update `CGDisplaySerialNumber` to be more intelligent and suss out the true serial number stored later in the EDID. Whether that would fix a low-level OS display issue is beyond my understanding. I'd guess not, but at least then programs like Luna and displayplacer could query useful information to help accurately place displays. I don't know what calls Luna makes, but I know for sure that displayplacer calls `CGDisplaySerialNumber` directly; I've checked the source code.

All of this was done on Thunderbolt 3, DisplayPort, or HDMI. These monitors do not have DVI, VGA, or anything "legacy" like that.

VESA EDID Standard

The VESA EDID 1.4 standard has this to say about the early SN bytes:
3.4.3 ID Serial Number: 4 Bytes
The ID serial number is a 32-bit serial number used to differentiate between individual instances of the
same display model. Its use is optional. When used, the bit order for this field shall follow that shown
in Table 3.7. The four bytes of the serial number are listed least significant byte (LSB) first. The range
of this serial number is 0 to 4,294,967,295. This serial number is a number only --- it shall not represent
ASCII codes. If this field is not used, then enter “00h, 00h, 00h, 00h”.

...

Note for Table 3.7: The EDID structure version 1, revision 1 (and newer) offers a way to represent the
serial number of the monitor as an ASCII string in a separate descriptor block. Refer to section 3.10.3
Display Descriptors for an alternative method of defining a serial number.

So, the first SN field is optional, though it does declare that the purpose is "to differentiate between individual instances of the same display model". It seems silly to me to have such an important function be an optional field, but I'm not the standard writer.

It goes on later to define the "second" possible serial number descriptor via a "Display Descriptor" in section 3.10.3.1:

3.10.3.1 Display Product Serial Number Descriptor Definition (tag #FFh)
Up to 13 characters (using ASCII codes) of a serial number may be stored in the Display Product Serial
Number Descriptor (tag #FFh). The data shall be sequenced such that the 1st byte (ASCII code) = the 1st
character, the 2nd byte (ASCII code) = the 2nd character, etc. If there are less than 13 characters in the
string, then terminate the serial number string with ASCII code ‘0Ah’ (line feed) and pad the unused
bytes in the field with ASCII code ‘20h’ (space). Table 3.24 defines the format. Refer to Appendix E
for ASCII Reference Tables

Given those definitions, I'm inclined to believe that Samsung has not deviated from the 1.4 spec, here, unless one wants to argue that putting identical values in the early SN field does not, in fact, help to "differentiate between individual instances of the same display model" (I do wish to argue it).

I probably just have a reading comprehension problem, but I do not see any verbiage calling out how the two fields should interact or be preferentially treated based on presence of one or the other. The only thing I see in that regard is the early SN field definiton saying "00h, 00h, 00h, 00h" should be used if "the field is not used".

Conclusions​

Unless there is some very specific language in a spec document that sways my opinion again, I'm inclined to believe that Apple, as you seem to have been preaching for a decade, is mostly at fault. Windows (at least my machine with a very new AMD card and drivers) seems to handle ripping the SN from the "Display Descriptors" section of the EDID just fine. It my macOS machine (M1 MacbookPro running Ventura 13.4.1) that seems to entirely **** the bed with respect to querying the "actual" SN. Aside from the complaint about how Samsung did use the early SN field juxtaposed against the VESA document that declares what it is for, the only thing that trips me up is that you claim the standard has priority based on field population that I have been unable to find. I guess that doesn't really matter if the early SN field is marked as "optional". The later field also seems to be marked as optional. So, I guess some monitor manufacturer could decide they want to see the world burn and not populate either field.

At this point, I do feel like it is Apple that should fix their decisioning logic when decoding/parsing the EDID from a monitor. Clearly something is being done differently if my Windows 11 machine is pulling the later field but my macOS machine is pulling the early field.

I still wish I could write over the EDID on one of the monitors; it'd likely allow me to fix the issue right now.

1691027014245.png


1691027058752.png
 
Last edited:
  • Like
Reactions: wegster and lasyos
@PianoPro

VESA EDID Standard

The VESA EDID 1.4 standard has this to say about the early SN bytes:


I probably just have a reading comprehension problem, but I do not see any verbiage calling out how the two fields should interact or be preferentially treated based on presence of one or the other. The only thing I see in that regard is the early SN field definiton saying "00h, 00h, 00h, 00h" should be used if "the field is not used".
...

Conclusions​

Aside from the complaint about how Samsung did use the early SN field justaposed against the VESA document that declares what it is for, the only thing that trips me up is that you claim the standard has priority based on field population that I have been unable to find. I guess that doesn't really matter if the early SN field is marked as "optional". The later field also seems to be marked as optional.

I'm home now. Here's what CTA-861 (our Bible for designing video sources, along with HDMI Standards) has to say about it:

Optional.
The serial number can also be stored in a separate descriptor block (see Section A.2.17).

0x0C ~ 0x0F are four bytes to be used for product Serial Number, which is defined as a 32-bit serial number. There is no specific requirement defined for the data or format of the serial number. This field should be zero if the serial number is contained in an ASCII serial number descriptor (see Section A.2.17). CTA-861 implementations should use 0x00 as padding for the Block 0 serial number if no serial number is provided in Block 0.

For the Source, if an ASCII Serial Number Descriptor is included in the Sink, then the Source should ignore the Serial Number field in Block 0. If no ASCII Serial Number Descriptor is present, then the field may have meaning. Ignore this block if all bytes are 0x00.
 
Last edited:
  • Like
Reactions: wegster and lasyos
How does CTA-861 interact (or not interact) with VESA EDID?
Incorporates it. You can download a slightly older version of 861 here by just clicking on a link.


The newest version of 861-I is FREE now from the CTA, you can get it here by signing up:

 
Last edited:
  • Like
Reactions: mattlorimor
Interesting developments, I wasn't aware of the if serial in CTA extension block, then ignore serial in main block requirement.

@mattlorimor The problem with CGDisplaySerialNumber is that it was defined way back in the Quartz days, when the ASCII serial number was not common. And because of that, it is defined to return a number as `unsigned integer of 32bits`. It is not possible for it to ever return the other serial number, that would be a breaking API change which does not happen.

1691048872767.png


Lunar and other apps can't use the ASCII serial number because there is no API for it. You either read and parse the EDID and hope that you get all the blocks, or on Apple Silicon, look for the AppleCLCD2 ioreg entry containing the AlphanumericSerialNumber property. Only now the problem is that there's no way to map the CGDisplayID of the screen, with the ioreg entry or the I²C port where the EDID is being read.

I do the best I can to map monitors to their metadata but Apple provides no API to get a definite and correct mapping, so our apps will have the same problem as the OS.

In light of the quality insights from @PianoPro, looks like we should be mad at both Apple and monitor vendors 😅 while the standard stated the serial number thing long ago, vendors moved slowly and still don't act according to spec, so it's understandable why Apple ignored this for so long.

Also, the main serial number block is 32bit! Even if the vendors entered a random number there, it would still be unique enough and not cause this mess.

But it's time for an update from Apple and I guess we need:
  • a stable serial number reading routine that favors the ASCII SN
    • I think the problem here is that to get to the extension block, you need to do at least 2 I²C reads + 2 writes, which means the monitor will take longer to connect and appear as visible
  • an API for reading the ASCII SN
  • an API for getting the correct I²C port for any specific CGDisplayID
 
Interesting developments, I wasn't aware of the if serial in CTA extension block, then ignore serial in main block requirement.

@mattlorimor The problem with CGDisplaySerialNumber is that it was defined way back in the Quartz days, when the ASCII serial number was not common. And because of that, it is defined to return a number as `unsigned integer of 32bits`. It is not possible for it to ever return the other serial number, that would be a breaking API change which does not happen.

View attachment 2240896

Lunar and other apps can't use the ASCII serial number because there is no API for it. You either read and parse the EDID and hope that you get all the blocks, or on Apple Silicon, look for the AppleCLCD2 ioreg entry containing the AlphanumericSerialNumber property. Only now the problem is that there's no way to map the CGDisplayID of the screen, with the ioreg entry or the I²C port where the EDID is being read.

I do the best I can to map monitors to their metadata but Apple provides no API to get a definite and correct mapping, so our apps will have the same problem as the OS.

In light of the quality insights from @PianoPro, looks like we should be mad at both Apple and monitor vendors 😅 while the standard stated the serial number thing long ago, vendors moved slowly and still don't act according to spec, so it's understandable why Apple ignored this for so long.

Also, the main serial number block is 32bit! Even if the vendors entered a random number there, it would still be unique enough and not cause this mess.

But it's time for an update from Apple and I guess we need:
  • a stable serial number reading routine that favors the ASCII SN
    • I think the problem here is that to get to the extension block, you need to do at least 2 I²C reads + 2 writes, which means the monitor will take longer to connect and appear as visible
  • an API for reading the ASCII SN
  • an API for getting the correct I²C port for any specific CGDisplayID
@alinpanaitiu - That's a really great point about the function return type. I agree. They wouldn't be able to change it without it being a breaking change. I believe you are correct when you say a new API method would be required.

Also, the main serial number block is 32bit! Even if the vendors entered a random number there, it would still be unique enough and not cause this mess.
I have stressed this exact point to Samsung in a follow-up email. They would seem to have less blame but still, arguably, some.

I have no idea how to get Apple to better address this. Even if they low-level fix their own macOS "flip flopping" symptom, apps like Lunar and displayplacer would benefit from being able to retrieve the secondary serial number reliably. Given how much and how long @PianoPro seems to have been at this, I don't hold out much hope. I don't even know where to begin with a formal complaint/request to Apple. As far as I can tell, the required low-level stuff is not open sourced, so it's not like I can just go create a GitHub issue. Lol I'm going to start hunting down Apple-employed display subsystem devs on LinkedIn.

Again, thanks a ton to everybody in this thread for continuing to document their findings.

This whole situation is crazy to me.
 
  • Like
Reactions: lasyos
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.