acidanthera / bugtracker

Acidanthera Bugtracker
386 stars 45 forks source link

AppleALC working intermittently #422

Open black-dragon74 opened 5 years ago

black-dragon74 commented 5 years ago

Hey, I would like to report an issue with the AppleALC project that I am facing since the very beginning on my hardware (ALC 295). I didn't bring it up before as I wanted to test everything before opening an issue.

The workings of the software is completely random. It sometimes works, sometimes doesn't. I have the logs from the event when it works and when it doesn't:

Logs when it doesn't work:

AppleALC:    init @ (DBG) AppleALC bootstrap DBG-139-2019-07-03
AppleALC:   iokit @ (DBG) getOSData vendor-id has 8086 value
AppleALC:   iokit @ (DBG) getOSData device-id has A170 value
AppleALC:   iokit @ (DBG) getOSData revision-id has 10 value
AppleALC:   iokit @ (DBG) getOSData alc-layout-id has E value
AppleALC:     alc @ (DBG) found 2 audio controllers
AppleALC:     alc @ (DBG) validating 0 controller 8086:3E9B:0
AppleALC:     alc @ (DBG) comparing to 0 mod 8086:9DC8
AppleALC:     alc @ (DBG) comparing to 1 mod 8086:A2F0
AppleALC:     alc @ (DBG) comparing to 2 mod 8086:A348
AppleALC:     alc @ (DBG) comparing to 3 mod 8086:A171
AppleALC:     alc @ (DBG) comparing to 4 mod 8086:8D21
AppleALC:     alc @ (DBG) comparing to 5 mod 8086:8D20
AppleALC:     alc @ (DBG) comparing to 6 mod 8086:F04
AppleALC:     alc @ (DBG) comparing to 7 mod 8086:24
AppleALC:     alc @ (DBG) comparing to 8 mod 8086:C0C
AppleALC:     alc @ (DBG) comparing to 9 mod 8086:8D20
AppleALC:     alc @ (DBG) comparing to 10 mod 8086:A171
AppleALC:     alc @ (DBG) comparing to 11 mod 1002:AAC8
AppleALC:     alc @ (DBG) comparing to 12 mod 1002:AB08
AppleALC:     alc @ (DBG) comparing to 13 mod 10DE:E0F
AppleALC:     alc @ (DBG) comparing to 14 mod 10DE:10EF
AppleALC:     alc @ (DBG) comparing to 15 mod 10DE:10F1
AppleALC:     alc @ (DBG) comparing to 16 mod 10DE:FBA
AppleALC:     alc @ (DBG) comparing to 17 mod 10DE:FB0
AppleALC:     alc @ (DBG) comparing to 18 mod 10DE:FBB
AppleALC:     alc @ (DBG) comparing to 19 mod 10DE:FB8
AppleALC:     alc @ (DBG) comparing to 20 mod 10DE:FB9
AppleALC:     alc @ (DBG) comparing to 21 mod 10DE:10F0
AppleALC:     alc @ (DBG) comparing to 22 mod 10DE:FBC
AppleALC:     alc @ (DBG) comparing to 23 mod 1022:1457
AppleALC:     alc @ (DBG) comparing to 24 mod 1022:15E3
AppleALC:     alc @ (DBG) validating 1 controller 8086:A170:10
AppleALC:     alc @ (DBG) comparing to 0 mod 8086:9DC8
AppleALC:     alc @ (DBG) comparing to 1 mod 8086:A2F0
AppleALC:     alc @ (DBG) comparing to 2 mod 8086:A348
AppleALC:     alc @ (DBG) comparing to 3 mod 8086:A171
AppleALC:     alc @ (DBG) comparing to 4 mod 8086:8D21
AppleALC:     alc @ (DBG) comparing to 5 mod 8086:8D20
AppleALC:     alc @ (DBG) comparing to 6 mod 8086:F04
AppleALC:     alc @ (DBG) comparing to 7 mod 8086:24
AppleALC:     alc @ (DBG) comparing to 8 mod 8086:C0C
AppleALC:     alc @ (DBG) comparing to 9 mod 8086:8D20
AppleALC:     alc @ (DBG) comparing to 10 mod 8086:A171
AppleALC:     alc @ (DBG) comparing to 11 mod 1002:AAC8
AppleALC:     alc @ (DBG) comparing to 12 mod 1002:AB08
AppleALC:     alc @ (DBG) comparing to 13 mod 10DE:E0F
AppleALC:     alc @ (DBG) comparing to 14 mod 10DE:10EF
AppleALC:     alc @ (DBG) comparing to 15 mod 10DE:10F1
AppleALC:     alc @ (DBG) comparing to 16 mod 10DE:FBA
AppleALC:     alc @ (DBG) comparing to 17 mod 10DE:FB0
AppleALC:     alc @ (DBG) comparing to 18 mod 10DE:FBB
AppleALC:     alc @ (DBG) comparing to 19 mod 10DE:FB8
AppleALC:     alc @ (DBG) comparing to 20 mod 10DE:FB9
AppleALC:     alc @ (DBG) comparing to 21 mod 10DE:10F0
AppleALC:     alc @ (DBG) comparing to 22 mod 10DE:FBC
AppleALC:     alc @ (DBG) comparing to 23 mod 1022:1457
AppleALC:     alc @ (DBG) comparing to 24 mod 1022:15E3
AppleALC:     alc @ (DBG) missing ControllerModInfo for 0 controller
AppleALC:     alc @ (DBG) missing ControllerModInfo for 1 controller
AppleALC:     alc @ (DBG) found analog codec IOHDACodecDevice
AppleALC:     alc @ (DBG) storing codec info for 10EC:295:100002
AppleALC:     alc @ failed to find IOHDACodecVendorID, retrying 0
AppleALC:     alc @ (DBG) found supported Realtek ALC295 codec revision 0x100002
AppleALC:     alc @ (DBG) missing ControllerModInfo for 0 controller
AppleALC:     alc @ (DBG) missing ControllerModInfo for 1 controller
AppleALC:     alc @ (DBG) will route resource loading callbacks
AppleALC:     alc @ (DBG) checking patch 0 for 9 kext (com.apple.driver.AppleHDA)
AppleALC:     alc @ (DBG) applying patch 0  for 9 kext (com.apple.driver.AppleHDA)
AppleALC:     alc @ (DBG) checking patch 1 for 9 kext (com.apple.driver.AppleHDA)
AppleALC:     alc @ (DBG) checking patch 2 for 9 kext (com.apple.driver.AppleHDA)
AppleALC:     alc @ (DBG) applying patch 2  for 9 kext (com.apple.driver.AppleHDA)
AppleALC:     alc @ (DBG) checking patch 3 for 9 kext (com.apple.driver.AppleHDA)
AppleALC:     alc @ (DBG) applying patch 3  for 9 kext (com.apple.driver.AppleHDA)
AppleALC:     alc @ (DBG) checking patch 4 for 9 kext (com.apple.driver.AppleHDA)
AppleALC:     alc @ (DBG) applying patch 4  for 9 kext (com.apple.driver.AppleHDA)
AppleALC:     alc @ (DBG) checking patch 5 for 9 kext (com.apple.driver.AppleHDA)
AppleALC:     alc @ (DBG) applying patch 5  for 9 kext (com.apple.driver.AppleHDA)
AppleALC:     alc @ (DBG) checking patch 6 for 9 kext (com.apple.driver.AppleHDA)
AppleALC:     alc @ (DBG) applying patch 6  for 9 kext (com.apple.driver.AppleHDAkernel) 
AppleALC:     alc @ (DBG) checking patch 7 for 9 kext (com.apple.driver.AppleHDA)

