waydabber / BetterDisplay

Unlock your displays on your Mac! Flexible HiDPI scaling, XDR/HDR extra brightness, virtual screens, DDC control, extra dimming, PIP/streaming, EDID override and lots more!
https://betterdisplay.pro
19.28k stars 341 forks source link

Kernel Panic on Sleep with MacMini Using HDMI and USB-C Monitors With Custom Resolution (with App Not Running) #2602

Closed uyu423 closed 8 months ago

uyu423 commented 8 months ago

Description:

I've encountered a recurrent issue where my MacMini reboots from sleep mode accompanied by a kernel panic. This issue started occurring after I installed BetterDisplay, an open-source tool for enhanced display management on macOS. My setup includes one monitor connected via HDMI and a second monitor connected via USB-C.

Kernel Panic Log Summary:

The kernel panic references AppleT602XDPTXPort with a message indicating a timeout occurred during deactivate() after displayRelease(). This seems to be related to display management, potentially linked to the operation of BetterDisplay. Below is a condensed version of the kernel panic log for reference:

panic(cpu 0 caller 0xfffffe001317839c): "AppleT602XDPTXPort(lpdptx-phy0)::deactivateTimeoutOccurred(0x10000035f): deactivate() incomplete 10 seconds after displayRelease()! (check DCPEXT)\n" @AppleT8112DPTXPort.cpp:574
...
Kernel version: Darwin Kernel Version 23.2.0
...
Loaded kexts include com.apple.driver.AppleDisplayCrossbar and related dependencies.

Steps to Reproduce:

  1. Install BetterDisplay on a MacMini.
  2. Connect one monitor via HDMI and a second monitor via USB-C.
  3. Enter sleep mode.
  4. Observe that the system experiences a kernel panic and reboots instead of sleeping properly.

Expected Behavior:

The system enters and exits sleep mode without issues, with all display configurations preserved and managed by BetterDisplay.

Actual Behavior:

The system experiences a kernel panic related to AppleT602XDPTXPort during sleep mode, leading to an unexpected reboot.

System Configuration:

Request:

I am seeking assistance to resolve this kernel panic issue related to display management with BetterDisplay. Any insights, suggestions, or fixes would be greatly appreciated. Thank you for your support and for the development of this valuable tool.

Full logs

