From: Clemens Ladisch <clemens@ladisch.de>
To: Manisha Sankpal <manisha.sankpal@gmail.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: SALSA library and recording
Date: Thu, 16 Apr 2009 09:12:17 +0200 [thread overview]
Message-ID: <49E6DA51.1020304@ladisch.de> (raw)
In-Reply-To: <5b6fae700904150932x5079088m9b2373cee37053b6@mail.gmail.com>
Manisha Sankpal wrote:
> I am using salsa library to capture the data from the sound card. The
> requirement is that the recording should be done from line-in port of the
> sound card. The selection of "Line-in" port should be done programatically.
>
> With ALSA library, I am able to select the line-in by calling
> snd_mixer_selem_set_capture_switch_all() function. However, this function
> is returning an error when SALSA library is used.
The high-level mixer functions are not implemented in the SALSA library.
> Is there any other function/way to select the line-in mixer element in
> the SALSA API?
You'll have to use the snd_ctl* functions.
To change the value of a mixer control, do something like this:
snd_ctl_t *ctl;
snd_ctl_elem_value_t *value;
int onoff = 1; /* or 0 for off */
err = snd_ctl_open(&ctl, "default", 0);
...
snd_ctl_elem_value_alloca(&value);
...
snd_ctl_elem_value_set_interface(value, SND_CTL_ELEM_IFACE_MIXER);
snd_ctl_elem_value_set_name(value, "xxxxx Capture Switch");
snd_ctl_elem_value_set_boolean(value, 0, onoff);
err = snd_ctl_elem_write(ctl, value);
...
snd_ctl_close(ctl);
You have to use the correct name; the names of mixer controls can be
seen in the output of "amixer controls".
If your hardware has a single "Capture Source" control instead, you
have to replace _set_boolean with _set_enumerated and use the correct
index.
HTH
Clemens
next prev parent reply other threads:[~2009-04-16 7:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-15 16:32 SALSA library and recording Manisha Sankpal
2009-04-16 7:12 ` Clemens Ladisch [this message]
2009-04-16 7:20 ` Takashi Iwai
2009-04-16 7:21 ` Takashi Iwai
-- strict thread matches above, loose matches on Subject: below --
2009-04-15 18:40 reetesh chandran
2009-04-16 7:22 ` Takashi Iwai
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=49E6DA51.1020304@ladisch.de \
--to=clemens@ladisch.de \
--cc=alsa-devel@alsa-project.org \
--cc=manisha.sankpal@gmail.com \
/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.