Jump to content
About Just Joined group Read more... ×
kevin_1351

[Help needed] VirtualSMC causes periodic updates of clamshell state

1 post in this topic

Recommended Posts

tl;dr: VirtualSMC causes me a flood of log messages and correlated cpu spikes. FakeSMC doesn't.

 

Hi, I have almost finalized my Huawei Matebook X Pro Opencore setup and everything is working very well besides wifi/bt ofc (which is about to change).

 

However, I noticed how the cpu usage sometimes went up a little and when looking at the Console I could see a never-ending flood of:

default	14:05:05.983292+0100	loginwindow	clamshellStateChanged | Clamshell state changed: closed=0, shouldSleepWhenClosed=2
default	14:05:05.982975+0100	kernel	PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0
default	14:05:05.982996+0100	kernel	PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0
default	14:05:06.985932+0100	kernel	PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0
default	14:05:06.985949+0100	kernel	PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0
default	14:05:06.986134+0100	loginwindow	clamshellStateChanged | Clamshell state changed: closed=0, shouldSleepWhenClosed=2
default	14:05:39.426574+0100	kernel	PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0
default	14:05:39.426729+0100	loginwindow	clamshellStateChanged | Clamshell state changed: closed=0, shouldSleepWhenClosed=2
default	14:05:39.426585+0100	kernel	PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0
default	14:05:41.431085+0100	kernel	PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0
default	14:05:41.431097+0100	kernel	PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0
default	14:05:41.431246+0100	loginwindow	clamshellStateChanged | Clamshell state changed: closed=0, shouldSleepWhenClosed=2
default	14:05:42.433068+0100	kernel	PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0
default	14:05:42.433227+0100	loginwindow	clamshellStateChanged | Clamshell state changed: closed=0, shouldSleepWhenClosed=2
default	14:05:42.433078+0100	kernel	PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0
default	14:05:43.434453+0100	kernel	PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0
default	14:05:43.434465+0100	kernel	PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0
default	14:05:43.434622+0100	loginwindow	clamshellStateChanged | Clamshell state changed: closed=0, shouldSleepWhenClosed=2
default	14:05:44.436155+0100	kernel	PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0
default	14:05:44.436166+0100	kernel	PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0

 

As you can see, multiple of these per second. Another guy with the same computer is also having this issue and posted a dsdt change to fix it. This fix didn't solve anything though

He tried to limit the Notify call by implementing a state change requirement before calling Notify.

 

Here is the original acpi:

    Scope (_SB)
    {
        Device (LID)
        {
            Name (_HID, EisaId ("PNP0C0D") /* Lid Device */)  // _HID: Hardware ID
            Method (_LID, 0, NotSerialized)  // _LID: Lid Status
            {
                Local0 = One
                Local0 = ^^PCI0.LPCB.EC0.RPIN (0x05, 0x06)
                If ((Local0 == 0x55))
                {
                    Local0 = Zero
                }
                Else
                {
                    Local0 = One
                }

                ^^PCI0.GFX0.CLID = Local0
                Return (Local0)
            }
        }

        Device (PWRB)
        {
            Name (_HID, EisaId ("PNP0C0C") /* Power Button Device */)  // _HID: Hardware ID
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                Return (0x0B)
            }
        }
    }

    Scope (_SB.PCI0.LPCB.EC0)
    {
        Method (_Q81, 0, NotSerialized)  // _Qxx: EC Query, xx=0x00-0xFF
        {
            Local0 = ^^^^LID._LID ()
            If ((Local0 == Zero))
            {
                ADBG ("LID-OFF")
                SGOV (0x02030009, Zero)
                SGOV (0x02060000, Zero)
            }
            Else
            {
                ADBG ("LID-ON")
                SGOV (0x02030009, One)
                SGOV (0x02060000, One)
                Notify (ALSD, 0x80) // Status Change
            }

            Notify (LID, 0x80) // Status Change
        }
    }

