- Настройка звука на хакинтоше
- § Введение
- § Codec Commander
- Настройка
- Установка кекста
- § Завод карт Creative
- § Метод AppleALC
- Шаг 1. Получение оригинального AppleHDA
- # Fixing audio with AppleALC
- # Finding your layout ID
- # Testing your layout
- # Making Layout ID more permanent
- # Miscellaneous issues
- # No Mic on AMD
- # Same layout ID from Clover doesn’t work on OpenCore
- # Kernel Panic on power state changes in 10.15
- # Troubleshooting
- # Checking if you have the right kexts
- # Checking if AppleALC is patching correctly
- # Checking AppleHDA is vanilla
- # AppleALC working inconsistently
- # AppleALC not working correctly with multiple sound cards
- # AppleALC not working from Windows reboot
- Как поменять Layout в config.plist для AppleALC
Настройка звука
на хакинтоше
§ Введение
Настройка звука на хакинтоше может занять даже больше времени, чем, собственно, сама установка macOS.
Эта статья содержит несколько инструкций, которые не являются панацеей от всех проблем, но могут помочь так же, как помогли мне.
§ Codec Commander
- компьютер перешел в режим сна и затем вышел из него;
- компьютер начал переходить в режим сна, но спустя небольшой промежуток времени (около 5-20 секунд) была нажата какая-либо клавиша и переход в сон отменился (задержка сна на полминуты — это особенность macOS).
В обоих случаях может показаться, что звук есть, но на самом деле его нет или он очень тихий. Для решения этой проблемы, собственно, и нужен Codec Commander.
Настройка
Последняя версия Codec Commander доступна на bitbucket.org. Но не все так просто: без предварительной настройки под ваш кодек кекст может не заработать. Подробное руководство по настройке Codec Commander находится на GitHub. Однако новичку будет очень сложно в нем разобраться. Самый простой способ — найти уже настроенный кекст под кодек своей системы. Я нашел Codec Commander для ALC1150 на tonymackx86.com.
Установка кекста
Устанавливать Codec Commander надо в системную папку. Рекомендую сделать это через Kext Utility.
§ Завод карт Creative
Для настройки звуковых карт Creative на хакинтоше энтузиасты разработали кекст kXAudioDriver, он заводит на хакинтоше следующие карты:
- Creative Live!
- Audigy 1/2
- Audigy RX
- EMU E-DSP
Скачивание и обсуждение кекста доступно на форуме insanelymac.com.
§ Метод AppleALC
AppleALC — кекст, который значительно упрощает настройку звука на хакинтоше. Он позволяет включить поддержку встроенного звукового оборудования компьютера без внесения модификаций в систему и динамически загружает все требуемые изменения в AppleHDA и другие кексты.
AppleALC может помочь, если после других методов завода встроенного звука наблюдаются проблемы.
Поддерживает ли ваш кодек AppleALC можно узнать на wiki-странице проекта. Там же есть и подробное руководство по его установке.
Перед установкой AppleALC требуется отменить все манипуляции с настройкой звука, вернув в систему оригинальный, не затронутый вмешательствами кекст AppleHDA, а также удалить некоторые строки, внесенные в файл конфигурации Clover, которые мог произвести, например, MultiBeast.
Шаг 1. Получение оригинального AppleHDA
На загрузочной флешке, созданной UniBeast, помимо значка «Установка macOS High Sierra» есть множество скрытых системных файлов. Для того чтобы добраться до стандартных кекстов системы, необходимо сделать их видимыми.
С помощью сочетания ⌘ + Shift + . (точка) можно отображать скрытые файлы в macOS и таким же способом их скрывать.
Источник
# Fixing audio with AppleALC
So to start, we’ll assume you already have Lilu and AppleALC installed, if you’re unsure if it’s been loaded correctly you can run the following in terminal(This will also check if AppleHDA is loaded, as without this AppleALC has nothing to patch):
If all 3 show up, you’re good to go. And make sure VoodooHDA is not present. This will conflict with AppleALC otherwise.
If you’re having issues, see the Troubleshooting section
# Finding your layout ID
So for this example, we’ll assume your codec is ALC1220. To verify yours, you have a couple options:
- Checking motherboard’s spec page and manual
- Check Device Manager in Windows
- Run cat in terminal on Linux
- cat /proc/asound/card0/codec#0 | less
Now with a codec, we’ll want to cross reference it with AppleALC’s supported codec list:
With the ALC1220, we get the following:
So from this it tells us 2 things:
- Which hardware revision is supported( 0x100003 ), only relevant when multiple revisions are listed with different layouts
- Various layout IDs supported by our codec( layout 1, 2, 3, 5, 7, 11, 13, 15, 16, 21, 27, 28, 29, 34 )
Now with a list of supported layout IDs, we’re ready to try some out
Note: If your Audio Codec is ALC 3XXX this is likely false and just a rebranded controller, do your research and see what the actual controller is.
- An example of this is the ALC3601, but when we load up Linux the real name is shown: ALC 671
# Testing your layout
To test out our layout IDs, we’re going to be using the boot-arg alcid=xxx where xxx is your layout. Remember that to try layout IDs one at a time. Do not add multiple IDs or alcid boot-args, if one doesn’t work then try the next ID and etc
# Making Layout ID more permanent
Once you’ve found a Layout ID that works with your hack, we can create a more permanent solution for closer to how real macs set their Layout ID.
With AppleALC, there’s a priority hierarchy with which properties are prioritized:
- alcid=xxx boot-arg, useful for debugging and overrides all other values
- alc-layout-id in DeviceProperties, should only be used on Apple hardware
- layout-id in DeviceProperties, should be used on both Apple and non-Apple hardware
To start, we’ll need to find out where our Audio controller is located on the PCI map. For this, we’ll be using a handy tool called gfxutil
(opens new window) then with the macOS terminal:
Then add this PciRoot with the child layout-id to your config.plist under DeviceProperties -> Add:
Note that AppleALC can accept both Decimal/Number and Hexadecimal/Data, generally the best method is Hex as you avoid any unnecessary conversions. You can use a simple decimal to hexadecimal calculator
(opens new window) to find yours. printf ‘%x\n’ DECI_VAL :
So in this example, alcid=11 would become either:
- layout-id | Data |
- layout-id | Number |
Note that the final HEX/Data value should be 4 bytes in total(ie. 0B 00 00 00 ), for layout IDs surpassing 255( FF 00 00 00 ) will need to remember that the bytes are swapped. So 256 will become FF 01 00 00
- HEX Swapping and data size can be completely ignored using the Decimal/Number method
Reminder: You MUST remove the boot-arg afterwards, as it will always have the top priority and so AppleALC will ignore all other entries like in DeviceProperties
# Miscellaneous issues
# No Mic on AMD
- This is a common issue with when running AppleALC with AMD, specifically no patches have been made to support Mic input. At the moment the «best» solution is to either buy a USB DAC/Mic or go the VoodooHDA.kext method. Problem with VoodooHDA is that it’s been known to be unstable and have worse audio quality than AppleALC
# Same layout ID from Clover doesn’t work on OpenCore
This is likely do to IRQ conflicts, on Clover there’s a whole sweep of ACPI hot-patches that are applied automagically. Fixing this is a little bit painful but SSDTTime
(opens new window) ‘s FixHPET option can handle most cases.
For odd cases where RTC and HPET take IRQs from other devices like USB and audio, you can reference the HP Compaq DC7900 ACPI patch
(opens new window) example in the trashOS repo
# Kernel Panic on power state changes in 10.15
- Enable PowerTimeoutKernelPanic in your config.plist:
- Kernel -> Quirks -> PowerTimeoutKernelPanic -> True
# Troubleshooting
So for troubleshooting, we’ll need to go over a couple things:
# Checking if you have the right kexts
To start, we’ll assume you already have Lilu and AppleALC installed, if you’re unsure if it’s been loaded correctly you can run the following in terminal(This will also check if AppleHDA is loaded, as without this AppleALC has nothing to patch):
If all 3 show up, you’re good to go. And make sure VoodooHDA is not present. This will conflict with AppleALC otherwise. Other kexts to make sure you do not have in your system:
- RealtekALC.kext
- CloverALC.kext
- VoodooHDA.kext
- HDA Blocker.kext
- HDAEnabler#.kext(# can be 1, 2, or 3)
Hey Lilu and/or AppleALC aren’t showing up
Generally the best place to start is by looking through your OpenCore logs and seeing if Lilu and AppleALC injected correctly:
If it says failed to inject:
Main places you can check as to why:
- Injection order: Make sure that Lilu is above AppleALC in kext order
- All kexts are latest release: Especially important for Lilu plugins, as mismatched kexts can cause issues
Note: To setup file logging, see OpenCore Debugging
# Checking if AppleALC is patching correctly
So with AppleALC, one of the most easiest things to check if the patching was done right was to see if your audio controller was renamed correctly. Grab IORegistryExplorer
(opens new window) and see if you have an HDEF device:
As you can see from the above image, we have the following:
- HDEF Device meaning our rename did the job
- AppleHDAController attached meaning Apple’s audio kext attached successfully
- alc-layout-id is a property showing our boot-arg/DeviceProperty injection was successful
- Note: layout-id | Data | 07000000 is the default layout, and alc-layout-id will override it and be the layout AppleHDA will use
Note: Do not rename your audio controller manually, this can cause issues as AppleALC is trying to patch already. Let AppleALC do it’s work.
More examples:
Correct layout-id | Incorrect layout-id |
---|---|
As you can see from the above 2, the right image is missing a lot of AppleHDAInput devices, meaning that AppleALC can’t match up your physical ports to something it can understand and output to. This means you’ve got some work to find the right layout ID for your system.
# Checking AppleHDA is vanilla
This section is mainly relevant for those who were replacing the stock AppleHDA with a custom one, this is going to verify whether or not yours is genuine:
This will check if the signature is valid for AppleHDA, if it’s not then you’re going to need to either get an original copy of AppleHDA for your system and replace it or update macOS(kexts will be cleaned out on updates). This will only happen when you’re manually patched AppleHDA so if this is a fresh install it’s highly unlikely you will have signature issues.
# AppleALC working inconsistently
Sometimes race conditions can occur where your hardware isn’t initialized in time for AppleHDAController resulting in no sound output. To get around this, you can either:
Specify in boot-args the delay:
Or Specify via DeviceProperties(in your HDEF device):
The above boot-arg/property will delay AppleHDAController by 1000 ms(1 second), note the ALC delay cannot exceed 3000 ms
# AppleALC not working correctly with multiple sound cards
For rare situations where you have 2 sounds cards(ex. onboard Realtek and an external PCIe card), you may want to avoid AppleALC patching devices you either don’t use or don’t need patching(like native PCIe cards). This is especially important if you find that AppleALC will not patch you onboard audio controller when the external one is present.
To get around this, we’ll first need to identify the location of both our audio controllers. The easiest way is to run gfxutil
(opens new window) and search for the PCI IDs:
Now with this large output you’ll want to find your PciRoot pathing, for this example, lets use a Creative Sound-Blaster AE-9PE PCIe audio card. For this, we know the PCI ID is 1102:0010 . So looking through our gfxutil output we get this:
From here, we can clearly see our PciRoot pathing is:
- Note: This will assume you know both the Vendor and Device ID of the external sound card. For reference, these are the common Vendor IDs:
- Creative Labs: 1102
- AsusTek: 1043
- Note 2: Your ACPI and PciRoot path will look different, so pay attention to your gfxutil output
Now that we have our PciRoot pathing, we can finally open up our config.plist and add our patch.
Under DeviceProperties -> Add, you’ll want to add your PciRoot(as a Dictionary) with the child called external-audio :
And with this done, you can reboot and AppleALC should now ignore your external audio controller!
# AppleALC not working from Windows reboot
If you find that rebooting from Windows into macOS breaks audio, we recommend either adding alctsel=1 to boot-args or add this property to your audio device in DeviceProperties:
Источник
Как поменять Layout в config.plist для AppleALC
В наших конфигах, прописан рабочий layout, однако бывает так, что необходим перебор других layout’ов с иными ресурсами под аудиокодек материнской платы.
Например, на передней панели не работают наушники или микрофон, или некоторые выходы/входы материнской платы.
Где находится и как открыть config.plist:
ESP Mounter Pro — данной программой, монтируете EFI раздел диска с системой, идёте по пути EFI — EFI — CLOVER, или по пути EFI — EFI — OC открываете config.plist в PlistEdit Pro.
Определить кодек мат. платы, можно с помощью программы IORegistryExplorer.
HDEF — IOHDACodecDevice — IOHDACodecDevice, будет vendor и device id чипа, например как на скриншоте, Realtek ALC888, где vendorid — 10ec(Realtek), deviceid — 0888, поиском в google, можно понять название кодека, чтобы далее в таблице, узнать, какие доступные layout можно пробовать перебрать.
Определившись с названием кодека, переходим к таблице, и видим, что например для ALC888, доступны следующие layout — 1, 2, 3, (4 for laptop), 5, 7, 11, 27, 28, 29
Codec | Revisions and layouts |
AD1984 | 0x100400, layout 11 |
AD1984A | 0x100400, layout 11, 13, 44 |
AD1988A | layout 12 |
AD1988B | layout 5, 7, 12 |
AD2000B | layout 5, 7 |
CA0132 | 0x100918 layout 0, 1, 2, 3, 4, 5, 6, 9, 10, 11, 12 |
CS4210 | 0x100101 layout 13 |
CS4213 | 0x100100 layout 28 |
CX8050 | layout 3 |
CX8070/ CX11880 | layout 15 |
CX8150 | layout 21 |
CX8200 | layout 3, 15, 21 |
CX8400 | layout 12 |
CX20561 | 0x100000, layout 11 |
CX20583 | layout 3 |
CX20585 | layout 3, 13 |
CX20588 | layout 3 |
CX20590 | 0x100000, 0x100002, 0x100003, layout 3, 12, 13, 14, 28 |
CX20641 | layout 11, 13 |
CX20642 | layout 11, 13 |
CX20722 | layout 3 |
CX20724 | layout 3, 13 |
CX20751/ CX20752 | layout 3, 21, 28 |
CX20753/ CX20754 | layout 3, 14, 15, 21 |
CX20755 | layout 3 |
CX20756 | layout 3, 13 |
CX20757 | layout 3, 28 |
IDT92HD66C3/65 | layout 3 |
IDT92HD71B7X | layout 3 |
IDT92HD73C1X5 | layout 19, 21 |
IDT92HD75B2X5 | layout 3 |
IDT92HD75B3X5 | layout 3, 11 |
IDT92HD99BXX | layout 3 |
IDT92HD87B1 | layout 3 |
IDT92HD81B1C5 | layout 3, 11 |
IDT92HD81B1X5 | layout 3, 11, 12, 20, 21, 28 |
IDT92HD87B1/3 | layout 12, 13 |
IDT92HD87B2/4 | layout 12 |
IDT92HD90BXX | layout 3, 12 |
IDT92HD91BXX | 0x100102, 0x100303 layout 3, 12, 13, 33, 84 |
IDT92HD93BXX | 0x100203, layout 12 |
IDT92HD95 | layout 12 |
ALC221 | layout 11, 15 |
ALC225/ALC3253 | layout 28, 30, 33 |
ALC230 | layout 13, 20 |
ALC233/ ALC3236 | layout 3, 4, 5, 13, 21, 27, 28, 29, 32, 33 |
ALC235 | layout 3, 11, 12, 14, 15, 16, 21, 28 |
ALC236 | 0x100001, 0x100002 layout 3, 11, 13, 15, 16, 54, 99 |
ALC255/ALC3234 | layout 3, 11, 13, 15, 17, 18, 21, 27, 28, 30, 31, 99 |
ALC256/ ALC3246 | layout 5, 11, 13, 14, 21, 22, 28, 56, 57 |
ALC257 | layout 11 |
ALC260 | layout 11, 12 |
ALC262 | 0x100202 layout 7, 11, 12, 13, 28 |
ALC268 | layout 3 |
ALC269/ ALC271X | 0x100004, 0x100100, 0x100202, 0x100203 layout 1-11, 13-21, 27-33, 35, 40, 45, 55, 58, 66, 76, 88, 93, 99, 127, 188 |
ALC270 | 0x100100, layout 3, 4, 21, 27, 28 |
ALC272 | 0x100001, layout 3, 11, 18 |
ALC275 | 0x100005, 0x100008, layout 3, 13, 28 |
ALC280 | layout 3, 4, 11, 13, 15, 16, 21 |
ALC282 | 0x100003, layout 3, 4, 13, 22, 27, 28, 29, 41, 43, 51, 76, 86, 127 |
ALC283 | layout 1, 3, 11, 15, 44, 66 |
ALC284 | layout 3 |
ALC285 | layout 11, 21 |
ALC286 | 0x100002, 0x100003 layout 3, 11 |
ALC288 | layout 3, 13, 23 |
ALC290/ ALC3241 | layout 3, 4, 28 |
ALC292 | layout 12, 18, 28 |
ALC293 | layout 11, 28, 29 |
ALC294 | layout 11, 12, 13, 21 |
ALC295 | layout 1, 3, 13, 14, 15, 21, 28, 77 |
ALC298 | 0x100101, 0x100103 layout 3, 11, 13, 21, 22, 28, 29, 30, 47, 66, 72, 99 |
ALC299 | 0x100002 layout 21, 22 |
ALC662 | 0x100101, 0x100300 layout 5, 7, 11, 12, 13, 15, 16, 17 |
ALC663 | 0x100001, 0x100002, layout 3, 4, 15, 28, 99 |
ALC665 | layout 12, 13 |
ALC668 | 0x100003, layout 3, 20, 27, 28, 29 |
ALC670 | 0x100002, layout 12 |
ALC671 | layout 12, 15 |
ALC700 | layout 11 |
ALC882 | 0x100101, layout 5, 7 |
ALC883 | 0x100002, layout 7 |
ALC885 | 0x100101, 0x100103 layout 1, 12, 15 |
ALC887 | 0x100202, 0x100302, layout 1, 2, 3, 5, 7, 11, 13, 17, 18, 20, 33, 40, 50, 52, 53, 87, 99 |
ALC888/ ALC1200 | 0x100101, 0x100001, 0x100202, 0x100302 layout 1, 2, 3, 4, 5, 7, 11, 27, 28, 29 |
ALC889 | 0x100004, layout 1, 2, 3, 11, 12 |
ALC891/ ALC867 | 0x100002, layout 11, 13 |
ALC892 | 0x100302, layout 1, 2, 3, 4, 5, 7, 12, 15, 16, 17, 18, 28, 31, 92, 97, 99 |
ALC898/ ALC899 | 0x100003, layout 1, 2, 3, 5, 7, 11, 13, 28, 65, 66, 98, 99, 101 |
ALC1150 | 0x100001, layout 1, 2, 3, 5, 7, 11 |
ALC1220 | 0x100003, layout 1, 2, 3, 5, 7, 11, 13, 15, 16, 27, 28, 29, 34 |
ALCS1200A | layout 1, 2, 3 |
ALCS1220A | layout 1, 2, 3, 5, 7, 11, 20, 21 |
STAC9200 | 0x102201, layout 11 |
VT1705 | 0x100000, layout 21 |
VT1802 | 0x100000, layout 3, 33, 65 |
VT2020/ VT2021 | 0x100100, layout 5, 7, 9 |
Теперь вам поочередно предстоит подставлять каждую цифру в config.plist, перезагружать, и проверять работу всех входов/выходов. И так далее, пока не добьётесь нужного результата.
Для изменения layout в config.plist, пользуйтесь PlistEditor Pro. Открыв config.plist, перейти в секцию
- CLOVER: Boot — Arguments — alcid=
- OpenCore: NVRAM — Add — 7C436110-AB2A-4BBB-A880-FE41995C9F82 — boot-args — alcid=
В этом месте вам и предстоит перебрать все возможные цифры с последующей перезагрузкой.
Источник