Contribute
Register

Mountain Lion: Customizing the Optimized AppleHDA

Status
Not open for further replies.

toleda

Moderator
Joined
May 19, 2010
Messages
22,834
Motherboard
Asus Maximus VII Impact
CPU
i7-4770K
Graphics
RX 560 + HD4600
Mac
  1. iMac
  2. MacBook Pro
  3. Mac mini
Classic Mac
  1. 512K
  2. LC
  3. Power Mac
Mobile Phone
  1. iOS
2787035531_066ba1ee85.jpeg

Customizing the Mountain Lion
Optimized AppleHDA.kext


Customizing the Mountain Lion Optimized AppleHDA.kext for Realtek ALC8xx Audio

Note: SPDIF Encoded Digital Audio patch is not working on the current AppleHDA.kext. See Post #25 for more information.

There have been numerous requests for additional AppleHDA.kext functionality. Often the requests can be satisfied with changes to the property lists embedded in AppleHDA.kext. This guide offers solutions for removing the automatic switching on inputs and outputs, adding and changing speaker configurations and increased SPDIF digital audio flexibility. All solutions are based on the Optimized AppleHDA.kexts for Realtek 885, 887, 888, 889, 892 and 898 audio codecs.

Guidelines
1. This is not a how to guide. It tells what something looks likes before and what it should look like after the edit. The how is left to the reader.

OS X Surround Sound
1. OS X volume control and mute (OSD, System Preferences, keyboard, mouse, Apple Remote, etc.)
1a. Supports volume control/mute for connected analog stereo speakers only
1b. No volume control/mute support for digital audio or aggregate devices
1b1. Use the controls and/or remote for the audio device attached making sound
1b2. There is no known way around this; don't ask. For DD/DTS, this restriction is the same for Windows
2. Surround Sound in OS X requires
2a. DD/DTS source (movies, iTunes/AC3, etc.)
2b. DD/DTS player (Plex, XBMC, Boxee, VLC - see 5 below)
2c. DD/DTS sound system.
3. Analog 5.1/7.1 Surround Sound tonymacx86 Forum • View topic - Universal 5.1-channel analogue audio
4. Audi MIDI Setup/Audio Devices/Digital Output/ always shows 2 Channel Stereo.
5. VLC encoded digital audio requires the edited Optical Surround/AppleHDA binary (See Procedure 8)

Requirements
1. 10.8 or newer - 64 bit kernel
2. Any optimized AppleHDA.kext v2.3.0 or newer
3. Working ML Optimized AppleHDA audio

Tools
1. Property List Editor (PLE) -
1a. Mac OS X Retail Install Disc v10.6 or v10.6.3 (Optional Installs/Xcode)
1b. http://sveinbjorn.org/install_proper..._mac_os_x_lion
2. PLE Alternatives
2a. PListEdit Pro Fat Cat Software – PlistEdit Pro
2b. Pref Setter Pref Setter
2c. Applications/TextEdit
3. zlib_terminal, (see Attachment 2)

Procedures
0. AppleHDA.kext Assumptions, Structure and Documents
1 Add SPDIFIn - not supported
2. Manual Mic and Front Mic Selection
3. Manual Speaker and Headphone Selection
4. Add Boost to input (Mic/Rear. Mic/Front and/or Line In)
5. Substitute Gray (Side) for Black (Rear)
6. Add Line Out (Gray/Rear -Rear Speakers) for analog 7.1 Surround Sound
7. Substitute SPDIF-2 Wire Output
8. SPDIF Optical Output/Encoded Digital Audio - Not available for 892 or 898
9. HDMI audio (AMD/Nvidia/HD3000/HD4000) Mountain Lion HDMI Audio
10. 2x HD3000/HD4000 HDMI Audio
Appendix:. ML Optimized AppleHDA.kext/PathMaps

Installation
1. Backup S/L/E/AppleHDA.kext
2. Copy edited AppleHDA..kext to Desktop
3. Run KextBeast
4. Restart

Attachments
1. View attachment ML-Customizing the Realtek ALC AppleHDA.pdf.zip
2. View attachment zlib_terminal.zip

Editing Tip
1. To ensure successful pasting of printed data into a plist
1a. paste first to TextEdit and make plain text (Format/Plain Text)
1b. copy from TextEdit and paste into plist

Credits
THe KiNG HOW TO] Patch AppleHDA - Knowledge Base - Project OS X Forums
VHC888 ALC889A, Gigabyte (Intel): now having a working front mic - InsanelyMac Forum
RevoGirl

Change Log
v0.1 - 10/8/12 - Draft
v0.2 -10/10/2012 - Procedure 8 correction
v0.3 - 10/18/12 - 0c4. Item/PathMapID Table and Item/CodecID Table correction
v0.4 - 10/25/12 - Clarify PathMap and ConfigData edits
 
Having a bit of trouble with:
7. Substitute SPDIF-2 Wire Output

