- Joined
- Jun 12, 2012
- Messages
- 349
- Motherboard
- ...
- CPU
- ...
- Graphics
- ...
Hi,
I've managed to get the combo jack on my laptop (Dell XPS 15 9560 using Realtek ALC3266/298) to act as a manually switchable headphone/stereo line-in jack, but I know the jack also supports CTIA audio devices like the iPhone headset. I think I know how to get the best of both worlds--Apple's Late 2011 MacBook Pro has a single combo jack that does SPDIF-IN/OUT, Line-In/Out, and CTIA headsets (and it uses native layout 28)--but the capability to do this hinges on a couple general questions about the AppleHDA patching process:
1. Does anyone know if Mac OS supports two line-in devices?
I've been trying to use "ExtMic," and I've gone as far as setting all the right verbs to enable the "headset mic," but it seems like Mac OS in general has trouble with ExtMic being used as a line-in (my laptop has the combo jack wired in such a way that both the Headset mic in and stereo line in are both basically line-in devices sharing the same port).
2. If two line-ins can't be done for whatever reason, how does one properly set up ExtMic?
3. Does anyone know, in detail, what "MuteGPIO" actually does?
I know the pattern is usually VREF + 0100 + NodeID, but that doesn't tell me much. From my research (trying stuff, comparing 3 apple codec dumps, tracing pathmaps and layouts, and reading AppleHDA spec and Realtek datasheets) it looks related to setting Pin Control Widgets when a device is enabled/disabled. One of its functions seems to be to set VREF on the pin control widget as determined via hda-verb GET_PIN_WIDGET queries. However, that 0100 part I can't figure out, and I've noticed that 0100 is actually 0000 in some layouts, namely in MuteGPIO for the headphones that have IOMux like layout 28, 77, 2, etc.
>>Also worth noting is that I've found ExtMic either has MuteGPIO 262144 or no MuteGPIO, and seems to use a node that isn't actually physically present. At least, none of Cirrus codecs I've pulled from Macs with CTIA support have a Node 0x16 (they stop at 0x15 per the linux dumps), which is what the ExtMic is linked to in the PathMap.
4. What are the "Amp" sections in the pathmap actually doing?
I found that in plaforms.xml in the native AppleHDA, Apple basically left most of a "how to make a codec" guide (open platforms.xml in a text editor and search for <!--; there are also some comments in some of the layout XMLs), and it seems like the only thing it doesn't answer about the PathMap is what "Amp" does. Apple also only uses ONE amp on the output nodes, not 3 like every AppleHDA patching guide says to.
Here are some other things I've found, for the sake of documenting them somewhere:
IOMux on the "headphone" device in the Layout XML enables switching. There is a corresponding "RetaskDetectDelegate" key on Line-In's pathmap (it goes where "Boost" would go if it were a Mic) that takes the value of the node of the headphone playback switch. I still needed to send some verbs to get the switch to work, but it worked.
>>For reference, I need to send 0x18 SET_PIN_WIDGET 0x24 to remove distortion and make the headphone jack's CTIA pin go into VREF 80 (the MuteGPIO I have on ExtMic is not getting triggered, and 0x18 is "Headset Mic Boost Volume" for me), and then after plugging in the line-in device and switching to Line Input in SysPrefs, I need to send 0x21 SET_PIN_WIDGET 0x00 to stop the headphone output from interfering with the Line-In (0x21 is "Headphone Playback Switch" for me).
Shoehorning DetectDelegate (with value of headphone playback switch) onto the ExtMic pathmap causes Headphone and speaker audio to flip. In other words, sound gets routed to the headphone jack when headphone unplugged, and routed to the speakers when headphones are plugged in.
Various layouts:
EDIT: Spellcheck & formatting because walls of text are ugly.
EDIT 326891: More grammar and formatting adjustments. Cause there's always something that gets missed...
I've managed to get the combo jack on my laptop (Dell XPS 15 9560 using Realtek ALC3266/298) to act as a manually switchable headphone/stereo line-in jack, but I know the jack also supports CTIA audio devices like the iPhone headset. I think I know how to get the best of both worlds--Apple's Late 2011 MacBook Pro has a single combo jack that does SPDIF-IN/OUT, Line-In/Out, and CTIA headsets (and it uses native layout 28)--but the capability to do this hinges on a couple general questions about the AppleHDA patching process:
1. Does anyone know if Mac OS supports two line-in devices?
I've been trying to use "ExtMic," and I've gone as far as setting all the right verbs to enable the "headset mic," but it seems like Mac OS in general has trouble with ExtMic being used as a line-in (my laptop has the combo jack wired in such a way that both the Headset mic in and stereo line in are both basically line-in devices sharing the same port).
2. If two line-ins can't be done for whatever reason, how does one properly set up ExtMic?
3. Does anyone know, in detail, what "MuteGPIO" actually does?
I know the pattern is usually VREF + 0100 + NodeID, but that doesn't tell me much. From my research (trying stuff, comparing 3 apple codec dumps, tracing pathmaps and layouts, and reading AppleHDA spec and Realtek datasheets) it looks related to setting Pin Control Widgets when a device is enabled/disabled. One of its functions seems to be to set VREF on the pin control widget as determined via hda-verb GET_PIN_WIDGET queries. However, that 0100 part I can't figure out, and I've noticed that 0100 is actually 0000 in some layouts, namely in MuteGPIO for the headphones that have IOMux like layout 28, 77, 2, etc.
>>Also worth noting is that I've found ExtMic either has MuteGPIO 262144 or no MuteGPIO, and seems to use a node that isn't actually physically present. At least, none of Cirrus codecs I've pulled from Macs with CTIA support have a Node 0x16 (they stop at 0x15 per the linux dumps), which is what the ExtMic is linked to in the PathMap.
4. What are the "Amp" sections in the pathmap actually doing?
I found that in plaforms.xml in the native AppleHDA, Apple basically left most of a "how to make a codec" guide (open platforms.xml in a text editor and search for <!--; there are also some comments in some of the layout XMLs), and it seems like the only thing it doesn't answer about the PathMap is what "Amp" does. Apple also only uses ONE amp on the output nodes, not 3 like every AppleHDA patching guide says to.
Here are some other things I've found, for the sake of documenting them somewhere:
IOMux on the "headphone" device in the Layout XML enables switching. There is a corresponding "RetaskDetectDelegate" key on Line-In's pathmap (it goes where "Boost" would go if it were a Mic) that takes the value of the node of the headphone playback switch. I still needed to send some verbs to get the switch to work, but it worked.
>>For reference, I need to send 0x18 SET_PIN_WIDGET 0x24 to remove distortion and make the headphone jack's CTIA pin go into VREF 80 (the MuteGPIO I have on ExtMic is not getting triggered, and 0x18 is "Headset Mic Boost Volume" for me), and then after plugging in the line-in device and switching to Line Input in SysPrefs, I need to send 0x21 SET_PIN_WIDGET 0x00 to stop the headphone output from interfering with the Line-In (0x21 is "Headphone Playback Switch" for me).
Shoehorning DetectDelegate (with value of headphone playback switch) onto the ExtMic pathmap causes Headphone and speaker audio to flip. In other words, sound gets routed to the headphone jack when headphone unplugged, and routed to the speakers when headphones are plugged in.
Various layouts:
- Late 2013 MacBook Pro 15 (MBP11,3) uses Layout 94 (Built-In: Mic/IntSpeaker, Jack: ExtMic/Headphone/SPDIF-Out), Cirrus CS4208
- Late 2011 MacBook Pro 13 (MBP8,1) uses Layout 28 (Built-In: Mic/IntSpeaker, Jack: ExtMic/Headphone/Line-In/SPDIF-Out/SPDIF-In), Cirrus CS4207
- Mid 2010 MacBook Pro 15 (MBP6,3) uses layout 11 (2 jacks: Output: ExtMic/Headphone/SPDIF-Out, Input: Line-in/SPDIF-In, Built-in: Mic/Intspeaker), Cirrus CS4206
- Here are some other layouts in use by real laptops.
EDIT: Spellcheck & formatting because walls of text are ugly.
EDIT 326891: More grammar and formatting adjustments. Cause there's always something that gets missed...
Attachments
Last edited: