Giter Site home page Giter Site logo

5t33z0 / applealc-guides Goto Github PK

View Code? Open in Web Editor NEW
44.0 5.0 15.0 9.12 MB

Guides for working with the AppleALC source code to get audio working on Wintel machines running macOS.

License: BSD 3-Clause "New" or "Revised" License

applealc clover opencore layout-id

applealc-guides's People

Contributors

5t33z0 avatar core-i99 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

applealc-guides's Issues

How to edit related files if you only want the built-in speaker to sound

Hello, may I ask a question about how to edit the Platforms.XML, layout.xml, and info.plist files to make the built-in speaker sound. Especially when dealing with data under PathMap child nodes in the fixed format of Platforms.XML. For example, the ALC287 of the Yoga Duet IML 2020 laptop currently cannot drive the built-in speaker using Alcid: 21. Can we solve this problem by first resolving the built-in speaker and then processing other nodes.

Suggested addition

The guide should mention that you should check first whether audio works under linux before proceeding with dumping the codec etc.. Users can check here whether others have been able to get audio working under linux on their device (I recommend running a probe to ensure you get the exact right model). I don't imagine it's possible to get AppleALC working if you can't get linux working first.

Codec-Dump-PNG Jack Mic External connected\disconnected

I extracted codec dumps from linux with external mic connector (jack) connected and disconnected and this is the result:

1 internal microphone
Internal Mic

2 External microphone
Dump External Mic (Jack Headphone)

As you can see, the dump highlights the connection nodes of the internal\external Mic, furthermore it is visible on connector 27 (0x1b) something changes when connecting the Jack, but at the moment the 27 OUT node is unused

Clarifications on Tracing Possible Paths section

@5T33Z0, in Tracing Possible Paths section, you say that "After a many, many trials, I settled with the following routing". Here I managed to create a list with all possible paths for my platform. However its unclear how to reduce that to a list of "valid" paths.
Could you, please, explain what tries you did? How do you check if they are valid or not?

I'm trying to create a new layout-id for ALC897. Existing ones does not work (I don't see my onboarding audio card as an output). I suppose there are 3 steps: 1) seen onboarding card as an audio output; 2) making sound play from it; 3) adding extra audio jacks to may config. Does it make sense? If so, focusing only on speaker/line out Pin Complex should be enough to achieve (1) and (2)?

Thanks!

Audio device with 6 channels

Thank you for the informative tutorial.

Do you happen to know if there is a way to setup the layout/platform in such a way that macOS would see an audio device with 6 output channels (5.1 audio) rather than 2 output channels (Left/Right Stereo)

Amp Capabilities settings :

I'm trying to create a layout with full functions for my X1 Tablet 3rd Gen, after several tests this is what I understood:

Dump info Node 2 :

[Audio Output] wcaps 0x41d: Stereo Amp-Out
Control: name="Front Playback Volume", index=0, device=0
ControlAmp: chs=3, dir=Out, idx=0, ofs=0
Device: name="ALC295 Analog", type="Audio", device=0
Amp-Out caps: ofs=0x57, nsteps=0x57, stepsize=0x02, mute=0
Amp-Out vals: [0x57 0x57]
Converter: stream=0, channel=0
PCM:
rates [0x40]: 48000
bits [0xe]: 16 20 24
formats [0x1]: PCM
Power states: D0 D1 D2 D3 EPSS
Power: setting=D0, actual=D0

How I set the Platforms69.xml since the node is OUT only
Screenshot 2024-03-17 alle 12 19 47

Dump info Node 8:

[Audio Input] wcaps 0x10051b: Stereo Amp-In
Control: name="Capture Volume", index=0, device=0
ControlAmp: chs=3, dir=In, idx=0, ofs=0
Control: name="Capture Switch", index=0, device=0
ControlAmp: chs=3, dir=In, idx=0, ofs=0
Device: name="ALC295 Analog", type="Audio", device=0
Amp-In caps: ofs=0x17, nsteps=0x3f, stepsize=0x02, mute=1
Amp-In vals: [0x3f 0x3f]
Converter: stream=0, channel=0
SDI-Select: 0
PCM:
rates [0x560]: 44100 48000 96000 192000
bits [0xe]: 16 20 24
formats [0x1]: PCM
Power states: D0 D1 D2 D3 EPSS
Power: setting=D0, actual=D0
Connection: 1
0x23