Which he changed to: 

    Scope (_SB)
    {
        Device (LID)
        {
            Name (_OLD, One) // assuming everything else.. the lid should start open?
            Name (_HID, EisaId ("PNP0C0D") /* Lid Device */)  // _HID: Hardware ID
            Method (_LID, 0, NotSerialized)  // _LID: Lid Status
            {
                Local0 = One
                Local0 = ^^PCI0.LPCB.EC0.RPIN (0x05, 0x06)
                If ((Local0 == 0x55))
                {
                    Local0 = Zero
                }
                Else
                {
                    Local0 = One
                }

                Return (Local0)
            }
        }

        Device (PNLF)
        {
            Name (_HID, EisaId ("APP0002"))  // _HID: Hardware ID
            Name (_CID, "backlight")  // _CID: Compatible ID
            Name (_UID, 0x0A)  // _UID: Unique ID
            Name (_STA, 0x0B)  // _STA: Status
        }

        Device (PWRB)
        {
            Name (_HID, EisaId ("PNP0C0C") /* Power Button Device */)  // _HID: Hardware ID
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                Return (0x0B)
            }
        }
    }

    Scope (_SB.PCI0.LPCB.EC0)
    {
        Method (_Q81, 0, NotSerialized)  // _Qxx: EC Query, xx=0x00-0xFF
        {
            Local0 = ^^^^LID._LID ()
            If ((Local0 == Zero))
            {
                ADBG ("LID-OFF")
                SGOV (0x02030009, Zero)
                SGOV (0x02060000, Zero)
            }
            Else
            {
                ADBG ("LID-ON")
                SGOV (0x02030009, One)
                SGOV (0x02060000, One)
                Notify (ALSD, 0x80) // Status Change
            }

            If ((^^^^LID._OLD != Local0))
            {
                Notify (LID, 0x80) // Status Change
                ^^^^LID._OLD = Local0
            }
        }
    }

Besides me not seeing any reason to declare _OLD in LID. The idea itself shouldn't be too bad right? Well, as I said, his fix didn't work.

 

In fact, to prove that Method _Q81 doesn't have anything to do with the issue at all, I created a Clover/Opencore patch to change _Q81 to XQ81. This resulted in my lid not working at all of course, but the log flooding still persisted!

So _Q81 doesn't have anything to do with the issue afaik.

 

Now, further Google searches led me to a chinese post where he tied the issue to VirtualSMC. And indeed, by migrating to FakeSMC the issue is no more.

 

Unfortunately, I'm very fond of VirtualSMC for various reasons. So I would very much like to keep it. If not I'd have to implement the old way of doing Battery monitoring etcetc. Which isn't very elegant and update proof as it requires DSDT patching.

 

So, I do believe that the issue may very well be in the DSDT code, perhaps in the ambient light part. I'm not very skilled at this and just started studying the ACPI spec 3 days ago.

 

Could someone please help me out? Thanks a lot in advance :)

 

 

origin.zip

OC.zip

Share this post


Link to post
Share on other sites
Advertisement

  • Recently Browsing   0 members

    No registered users viewing this page.

