Jump to content

Experimental 6 channel AppleHDA


shiecldk
 Share

32 posts in this topic

Recommended Posts

This patch method will get analog surround sound work in AppleHDA's native multi-channel output rule. If you have problem with this, please use traditional way to patch your AppleHDA.

 

Credit to: THe KiNG, bcc9, Revogirl, TimeWalker, 紫米, VCH888, EMlyDinEsH and many others.

 

If you've never patched AppleHDA, I recommend you to read these two guides about patching AppleHDA before reading this topic.  ;)

The KiNG's Guide

EMlyDinEsH's Guide

 

Take my ALC889 as example:

post-957641-0-91579500-1387024975_thumb.jpg

1. Center Speaker and Subwoofer

2. Left and Right Surround

3. Left and Right Rear (used for 7.1 surround sound)

4. Line in

5. Left and Right Front

6. Mic

7. S/PDIF Optical and Coaxial

 

post-957641-0-68938100-1387022612_thumb.jpg

Internal Speakers: 5 + 1 + 2

Line Out: 3

Digital Out: 7

 

post-957641-0-76783200-1387022609_thumb.jpg

Internal microphone: 6

Line In: 4

 

No longer need to setup aggregate device in Audio MIDI Setup to get 6 channel output!

6 channel sound is confirm worked on Built-in Output, even though it's showed as 2 channel in Audio MIDI Setup. (same as Built-in Digital Output)

There is no way to adjust the volume in each channel under OS X. You have to adjust the volume on your speakers.

post-957641-0-52511800-1387022606_thumb.jpg

 

 

PinConfigurations

Original ALC889 Codec dumped from Ubuntu:

Codec: Realtek ALC889
Address: 2

Node 11  40 01 43 99  [Fixed] SPDIF Out at Int ATAPI  Unknown
Node 12  20 00 00 00  [N/A]   Speaker   at Ext Rear   Black
Node 14  10 44 01 01  [Jack]  Line Out  at Ext Rear   Green    EAPD
Node 15  12 14 01 01  [Jack]  Line Out  at Ext Rear   Black    EAPD
Node 16  11 64 01 01  [Jack]  Line Out  at Ext Rear   Orange
Node 17  14 24 01 01  [Jack]  Line Out  at Ext Rear   Grey
Node 18  50 9c a1 01  [Jack]  Mic       at Ext Rear   Pink     VREF_80
Node 19  60 9c a1 02  [Jack]  Mic       at Ext Front  Pink     VREF_80
Node 1a  5f 34 81 01  [Jack]  Line In   at Ext Rear   Blue     VREF_HIZ
Node 1b  20 4c 21 02  [Jack]  HP Out    at Ext Front  Green    VREF_HIZ
Node 1c  f0 01 33 99  [Fixed] CD        at Int ATAPI  Unknown
Node 1d  01 e6 05 40  [N/A]   Line Out  at Ext N/A    White
Node 1e  30 61 4b 01  [Jack]  SPDIF Out at Ext Rear   Orange
Node 1f  f0 11 11 41  [N/A]   Speaker   at Ext Rear   Black

Fixed PinConfigurations:

01171cf0 01171d00 01171e00 01171f40
01271cf0 01271d00 01271e00 01271f40
01471c40 01471d01 01471e10 01471f90 // green jack     Internal Speakers
01571c42 01571d01 01571e10 01571f90 // black jack     Internal Speakers
01671c41 01671d01 01671e10 01671f90 // orange jack    Internal Speakers
01771c30 01771d01 01771e00 01771f90 // grey jack      Line Out
01871c10 01871d91 01871ea0 01871f90 // rear mic       Internal microphone
01971c70 01971d30 01971e81 01971f02 // front mic      Line In
01a71c20 01a71d30 01a71e81 01a71f01 // rear line in   Line In
01b71c50 01b71d40 01b71e21 01b71f01 // headphone      Headphones
01c71cf0 01c71d00 01c71e00 01c71f40
01d71cf0 01d71d00 01d71e00 01d71f40
01e71c60 01e71de0 01e71e4b 01e71f01 // s/pdif         Digital Out
01f71cf0 01f71d00 01f71e00 01f71f40

Be careful about the Internal Speakers:

We need to setup "Sequence" (01 & 2) for the analogy multi-channel jacks and use the same "Default Association" to group them.