Logs when it works:

AppleALC:    init @ (DBG) AppleALC bootstrap DBG-139-2019-07-03
AppleALC:   iokit @ (DBG) getOSData vendor-id has 8086 value
AppleALC:   iokit @ (DBG) getOSData device-id has A170 value
AppleALC:   iokit @ (DBG) getOSData revision-id has 10 value
AppleALC:   iokit @ (DBG) getOSData alc-layout-id has E value
AppleALC:     alc @ (DBG) found 2 audio controllers
AppleALC:     alc @ (DBG) validating 0 controller 8086:3E9B:0
AppleALC:     alc @ (DBG) comparing to 0 mod 8086:9DC8
AppleALC:     alc @ (DBG) comparing to 1 mod 8086:A2F0
AppleALC:     alc @ (DBG) comparing to 2 mod 8086:A348
AppleALC:     alc @ (DBG) comparing to 3 mod 8086:A171
AppleALC:     alc @ (DBG) comparing to 4 mod 8086:8D21
AppleALC:     alc @ (DBG) comparing to 5 mod 8086:8D20
AppleALC:     alc @ (DBG) comparing to 6 mod 8086:F04
AppleALC:     alc @ (DBG) comparing to 7 mod 8086:24
AppleALC:     alc @ (DBG) comparing to 8 mod 8086:C0C
AppleALC:     alc @ (DBG) comparing to 9 mod 8086:8D20
AppleALC:     alc @ (DBG) comparing to 10 mod 8086:A171
AppleALC:     alc @ (DBG) comparing to 11 mod 1002:AAC8
AppleALC:     alc @ (DBG) comparing to 12 mod 1002:AB08
AppleALC:     alc @ (DBG) comparing to 13 mod 10DE:E0F
AppleALC:     alc @ (DBG) comparing to 14 mod 10DE:10EF
AppleALC:     alc @ (DBG) comparing to 15 mod 10DE:10F1
AppleALC:     alc @ (DBG) comparing to 16 mod 10DE:FBA
AppleALC:     alc @ (DBG) comparing to 17 mod 10DE:FB0
AppleALC:     alc @ (DBG) comparing to 18 mod 10DE:FBB
AppleALC:     alc @ (DBG) comparing to 19 mod 10DE:FB8
AppleALC:     alc @ (DBG) comparing to 20 mod 10DE:FB9
AppleALC:     alc @ (DBG) comparing to 21 mod 10DE:10F0
AppleALC:     alc @ (DBG) comparing to 22 mod 10DE:FBC
AppleALC:     alc @ (DBG) comparing to 23 mod 1022:1457
AppleALC:     alc @ (DBG) comparing to 24 mod 1022:15E3
AppleALC:     alc @ (DBG) validating 1 controller 8086:A170:10
AppleALC:     alc @ (DBG) comparing to 0 mod 8086:9DC8
AppleALC:     alc @ (DBG) comparing to 1 mod 8086:A2F0
AppleALC:     alc @ (DBG) comparing to 2 mod 8086:A348
AppleALC:     alc @ (DBG) comparing to 3 mod 8086:A171
AppleALC:     alc @ (DBG) comparing to 4 mod 8086:8D21
AppleALC:     alc @ (DBG) comparing to 5 mod 8086:8D20
AppleALC:     alc @ (DBG) comparing to 6 mod 8086:F04
AppleALC:     alc @ (DBG) comparing to 7 mod 8086:24
AppleALC:     alc @ (DBG) comparing to 8 mod 8086:C0C
AppleALC:     alc @ (DBG) comparing to 9 mod 8086:8D20
AppleALC:     alc @ (DBG) comparing to 10 mod 8086:A171
AppleALC:     alc @ (DBG) comparing to 11 mod 1002:AAC8
AppleALC:     alc @ (DBG) comparing to 12 mod 1002:AB08
AppleALC:     alc @ (DBG) comparing to 13 mod 10DE:E0F
AppleALC:     alc @ (DBG) comparing to 14 mod 10DE:10EF
AppleALC:     alc @ (DBG) comparing to 15 mod 10DE:10F1
AppleALC:     alc @ (DBG) comparing to 16 mod 10DE:FBA
AppleALC:     alc @ (DBG) comparing to 17 mod 10DE:FB0
AppleALC:     alc @ (DBG) comparing to 18 mod 10DE:FBB
AppleALC:     alc @ (DBG) comparing to 19 mod 10DE:FB8
AppleALC:     alc @ (DBG) comparing to 20 mod 10DE:FB9
AppleALC:     alc @ (DBG) comparing to 21 mod 10DE:10F0
AppleALC:     alc @ (DBG) comparing to 22 mod 10DE:FBC
AppleALC:     alc @ (DBG) comparing to 23 mod 1022:1457
AppleALC:     alc @ (DBG) comparing to 24 mod 1022:15E3
AppleALC:     alc @ (DBG) missing ControllerModInfo for 0 controller
AppleALC:     alc @ (DBG) missing ControllerModInfo for 1 controller
AppleALC:     alc @ (DBG) found analog codec IOHDACodecDevice
AppleALC:     alc @ (DBG) storing codec info for 10EC:295:100002
AppleALC:     alc @ failed to find IOHDACodecVendorID, retrying 0
AppleALC:     alc @ (DBG) found supported Realtek ALC295 codec revision 0x100002
AppleALC:     alc @ (DBG) missing ControllerModInfo for 0 controller
AppleALC:     alc @ (DBG) missing ControllerModInfo for 1 controller
AppleALC:     alc @ (DBG) will route resource loading callbacks
AppleALC:     alc @ (DBG) checking patch 0 for 9 kext (com.apple.driver.AppleHDA)
AppleALC:     alc @ (DBG) applying patch 0  for 9 kext (com.apple.driver.AppleHDA)
AppleALC:     alc @ (DBG) checking patch 1 for 9 kext (com.apple.driver.AppleHDA)
AppleALC:     alc @ (DBG) checking patch 2 for 9 kext (com.apple.driver.AppleHDA)
AppleALC:     alc @ (DBG) applying patch 2  for 9 kext (com.apple.driver.AppleHDA)
AppleALC:     alc @ (DBG) checking patch 3 for 9 kext (com.apple.driver.AppleHDA)
AppleALC:     alc @ (DBG) applying patch 3  for 9 kext (com.apple.driver.AppleHDA)
AppleALC:     alc @ (DBG) checking patch 4 for 9 kext (com.apple.driver.AppleHDA)
AppleALC:     alc @ (DBG) applying patch 4  for 9 kext (com.apple.driver.AppleHDA)
AppleALC:     alc @ (DBG) checking patch 5 for 9 kext (com.apple.driver.AppleHDA)
AppleALC:     alc @ (DBG) applying patch 5  for 9 kext (com.apple.driver.AppleHDA)
AppleALC:     alc @ (DBG) checking patch 6 for 9 kext (com.apple.driver.AppleHDA)
AppleALC:     alc @ (DBG) applying patch 6  for 9 kext (com.apple.driver.AppleHDA)
AppleALC:     alc @ (DBG) checking patch 7 for 9 kext (com.apple.driver.AppleHDA)
AppleALC:   iokit @ (DBG) getOSData layout-id has 7 value
AppleALC:     alc @ (DBG) initializePinConfig AppleHDACodecGeneric received hda 0xFFFFFF802BA87020, config 0xFFFFFF80290CDE60 config name AppleHDAHardwareConfigDriver apple layout 7 codec 10EC0295 layout 14
AppleALC:     alc @ (DBG) discovered HDAConfigDefault with 25 entries
AppleALC:     alc @ (DBG) layoutLoadCallback 4 0 1 15073 1
AppleALC:     alc @ (DBG) resource-request arrived layout
AppleALC:     alc @ (DBG) checking codec 10EC:295:100002
AppleALC:     alc @ (DBG) selecting from 8 files
AppleALC:     alc @ (DBG) comparing 0 layout 1/E
AppleALC:     alc @ (DBG) comparing 1 layout 3/E
AppleALC:     alc @ (DBG) comparing 2 layout D/E
AppleALC:     alc @ (DBG) comparing 3 layout E/E
AppleALC:     alc @ (DBG) found layout at 3 index
AppleALC:     alc @ (DBG) layoutLoadCallback done 4 0 1 1695 1
AppleALC:     alc @ (DBG) platformLoadCallback 5 0 1 14921 1
AppleALC:     alc @ (DBG) resource-request arrived platform
AppleALC:     alc @ (DBG) checking codec 10EC:295:100002
AppleALC:     alc @ (DBG) selecting from 8 files
AppleALC:     alc @ (DBG) comparing 0 layout 1/E
AppleALC:     alc @ (DBG) comparing 1 layout 3/E
AppleALC:     alc @ (DBG) comparing 2 layout D/E
AppleALC:     alc @ (DBG) comparing 3 layout E/E
AppleALC:     alc @ (DBG) found platform at 3 index
AppleALC:     alc @ (DBG) platformLoadCallback done 5 0 1 592 1
AppleALC:     alc @ (DBG) power change AppleHDADriver at AppleHDACodecGeneric from 1 to 2 in from pin 0 sleep 0

