From: Clemens Ladisch <clemens@ladisch.de>
To: "Paul D. DeRocco" <pderocco@ix.netcom.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: [Alsa-user] Master volume control
Date: Thu, 14 Mar 2013 16:10:12 +0100 [thread overview]
Message-ID: <5141E854.206@ladisch.de> (raw)
In-Reply-To: <DB754736B2E5480F987C1DE8E330AC7C@PAULD>
Paul D. DeRocco wrote:
>> snd_ctl_elem_value_set_interface(value, SND_CTL_ELEM_IFACE_MIXER);
>> snd_ctl_elem_value_set_name(value, "Master Playback Volume");
>> snd_ctl_elem_value_set_integer(value, 0, 42);
>> CHECK(snd_ctl_elem_write(ctl, value));
>
> Well, I finally got a chance to try this. It "works", but the
> snd_ctl_elem_write call takes a couple of milliseconds (that's around a
> million instructions on my Atom), and it apparently spends this time in
> kernel state, because it causes my sound thread to underrun, so it's not
> usable.
I'd guess that some driver uses a busy loop for writing the codec
registers.
Which drivers are you using for your sound hardware?
> If I use alsamixer, I don't have this problem; I can manipulate the master
> volume smoothly while I'm playing my synth app. So I went through the
> source, and found that it's using snd_mixer_selem_set_playback_volume.
Ultimately, this is a wrapper for the snd_ctl_* functions.
Regards,
Clemens
next prev parent reply other threads:[~2013-03-14 15:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <B3AC1EE66F1142FF99DDC145B8669DDD@PAULD>
[not found] ` <512F0AF5.3050502@googlemail.com>
2013-03-13 16:47 ` [Alsa-user] Master volume control Paul D. DeRocco
2013-03-13 17:11 ` Daniel Mack
2013-03-13 18:39 ` Paul D. DeRocco
2013-03-13 20:17 ` Paul D. DeRocco
2013-03-14 15:10 ` Clemens Ladisch [this message]
2013-03-14 16:38 ` Paul D. DeRocco
2013-03-14 20:08 ` Clemens Ladisch
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=5141E854.206@ladisch.de \
--to=clemens@ladisch.de \
--cc=alsa-devel@alsa-project.org \
--cc=pderocco@ix.netcom.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.