Page MenuHomeFreeBSD

snd_hda: Enable the headset microphone on Framework ALC295 laptops
Needs ReviewPublic

Authored by christos on Fri, Oct 9, 2:40 PM.
Tags
None
Referenced Files
F175730446: D60527.id.diff
Mon, Oct 12, 8:52 PM
F175685510: D60527.id189341.diff
Mon, Oct 12, 12:49 PM
Unknown Object (File)
Sun, Oct 11, 2:19 PM
Unknown Object (File)
Sun, Oct 11, 6:40 AM
Unknown Object (File)
Sun, Oct 11, 3:51 AM
Unknown Object (File)
Sat, Oct 10, 6:06 PM
Unknown Object (File)
Sat, Oct 10, 2:51 PM
Unknown Object (File)
Sat, Oct 10, 1:43 PM
Subscribers

Details

Reviewers
markj
emaste
jrm
Summary

The ALC295's jack is configured in headphone-only mode by default. Set
it to CTIA headset mode so that the headset microphone can work,
otherwise the pin configuration patches alone are not enough.

One caveat, as a result of jack presence detection not working properly,
is that a user has to switch between internal and headset microphones
using mixer(8). The "monitor" knob corresponds to the internal mic, and
"mic" to the headset one.

This patch currently covers the Framework 11th Gen (0x0001), AMD Ryzen
7040 13in (0x0006), and AMD Ryzen AI 300 (0x000b).

Obtained from: Linux
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 77953
Build 74836: arc lint + arc unit

Event Timeline

I assume you used Linux source as a reference, but this code is not derived from Linux and so "Obtained from" isn't right. I would just write as prose in the commit message something like "Configuration based on Linux commit 1234abcd" if you found a specific Linux commit that added support, or something simple like "Linux (at commit <hash>) used as a reference."

sys/dev/sound/pci/hda/hdaa_patches.c
405

Removing loc=Left here is probably a separate change. But why does nid 33 now have no location and nid 25 specifies right?

777

should it be uint32_t?

787

it looks like we don't use the return value anywhere; should this be a void fn?

christos marked 3 inline comments as done.

Address Ed's comments. Note that hdaa_update_coef() now closely resembles
Linux's equivalent:

static void __alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
				    unsigned int coef_idx, unsigned int mask,
				    unsigned int bits_set)
{
	unsigned int val = __alc_read_coefex_idx(codec, nid, coef_idx);

	if (val != -1)
		__alc_write_coefex_idx(codec, nid, coef_idx,
				       (val & ~mask) | bits_set);
}

@emaste, could that be a problem?

Also updated the commit message but it doesn't update automatically. I removed
the "Obtained by:" and added the following lines:

Linux commit 5a36767 used as a reference.

See also:       https://github.com/torvalds/linux/commit/5a36767a41650518f35ea0bae9a2d6e775f1aed1