We can clearly see that for some reason initializePinConfig method is not being called. The result is no Audio input/output devices.

The way to get back the audio is: Keep rebooting till you don't get it back. Which is a really dumb way to solve any problem. I have tried with all different layout IDs supported for ALC295. The result is the same.

I have also tried with warm-booting and cold-booting. The results are exactly the same. Sometimes it works, sometimes it does not.

I have no other audio patches in place so there is no way anything else could be interfering with the workings of AppleALC

I have tried every possible options and quirks and am not able to solve this. Hence this issue.

I would be glad to provide any help I could for further research.

Warmest Regards

undercoldwater commented 4 years ago

@Sniki

For me delay did not work. I generated SSDT-HPET with SSDTime from linux. I added the generated SSDT-HPET.aml and patch to my OC but it did not work either.

Today, I saw your post about OC 5.9 guide for lenevo T440s in tonymacs and I used your SSDT and the patch to disable native HPET and finally the audio is working on my Lenevo X1 Carbon 3rd Gen.

Sniki, will it be possible for you to check my SSDT-HPET to see what was the problem?

SSDT-HPET generated by SSDTime: `/*

  • Intel ACPI Component Architecture
  • AML/ASL+ Disassembler version 20200110 (64-bit version)
  • Copyright (c) 2000 - 2020 Intel Corporation
  • Disassembling to symbolic ASL+ operators
  • Disassembly of iASLEZDfal.aml, Wed Aug 19 00:58:56 2020
  • Original Table Header:
  • Signature        "SSDT"
  • Length           0x0000007C (124)
  • Revision         0x02
  • Checksum         0xEE
  • OEM ID           "CORP"
  • OEM Table ID     "HPET"
  • OEM Revision     0x00000000 (0)
  • Compiler ID      "INTL"
  • Compiler Version 0x20180105 (538444037)

*/ DefinitionBlock ("", "SSDT", 2, "CORP", "HPET", 0x00000000) { External (SB.PCI0.LPC_, DeviceObj) External (SB.PCI0.LPC_.HPET, DeviceObj)

Name (\_SB.PCI0.LPC.HPET._CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
{
    IRQNoFlags ()
        {0,8,11}
    Memory32Fixed (ReadWrite,
        0xFED00000,         // Address Base
        0x00000400,         // Address Length
        )
})

}

`

