AsahiLinux / asahi-audio

Userspace audio for Asahi Linux
MIT License
128 stars 12 forks source link

J493 sound card support (Apple M2) #37

Closed vovkapoc closed 1 week ago

vovkapoc commented 3 months ago

I check my sound card details in /sys/firmware/devicetree/base/sound:

root@fedora:/sys/firmware/devicetree/base/sound# find . -type f -exec xxd -c 24 {} \;
00000000: 4d61 6342 6f6f 6b20 5072 6f20 4a34 3933 00                   MacBook Pro J493.
00000000: 0000 00bf 0000 0000 0000 00bf 0000 0001                      ................
00000000: 6370 7500                                                    cpu.
00000000: 0000 00c0 0000 00c1 0000 00c2 0000 00c3                      ................
00000000: 636f 6465 6300                                               codec.
00000000: 5370 6561 6b65 7273 00                                       Speakers.
00000000: 6461 692d 6c69 6e6b 00                                       dai-link.
00000000: 6170 706c 652c 6a34 3933 2d6d 6163 6175 6469 6f00 6170 706c  apple,j493-macaudio.appl
00000018: 652c 6d61 6361 7564 696f 00                                  e,macaudio.
00000000: 736f 756e 6400                                               sound.
00000000: 0000 00bf 0000 0002                                          ........
00000000: 6370 7500                                                    cpu.
00000000: 0000 00c4                                                    ....
00000000: 636f 6465 6300                                               codec.
00000000: 4865 6164 7068 6f6e 6520 4a61 636b 00                        Headphone Jack.
00000000: 6461 692d 6c69 6e6b 00                                       dai-link.
root@fedora:/sys/firmware/devicetree/base/sound# 

My sound card detected as: MacBook Pro J493 and currently use native driver dai-link I installed latest AsahiLinux (gnome), all worked very good and very fast, but sound worked very bad... I find this repository for build driver and install now, but not see config for j493... :-( Please add config for my sound card in tree...

Thank you very much! You best of the best, really Fedora worked very very good!!!

P.S. Sorry for my bad English, I from Ukraine...

chadmed commented 3 months ago

This repo has nothing to do with the driver/kernel, and everything there looks fine. J493 is supported, as denoted in the Makefile. Since your machine is the same as J293, we just alias that config in the Makefile.

Could you elaborate on what you mean when you say the sound is bad? Fedora Asahi Remix should install all the required support packages by default.

vovkapoc commented 3 months ago

This repo has nothing to do with the driver/kernel, and everything there looks fine. J493 is supported, as denoted in the Makefile. Since your machine is the same as J293, we just alias that config in the Makefile.

Could you elaborate on what you mean when you say the sound is bad? Fedora Asahi Remix should install all the required support packages by default.

I installed latest fedora (gnome version) and sound in my M2 mac book pro is very bad... How to fix this? How to build latest kernel/installer with latest patches?

chadmed commented 3 months ago

If you're using GNOME this could be related to a known issue with libgvc where it doesn't respect the permissions we set in WirePlumber.

Could you please make sure that you are using the output called "MacBook Air J493 Speakers" and not the one called "Built-in Speakers"

vovkapoc commented 3 months ago

If you're using GNOME this could be related to a known issue with libgvc where it doesn't respect the permissions we set in WirePlumber.

Could you please make sure that you are using the output called "MacBook Air J493 Speakers" and not the one called "Built-in Speakers"

vovkapoc@fedora:~$ alsactl info
#
# Sound card
#
- card: 0
  id: AppleJ493
  name: MacBook Pro J493
  longname: MacBook Pro J493
  driver_name: macaudio
  mixer_name: 
  components: 
  controls_count: 47
  pcm:
    - stream: PLAYBACK
      devices:
        - device: 0
          id: Primary (*)
          name: 
          subdevices:
            - subdevice: 0
              name: subdevice #0
        - device: 1
          id: Secondary (*)
          name: 
          subdevices:
            - subdevice: 0
              name: subdevice #0
    - stream: CAPTURE
      devices:
        - device: 0
          id: Primary (*)
          name: 
          subdevices:
            - subdevice: 0
              name: subdevice #0
        - device: 2
          id: Speaker Sense (*)
          name: 
          subdevices:
            - subdevice: 0
              name: subdevice #0
alsactl: rawmidi_device_list:105: snd_ctl_rawmidi_next_device

This configuration for my sound card is good? Sound really bad quality. How to fix this with alsactl or another terminal commands?

chadmed commented 3 months ago

That doesn't help me. This repo and the DSP has nothing to do with the kernel. Your kernel settings are fine. You need to check GNOME settings and see what audio output is selected. It needs to be "MacBook Pro J493 Speakers" and not "Built-in Speakers".

Note that we do not - and will not - support ALSA direct to the ASoC device. Sound output must go through PipeWire/WirePlumber.

chadmed commented 1 week ago

Feel free to reopen if you actually find something actionable