RehabMan
Moderator
- Joined
- May 2, 2012
- Messages
- 181,058
- Motherboard
- Intel DH67BL
- CPU
- i7-2600K
- Graphics
- HD 3000
- Mac
- Mobile Phone
DDDDDDDDDDDDDDDDDD
Fixed it.
I found this thing in the DSDT:
It's actually a top-level device, too--not on LPCB or anything.Code:Device (ALSD) { Name (_HID, "ACPI0008") // _HID: Hardware ID Method (_STA, 0, NotSerialized) // _STA: Status { If ((ALSE == 0x02)) { Return (0x0B) } Return (Zero) } Method (_ALI, 0, NotSerialized) // _ALI: Ambient Light Illuminance { Return (((LHIH << 0x08) | LLOW)) } Name (_ALR, Package (0x05) // _ALR: Ambient Light Response { Package (0x02) { 0x46, Zero }, Package (0x02) { 0x49, 0x0A }, Package (0x02) { 0x55, 0x50 }, Package (0x02) { 0x64, 0x012C }, Package (0x02) { 0x96, 0x03E8 } }) }
Here we can see that ALSE--Ambient Light Sensor Enable, most likely--is read from hardware (it's defined in a memory region in my laptop's SaSsdt), but this ALSD sensor, which I think is actually some funky Dell content-based adaptive brightness thing, does not seem to work under macOS. My curiosity as to why this device was defined led to faking it on LPCB as the MacBook Air's ALS0 device, because apparently Airs have dedicated light sensors and Pros don't (???).
Anyways, I had to mod FakeSMC (attached) and use the attached SSDT to get AppleLMUController to load, and the ioreg image is the result. Brightness now gets reloaded correctly. Well, more like Dell's BIOS loads its setting, then during boot the NVRAM.plist setting is applied over top.
If someone else could please try using this kext (it's the latest downloadable version of RehabMan's FakeSMC repo with additions from here) plus corresponding SSDT on a Dell exhibiting the same problem, that would be great. I need to make sure I'm not just going crazy. (I also want to try a couple more things, but at the very least it would be nice to have confirmation that the ALS is the common cause.)
Based on this..., although I can't reproduce the problem on my systems, I wanted to see if there was a way to make a generic ALS, and if FakeSMC.kext with those extra keys was a problem on other computers...
So I added the keys... this is the diff (it was a little unclear which keys you were adding, but this is what I gathered by reading between the lines):
Code:
SPEEDY-NUC:kozlek.git rehabman$ git diff
diff --git a/FakeSMC/FakeSMC-Info.plist b/FakeSMC/FakeSMC-Info.plist
index 3ebd61cd..8d2bf9e8 100755
--- a/FakeSMC/FakeSMC-Info.plist
+++ b/FakeSMC/FakeSMC-Info.plist
@@ -151,6 +151,31 @@
<string>si8</string>
<data>BQ==</data>
</array>
+ <key>RMde</key>
+ <array>
+ <string>char</string>
+ <data>QQ==</data>
+ </array>
+ <key>ALV0</key>
+ <array>
+ <string>{alv</string>
+ <data>ARAGdQEgALYO4A==</data>
+ </array>
+ <key>ALRV</key>
+ <array>
+ <string>ui16</string>
+ <data>AAE=</data>
+ </array>
+ <key>ALI0</key>
+ <array>
+ <string>{ali</string>
+ <data>BwECAA==</data>
+ </array>
+ <key>MSLD</key>
+ <array>
+ <string>ui8 </string>
+ <data>AA==</data>
+ </array>
</dict>
<key>Types</key>
<dict>
The FakeSMC.kext with this change is attached.
I didn't have any issue with the updated FakeSMC.kext (without SSDT-ALS0.aml) on a desktop, nor any of my laptops.
So..., then I move on to enabling a Fake ALS that is generic...
I did a little reading on ALS in the ACPI spec... and decided to create a minimal SSDT-ALS0.dsl to serve as a generic, never changing, fake ALS:
Code:
// Fake ambient light sensor device
DefinitionBlock("", "SSDT", 2, "hack", "ALS0", 0)
{
Device(_SB.ALS0)
{
Name(_HID, "ACPI0008")
Name(_CID, "smc-als")
Name(_ALI, 300)
Name(_ALR, Package()
{
//Package() { 70, 0 },
//Package() { 73, 10 },
//Package() { 85, 80 },
Package() { 100, 300 },
//Package() { 150, 1000 },
})
}
}
//EOF
As you can see, the version above always returns 300 for the _ALI and only has one mapping in _ALR: a neutral mapping (100) for 300 lux)
I actually tested both ways with the other items in the list, and without...
Both same result...
This does get me the "Automatically adjust brightness" checkbox in SysPrefs->Displays, so maybe it is also adequate to fix the brightness restore (and relies on no specifics of any particular native ACPI).
The pre-built SSDT-ALS0.aml is also attached.
Please test.
Attachments
Last edited: