davidjo / snd_hda_macbookpro

Kernel audio driver for Macs with 8409 HDA chip + MAX98706/SSM3515 amps
GNU General Public License v2.0
270 stars 59 forks source link

How to avoid stereo duplication / improve audio quality by replicating CoreAudio filtering #56

Open JayFoxRox opened 1 year ago

JayFoxRox commented 1 year ago

This commit talks about stereo duplication: https://github.com/davidjo/snd_hda_macbookpro/commit/063110b132b69ea8e6223d3c6870df47137ccacb and this is also mentioned in the README changes in https://github.com/davidjo/snd_hda_macbookpro/commit/6640c79c061b7596b01901cf3f581af94cb9a557

I wonder if this (current-state) is enough for good audio, or if it's possible to get full access to the speaker array to do something like https://github.com/chadmed/asahi-audio (the author also wants to find a more generic plug-and-play solution: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2210).

//Edit:

Here's the resources I found already:

davidjo commented 1 year ago

The auto duplication only occurs if you set the audio to the stereo output (for ubuntu in Audio Settings). You should also see a 4 channel surround output - that requires a 4 channel stream if you set audio output to that. All you have to do is create the 4 channel stream. (Note that unlike the Apple way this is a left/right tweeter left/right woofer order). (Apples is left tweeter/left woofer/right tweeter/right woofer). If you look thro the issues here (possibly closed issues) various attempts at generating 4 channel streams from pulse or alsa have been tried ie actual user configuration scripts have been attempted - you shouldnt need to change the actual kernel driver. (Unfortunately Ubuntu 22.04 is not using pipewire - next non-LTS version will I believe).

slynobody commented 1 year ago

I got working 4-channel sound on an Imac qualitywise near macos with these changes:

it even works very nice with wine if you enable '4-channel-audio' in wine-settings (if the 4.0-device is visible / used)

what does not work yet is

davidjo commented 1 year ago

Nice work. Headphones need to switch back to 2 channel - the headphone audio path is separate from the speaker path so any downmixing needs doing to be done in pipewire.