Announcements

  • Similar Content

    • By MaLd0n
      -OpenCore Vanilla TUTORIAL-
       
       
      -USB Port Mapping TUTORIAL-
       
        1 -Create a USB bootable
       
      Create your usb installer, use this tool and download Catalina or Big Sur from Apple servers
       
      Catalina
      installScript_allfullapp.zip
       
      Big Sur
      installScript_1016fullapp.zip
       
      Credits: crazybirdy
       
      Copy Catalina / Big Sur installer to Applications folder, open terminal and run
       
      Catalina
       
       
      Big Sur
       
       
      If you want check one step by step, check here
       
      -Opencore Vanilla Tutorial
      https://tinyurl.com/ycvcnp8h
       
      2- EFI folder USB installation
       
      -EFI OpenCore Folder Desktop 10th Intel Processors
      Paste this EFI folder in EFI partition in your USB STICK
      https://tinyurl.com/ybwr9kq3
       
      -EFI Clover Folder Desktop 10th Intel Processors
      Paste this EFI folder in EFI partition in your USB STICK
      https://tinyurl.com/y6avuxsv
       
       
      3- EFI folder SSD
       
      -EFI OpenCore Folder Desktop 10th Intel Processors
      Paste this EFI folder in EFI partition SSD 
      https://tinyurl.com/ybwr9kq3
       
      -EFI Clover Folder Desktop 10th Intel Processors
      Paste this EFI folder in EFI partition SSD
      https://tinyurl.com/y6avuxsv
       
      4- Start Fine Tune
       
      Run this app and post full dump here for full ACPI solution
       
      RunMe.app
      https://tinyurl.com/y9562hz7
       
       
      If you like a SSDT way, here we go
      SSDT-OLARILA.aml.zip
       
      5- USB Solution
      USB INTEL SERIE 400.zip
       
      Use these kexts, enable XHCI port limit patch and follow this tutorial for remap USB ports
       
       
       
      --DSDT PATCHES--
       
      -FIX ERRORS AND WARNINGS -FIX ACPI ERRORS -REMOVE UNUSED SCOPES / DEVICES -HIGH PRECISION EVENT TIMER -SATA SERIE ID -DMAC -REMOVE LINES, PROBLEMATIC and UNUSED -FIX K.P in REBOOT -NVRAM -REAL TIME CLOCK -SLPB -DARWIN / WINDOWS -XHCI -PLUGIN TYPE -HDEF -ARTC -IPIC -TIMR -SBUS -BUS1 -MCHC -ALS0 -SHUTDOWN -UAR1 -LAN -FWHD -USBX -PMCR -PPMC -XSPI -kUSBCompanionIndex -io-device-location -IMEI -EC -PNLF -ARPT -GFX0 -NVME -ACPI-WAKE-GPE -DTGP -HDMI / HDAU  
      --SCREENSHOTS--































      -If you want to buy me a beer - Donations with PayPal
      https://tinyurl.com/r2bvzm7
       
      Big Thanks to XLR and your Badass Motherboard, Ultrafast CPU, Coolest Heatsink, Huge Graphics Card, Tonnes of RAM,
      Gigantic Hard Drive, Lightspeed Disk Burner, Professional Sound Card, Massive LCD Display.
       
       
      -Credits and thanks to the old and new people in the community who developed patches, kexts and bootloaders!
      Slice, Kabyl, usr-sse2, jadran, Blackosx, dmazar, STLVNUB, pcj, apianti, JrCs, pene, FrodoKenny, skoczy, ycr.ru, Oscar09, xsmile, SoThOr, RehabMan, Download-Fritz, Zenit432, cecekpawon, Intel, Apple, Oracle, Chameleon Team, crazybirdy, Mieze, Mirone, Oldnapalm, netkas, Elconiglio, artut-pt, ErmaC, Pavo, Toleda, Master Chief and family, bcc9, The King, PMheart, Sherlocks, Micky1979, vit9696, vandroiy2013, Voodoo Team, Pike R. Alpha, lvs1974, Austere.J, CVad and many, many, many others!

      We're all here to have fun and learn from each other!
    • By MaLd0n
      A very custom DSDT for best experience under macOS. Removed all unused devices, injected all Apple devices, essentials, cosmetics, real improvements. 
       
      -OpenCore Vanilla TUTORIAL-
       
       
      -USB Port Mapping TUTORIAL-
       
          -Original DSDT have 167,880 lines and 762kb
       
      DSDT ORIGINAL.aml.zip138.01 kB · 8 downloads
       
      -Patched DSDT have 30,912 lines and 111kb
       
      DSDT PATCHED.aml.zip27.01 kB · 17 downloads
       
      --Hardware--
      Asus ROG RAMPAGE VI EXTREME OMEGA

      Processor  Intel i9-10980XE

      GPU Radeon RX 5700 XT

      --DSDT Patches--
      -FIX ERRORS AND WARNINGS -FIX ACPI ERRORS -REMOVE UNUSED SCOPES / DEVICES -HIGH PRECISION EVENT TIMER -SATA SERIE ID -DMAC -REMOVE LINES, PROBLEMATIC and UNUSED -REAL TIME CLOCK -SLPB -DARWIN / WINDOWS -XHCI -PLUGIN TYPE -HDEF -ARTC -IPIC -TIMR -SBUS -BUS1 -MCHC -ALS0 -SHUTDOWN -UAR1 -LAN -FWHD -USBX -XSPI -EC -PNLF -ARPT -GFX0 -NVME  
      --Screenshots-



















       
      -Credits and thanks to the old and new people in the community who developed patches, kexts and bootloaders!
      Slice, Kabyl, usr-sse2, jadran, Blackosx, dmazar, STLVNUB, pcj, apianti, JrCs, pene, FrodoKenny, skoczy, ycr.ru, Oscar09, xsmile, SoThOr, RehabMan, Download-Fritz, Zenit432, cecekpawon, Intel, Apple, Oracle, Chameleon Team, crazybirdy, Mieze, Mirone, Oldnapalm, netkas, Elconiglio, artut-pt, ErmaC, Pavo, Toleda, Master Chief and family, bcc9, The King, PMheart, Sherlocks, Micky1979, vit9696, vandroiy2013, Voodoo Team, Pike R. Alpha, lvs1974, Austere.J, CVad and many, many, many others!

      We're all here to have fun and learn from each other!
    • By MaLd0n
      -OpenCore Vanilla TUTORIAL-
       
       
      -USB Port Mapping TUTORIAL-
       
          -Wifi card has been replaced with Dell DW1560!
      -I'm using a S145 Model with Intel Core i5-1035G1 IceLake / Intel HD Graphics ICL
      -Update bios/uefi to last version 
       
      *For now we have 2 problems. Wake from sleep and some bugs in trackpad*
       
      --Bios/UEFI config--
      Go to Security tab and disable Secure boot
       
      -IceLake Premade installation Folder (easy way installation)
      https://tinyurl.com/y3tl6xlx
       
      --Clover and OpenCore Folders--
      Just paste EFI folder inside EFI partition
      -OpenCore
      https://tinyurl.com/y3c4rjkr
      -Clover
      https://tinyurl.com/y4496nq8
       
      --Enable Trackpad Dragging Option--
      Go to System Preferences/Accessibility/PointerControl/Trackpad Options and "Enable dragging"

      -Bluetooth Broadcom
       
      BrcmBluetoothInjector.zip2.46 MB · 4 downloads
       
      -OcQuirks.efi for Clover (Just replace Drivers folder)
       
      drivers.zip74.57 kB · 4 downloads
       
      --DSDT Patches--

      -Patches
      -FIX ERRORS AND WARNINGS -REMOVE UNUSED SCOPES / DEVICES -HIGH PRECISION EVENT TIMER -SATA SERIE 12 ID -DMAC -REMOVE LINES, PROBLEMATIC and UNUSED -SLPB -DARWIN / WINDOWS 2015 -XHCI -PLUGIN TYPE -HDAS to HDEF -HDEF -REAL TIME CLOCK -ARTC -IRQs -SBUS -BUS1 -MCHC -ALS0 -SHUTDOWN -FWHD -USBX -PMCR -PPMC -XSPI -GMM -IMEI -EC -PRWs -_DSMs -PNLF -BRIGHTNESS KEYS -I2C -NATIVE USB -ARPT -GFX0 -DTGP -ACQUIRE MUT0 0XFFFF -OPERATION REGION GPIO -MUTEX MUT0 0x00 -EXTERNAL REFERENCES -UNKNOWNOBJ -FULL RENAMED DEVICES   --IGPU Patch-- (All credits to Austere.J) Discussion about that HERE
       
      <key>PciRoot(0x0)/Pci(0x2,0x0)</key>             <dict>                 <key>AAPL,ig-platform-id</key>                 <data>AABSig==</data>                 <key>device-id</key>                 <data>UooAAA==</data>                 <key>framebuffer-fbmem</key>                 <data>AACQAA==</data>                 <key>framebuffer-patch-enable</key>                 <data>AQAAAA==</data>                 <key>framebuffer-stolenmem</key>                 <data>AAAwAQ==</data>                 <key>framebuffer-unifiedmem</key>                 <data>AAAAgA==</data>                 <key>hda-gfx</key>                 <string>onboard-1</string>                 <key>igfxfw</key>                 <data>AgAAAA==</data>             </dict>  
      --USB Fix-- https://tinyurl.com/y4mqfahz
       
      -ScreenShots

       


























      -Credits and thanks to the old and new people in the community who developed patches, kexts and bootloaders!   Slice, Kabyl, usr-sse2, jadran, Blackosx, dmazar, STLVNUB, pcj, apianti, JrCs, pene, FrodoKenny, skoczy, ycr.ru, Oscar09, xsmile, SoThOr, RehabMan, Download-Fritz, Zenit432, cecekpawon, Intel, Apple, Oracle, Chameleon Team, crazybirdy, Mieze, Mirone, Oldnapalm, netkas, Elconiglio, artut-pt, ErmaC, Pavo, Toleda, Master Chief and family, bcc9, The King, PMheart, Sherlocks, Micky1979, vit9696, vandroiy2013, Voodoo Team, Pike R. Alpha, lvs1974, Austere.J, CVad, Sampath007, onemanosx, erroruser, Jenny David, Acidanthera Team, Olarila Facebook Community, Hackintosh Facebook Community and many others!     We're all here to have fun and learn from each other!
×