From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Tom Yan <tom.ty89@gmail.com>,
alsa-devel@alsa-project.org, alsa-user@alsa-project.org,
pulseaudio-discuss@lists.freedesktop.org
Subject: Re: [pulseaudio-discuss] Why doesn't mixer control (values) have some kind of locking mechanism? (mutex?)
Date: Thu, 6 Aug 2020 10:30:36 -0500 [thread overview]
Message-ID: <61bf48f0-e63e-c762-c083-27a0bf371483@linux.intel.com> (raw)
In-Reply-To: <20200806020601.GA6286@laptop>
> ALSA control core allows applications to lock/unlock a control element
> so that any write opreation to the control element fails for processes
> except for owner process.
>
> When a process requests `SNDRV_CTL_IOCTL_ELEM_LOCK`[1] against a
> control element. After operating the request, the control element is
> under 'owned by the process' state. In this state, any request of
> `SNDRV_CTL_IOCTL_ELEM_WRITE` from the other processes fails with
> `-EPERM`[2]. The write operation from the owner process is successful
> only. When the owner process is going to finish, the state is
> released[3].
>
> ALSA userspace library, a.k.a alsa-lib, has a pair of
> `snd_ctl_elem_lock()` and `snd_ctl_elem_unlock()` as its exported
> API[4].
Thank you Sakamoto-san for this explanation, I wasn't even aware this
existed.
What I was trying to describe in my earlier answer is a different need
to have an atomic update of *multiple* controls.
If e.g. a DSP or hardware engine exposes two separate filters for left
and right channels, and the coefficients for those filters are modified
with separate controls, it would be really nice to have the capability
of writing these controls separately, but have a 'commit' mechanism so
that these updated coefficients are used at the same time by the left
and right filters.
next prev parent reply other threads:[~2020-08-06 15:31 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-05 17:31 Why doesn't mixer control (values) have some kind of locking mechanism? (mutex?) Tom Yan
2020-08-05 18:40 ` Pierre-Louis Bossart
2020-08-06 2:06 ` Takashi Sakamoto
2020-08-06 8:57 ` Tom Yan
2020-08-06 9:14 ` Takashi Sakamoto
2020-08-06 12:31 ` Tom Yan
2020-08-06 14:47 ` Takashi Sakamoto
2020-08-06 15:34 ` Tom Yan
2020-08-06 17:19 ` Takashi Sakamoto
2020-08-06 18:45 ` Tom Yan
2020-08-07 9:08 ` Jaroslav Kysela
2020-08-06 15:30 ` Pierre-Louis Bossart [this message]
2020-08-06 17:47 ` [pulseaudio-discuss] " Takashi Sakamoto
2020-08-07 0:12 ` Pierre-Louis Bossart
2020-08-07 2:34 ` Takashi Sakamoto
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=61bf48f0-e63e-c762-c083-27a0bf371483@linux.intel.com \
--to=pierre-louis.bossart@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=alsa-user@alsa-project.org \
--cc=pulseaudio-discuss@lists.freedesktop.org \
--cc=tom.ty89@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.