I also changed the jack color to unknown (0), as Mac always use 0 for speakers in PinConfigurations. But I don't think it's necessary.

And change all "Default Device" to speakers (1).

40 01 10 90
42 010 90
41 010 90

 

Let's take MacBookPro5,2's  PinConfigurations as reference:

50 40 2b 01
20 30 8b 01
41 01 10 90 // 6ch speaker
42 01 10 90 // 6ch speaker
10 01 a0 90
40 01 10 90 // 6ch speaker
70 90 a1 01
60 e0 4b 01
30 e0 cb 01

"Use ambient noise reduction" is available for Internal microphone (rear mic) in System Preferences after changing "50 9c a1 01" to "10 91 a0 90".

 

Layout

Outputs:

post-957641-0-79485100-1387027384_thumb.png

 

Headphone:

post-957641-0-53245800-1387027376_thumb.png

I've tried to put AmpPostDelay and AmpPreDelay=100 under both Headphone and IntSpeaker. But I found out there are some instrumental sound being cut down in musics and human voice become a bit lower?! I'm not sure.

 

IntSpeaker:

post-957641-0-66679100-1387027378_thumb.png

It's necessary to setup this SignalProcessing under IntSpeaker, otherwise sound will be distorted even you are not using 6 channel output.

post-957641-0-27638000-1387027381_thumb.jpg

There is a value "Dsp6ChOutput" in SignalProcessing. As the name implies, it's used for 6 channel. This is a key to enable AppleHDA's native 6 channel DSP support. Even if you have a different sound card other than my ALC889, you should still use this SignalProcessing section inside the layout.xml, which I attached in ALC889 xml.zip at the bottom of this post, for your IntSpeaker.

This whole SignalProcessing section was discovered by VCH888. Thanks to him!

But unfortunately, there is no Dsp8ChOutput in AppleHDA, as I've checked all layout xml files and AppleHDA's binary. It's not possible to setup 8 channel sound this way, as AppleHDA does not have 8 channel DSP support.

 

LineOut:

post-957641-0-71159100-1387027382_thumb.png

 

SPDIFOut:

post-957641-0-60233800-1387027386_thumb.png

The signal is digital, so no need to setup any value right here.

 

Inputs:

post-957641-0-17841200-1387028824_thumb.png

 

LineIn:

post-957641-0-87067400-1387028825_thumb.png

There are some problems for hackintosh to use ExtMic. So I changed the rear and front mic to internal mic and line in.

MuteGPIO: 0x50 (VREF_80) + 0100 + NodeID (19) = 0x50010019 = 1342242841

 

Mic:

post-957641-0-73264400-1387028827_thumb.png

MuteGPIO: 0x50 (VREF_80) + 0100 + NodeID (18) = 0x50010018 = 1342242840

SignalProcessing is used for reducing noise.

 

 

Platforms

The easiest part for sure if you patch AppleHDA in normal way, but using AppleHDA's multi-channel output rules is another case.

 

post-957641-0-66534000-1387031280_thumb.jpg

0

-0    //Mic (rear mic)

--0

-1   //LineIn (front mic)

--0

1

-0    //LineIn

--0

2

-0    //IntSpeaker (We have to be careful about this in PathMaps. Notice that the jacks are in the same group.)

--0    * Black Jack - Left and Right Surround

--1    * Orange Jack - Center Speaker and Subwoofer

--2    * Green Jack - Left and Right Front

-1   //Headphone

--0

3

-0   //LineOut

--0

4

-0   //SPDIFOut

--0

 

Let's talk about IntSpeaker:

All Amp values must be same as what the pictures show below.

(2, 0, 0) Black Jack - Left and Right Surround

post-957641-0-38184000-1387032791_thumb.jpg