I have the same machine as yours. Did HEPT fix by SSDT-time, with or without alcdelay, none of those could drive my alc292, and when i used the kextstat grep thingy in Terminal, logging showed that only com.apple.driver.HDAcontroller was loaded.

The disable navie applehept method is working perfer now on my machine, the only issue now is headphone noise

SheehabMuhammad commented 4 years ago

@undercoldwater

Same here, the audio worked after disabling Native HPET.

For headphone noise. you can try alcplugfix.

black-dragon74 commented 4 years ago

@festano92 What laptop and what codec do you have?

andreszerocross commented 3 years ago

Listen, there is 2 condition about "Audio not working"

  1. Speaker icon is GREY (there is no audio device output in audio preferences), this is caused by HPET and HPET patch is needed from Intel Broadwell and below. Intel Skylake and above don't need HPET patch. I assumed you have chooses correct layoutID after give HPET patch to make audio working

  2. Speaker icon is available, and you can see internal speaker, etc in Audio preferences, but audio device give no output (it can give you output sometime / random reboot ). This is probably caused by other thing like COEF_INDEX and PROC_COEF.

So don't mix it about "not working audio".

HPET patch just for broadwell and below

Red1860 commented 3 years ago

@vit9696 and @black-dragon74 I finally managed to get audio working with OpenCore.

