From 30761935c6caad4e8f25453ffd5804be83563d02 Mon Sep 17 00:00:00 2001 From: mav Date: Wed, 25 Jan 2012 20:46:10 +0000 Subject: Rewrite jack presence detection and implement automatic recording source selection in snd_hda(4) driver. Now driver tracks jack presence detection status for every CODEC pin. For playback associations, when configured, that information, same as before, can be used to automatically redirect audio to headphones. Also same as before, these events are used to track digital display connection status and fetch ELD. Now in addition to that driver uses that information to automatically switch recording source of the mixer to the connected input. When there are devices with no jack detection and with one both connected, last ones will have the precedence. As result, on most laptops after boot internal microphone should be automatically selected. But if external one (for example, headset) connected, it will be selected automatically. When external mic disconnected, internal one will be selected again. Automatic recording source selection is enabled by default now to make recording work out of the box without touching mixer. But it can be disabled or limited only to attach time using hint.pcm.X.rec.autosrc loader tunables or dev.pcm.X.rec.autosrc sysctls. MFC after: 2 months Sponsored by: iXsystems, Inc. --- share/man/man4/snd_hda.4 | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'share') diff --git a/share/man/man4/snd_hda.4 b/share/man/man4/snd_hda.4 index 270a9f5..bcdd95a 100644 --- a/share/man/man4/snd_hda.4 +++ b/share/man/man4/snd_hda.4 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 11, 2012 +.Dd January 25, 2012 .Dt SND_HDA 4 .Os .Sh NAME @@ -182,6 +182,18 @@ May be specified as a 32-bit hexadecimal value with a leading or as a set of space-separated .Dq Ar option Ns = Ns Ar value pairs. +.It Va hint.pcm.%d.rec.autosrc +Controls automatic recording source feature: +.Bl -tag -compact +.It 0 +disabled, +.It 1 +once on attach, +.It 2 +enabled. +.El +When enabled, driver will automatically set recording source of the mixer to +connected input using jack presence detection statuses. .El .Pp Pin configuration is the UAA driver's main source of information about codec @@ -357,6 +369,16 @@ Original pin configuration written by BIOS. Setting this to a non-zero value makes driver to destroy existing pcm devices and process new pins configuration set via .Va dev.hdaa.%d.nid%d_config. +.It Va dev.pcm.%d.play.32bit , dev.pcm.%d.rec.32bit +HDA controller uses 32bit representation for all samples of more then 16 bits. +These variables allow to specify how many bits of these 32 should be +used by CODEC. +Depending on codec capabilities, possible values are 20, 24 and 32 bit. +The default value is 24. +.It Va dev.pcm.%d.rec.autosrc +Run-time equivalent of the +.Va hint.pcm.%d.rec.autosrc +tunable. .El .Sh EXAMPLES Taking HP Compaq DX2300 with Realtek ALC888 HDA codec for example. -- cgit v1.1