External Microphone via 3.5mm Jack (Librem 14)

I have some good news on this! Finally made some breakthroughs, and jack detect is working. I think the audio quality is good too (the guessed verbs forcing the mic on were probably resetting other things that shouldn’t have been reset, no way to know).

This requires both BIOS and EC updates, please try these preview builds:

With these updates, the headset jack detection now works, and the mic input works. Let me know how this works for you all and how the audio quality is! If there is any problem with audio quality, a few-seconds recording would be helpful! (If you have any HDA verb hacks, please be sure to undo those.)

The jack detect takes about 1-2 seconds to respond right now, that’s just because of the way Librem-EC polls some of its low frequency tasks.

The problem was mainly in the EC - it wasn’t asserting the jack detect correctly, and figuring out what the codec wanted was mostly trial and error. The coreboot update undoes the workarounds disabling the jack detect (since it now works) and also checks the EC - it falls back to the older verbs if the EC hasn’t been updated yet.

8 Likes

This is dope as hell. Great work! Question for you - for those of us not familiar with applying these kinds of updates. Is there some documentation we can follow? I assume it would be similar to the process described here, however, not familiar with using an ISO file. For those of us who are still getting acquainted with the process, how does one update our firmware to take advantage of these discoveries?

Sure, yes there is documentation:

For the system firmware (coreboot+SeaBIOS / PureBoot) - https://source.puri.sm/firmware/utility#usage - it’s just a few steps to run the script, the script will guide you with menus. Use the preview URI above of course to get the preview firmware.

For the EC firmware - https://puri.sm/projects/librem-ec/ - this is straightforward too. Again use the preview URI above to get the preview firmware.

I had a couple of reports that only the headphone jack detect was working, the mic still wasn’t detected, so there may still be some refinement needed. Let me know how it works for you all!

3 Likes

Hi all, I’ve updated the EC firmware - we tweaked the jack sense assertion time from 1 ms to 10 ms. Some internal users reported that the first build didn’t always detect the microphone, and this tweak fixed it. (The BIOS firmware is unchanged from the first preview post.)

If anybody has a chance to test it, I’d appreciate knowing your results! I will work this into our next firmware releases.

5 Likes

Hi Jonathon, thanks for the fix! Is it included in official releases, or is it still just a preview? Where we can see MR or something like that to track this fix in releases?

P.S. I have installed bios and ec updates (releases) and my 3.5 mic still doesn’t work. And I’m a little afraid to install preview version of core features

Hi Alexey,

This fix was released in coreboot 4.19-Purism-1, PureBoot 25, and Librem-EC 1.13.

Fix in Librem EC 1.13: https://source.puri.sm/firmware/librem-ec/-/commit/15870cf73c60f8901e9b09dbb76434ddc1a0133a
Updated HDA verbs in coreboot 4.19-Purism-1: https://source.puri.sm/firmware/coreboot/-/commit/36482ccb6dd42ac5698c973f97c611cb3d5c353d
Patch to upstream the HDA verbs to coreboot: https://review.coreboot.org/c/coreboot/+/74364

my 3.5 mic still doesn’t work

Is this a standalone 3.5mm mic, or do you mean the microphone part of a headset does not work? (Do the headphones work, and are they detected automatically?) What BIOS and EC version do you have?

It’s external standalone mic (boya by-m1). When I plug it in, it detected as headphones (output device) in settings. So in input device list I have only internal mic.

And mic in bluetooth headset doesn’t work too, btw.

Versions:
Librem EC 1.13
coreboot: 4.20.1-Purism-1 (06/12/2023)

That microphone has a switch to toggle between “camera” and “smartphone” mode - it probably toggles the wiring of the TRRS plug in particular. Do you have it in “smartphone” mode?

Librem 14 will think that there are headphones plugged in as well though - the jack sense cannot differentiate a headset from a microphone alone. (The audio will switch to nonexistent headphones.)

I can’t confirm the smartphone-mode wiring of this device though - most devices outside of the Chinese market (including Librem 14) use CTIA, microphone on sleeve. Some devices though have OMTP wiring with the mic on the second ring. This device’s instructions are equal parts English and Chinese, so I couldn’t guess which it is.

I haven’t tried a Bluetooth headset, if the Bluetooth interface is up and you can pair devices then we are getting into OS territory, from a firmware perspective the Bluetooth interface is up. We might need to check with OS folks :grin:

Sure, I have it in “smartphone” mode. But in both mode it is the same: input device list have one item, only internal mic, which sound bar fills when I clap to laptop, not to mic.

And another interesting observation. Sometimes when I plug in mic, input device changes to Microphone (instead of “Internal Microphone”).
image

And, if it happens (rarely), mic bar fills, when I play a sound!
image

P.S. Boya is in “smartphone” mode

Thanks for the details Alexey. The note that the mic bar fills when playing a sound is particularly relevant - this suggests to me that the microphone has OMTP wiring in “smartphone” mode, not CTIA like the Librem 14.

The difference as I mentioned is the position of mic and ground. The codec does detect the presence of a mic (headset versus plain headphones), and with transposed mic/ground it makes sense that this would be unreliable. Playing audio would cause an input signal if the microphone puts some impedance between the speaker terminals and its own ground, which due to the reversed wiring is actually the microphone input.

To use this mic you would have to use an adapter - either a USB adapter with a dedicated mic input (I use one on my desktop systems), or a 3.5mm TRRS plug to separate 3.5mm headphone/mic jacks (must be CTIA wired, most outside of China should be, and be aware Librem 14 will still think there are headphones connected since it is unable to sense a mic-only connection).

1 Like

Confirmed Jabra microphone headset via 3.5mm jack is working on Qubes v4.2.0. Make sure that the camera/mic hardware kill switch is set to ON and that the dom0:mic device is attached the appropriate Qube VM.

Also, under Audio mixer (window title will be “[dom0] volume control”) set the Input devices => Port dropdown menu to “Microphone (plugged in)”. Then on the “Recording” tab of the [Dom0] Volume Control dialogue, set the desired application’s ‘record from’ dropdown menu to “Built-in Audio Analog Stereo”. Tap and speak into the microphone to verify your levels are set correctly and that it’s using the headset mic and not laptops built-in one.

After verifying all these settings, you should be good to go. Remember the camera/mic hardware kill switch will disable the 3.5mm jack as well.

Thank you Jonathan for getting this working. Really makes a difference when I’m working mobile and don’t want to fiddle with the USB mic adapter.

3 Likes