All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Courtier-Dutton <James@superbug.co.uk>
To: alsa-devel <alsa-devel@lists.sourceforge.net>
Subject: Mixer improvements
Date: Sun, 11 Sep 2005 12:51:17 +0100	[thread overview]
Message-ID: <43241A35.8080903@superbug.co.uk> (raw)

Hi,

See below for current sndrv_ctl_elem_info structure.

I would like to add to this structure the following elements:
1) Unsigned integer index to percent <-> dB function.
I would implement in alsa-lib an array of functions, each doing a 
conversion of a different type. This index would select which conversion 
routine to use for this particular mixer element. A value of 0 in this 
index would indicate that no conversion function is currently 
implemented for this mixer control and would therefore be backward 
compatible as by default, unused integers in a structure are given a 
value of 0.
2) Integer for Analog or Digital path. This will indicate which side of 
the ADC and DAC converter the mixer control is. This is particularly 
useful when trying to set mic capture levels, capture limiting and 
sampling accuracy. 0 = Digital, 1 = Analog
For example, One would probably want to set the digital(After ADC) mixer 
controls all to 0dB level, so one gets exact samples from the ADC all 
the way to the application, but one would want to adjust the mixer 
controls before the ADC in order to avoid clipping.
3) Link information.
Like USB and HDA sound cards, they have a linked list showing which 
mixer element is connected to which other mixer element. I would like to 
implement this for PCI sound cards. Maybe if we used exactly the same 
method as the USB one, we could

Points 1 and 2 I would like to implement immeadiately, with points 3 a 
nice to have.

4) Alternatively, we could implement this in alsa-lib, and just add 
something to the card info structure that would uniquely identify a 
sound card. e.g. General device name and a unique subdevice ID. So that 
all the various Audigy 2 cards would use a different config file in 
alsa-lib. We could make the device name a dir, and the subdevice ID the 
actual config file.

Can someone please tell me which is the prefered method 1-3 or 4?

Extract from asound.h:
struct sndrv_ctl_elem_info {
         struct sndrv_ctl_elem_id id;    /* W: element ID */
         enum sndrv_ctl_elem_type type;  /* R: value type - 
SNDRV_CTL_ELEM_TYPE_* */
         unsigned int access;            /* R: value access (bitmask) - 
SNDRV_CTL_ELEM_ACCESS_* */
         unsigned int count;             /* count of values */
         pid_t owner;                    /* owner's PID of this control */
         union {
                 struct {
                         long min;               /* R: minimum value */
                         long max;               /* R: maximum value */
                         long step;              /* R: step (0 variable) */
                 } integer;
                 struct {
                         long long min;          /* R: minimum value */
                         long long max;          /* R: maximum value */
                         long long step;         /* R: step (0 variable) */
                 } integer64;
                 struct {
                         unsigned int items;     /* R: number of items */
                         unsigned int item;      /* W: item number */
                         char name[64];          /* R: value name */
                 } enumerated;
                 unsigned char reserved[128];
         } value;
         union {
                 unsigned short d[4];            /* dimensions */
                 unsigned short *d_ptr;          /* indirect */
         } dimen;
         unsigned char reserved[64-4*sizeof(unsigned short)];
};


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

             reply	other threads:[~2005-09-11 11:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-11 11:51 James Courtier-Dutton [this message]
2005-09-12 12:25 ` Mixer improvements Takashi Iwai
2005-09-12 12:44   ` Jaroslav Kysela
2005-09-12 12:57     ` Takashi Iwai
2005-09-17 18:39     ` James Courtier-Dutton

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=43241A35.8080903@superbug.co.uk \
    --to=james@superbug.co.uk \
    --cc=alsa-devel@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.