Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mic support on Asahi Linux #47

Open
hashx101 opened this issue Sep 29, 2024 · 7 comments
Open

Mic support on Asahi Linux #47

hashx101 opened this issue Sep 29, 2024 · 7 comments

Comments

@hashx101
Copy link

Have been researching if anyway the mic would work.
I just installed the latest version of asahi linux, I have the M2 2023 macbook pro 14 inch.
I am trying to connect the Airpod Pro Max and test on google meet. The A2DP Sink codec works for the airpod pro max speakers, but the mic would not work, even it shows as connected to airpod pro max. I saw some forums saying that people are able to use the mic with and airpod or external usb mic.

I would like to check if there are any updates on the mic driver on asahi, and if I have missed any settings to fix the mic. thank you

@mkurz
Copy link

mkurz commented Sep 29, 2024

First: I am on Arch Linux ARM, not Fedora.
I had the same problem with my Pixel Buds Pro - A2DP did work, so I could listen but the mic did not.
Turns out this was a problem within Pipewire and they fixed it in version 1.2.0 - which I think Fedora does not yet ship.
See the comments here where others say it's fixed for them using Airpods: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2689#note_2417741
This is the fix as it seems: https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/2015?commit_id=b94d6e53a1e6c816dacd4ad195496c79ff4e47c3

On Arch Linux ARM I already use latest pipewire so my mic works perfectly (using the LC3-SWB codec which pipewire 1.2 started to support as well).
So I guess with next Fedora release it should work for you too.

@hashx101
Copy link
Author

hashx101 commented Sep 30, 2024

@mkurz Thank you for digging into this and sharing your experience, really appreciated! That's awesome to hear that there is a fix already in place and the bluetooth mic working for you. I checked the pipewire version on my end, it is:
pipewire Compiled with libpipewire 1.0.8 Linked with libpipewire 1.0.8
I was reviewing the link you referenced to the pipewire repo and the previous comments. You mentioned that you applied the patch and built with the kernel. Curious how you did the test?
I also was checking out the repo of pipewire there is a installation doc https://gitlab.freedesktop.org/pipewire/pipewire/-/blob/master/INSTALL.md where you can build from source, have you tried it out that way to test as well?

I was checking out some forums people were saying that the pipewire version update was not as frequent since fedora 37. If I could update the pipewire version independently without the wait would be great.

On another note, I was testing a non-bluetooth usb-c headset I got from amazon https://www.amazon.com/Headphones-Samsung-Earphones-Earbuds-OnePlus/dp/B0B941P3TF - both the audio and the mic work fine (stereo analog setting). At least this can resolve my immediate need to have this linux environment for day-to-day use. And it looks like the major problem would be bluetooth mic only now.

@mkurz
Copy link

mkurz commented Sep 30, 2024

@hashx101 Again, I am on Arch Linux, not Fedora. What I did was I used the pipewire-git AUR, modified the PKGBUILD to apply the patch needed and rebuild and re-installed pipewire with that fix applied: https://aur.archlinux.org/cgit/aur.git/tree/?h=pipewire-git
I have no idea how you do that in Fedora and I don't have time to look into that.
IMHO if you don't know how to fix that yourself, I would right now just wait for Fedora 41, which will be released beginning of November - after that it will take probably another few weeks until that makes it to the Asahi Fedora. However, then you will automatically get pipewire 1.2: https://packages.fedoraproject.org/pkgs/pipewire/pipewire/
Until that I would just stick to the USB mic.

Also, because I am just curious, can you comment here as soon as you are running pipewire 1.2 if that version resolves your problem? Thanks!

@hashx101
Copy link
Author

hashx101 commented Oct 1, 2024

Hey @mkurz thanks again for sharing how you applied the patch and the fedora pipewire package release schedule!
It's nice that they have a schedule to update the pipewire versions in the next release and it's not too far away.

I believe like you said in the gitlab thread, I also don't have the ability to 'fix' directly the issue related the mechanisms on the audio codecs. But I am trying to understand what the fix is, this commit they referenced: fix-commit

In particular at this part from sco-io.c
Before, no matter what the bus_type is, the read_size is 0. for bus_type other than usb, now they allocate some memory for the audio data packets. Although P V mentioned somewhere in the thread saying that the first patch he referred only work for usb. But from this commit that got merged to master, it seems like it is the later fix he did, and fixed the non-usb bluetooth.
`

io->log = log;

if (transport->device->adapter->bus_type == BUS_TYPE_USB) {
	/* For USB we need to wait for RX to know it. Using wrong size doesn't
	 * work anyway, and may result to errors printed to dmesg if too big.
	 */
	io->read_size = 0;
} else {
	/* Set some sensible initial packet size */
	switch (transport->codec) {
	case HFP_AUDIO_CODEC_CVSD:
		io->read_size = 48;  /* 3ms S16_LE 8000 Hz */
		break;
	case HFP_AUDIO_CODEC_MSBC:
	case HFP_AUDIO_CODEC_LC3_SWB:
	default:
		io->read_size = HFP_CODEC_PACKET_SIZE;
		break;
	}
}

`

I believe that if you build the pipewire package from source and run natively on your local with the daemon, it should work the same as the one that download from linux distro repo. My plan is to stop and uninstall the pipewire 1.0.8 that got from the fedora 40 and build from the source and run the pipewire master branch and/or 1.2 branch to test if it fixes the problem. I will find some time to try it out in between the next fedora 41 release. If that works, I will update this thread and hope this helps someone also having similar issue!

@eugenialoli
Copy link

Is the built-in mic working with Asahi 41 now? That's the only piece of hardware I need working before I jump in to it, since I need it for video conferences.

@JanWielemaker
Copy link

Is the built-in mic working with Asahi 41 now?

It does not show up in the sound settings. Pipewire is at 1.2.7.

@hashx101
Copy link
Author

Is the built-in mic working with Asahi 41 now? That's the only piece of hardware I need working before I jump in to it, since I need it for video conferences.

I upgraded to Asahi 41 but no, the bluetooth mic - e.g. Airpods still not functioning. However, the analog mic would work, the method I mentioned in the thread earlier, get a usbc headset on Amazon.

On the note of video conferencing - if your work highly dependent on Zoom(like me), I would not recommend running Asahi as your primary OS as Zoom is unsupported. Google meet is fine and if you are ok with plugging in analog headset for conferences. It's still nice to have it installed at a partition so I can switch to it to run CPU intensive jobs whenever I want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants