Page MenuHomeFreeBSD

snd_hda: Reassign duplicate HDMI/DP pin sequences instead of disabling
ClosedPublic

Authored by guest-seuros on Feb 23 2026, 10:42 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, May 17, 9:19 PM
Unknown Object (File)
Sun, May 17, 9:12 PM
Unknown Object (File)
Thu, May 14, 5:50 AM
Unknown Object (File)
Wed, May 13, 9:24 PM
Unknown Object (File)
Mon, May 11, 1:53 PM
Unknown Object (File)
Sun, May 10, 7:33 AM
Unknown Object (File)
Sun, May 10, 7:24 AM
Unknown Object (File)
Mon, Apr 27, 4:02 PM
Subscribers

Details

Summary

Some firmware (e.g. Apple EFI on Sandy Bridge Mac hardware) programs all HDMI/DP output pins in an association with identical sequence numbers.

The existing code disables the entire association on the first duplicate, leaving HDMI/DP audio non-functional.

For digital output pins (HDMI/DP) with seq=0 duplicates, search for the next free sequence slot and reassign the duplicate rather than disabling.

The seq=0 restriction targets the known Apple firmware pattern; any other duplicate sequence is more likely a genuine firmware error and the association is still disabled.

Update first after reassignment so that hpredir is not left pointing at a stale sequence. Non-digital and input associations retain the existing disable behaviour.

Test Plan

Tested on Mac Mini 5,1 (Intel Sandy Bridge, Cougar Point PCH) where the fix allows pcm to enumerate all three HDMI/DP pins without sysctl
overrides.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 70939
Build 67822: arc lint + arc unit

Event Timeline

guest-seuros held this revision as a draft.
guest-seuros edited the summary of this revision. (Show Details)
guest-seuros edited the test plan for this revision. (Show Details)
guest-seuros added a reviewer: mav.

tagging christos@ as this is an audio thing.

sys/dev/sound/pci/hda/hdaa.c
3290

seq is always 0 in this case, so why it is used here? Also the rounding (% 16) seems redundant if you are looping to 16 anyway.

You could just rewrite the whole loop as:

for (cand = 1; cand < 16; cand++) {
	if (as[cnt].pins[cand] == 0) {
		newseq = cand;
		break;
	}
}
3308

I'm not sure I understand what this does. It'd be good to have a comment here.

guest-seuros edited the summary of this revision. (Show Details)

Address review: simplify seq search loop, add comment for hpredir anchor update

I don't have the hardware to test this on, but if it works for you, LGTM. Do you have a commit bit or should I commit it?

This revision is now accepted and ready to land.Mon, May 18, 1:48 PM

Can you land it please?

But if you want to double check, i could give you ssh access to my test lab computers.

While the initial dev was tested in an Apple 2011, the same logic apply to macbooks 2012-2015, apple mini 2014.

Can you land it please?

Sure.

But if you want to double check, i could give you ssh access to my test lab computers.

While the initial dev was tested in an Apple 2011, the same logic apply to macbooks 2012-2015, apple mini 2014.

Not sure there is a point to access the machine. My question was whether sound works properly, especially through the HDMI/DP devices.

Yes. Once this patch applied, the DRM driver attach and emit sound as indented.

christos retitled this revision from hdaa: reassign duplicate HDMI/DP pin sequences instead of disabling to snd_hda: Reassign duplicate HDMI/DP pin sequences instead of disabling.Tue, May 19, 12:25 PM