HD Audio: DisplayPort and HDMI codecs?

From: Thomas Pike
Date: Mon Sep 16 2013 - 08:33:21 EST


Hi everyone,
I need to ask something that's been bugging me for years. Suppose you have a graphics adapter with both DisplayPort and HDMI ports, and both of them are connected to different screens.

Then how do I decide where to route my audio signals?
Linux ALSA drivers only expose one generic codec (usually something like /proc/asound/card0/codec#3) that is supposed to cater both to DP and HDMI. Of course, audio only ends up at one of the two, and in my experience DP takes precedence. This goes as far as that no matter whether even a device is connected to DP or not, HDMI does not receive any audio as soon as a DP port exists.
Usually I'd route my audio with something like `mplayer -ao alsa:device=hw=0.3`, but since codec#3 represents both DP and HDMI, there is no way for me to pick a particular audio sink (and pulseaudio naturally wouldn't allow me to do anything beyond this either, as it only patches through audio to ALSA devices).
At first I thought this is a vendor-specific problem, but after experiencing it on both AMD and Intel adapters, I checked the kernel modules: All HD audio related to DP/HDMI seems to processed by snd_hda_codec_hdmi. HDA kernel modules don't seem to allow for any parameters to set the preferred audio port either, so I believe this is a generic problem.

So, any suggestions on how this can be fixed?
Wouldn't it be advisable to expose each audio port via a separate codec? This way I could even simultaneously run multiple audio streams over multiple DP/HDMI connections.

Thanks for you insight!
T. Pike --
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/