BetterDisplay icon indicating copy to clipboard operation
BetterDisplay copied to clipboard

Duplicate display entry ("LG TV SSCR2 2") created after sleep/wake although all stored identifiers are identical

Open paststrange opened this issue 3 weeks ago • 5 comments

Setup

  • BetterDisplay 5.2.1
  • MacBook Pro M3 Pro (Mac15,6), macOS 27.2 (26B123)
  • One LG TV (LG TV SSCR2, 3840×2160 @ 120 Hz) over HDMI, plus the built-in display
  • The TV reports the placeholder numeric serial 16843009 (0x01010101), and no alphanumeric serial
  • Display identification method: left at the default (no identificationMethod key in the prefs)

Problem After the Mac wakes from sleep, BetterDisplay sometimes creates a second entry for the same TV. It shows up as LG TV SSCR2 1 (old, now disconnected) and LG TV SSCR2 2 (new, connected). The settings stored on the old entry (brightness, etc.) are not applied to the new one. macOS itself only sees one external display (system_profiler SPDisplaysDataType).

The new entry was created on a wake after which macOS gave the TV a different CGDirectDisplayID (2 → 3).

Evidence These are the stored records for the same physical TV, taken from pro.betterdisplay.BetterDisplay.plist:

Field Old entry (tag 3) New entry (tag 111)
name LG TV SSCR2 1 LG TV SSCR2 2
firstAdded 2025-05-27 2026-11-08 10:06
persistedDisplayID 2 3
vendorNumber / modelNumber / serial 7789 / 33485 / 16843009 identical
systemUUID E790ACAB-1B0E-4703-8844-25DB8D074A30 identical
ioDisplayLocation …/AppleH15IO/dispext0@C0000000/IOMobileFramebufferShim identical
portID 48 identical
edidData (same blob) identical
yearOfManufacture / weekOfManufacture 2024 / 1 identical

persistedDisplayID is the only field that differs. Every hardware identifier matches, including the full EDID, system UUID, port and IO location. This is unlike #5929, where the IO location and UUID actually changed.

On each wake there is also a brief Generic Display (tag 63: systemUUID UNKNOWN, same vendor/model/serial). It appears about 1 s before the TV's EDID becomes available and disappears right after. That may be why the matching fails: at that moment the old entry looks "taken", or the CG display ID has already changed.

Expected When every stored identifier (EDID, system UUID, IO location, port) matches an existing entry, BetterDisplay should reuse that entry even if the CGDirectDisplayID changed across sleep/wake. It should not create … 2.

Workaround Forget the stale record manually (as suggested in #5962). The duplicate can come back the next time the display ID flips.

Related #5962, #5929, #1591

paststrange avatar Nov 08 '26 15:11 paststrange

Update: this looks like a regression in 5.2.x

I downgraded to v5.1.1 (official release DMG, same Team ID) and kept the existing preferences file.

Right after launch, 5.1.1 matched the TV back to the original entry (tag 3). It renamed that entry from LG TV SSCR2 1 to LG TV SSCR2 and marked it connected. The duplicate entry from 5.2.1 (tag 111, LG TV SSCR2 2) is now shown as disconnected.

The TV's CGDirectDisplayID is still 3, while the original entry's persistedDisplayID is 2. So 5.1.1 matches the display correctly even though the display ID changed, and 5.2.1 created a new entry in the same situation.

Version Display ID 3, original entry recorded with ID 2
5.1.1 matched to existing entry (tag 3) ✅
5.2.1 created new entry … 2 (tag 111) ❌

I did not test 5.2.0 (pre-release). I'm staying on 5.1.1 for now and am happy to test a fix build.

paststrange avatar Nov 08 '26 15:11 paststrange

Thank you @paststrange for reporting this.

can you please go back to the v5.2.1 version, go to app menu's Tools > Show Console, then turn on "Logging" (see the title bar)?

Then please reproduce the issue. Afterwards copy the entire log you see in the console window. This should help a lot reproducing or investigating the issue.

Thanks again!

waydabber avatar Nov 08 '26 17:11 waydabber

(note: I found a possible path this may happen in certain conditions however that path is the same in v5.1.1, which is somewhat confusing as downgrading to v5.1.1 seems to have fixed the issue according to the report).

waydabber avatar Nov 08 '26 17:11 waydabber

I believe now that downgrading to v5.1.1 was incidental, as probably the issue arises from some specific timing factors. I'll attempt to provide a fix based on the error path we found. The logs would still be super useful though if the issue could be reproduced. Please note that when you enable logging and run the app normally, the logs will be there, so whenever the issue resurfaces, you can just go to Show Console and grab the logs - the console does not need to be open continuously @paststrange.

waydabber avatar Nov 08 '26 18:11 waydabber

I added a fix for this.

waydabber avatar Nov 13 '26 09:11 waydabber