Same approach for input nodes
Screenshot 2024-03-17 alle 12 22 52

Dump info Node 27:

[Pin Complex] wcaps 0x40058f: Stereo Amp-In Amp-Out
Control: name="Bass Speaker Playback Switch", index=0, device=0
ControlAmp: chs=3, dir=Out, idx=0, ofs=0
Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0
Amp-In vals: [0x00 0x00]
Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
Amp-Out vals: [0x80 0x80]
Pincap 0x00013734: IN OUT EAPD Detect
Vref caps: HIZ 50 GRD 80 100
EAPD 0x2: EAPD
Pin Default 0x90170150: [Fixed] Speaker at Int N/A
Conn = Analog, Color = Unknown
DefAssociation = 0x5, Sequence = 0x0
Misc = NO_PRESENCE
Pin-ctls: 0x40: OUT VREF_HIZ
Unsolicited: tag=00, enabled=0
Power states: D0 D1 D2 D3 EPSS
Power: setting=D0, actual=D0
Connection: 2
0x02 0x03*

This node 27 being IN\OUT instead I set it like this
Screenshot 2024-03-17 alle 12 37 08

Can we define this configuration as correct???

The result of my tests is fully functional, I improved the quality of the sounds in Output\Input and reduced noises\background disturbances.

But the work is still very long.........

Questions about slimming AppleALC Kext

Hi, I'm kinda interested in slimming AppleALC kext for smaller file size. On reading your tutorial, I've got some questions:

  • We only need to repeat the process of slimming the kext when a new release has fixes regarding our codec, not on every release, right? I assume that even our codec gets new layout ID, we don't need to update either. Is that right?
  • At the time of me writing this, AppleALC kext version is 1.8.1. How come yours is 1.8.2 :v ?

Additions and suggestions

first of all, thank you so much for your guide! it is very helpful and comprehensive. however, some bits are ambiguous in the guide:

  • first, in Part IV, Node 24 is labeled as "(Jack) Mic at Ext Left" and Node 25 is labeled as "Speaker Ext. (S) IN Detect" in the final routings table.
  • In Part V, Node 24 is used as Line In of the docking station but in Part IX (in your patched pin-config) you highlighted Node 25 as the Line In of the dock.

If the Node 24 is the combojack that exists on the laptop itself, shouldn't it be placed with the Node 18 (internal mic) in order to get automatic switching working (in the Part VII, on the "finished Platforms39.xml" screenshot)? I didn't understand why you put the Line In of the dock (25) under the Node 18 since you stated that you need to switch manually in order to get microphones working without sending the sound through the input jack.

I'm sorry if i got this wrong but labeling the jacks according to their physical locations would be nice in the Part IV in order to clear any confusions down the guide.

  • second, the MuteGPIO section doesn't explain what you need to do when there is no VREF value on the Internal Microphones and you add manual switch to the Line-In; you shouldn't add any MuteGPIO value under the "Mic" dictionary since it can't be muted.
    you need to, however, add the MuteGPIO values to the "LineIn" directory in order to get sound from headphones with four pole jacks.

now, i want to suggest a tip for what to do when the codec dump does not have clear labels on the nodes. i struggled to figure out what node is the Line-In for the combojack because nearly half of the nodes are labeled as "Speaker" and they have the Pin-configs of "0x411111f0".

microphone of my EarPods work without a problem in linux, so i installed "alsa-tools" and used hdajacksensetest to see which nodes change when i plug in my headset. as you can see, Node 19 is the Line-In for the combojack, but it has specific properties attached to it (Pink Mic, Right Side), unlike "Black Speaker" in my codec-dump. i found out that it was patched in the linux kernel.
to confirm that, i did navigate to "/sys/class/sound/hwC0D0. in here, a specific text file took my interest named driver_pin_configs. sure enough, it was the pin-config that was applied when i boot into linux. i used that pin-config to correct my Line-In node and it is now working properly.
in the case that the microphones / speakers / etc. do not work in the linux, you can get the codec dump from windows with this tool to see the replaced pin-configs.

inclusion of this information might be useful for the people who have the same problem as mine.
this guide was very helpful and the credits goes to them.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.