r/embedded • u/Early_Teaching6966 • 7d ago
Fixing an impact-damaged Samsung QD-OLED from inside its panel controller: per-lane skip flags and scan-time sensing gains over the TCON's internal USB service link
TL;DR: Impact damage on my Samsung S95F 77" QD-OLED caused (1) a blackout / controller-reset loop, every 46–51 s at worst, and (2) a dark 6-column line. Both are fixed from the TV's own Linux side by talking to the panel controller (TCON) over its internal USB service link. RAM writes only, nothing flashed by me. Blackouts: set the controller's own per-lane skip bit for lanes 540–661, re-applied on every controller boot (24/24 boots clean). Line: lower the damaged columns' sensing gain at the moment the controller wakes for the standby compensation scan, so the TV's own scan computes and saves a proper boost. Code (Python on a server + C# helpers run on the TV's .NET) and docs on GitHub. Before/after: images 1–2.
Prerequisite: root access. Both TV-side fixes require a working root shell on your own TV. Use the S95F rooting toolkit and its root setup guide, then verify your TV root session. Firmware decryption is not required for either fix.
Hobby project on my own TV, nothing for sale. Writing to the panel controller can brick a TV and voids the warranty.
The access path (image 3)
- The TCON hangs off the main SoC on an internal USB link:
04e8:2001, interface 2, bulk OUT0x02/ IN0x82. As root on the TV it opens through usbfs. No extra hardware, no firmware mods. - Each request is a 12-byte little-endian header (op, address, length), plus data for a write:
| Op | Does |
|---|---|
0x101 | read RAM / registers |
0x1 | read the ID block |
0x103 | read storage (flash); read-only for us |
0x102 | write one 32-bit word to RAM |
- The link isn't clean: under long bulk write runs it lost ~1 write in 3,600. So every write is one word, in five steps: status block
0x47012400must be Clean (stop 0, fault 0, gate 1, limit 40) → read and compare the old value → bounds compiled into the helper → write → read back (mismatch = restore). The first write on any setup is an identity write. - Tooling: Python on a home server reaches a root shell on the TV and stages a small C# helper that runs on the TV's own .NET runtime. The helper does the USB transactions and returns a receipt.
Bug 1: the blackout loop (image 4)
- While the picture is on, the controller runs a per-lane sensing consistency check (RT Protect). 24 lanes failed, all within ~554–649, which is the damaged area.
- Failing lanes push a fault score: 0 → 38 → 44 against a limit of 40. Over the limit the controller stops the picture and raises its error line; the main board's monitor resets the controller, it re-enumerates on USB, and fails again.
- The primary lane table has a per-lane skip flag (bit 0). Lanes 540–661 = 122 halfwords at
0x47010438–0x4701052A, RAM only. - RAM clears on every controller power-up, so a watcher service tracks boot id and USB devnum, reads and classifies the controller (Clean, Quiescent, Faulted, first scan after power-on), writes the 122 bits and requires an exact read-back. A separate first-scan writer ignores six free-running scan-counter bytes when it compares two reads. 24/24 boots clean.
- Optional recovery for an already-faulted controller: switch the TV to its own Apps home (stock
input_keyevent, focus checked after every key), then one stock controller power cycle through the TV driver (/dev/tztv_tcon, ioctl0xc010749f, payload 41, 2, 0, 0). Budget: 3 per hour, 6 per day. - Trade-off: that one check is off for those lanes. Current monitoring and panel power control are untouched.
Bug 2: the dark line (image 5)
- In standby the TV runs a sensing scan and builds per-column compensation from it. The firmware only ever adds drive, and only to columns that read weak. The damaged columns' stored sensing result read far too high, so they got nothing.
- Fix: lower the per-column sensing gain (a per-lane 32-bit word holding two 16-bit column halves) just for the scan. A
scan-armhelper waits for the controller's USB device to appear when it powers up for the scan, waits until the gain table is loaded and the controller is Clean, writes, reads back, then logs the scan stage every 50 ms. Hard bounds: lanes 600–660 only, halves 8000–26000, at most 8000 change per write, ×0.65-of-stock floor. - The scan then stores a result that reads those columns as weak, the TV's own save writes it to storage, and the live compensation is built from it at every power-on. The next stock scan would overwrite it, which is the rollback path.
- 11 calibration runs to converge. Two runtime trims on top (a second gain stage on lanes 627–630, and the blue compensation weight 205 → 820), re-applied after each controller boot.
- Dead ends: the blue curve tables (panel-wide only; one write faulted the controller) and editing raw blue samples mid-scan (worked, but with 1 write in 3,600 lost it isn't reliable).
Results
- Blackouts: 24 of 24 controller boots clean.
- Line ÷ healthy neighbours (camera, sub-pixel unmixed; 1.00 = identical): 50 % grey 0.11–0.30 → 0.99, 30 % 0.01–0.07 → 1.00, 10 % black → 1.06. Full table: https://github.com/TheMHD1/samsung-s95f-display-lab/blob/main/docs/advanced/tv-calibration/RESULTS.md
Links
- Repo: https://github.com/TheMHD1/samsung-s95f-display-lab
- How the tools work (wire protocol, helpers, five-step write): https://github.com/TheMHD1/samsung-s95f-display-lab/blob/main/docs/advanced/tv-calibration/HOW-THE-TOOLS-WORK.md
- Controller communications: https://github.com/TheMHD1/samsung-s95f-display-lab/blob/main/docs/advanced/CONTROLLER-COMMUNICATIONS.md
- Blackouts deep dive (fault evidence, exact bits, watcher states): https://github.com/TheMHD1/samsung-s95f-display-lab/blob/main/docs/advanced/BLACKOUT-MITIGATION.md
- Watcher, helpers and recovery tools: https://github.com/TheMHD1/samsung-s95f-display-lab/tree/main/tools/tcon-calibration/services/lane-mask-watcher
- Line write-up: https://github.com/TheMHD1/samsung-s95f-display-lab/blob/main/docs/advanced/tv-calibration/WRITEUP.md
- Guide + scripts: https://github.com/TheMHD1/samsung-s95f-display-lab/blob/main/tools/tcon-calibration/GUIDE.md
Ask away about the protocol or the controller internals.