Platforms.xml - This wasn't in my kext. So I generated it using the perl script from Platforms.xml.zlib (AppleHDA.kext/Contents/Resources)
layout3.xml - This wasn't in my kext. So I generated it using the perl script from Layout3.xml.zlib (AppleHDA.kext/Contents/Resources)

ALC887
Audio ID 3
PathMapID 387

From the table:
Item 3 - 387 - 283904135 - 3

Opened platforms.xml in PlistEditPro - went to PathMaps/2/PathMapID (Because this is the one with a PathMapID of 387 - is this a mistake in the table?)
and changed NodeID:30 and NodeID:6 to 17 and 16 - saved

Next:
info.plist - (AppleHDA.kext/Contents/Plugins/AppleHDAHardwareConfigDriver.kext/Contents)

IOKitPersonalities - HDA Hardware Config Resource - HDAConfigDefault - 2 (Because this is the one I changed in platforms.xml).


Replaced info.plist. deflated Playforms.xml to Platforms.zml.zlib and included both in AppleHDA.kext.

Installed and Restarted - Now only have HDMI Sound and lost all the others.....

Attached AppleHDA.kext and IOReg before my edits. And AppleHDA.kext after the edits.
 

Attachments

  • NatDeamer.zip
    2 MB · Views: 339
Next:
info.plist - (AppleHDA.kext/Contents/Plugins/AppleHDAHardwareConfigDriver.kext/Contents)

IOKitPersonalities - HDA Hardware Config Resource - HDAConfigDefault - 2 (Because this is the one I changed in platforms.xml).


Replaced info.plist. deflated Playforms.xml to Platforms.zml.zlib and included both in AppleHDA.kext.

Installed and Restarted - Now only have HDMI Sound and lost all the others.....
I made a mistake in the order of layouts in Platforms.xml.zlib. It will be fixed in the next release.

The no audio is caused the Platforms.xml.zlib file is empty. The platforms.xml file in the After/AppleHDA.kext is edited correctly. However, it was not deflated properly, resulting in the empty file. The command is perl zlib.pl deflate Platforms.xml > Platforms.xml.zlib. Verify Platforms.xml.zlib and delete Platforms.xml from the Resources file.

Regarding info.plist, you edited the wrong layout. No need to change layout 2 (Item 2). Edit Layout 3 (Item 3), Save.

Install and reply with an IOReg.
 
Thanks! Optical Audio now working!

Just got to try and get the Encoded Digital Audio for VLC.

I tried applying the patch to my working optical AppleHDA.kext but it hasn't worked (attached)
sudo perl -pi -e 's|\x85\x08\xec\x10|\x87\x08\xec\x10|g' Desktop/SPDIF/Encoded_Audio/AppleHDA.kext/Contents/MacOS/AppleHDA

Do I need a different AppleHDA.kext? The guide says to use "885_Lion_AppleHDA.zip" - But I am 887 and Mountain Lion....
If i need 885_Lion_AppleHDA.zip where can I find it?

Thanks :)
 

Attachments

  • NatDeamer-AppleHDA.kext.zip
    767.5 KB · Views: 310
Do I need a different AppleHDA.kext? The guide says to use "885_Lion_AppleHDA.zip" - But I am 887 and Mountain Lion....
If i need 885_Lion_AppleHDA.zip where can I find it?
The Lion guide will not work in ML. Download Attachment 1, Customizing the ML Optimized AppleHDA.kext_v0.4 in Post 1 of this thread.
 
What a stupid mistake I made there! Not sure how I had the wrong guide open!

I have ran the 2 commands for 887... But still not getting the Encoded Digital Out in VLC
 

Attachments

  • AppleHDA.kext.zip
    767.5 KB · Views: 317
In Audio Midi:
Built-in Digital Output
Format: 48000 (44100 and 96000 also available)
2ch-24bit Integer (2-ch 20bit Integer and 2-ch 16 bit Integer also available)

In VLC:
x Use S/PDIF when available
Force Detection of Dolby Surround: On

*It might be worth also pointing out that my HDMI audio has also stopped doing DD/DTS via VLC to my amp - pretty sure this started happening after applying edits to AppleHDA.kext but can't be 100% sure.

I have tried MPlayerX and this is doing the passthrough fine on HDMI and optical.
 
In Audio Midi:
Built-in Digital Output
Format: 48000 (44100 and 96000 also available)
2ch-24bit Integer (2-ch 20bit Integer and 2-ch 16 bit Integer also available)
You see a 4th choice of Encoded Digital Audio in Format. Verify the edited AppleHDA.kext was installed properly. Other than trying the edit again, I don't have any other suggestions.
 
I have tried the edit again. Starting with the AppleHDA.kext from Multibeast.
There is no 'Encoded Digital Audio' option :(.

I then tried just installing the AppleHDA.kext from Multibeast without making any changes. But I am not getting passthrough in VLC over HDMI.

I guess I will just have to use MPlayerX from now on.
 
Status
Not open for further replies.
Back
Top