I tried with the available renames as mentioned on OpenCore Configuration.pdf for HPET fix but it didn't fix the issue although the patch worked (modified as needed by my ACPI set) I see that STA returns Noop but still no audio.

What i did is i added config.plist /Kernel/Block/ com.apple.driver.AppleHPET

As soon as i rebooted volume icon was non greyed out, and audio is working, also for some reasons, checking IOreg does still show AppleHPET loaded.

You may want to give this one a try @black-dragon74 just so we know for sure that it has no relation to AppleALC but rather a non-well configured ACPI as @vit9696 mentioned a few comments above.

Thanks

Off-Topic/Firm handshake note: holly crap the boot speed is nonsense/unbelievably fast with OC 0.0.4 + new AppleSupportPkg

Hi i was also able to get my audio working with that patch but i noticed something. I get a kernel panic when booting into recovery, updating macOS when this line is present. Do you have the same results also?

gnpaone commented 2 years ago

Same problem for me too, alc255 here with intel 9th gen (CFL+) laptop (layout id 27). I get this issue less frequently and whenever I get this, I just change the version of applealc kext, I mean I use different version of kext (debug and release versions are also considered different kext). recently I faced this issue and changed my kext to 1.6.8-RELEASE version. If some reboots/shutdowns after if the problem repeats then I would use either 1.6.8-DEBUG or completely different version like 1.6.6-RELEASE, changing the kext works. The issue is 1. mentioned by @andreszerocross above. The thing is kext fails to load when the issue occurs

ozonefire commented 2 years ago

My motherboard have alc887 ok so whenever i run logic or ableton i hear some weird noices

Core-i99 commented 2 years ago

My motherboard have alc887 ok so whenever i run logic or ableton i hear some weird noices

That's really not a good idea. Of you want to do music production then buy an interface. Onboard audio isn't strong enough for that.