(2, 0, 1Orange Jack - Center Speaker and Subwoofer

post-957641-0-39228500-1387032797_thumb.jpg

(2, 0, 2Green Jack - Left and Right Front

post-957641-0-47054700-1387032794_thumb.jpg

 

When it comes to mic:

post-957641-0-68304800-1387033495_thumb.jpg

The higher Boost value (0~3) you setup, the more sensitive mic you get.

 

Result:

post-957641-0-92352400-1387076690_thumb.jpg

Analog 6 channel surround sound can be output by selecting "Internal Speakers" in System Preferences!

And no more useless LineOut devices in System Preferences now.

 

 

Files:

ALC889:

AppleHDA.kext in forum Downloads

layout & Platforms: ALC889 xml.zip

Binary patch:

sudo perl -pi -e 's|\x84\x19\xd4\x11|\x89\x08\xec\x10|g' /System/Library/Extensions/AppleHDA.kext/Contents/MacOS/AppleHDA 

HDEF section under DSDT:

 

 

Device (HDEF)
        {
            Name (_ADR, 0x001B0000)  // _ADR: Address
            ...skip...
            Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
            {
                Store (Package (0x0E)
                    {
                        "AAPL,slot-name", 
                        Buffer (0x09)
                        {
                            "Built-in"
                        }, 

                        "name", 
                        Buffer (0x06)
                        {
                            "audio"
                        }, 

                        "model", 
                        Buffer (0x0F)
                        {
                            "Realtek ALC889"
                        }, 

                        "device_type", 
                        Buffer (0x16)
                        {
                            "High Definition Audio"
                        }, 

                        "layout-id", 
                        Buffer (0x04)
                        {
                             0x20, 0x00, 0x00, 0x00
                        }, 

                        "hda-gfx", 
                        Buffer (0x0A)
                        {
                            "onboard-1"
                        }, 

                        "PinConfigurations", 
                        Buffer (Zero) {}
                    }, Local0)
                DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                Return (Local0)
            }
        } 

 

 

 

 

**Cautions for OS X Yosemite**

There are some changes needed to be made after updating to OS X Yosemite.

 

Firstly, this Boot Argument is necessary to be added in order to load the patched AppleHDA correctly:

kext-dev-mode=1 

Secondly, Binary Patch had also changed:

sudo perl -pi -e 's|\x84\x19\xd4\x11|\x00\x00\x00\x00|g' /System/Library/Extensions/AppleHDA.kext/Contents/MacOS/AppleHDA 

sudo perl -pi -e 's|\x8b\x19\xd4\x11|\x89\x08\xec\x10|g' /System/Library/Extensions/AppleHDA.kext/Contents/MacOS/AppleHDA  

Good luck! And please do not copy my guide to other website, especially Tonymac's forum! ;) (But I guess they won't even understand this. :D )

Edited by shiecldk
  • Like 13
Link to comment
Share on other sites

  • 2 months later...

GA-X58A-UD3R v2 Loads the kext but don't work. System Profile shows the info but System Preferences don't show anything. :-(

I do the DSDT edits without problem.

Same issue in my system with new version AppleHDA for 10.9.2

Link to comment
Share on other sites

GA-X58A-UD3R v2 Loads the kext but don't work. System Profile shows the info but System Preferences don't show anything for 10.9.2 :-(

I do the DSDT edits without problem.

 

Same issue in my system with new version AppleHDA for 10.9.2

 

 

Sorry, I forgot to do the binary patch. Updated now. If you like, you can try again.  ^_^

  • Like 2
Link to comment
Share on other sites

Hmmm... i have an issue, sound doesn't work after sleep, i try the previous version

Work fine on my system... (Gigabyte board)

Are you using the latest AppleACPIPlatform.kext (2.0)? It seems some people, who are using the older AppleACPIPlatform.kext, have problem with 10.9.2's AppleHDA.

Link to comment
Share on other sites

Work fine on my system... (Gigabyte board)

Are you using the latest AppleACPIPlatform.kext (2.0)? It seems some people, who are using the older AppleACPIPlatform.kext, have problem with 10.9.2's AppleHDA.

 

Hi:

I followed your guide for ALC892, but I couldn't make it to work (10.9.2) 

Using DSDT with Layout 1

I am experiencing a hybrid between a guide and a AppleHda.kext of Toleda (which works when it wants to) 

I'll try changing AppleACPIPlatform.kext and see what happens. 

Thank you.

 

 

P.S.:

 

More information to check and try

 

http://forum.osxlatitude.com/index.php?/topic/3084-eapd-fix-in-a-standalone-kext-no-need-ioaudiofamily-patch/

post-201840-0-43058300-1394883437_thumb.jpg

Link to comment
Share on other sites

Hi:

I followed your guide for ALC892, but I couldn't make it to work (10.9.2) 

Using DSDT with Layout 1

I am experiencing a hybrid between a guide and a AppleHda.kext of Toleda (which works when it wants to) 

I'll try changing AppleACPIPlatform.kext and see what happens. 

Thank you.

Are you using the right binary patch for ALC892?

According to bcc9's topic, it should be this one in your case:

sudo perl -pi -e 's|\x8b\x19\xd4\x11|\x92\x08\xec\x10|g' /System/Library/Extensions/AppleHDA.kext/Contents/MacOS/AppleHDA 

I'd recommend you to make your own AppleHDA staring from the vanilla one.

Try to understand the guide from THe KiNG -> EMlyDinEsH -> and finally this topic.

If you've already known how to setup PinConfigurations' value, you can skip to EMlyDinEsH's guide. (It will take you a little time to understand how to patch AppleHDA. Good luck! :))

  • Like 1
Link to comment
Share on other sites

  • 4 months later...
I can't make dsdt with     

 

 


 

                           "layout-id", 

                            Buffer (0x04)

                            {

                                 0x20, 0x00, 0x00, 0x00

                            }, 


                   

                   

how to resolve

 

 

    "layout-id", 

    Unicode (" "), 

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

 

I can't make dsdt with     
 
 
 
                           "layout-id", 
                            Buffer (0x04)
                            {
                                 0x20, 0x00, 0x00, 0x00
                            }, 
                   
                   
how to resolve
 
 
    "layout-id", 
    Unicode (" "), 

 

 

I am also having this issue.  Any way to resolve?

Link to comment
Share on other sites

  • 8 months later...

Thanks for the Guide!

Can You or anyone else describe more exactly what to do with AMP values?

All Amp values must be same as what the pictures show below.

(2, 0, 0Black Jack - Left and Right Surround

(2, 0, 1Orange Jack - Center Speaker and Subwoofer

(2, 0, 2Green Jack - Left and Right Front


<key>Channels</key>

<array>

<dict>

<key>Bind</key>

<integer>1</integer>

<key>Channel</key>

<integer>3</integer>

</dict>

<dict>

<key>Bind</key>

<integer>2</integer>

<key>Channel</key>

<integer>4</integer>

</dict>

 

I think 1 and 2 is Front, 3 and 4 - Center/LFE , 5 and 6 - Surround. Is it OK for any Codec and where did these values come from?


and another question, if path contains two AMPs

<array>
						<array>
							<dict>
								<key>NodeID</key>
								<integer>18</integer>
							</dict>
							<dict>
								<key>Amp</key>
								<dict>
									<key>Channels</key>
									<array>
										<dict>
											<key>Bind</key>
											<integer>1</integer>
											<key>Channel</key>
											<integer>1</integer>
										</dict>
										<dict>
											<key>Bind</key>
											<integer>2</integer>
											<key>Channel</key>
											<integer>2</integer>
										</dict>
									</array>
									<key>MuteInputAmp</key>
									<true/>
								</dict>
								<key>NodeID</key>
								<integer>41</integer>
							</dict>
							<dict>
								<key>Amp</key>
								<dict>
									<key>Channels</key>
									<array>
										<dict>
											<key>Bind</key>
											<integer>1</integer>
											<key>Channel</key>
											<integer>1</integer>
										</dict>
										<dict>
											<key>Bind</key>
											<integer>2</integer>
											<key>Channel</key>
											<integer>2</integer>
										</dict>
									</array>
									<key>PublishVolume</key>
									<true/>
								</dict>
								<key>NodeID</key>
								<integer>4</integer>
							</dict>
						</array>

How do I need to modify Channels and Bind? The First One, the Second or Both?

Link to comment
Share on other sites

  • 10 months later...

5.1ch_ALC898.zip

 

This folder is a sample of 5.1ch_ALC898.  I made two layouts and SoftwareDSP was based on layout70.  They are almost the same except “ParameterInfo of DspFunction2, 3, and 4.”   I have no idea how to edit or modify “ParameterInfo” and hope that someone can make it better, especially ParameterInfo.

 

Note: 

1) I had to swap channel of orange jack to get sound on Center speaker. (using an additional 3.5 mm jack male to female cable and swapping audio cable)

2) The sound from layout1, w/ ParameterInfo, is better than layout2, w/o ParameterInfo.

 
  • Like 2
Link to comment
Share on other sites

 Share

×
×
  • Create New...