acidanthera / bugtracker

Acidanthera Bugtracker
381 stars 43 forks source link

Support DMIC (Intel SST) #2084

Open Lorys89 opened 2 years ago

Lorys89 commented 2 years ago

hi everyone, hi @vit9696 I was wondering seen the numerous notebooks that mount dmic array intel sst if it is possible to implement this code on apple alc or create a new kext. I viewed these parts that I link on linux drivers : https://github.com/torvalds/linux/blob/master/sound/soc/intel/boards/sof_sdw_dmic.c https://github.com/torvalds/linux/blob/master/sound/soc/intel/boards/sof_sdw.c

cc @vandroiy2013

vit9696 commented 2 years ago

I believe AppleHDA will not be able to use this, and a separate driver will be needed. I cannot imagine writing it within Acidanthera, but if anyone wants to contribute this, we will be glad to help to maintain.

mikebeaton commented 1 year ago

AppleHDA is Apple's driver for Intel HDA (high definition audio) sound chips. Each Intel HDA chip has its own unique layout (of inputs, outputs, amplifiers, etc.). AppleALC is Acidanthera's driver to configure AppleHDA with the layout of Intel HDA sound cards which it has never seen before. Intel SST is not Intel HDA (and not compatible with it, I believe, unless someone wants to correct me) therefore AppleALC cannot tell AppleHDA how to use an Intel SST chip, and an entire new macOS sound driver for the different chipset would be needed.

EDIT: BTW one could attempt to configure AudioDxe, as a way to determine whether these cards also have Intel HDA as a fallback. If they do - i.e. if AudioDxe can see sound card stuff - then it's a different story and should be in scope. (But again, afaik this will not work - if someone already knows, please comment. Thx.)

mikebeaton commented 1 year ago

Well who's we? If you make progress with this, you would be more than welcome to discuss it further and consider making a PR, but as @vit9696 stated, it is currently unlikely to be originally written within Acidanthera.

meghan06 commented 1 year ago

@kryptinx cc @mikebeaton max98927 uses an Intel DSP (branded as Smart Sound) and is i2s from that coprocessor.

For anybody willing to work on an audio driver for this, make a template driver that has 2 inputs + output endpoints that gets a DMA buffer + position callback from macOS. Soundflower could work as an template with some tweaking since it's just an simple loopback driver.

meghan06 commented 1 year ago

@mikebeaton I wanted to add on to your previous comment above and clarify some items mentioned.

Intel SST utilizes I2S codecs for speakers and headphones instead of HD Audio codecs. it is not possible to expose HD Audio speaker endpoints as the device (codec) is physically not there. Linux kernel drivers like skylake-driver and avs-driver enable Audio DSP capabilities for devices that do support offloaded streaming and/or intend to lower battery consumption of the audio stack. Chromebooks with max98927 are one of the examples.

I was able to find these, but they are for Linux. driver code 1, tools 2, and topology references 3

note: ‘main’ branch targets the avs-driver whereas ‘for-skylake-driver’ targets the skylake-driver

Edit: Also, Intel DMIC is the microphone setup, Intel SST is the speaker setup AFAIK.