```panic(cpu 0 caller 0xfffffe001317839c): "AppleT602XDPTXPort(lpdptx-phy0)::deactivateTimeoutOccurred(0x10000035f): deactivate() incomplete 10 seconds after displayRelease()! (check DCPEXT)\n" @AppleT8112DPTXPort.cpp:574 Debugger message: panic Memory ID: 0x6 OS release type: User OS version: 23C71 Kernel version: Darwin Kernel Version 23.2.0: Wed Nov 15 21:55:06 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6020 Fileset Kernelcache UUID: 869403F0E135E5AF8C41B1876A9CE8B8 Kernel UUID: E96926EC-B526-329B-9195-49D0D303154A Boot session UUID: F089603A-D773-4D8D-9C9E-D560C62AE7B7 iBoot version: iBoot-10151.61.4 secure boot?: YES roots installed: 0 Paniclog version: 14 KernelCache slide: 0x0000000009b64000 KernelCache base: 0xfffffe0010b68000 Kernel slide: 0x0000000009b6c000 Kernel text base: 0xfffffe0010b70000 Kernel text exec slide: 0x000000000b0c0000 Kernel text exec base: 0xfffffe00120c4000 mach_absolute_time: 0xd692efba20 Epoch Time: sec usec Boot : 0x65a7589c 0x000c067a Sleep : 0x65a83a4b 0x0001d756 Wake : 0x65a83be2 0x00071822 Calendar: 0x65a83c86 0x00095b24 Zone info: Zone map: 0xfffffe101c094000 - 0xfffffe301c094000 . VM : 0xfffffe101c094000 - 0xfffffe14e8d60000 . RO : 0xfffffe14e8d60000 - 0xfffffe16826f8000 . GEN0 : 0xfffffe16826f8000 - 0xfffffe1b4f3c4000 . GEN1 : 0xfffffe1b4f3c4000 - 0xfffffe201c090000 . GEN2 : 0xfffffe201c090000 - 0xfffffe24e8d5c000 . GEN3 : 0xfffffe24e8d5c000 - 0xfffffe29b5a28000 . DATA : 0xfffffe29b5a28000 - 0xfffffe301c094000 Metadata: 0xfffffe301c0a4000 - 0xfffffe30240a4000 Bitmaps : 0xfffffe30240a4000 - 0xfffffe3026e9c000 Extra : 0 - 0 TPIDRx_ELy = {1: 0xfffffe168524d000 0: 0x0000000000000000 0ro: 0x0000000000000000 } CORE 0 PVH locks held: None CORE 1 PVH locks held: None CORE 2 PVH locks held: None CORE 3 PVH locks held: None CORE 4 PVH locks held: None CORE 5 PVH locks held: None CORE 6 PVH locks held: None CORE 7 PVH locks held: None CORE 8 PVH locks held: None CORE 9 PVH locks held: None CORE 0 is the one that panicked. Check the full backtrace for details. CORE 1: PC=0xfffffe0012154548, LR=0xfffffe0012154548, FP=0xfffffe3a30537ef0 CORE 2: PC=0xfffffe0012154548, LR=0xfffffe0012154548, FP=0xfffffe3a31b0bef0 CORE 3: PC=0xfffffe0012154548, LR=0xfffffe0012154548, FP=0xfffffe3a3175bef0 CORE 4: PC=0xfffffe0012154548, LR=0xfffffe0012154548, FP=0xfffffe3a3121bef0 CORE 5: PC=0xfffffe0012154548, LR=0xfffffe0012154548, FP=0xfffffe3a3174fef0 CORE 6: PC=0xfffffe001215454c, LR=0xfffffe0012154548, FP=0xfffffe3a3168fef0 CORE 7: PC=0xfffffe0012154548, LR=0xfffffe0012154548, FP=0xfffffe3a30033ef0 CORE 8: PC=0xfffffe0012154548, LR=0xfffffe0012154548, FP=0xfffffe3a31447ef0 CORE 9: PC=0xfffffe0012154548, LR=0xfffffe0012154548, FP=0xfffffe3a319f7ef0 Compressor Info: 10% of compressed pages limit (OK) and 9% of segments limit (OK) with 0 swapfiles and OK swap space Panicked task 0xfffffe16827a7448: 0 pages, 537 threads: pid 0: kernel_task Panicked thread: 0xfffffe168524d000, backtrace: 0xfffffe3a318e3770, tid: 1121869 lr: 0xfffffe001211a9b0 fp: 0xfffffe3a318e3800 lr: 0xfffffe0012263464 fp: 0xfffffe3a318e3870 lr: 0xfffffe00122619fc fp: 0xfffffe3a318e3960 lr: 0xfffffe00120cb8cc fp: 0xfffffe3a318e3970 lr: 0xfffffe001211a2a4 fp: 0xfffffe3a318e3d20 lr: 0xfffffe0012912da8 fp: 0xfffffe3a318e3d40 lr: 0xfffffe001317839c fp: 0xfffffe3a318e3d90 lr: 0xfffffe0013151a38 fp: 0xfffffe3a318e3db0 lr: 0xfffffe001281e838 fp: 0xfffffe3a318e3df0 lr: 0xfffffe0012179414 fp: 0xfffffe3a318e3e30 lr: 0xfffffe001217a448 fp: 0xfffffe3a318e3f20 lr: 0xfffffe00120d4be4 fp: 0x0000000000000000 Kernel Extensions in backtrace: com.apple.driver.AppleDisplayCrossbar(1.0)[A925BCBF-817A-32DD-ACAA-F9FD8AE54E4A]@0xfffffe00131474e0->0xfffffe0013178d47 dependency: com.apple.driver.AppleARMPlatform(1.0.2)[9FC0A536-5BC6-33D5-911A-5A46BDDBBCEF]@0xfffffe0012abdfd0->0xfffffe0012b10b0b dependency: com.apple.driver.AppleTypeCPhy(1)[64D2F64D-165C-3A6F-A032-08C256FA536F]@0xfffffe0013bec2b0->0xfffffe0013bffa1b dependency: com.apple.iokit.IOAVFamily(1.0.0)[14077AAB-D09F-3015-B7FB-5FC40382573D]@0xfffffe0014286120->0xfffffe001430fc7f dependency: com.apple.iokit.IOAccessoryManager(1.0.0)[236E02DF-096D-3869-B2F0-FF0F46C29617]@0xfffffe001430fc80->0xfffffe0014419717 dependency: com.apple.iokit.IODisplayPortFamily(1.0.0)[5CFE0C2D-A7A7-362E-9BB7-1E277740CDCF]@0xfffffe00144d9410->0xfffffe001452d9cb dependency: com.apple.iokit.IOPortFamily(1.0)[A0E01328-EC47-32B6-876C-21C80CFE5C41]@0xfffffe001488d7f0->0xfffffe001488d873 dependency: com.apple.iokit.IOThunderboltFamily(9.3.3)[AFCB2506-B866-3BF9-80D6-626938430929]@0xfffffe0014995b20->0xfffffe0014ae020f last started kext at 30426250465: com.apple.filesystems.autofs 3.0 (addr 0xfffffe00115775e0, size 5912) loaded kexts: com.apple.filesystems.autofs 3.0 com.apple.UVCService 1 com.apple.driver.AppleTopCaseHIDEventDriver 7400.26 com.apple.driver.AppleBiometricServices 1 com.apple.driver.CoreKDL 1 com.apple.driver.DiskImages.ReadWriteDiskImage 493.0.0 com.apple.driver.DiskImages.UDIFDiskImage 493.0.0 com.apple.driver.DiskImages.RAMBackingStore 493.0.0 com.apple.driver.DiskImages.FileBackingStore 493.0.0 com.apple.driver.BCMWLANFirmware4388.Hashstore 1 com.apple.iokit.AppleBCM5701Ethernet 11.0.0 com.apple.driver.AppleAOPVoiceTrigger 300.7 com.apple.driver.AppleThunderboltIP 4.0.3 com.apple.driver.AppleUSBDeviceNCM 5.0.0 com.apple.driver.AppleFileSystemDriver 3.0.1 com.apple.nke.l2tp 1.9 com.apple.filesystems.tmpfs 1 com.apple.driver.AppleSmartIO2 1 com.apple.driver.SEPHibernation 1 com.apple.driver.ApplePMP 1 com.apple.driver.AppleCS42L84Audio 700.46 com.apple.driver.AppleTypeCRetimer 1.0.0 com.apple.AppleEmbeddedSimpleSPINORFlasher 1 com.apple.filesystems.nfs 1 com.apple.filesystems.lifs 1 com.apple.filesystems.apfs 2235.60.6 com.apple.IOTextEncryptionFamily 1.0.0 com.apple.driver.AppleSN012776Amp 700.46 com.apple.filesystems.hfs.kext 650.0.2 com.apple.security.BootPolicy 1 com.apple.BootCache 40 com.apple.AppleFSCompression.AppleFSCompressionTypeZlib 1.0.0 com.apple.AppleFSCompression.AppleFSCompressionTypeDataless 1.0.0d1 com.apple.driver.AppleT6020CLPC 1 com.apple.driver.AppleT6020SOCTuner 1 com.apple.driver.AppleSmartBatteryManager 161.0.0 com.apple.driver.usb.AppleSynopsysUSB40XHCI 1 com.apple.driver.AppleS8000DWI 1.0.0d1 com.apple.driver.AppleProResHW 326.11.0 com.apple.driver.ApplePMPFirmware 1 com.apple.driver.AppleInterruptControllerV2 1.0.0d1 com.apple.driver.AppleSamsungSerial 1.0.0d1 com.apple.driver.AppleS8000AES 1 com.apple.driver.AppleJPEGDriver 6.2.2 com.apple.driver.AppleAVE2 703.54.1 com.apple.driver.AppleBCMWLANBusInterfacePCIe 1 com.apple.driver.AppleBluetoothModule 1 com.apple.driver.AppleEventLogHandler 1 com.apple.driver.AppleT6020PMGR 1 com.apple.driver.AppleS5L8960XNCO 1 com.apple.driver.AppleMobileDispT602X-DCP 140.0 com.apple.driver.AppleS5L8920XPWM 1.0.0d1 com.apple.driver.AppleSerialShim 1 com.apple.driver.AppleSPIMC 1 com.apple.driver.AudioDMAController-T602x 300.15 com.apple.driver.AppleAVD 737.1 com.apple.AGXG14X 276.58 com.apple.driver.AppleT8110DART 1 com.apple.driver.AppleS5L8940XI2C 1.0.0d2 com.apple.driver.AppleT6020 1 com.apple.driver.AppleM68Buttons 1.0.0d1 com.apple.iokit.IOUserEthernet 1.0.1 com.apple.driver.usb.AppleUSBUserHCI 1 com.apple.iokit.IOKitRegistryCompatibility 1 com.apple.iokit.EndpointSecurity 1 com.apple.driver.AppleDiskImages2 273 com.apple.AppleSystemPolicy 2.0.0 com.apple.nke.applicationfirewall 404 com.apple.kec.InvalidateHmac 1 com.apple.kec.AppleEncryptedArchive 1 com.apple.driver.AppleUSBMergeNub 900.4.2 com.apple.driver.driverkit.serial 6.0.0 com.apple.driver.AppleActuatorDriver 7400.42 com.apple.driver.AppleMultitouchDriver 7400.42 com.apple.driver.AppleInputDeviceSupport 7410.1 com.apple.driver.AppleHSBluetoothDriver 7400.26 com.apple.driver.IOBluetoothHIDDriver 9.0.0 com.apple.driver.AppleMesaSEPDriver 100.99 com.apple.iokit.IOBiometricFamily 1 com.apple.driver.usb.IOUSBHostHIDDevice 1.2 com.apple.driver.usb.cdc 5.0.0 com.apple.driver.AppleUSBAudio 610.3 com.apple.iokit.IOAudioFamily 500.4 com.apple.vecLib.kext 1.2.0 com.apple.driver.AppleUVDMDriver 1.0.0 com.apple.driver.AppleUVDM 1.0.0 com.apple.driver.DiskImages.KernelBacked 493.0.0 com.apple.driver.AppleXsanScheme 3 com.apple.driver.usb.AppleEmbeddedUSBXHCIPCI 1 com.apple.driver.usb.AppleUSBXHCIPCI 1.2 com.apple.driver.AppleConvergedIPCOLYBTControl 1 com.apple.driver.AppleConvergedPCI 1 com.apple.driver.AppleBluetoothDebug 1 com.apple.driver.AppleAOPAudio 300.14 com.apple.driver.usb.networking 5.0.0 com.apple.driver.AppleThunderboltUSBDownAdapter 1.0.4 com.apple.driver.AppleThunderboltPCIDownAdapter 4.1.1 com.apple.driver.AppleThunderboltDPInAdapter 8.5.1 com.apple.driver.AppleThunderboltDPAdapterFamily 8.5.1 com.apple.nke.ppp 1.9 com.apple.driver.AppleTrustedAccessory 1 com.apple.iokit.AppleSEPGenericTransfer 1 com.apple.driver.AppleSEPHDCPManager 1.0.1 com.apple.driver.AppleDCPDPTXProxy 1.0.0 com.apple.driver.AppleCSEmbeddedAudio 700.46 com.apple.driver.DCPDPFamilyProxy 1 com.apple.driver.AppleBSDKextStarter 3 com.apple.kext.triggers 1.0 com.apple.driver.AppleDiagnosticDataAccessReadOnly 1.0.0 com.apple.driver.AppleEmbeddedAudio 700.46 com.apple.iokit.AppleARMIISAudio 300.11 com.apple.filesystems.hfs.encodings.kext 1 com.apple.driver.AppleSyntheticGameController 11.2.3 com.apple.driver.AppleBTM 1.0.1 com.apple.driver.IOHIDPowerSource 1 com.apple.driver.AppleCallbackPowerSource 1 com.apple.driver.ApplePassthroughPPM 3.0 com.apple.driver.AppleT8112TypeCPhy 1 com.apple.driver.AppleT8103TypeCPhy 1 com.apple.driver.AppleUSBXDCIARM 1.0 com.apple.driver.AppleUSBXDCI 1.0 com.apple.iokit.IOUSBDeviceFamily 2.0.0 com.apple.driver.usb.AppleSynopsysUSBXHCI 1 com.apple.driver.usb.AppleUSBXHCI 1.2 com.apple.driver.AppleEmbeddedUSBHost 1 com.apple.driver.usb.AppleUSBHub 1.2 com.apple.driver.usb.AppleUSBHostCompositeDevice 1.2 com.apple.driver.AppleSPU 1 com.apple.AGXFirmwareKextG14XRTBuddy 1 com.apple.AGXFirmwareKextRTBuddy64 276.58 com.apple.driver.AppleSPMIPMU 1.0.1 com.apple.driver.AppleDialogPMU 1.0.1 com.apple.iokit.IONVMeFamily 2.1.0 com.apple.driver.AppleNANDConfigAccess 1.0.0 com.apple.driver.AppleStockholmControl 1.0.0 com.apple.driver.AppleARMWatchdogTimer 1 com.apple.driver.AppleBluetoothDebugService 1 com.apple.driver.AppleBCMWLANCore 1.0.0 com.apple.iokit.IO80211Family 1200.13.0 com.apple.driver.IOImageLoader 1.0.0 com.apple.driver.AppleOLYHAL 1 com.apple.driver.AppleSART 1 com.apple.driver.AppleSPMI 1.0.1 com.apple.driver.ApplePMGR 1 com.apple.iokit.IOMobileGraphicsFamily-DCP 343.0.0 com.apple.iokit.IOMobileGraphicsFamily 343.0.0 com.apple.driver.AppleM2ScalerCSCDriver 265.0.0 com.apple.driver.AppleHPM 3.4.4 com.apple.driver.AppleDCP 1 com.apple.driver.DCPAVFamilyProxy 1 com.apple.driver.AppleFirmwareKit 1 com.apple.driver.AppleDisplayCrossbar 1.0.0 com.apple.iokit.IODisplayPortFamily 1.0.0 com.apple.driver.AppleTypeCPhy 1 com.apple.iokit.IOGPUFamily 93.10.1 com.apple.driver.AppleMCA2-T602x 800.11 com.apple.driver.AppleEmbeddedAudioLibs 300.1 com.apple.driver.AppleFirmwareUpdateKext 1 com.apple.driver.AppleThunderboltNHI 7.2.81 com.apple.driver.AppleT6000PCIeC 1 com.apple.iokit.IOThunderboltFamily 9.3.3 com.apple.iokit.IOPortFamily 1.0 com.apple.driver.ApplePIODMA 1 com.apple.iokit.IOAVBFamily 1220.1 com.apple.plugin.IOgPTPPlugin 1200.91 com.apple.driver.AppleT602xPCIe 1 com.apple.driver.AppleGPIOICController 1.0.2 com.apple.driver.AppleFireStormErrorHandler 1 com.apple.driver.usb.AppleUSBHostPacketFilter 1.0 com.apple.driver.AppleMobileApNonce 1 com.apple.driver.AppleMultiFunctionManager 1 com.apple.driver.corecapture 1.0.4 com.apple.driver.AppleEmbeddedPCIE 1 com.apple.iokit.IOTimeSyncFamily 1200.91 com.apple.driver.DiskImages 493.0.0 com.apple.iokit.IOGraphicsFamily 598 com.apple.iokit.IOBluetoothFamily 9.0.0 com.apple.driver.AppleSSE 1.0 com.apple.driver.AppleSEPKeyStore 2 com.apple.driver.AppleUSBTDM 556 com.apple.iokit.IOUSBMassStorageDriver 243 com.apple.iokit.IOPCIFamily 2.9 com.apple.iokit.IOSCSIBlockCommandsDevice 492 com.apple.iokit.IOSCSIArchitectureModelFamily 492 com.apple.driver.AppleRSMChannel 1 com.apple.iokit.IORSMFamily 1 com.apple.driver.AppleLockdownMode 1 com.apple.driver.AppleIPAppender 1.0 com.apple.driver.AppleFDEKeyStore 28.30 com.apple.driver.AppleEffaceableStorage 1.0 com.apple.driver.AppleCredentialManager 1.0 com.apple.driver.KernelRelayHost 1 com.apple.iokit.IOUSBHostFamily 1.2 com.apple.driver.AppleUSBHostMergeProperties 1.2 com.apple.driver.usb.AppleUSBCommon 1.0 com.apple.driver.AppleSMC 3.1.9 com.apple.driver.RTBuddy 1.0.0 com.apple.driver.AppleEmbeddedTempSensor 1.0.0 com.apple.driver.AppleARMPMU 1.0 com.apple.iokit.IOAccessoryManager 1.0.0 com.apple.driver.AppleOnboardSerial 1.0 com.apple.iokit.IOSkywalkFamily 1.0 com.apple.driver.mDNSOffloadUserClient 1.0.1b8 com.apple.iokit.IONetworkingFamily 3.4 com.apple.iokit.IOSerialFamily 11 com.apple.driver.AppleSEPManager 1.0.1 com.apple.driver.AppleA7IOP 1.0.2 com.apple.driver.IOSlaveProcessor 1 com.apple.driver.AppleBiometricSensor 2 com.apple.iokit.IOHIDFamily 2.0.0 com.apple.driver.AppleANELoadBalancer 7.202.3 com.apple.driver.AppleH11ANEInterface 7.202.0 com.apple.driver.IODARTFamily 1 com.apple.AUC 1.0 com.apple.iokit.IOSurface 352.0.3 com.apple.iokit.IOAVFamily 1.0.0 com.apple.iokit.IOHDCPFamily 1.0.0 com.apple.iokit.IOCECFamily 1 com.apple.iokit.IOAudio2Family 1.0 com.apple.driver.AppleIISController 300.1 com.apple.driver.AppleAudioClockLibs 300.1 com.apple.driver.FairPlayIOKit 71.3.0 com.apple.driver.AppleARMPlatform 1.0.2 com.apple.iokit.IOSlowAdaptiveClockingFamily 1.0.0 com.apple.iokit.IOReportFamily 47 com.apple.security.quarantine 4 com.apple.security.sandbox 300.0 com.apple.iokit.IOStorageFamily 2.1 com.apple.kext.AppleMatch 1.0.0d1 com.apple.driver.AppleMobileFileIntegrity 1.0.5 com.apple.iokit.CoreAnalyticsFamily 1 com.apple.security.AppleImage4 5.0.0 com.apple.kext.CoreTrust 1 com.apple.iokit.IOCryptoAcceleratorFamily 1.0.1 com.apple.kec.pthread 1 com.apple.kec.Libm 1 com.apple.kec.Compression 1.0 com.apple.kec.corecrypto 14.0 ** Stackshot Succeeded ** Bytes Traced 705689 (Uncompressed 1843536) ** ```
waydabber commented 8 months ago

