alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Mark Hills <mark@pogo.org.uk>
To: Felix Homann <linuxaudio@showlabor.de>
Cc: alsa-devel@alsa-project.org, patch@alsa-project.org
Subject: Re: [PATCH 1/5] Unify M-Audio Fast Track Ultra and Ebox-44 mixer quirks.
Date: Mon, 23 Apr 2012 19:36:06 +0100 (BST)	[thread overview]
Message-ID: <alpine.LNX.2.01.1204231932580.20159@stax.localdomain> (raw)
In-Reply-To: <1335205467-12650-2-git-send-email-linuxaudio@showlabor.de>

On Mon, 23 Apr 2012, Felix Homann wrote:

> +/* This function allows for the creation of standard UAC controls.
> + * See the quirks for M-Audio FTUs or Ebox-44.
> + * If you don't want to set a TLV callback pass NULL.
> + * 
> + * Since there doesn't seem to be a devices that needs a multichannel
> + * version, we keep it mono for simplicity.
> + */
> +static int snd_create_std_mono_ctl(struct usb_mixer_interface *mixer,
> +				unsigned int unitid,
> +				unsigned int control,
> +				unsigned int cmask,
> +				int val_type,
> +				const char *name,
> +				snd_kcontrol_tlv_rw_t *tlv_callback)
> +{
> +	int err;
> +	struct usb_mixer_elem_info *cval;
> +	struct snd_kcontrol *kctl;
> +
> +	cval = kzalloc(sizeof(*cval), GFP_KERNEL);
> +	if (!cval)
> +		return -ENOMEM;
> +
> +	cval->id = unitid;
> +	cval->mixer = mixer;
> +	cval->val_type = val_type;
> +	cval->channels = 1;
> +	cval->control = control;
> +	cval->cmask = cmask;
> +
> +	/* FIXME: Do we need this?
> +	 * The following values are for compatibility with
> +	 * Ebox-44 mixer.
> +	 * But the corresponding ebox-44 function says:
> +	 *    "Volume controls will override these values"
> +	 * 
> +	 * These values don't have any effect at all for
> +	 * M-Audio FTUs.
> +	 * So I think, we can safely omit the range settings here.
> +	 */
> +	cval->min = 0;
> +	cval->max = 1;
> +	cval->res = 0;
> +	cval->dBmin = 0;
> +	cval->dBmax = 0;

When implementing the Ebox44 quirk, I found I needed this. The min and max 
would be automatically completed for the S16 values, but not for the mute 
buttons, so I defaulted to the range required for the BOOLEAN.

I was really hoping some one would explain this when I RFC'd the patch. 
But at that time the code was not part of some general-purpose function so 
it wasn't really an issue.

-- 
Mark

  reply	other threads:[~2012-04-23 18:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-23 18:24 [PATCH 0/5] Alsa: snd-usb: Improve M-Audio Fast Track Ultra mixer - v3 Felix Homann
2012-04-23 18:24 ` [PATCH 1/5] Unify M-Audio Fast Track Ultra and Ebox-44 mixer quirks Felix Homann
2012-04-23 18:36   ` Mark Hills [this message]
2012-04-23 18:46     ` Felix Homann
2012-04-24  6:20     ` Takashi Iwai
2012-04-23 18:24 ` [PATCH 2/5] Rename and export mixer_vol_tlv Felix Homann
2012-04-23 18:24 ` [PATCH 3/5] Add TLV to M-Audio Fast Track Ultra controls Felix Homann
2012-04-23 18:24 ` [PATCH 4/5] Rename Fast Track Ultra mixer quirk functions Felix Homann
2012-04-23 18:24 ` [PATCH 5/5] M-Audio Fast Track Ultra: Add effect controls Felix Homann
2012-04-23 18:47 ` [PATCH 0/5] Alsa: snd-usb: Improve M-Audio Fast Track Ultra mixer - v3 Mark Hills
2012-04-23 19:00   ` Felix Homann
2012-04-24  6:21 ` Takashi Iwai
2012-04-24  7:18   ` Felix Homann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.01.1204231932580.20159@stax.localdomain \
    --to=mark@pogo.org.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=linuxaudio@showlabor.de \
    --cc=patch@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).