control: decode HDMI device name from ELD

The HDMI drivers set an uniform PCM names. Use ELD (EDID) to obtain
the HDMI device name and send this string to applications for a better
user experience.

Example (aplay -l):

  card 1: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
    Subdevices: 1/1

  vs improved:

  card 1: PCH [HDA Intel PCH], device 8: HDMI 2 [Philips 272P4]
    Subdevices: 1/1

Fixes: https://github.com/alsa-project/alsa-lib/issues/209
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2022-05-05 14:28:41 +02:00
parent 9c0c757b85
commit 859448f010
5 changed files with 111 additions and 1 deletions

View file

@ -320,6 +320,9 @@ static int snd_pcm_hw_info(snd_pcm_t *pcm, snd_pcm_info_t * info)
SYSMSG("SNDRV_PCM_IOCTL_INFO failed (%i)", err);
return err;
}
/* may be configurable (optional) */
if (__snd_pcm_info_eld_fixup_check(info))
return __snd_pcm_info_eld_fixup(info);
return 0;
}