External Microphone via 3.5mm Jack (Librem 14)

Hi @kate.mason, sorry for the delay seeing this. There is a lot of background here to catch up on, so I want to assess where we currently are, check out any work that was in-progress, and go through the suggestions from this thread. I hope to have another update for you soon regarding where we are and what steps I think we can take next.

2 Likes

I think I’m running into this same issue with Qubes OS v4.1.1. The microphone does not produce any signal levels when plugged into the 3.5mm audio jack on the right side of the Librem 14.

The dom0 volume control panel => Input Devices => Built-in Analog Stereo => Port: Microphone shows no activity when speaking into the mic, and yes I have made sure to turn the camera/mic switch to the ON position.

When I connect a USB microphone, it does not even show up as an input device in same control panel, however I can attach it to a VM and get audio out of it.

I did some more testing and I can get the built-in microphone next to the camera working with VMs after flipping the hardware kill switch and attaching the dom0:mic device to a Qube VM.

It’s the 3.5mm stereo audio headphone jack on the right side that I’m still having issues with. Does anyone know what the name of this device should be?

1 Like

Any updates on the firmware fix? Would prefer to use my 3.5mm plug headset to conduct calls. I have the Librem-EC 1.11 fireware installed on my Librem 14 and am still struggling with this.

Found a librem ec repo issue for this problem here https://source.puri.sm/firmware/librem-ec/-/issues/10

I have raised it a long time ago…

Yes, and according to Nicole’s comment, it appears the embedded controller firmware is not the issue and functioning as it should.

If anyone finds a solution hopefully they can comment on that issue you opened and have it closed.

I was having this issue while running Qubes OS, doed it also occur under PureOS?

Unfortunately, external microphone does not work in PureOS either.

Hey all, I have been working on this and got a little bit more information, but not much, and no improvement so far unfortunately.

Setting the 0x4a coefficient to 0xe (the guessed verb that seems to enable mic input) does not work reliably for me. It does sometimes enable mic input (with hiss), but sometimes I have to run it several times before there is any change, so I do not think this change is anything we can ship in firmware. This doesn’t appear to be an ordinary register (if you read it back, the value is not constant), so as far as I can tell, it’s not a set of bit flags we can try to whittle down.

The hiss on my device is not awful, I think I could use this for a voice call, but it’s certainly not great. I expect we could wipe it out with EQ parameters. There are a few boards (not many) in coreboot using ALC256 that have EQ parameters, like this one: https://review.coreboot.org/plugins/gitiles/coreboot/+/refs/heads/master/src/mainboard/starlabs/starbook/variants/cml/hda_verb.c#88 Those params (according to comments, which could be wrong) look like they might eliminate hiss, but they had no effect for me. It’s possible that the 0x4a=0xe coefficient could be resetting them anyway, etc.

It is possible there could still be something wrong with the librem-ec jack detect, and we’re looking into it. However this will probably not affect the audio quality.

For those of you that have tried the guessed verbs and got mic input, how is the hiss? Could you use that audio for a voice call?

2 Likes

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