[alsa-devel] [PATCH v2] alsa-tools: Add a small "hdajacksensetest" helper
Raymond Yau
superquad.vortex2 at gmail.com
Mon Oct 6 16:56:45 CEST 2014
> I previously had a small python script doing the same thing,
> but it depended on hda-analyzer, which always breaks when something
> new is added to the codec proc file.
>
> I got tired and rewrote it as a small C program instead, which I
> hope will be a useful addition to alsa-tools.
>
> +
> +static gboolean should_check_pin(pin_configs_t *pin)
> +{
> + unsigned long defcfg = actual_pin_config(pin);
> + if (try_all_pins)
> + return TRUE;
> + if (get_port_conn(defcfg) != 0)
> + return FALSE; // Not a jack
> + if (defcfg & (1 << 8)) // Jack has NO_PRESENCE set
> + return FALSE;
> + return TRUE;
> +}
> +
The pincap of the pin complex must support DETECT even when you specify
try_all_pins
More information about the Alsa-devel
mailing list