[alsa-devel] [RFC PATCH] ALSA: hda - Implement a poll loop for jacks as a module parameter

Takashi Iwai tiwai at suse.de
Tue Oct 9 15:32:36 CEST 2012


At Tue,  9 Oct 2012 15:19:44 +0200,
David Henningsson wrote:
> 
> Now that we have a generic unsol mechanism, we can implement a generic
> poll loop, which can be used for debugging, or if a codec's unsol
> mechanism is broken.
> 
> Signed-off-by: David Henningsson <david.henningsson at canonical.com>

The patch almost looks good, but I postpone as a 3.8 thing.

> ---
> 
> I'm also considering activating it by default if we go into single_cmd mode
> due to codec not responding. What do you think?

Well, I don't buy it.  Falling back to single_cmd doesn't mean that we
are saving the world perfectly.  I recently even think it might be
even better not to do that, otherwise people won't notice the
breakage.


> diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
> index f09ff6c..b4f1ab8 100644
> --- a/sound/pci/hda/hda_intel.c
> +++ b/sound/pci/hda/hda_intel.c
> @@ -68,6 +68,7 @@ static int position_fix[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = -1};
>  static int bdl_pos_adj[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = -1};
>  static int probe_mask[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = -1};
>  static int probe_only[SNDRV_CARDS];
> +static int jackpoll_ms[SNDRV_CARDS];
>  static bool single_cmd;
>  static int enable_msi = -1;
>  #ifdef CONFIG_SND_HDA_PATCH_LOADER
> @@ -95,6 +96,8 @@ module_param_array(probe_mask, int, NULL, 0444);
>  MODULE_PARM_DESC(probe_mask, "Bitmask to probe codecs (default = -1).");
>  module_param_array(probe_only, int, NULL, 0444);
>  MODULE_PARM_DESC(probe_only, "Only probing and no codec initialization.");
> +module_param_array(jackpoll_ms, int, NULL, 0444);
> +MODULE_PARM_DESC(jackpoll_ms, "Ms between polling for jack events (default = 0, using unsol events only)");
>  module_param(single_cmd, bool, 0444);
>  MODULE_PARM_DESC(single_cmd, "Use single command to communicate with codecs "
>  		 "(for debugging only).");
> @@ -1666,6 +1669,8 @@ static int DELAYED_INIT_MARK azx_codec_create(struct azx *chip, const char *mode
>  			err = snd_hda_codec_new(chip->bus, c, &codec);
>  			if (err < 0)
>  				continue;
> +			codec->jackpoll_interval =
> +				msecs_to_jiffies(jackpoll_ms[chip->dev_index]);

Better to add a sanity check of the interval value.


Takashi


More information about the Alsa-devel mailing list