Hi there,

thanks for reaching out and sorry about the trouble!

From the log section it seems like the issue is happening at low level (DCPEXT) is the part of the Apple Silicon chip that manages external displays, negotiating the connection. BetterDisplay does not directly communicate to this component but uses macOS APIs to interact with it, so it might be difficult to figure out what causes the issue or if there is a definite connection between the crash and the app (as sadly Apple Silicon Macs have a tendency to crash or mishandle display related stuff for a myriad of internal reasons). However if the issue is clearly linked to BetterDisplay running (happens only then), an approach might be to try to isolate which functionality triggers the issue with this specific display configuration (this means trying to disable various BetterDisplay features until the issue is pinpointed).

Questions:

Screenshot 2024-02-02 at 10 02 05

Thank you!

uyu423 commented 8 months ago

@waydabber

Hello,

Thank you very much for your prompt and detailed response. Here are the answers to your questions based on my experience:

I will proceed with disabling the connection management feature to see if this change affects the occurrence of the issue. I appreciate your guidance on this matter and will report back with my findings.

Thank you for your assistance and patience.

ps) Is there a way to change BetterDisplay's language options? I'd like to share a screenshot of my settings, but it's in Korean so it might be difficult to understand. If you can tell me how to change the language to English, I will share the current settings screen.

uyu423 commented 8 months ago

ps2) Since I am not using the Pro version, I cannot change the Display Connections items....

waydabber commented 8 months ago

Sure, you can change the language under System Settings > General > Language & Region > Applications.

waydabber commented 8 months ago

All right, since the issue seems to be happening regardless of whether BetterDisplay is running or not, it might be some kind of display specific problem. The problem is related to the DCP which handles the framebuffer as well, so it might be that the configured custom resolution causes the issue. You can try with different custom resolutions or test if a reset to the default configuration fixes the issue or not.

I'll move this over to discussions, maybe others had/have similar issues and can chime in.