From: Clemens Ladisch <clemens@ladisch.de>
To: Uli Franke <uli.franke@weiss.ch>
Cc: Daniel Weiss <weiss@weiss.ch>,
alsa-devel@alsa-project.org,
Rolf Anderegg <rolf.anderegg@weiss.ch>
Subject: Re: Constraints and hw_params with highly configurable HW
Date: Tue, 03 Sep 2013 19:58:04 +0200 [thread overview]
Message-ID: <5226232C.5080803@ladisch.de> (raw)
In-Reply-To: <5226041B.4010105@weiss.ch>
Uli Franke wrote:
> I'm currently debugging and fine-tuning things and that's where some
> questions arose. The initial implementation of Clemens tried to fetch
> all possible configurations of a device during probe in order to have
> all combinations of rates and channels at hand when it comes to
> formulate the constraints set within the ALSA pcm substream open
> callback. That's a nice approach but will fail with a lot of devices as
> their configurations can (and mostly will) be volatile. Our devices for
> instance feature several switches, options and alike which have heavy
> influence on the channel layout and sample rates and combination of both.
Then the constraints should be read from the device in the PCM open
callback.
(If the settings can be controlled by software, they should by locked
as long as some PCM device is open.)
> Therefore I had the idea to define some maximum constraints and let the
> ALSA hw_params callback fail in case some settings or combinations are
> determined to be not supported during its invocation.
It wouldn't be a nice thing to do for the driver to set constraints
that it already _knows_ it will not be able to support.
In the most common case, the hw_param callback happens immediately after
the open callback, so it makes sense for .open to set constraints that
reflect the current state of the device. It is still possible for the
device state to change between .open and .hw_params, but that's the best
the driver can do.
(What happens if the user flicks a switch while the software is
playing?)
> would EINVAL an appropriate error code to return?
Yes.
Regards,
Clemens
next prev parent reply other threads:[~2013-09-03 17:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-03 15:45 Constraints and hw_params with highly configurable HW Uli Franke
2013-09-03 17:58 ` Clemens Ladisch [this message]
2013-09-04 9:42 ` Uli Franke
2013-09-05 8:47 ` 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=5226232C.5080803@ladisch.de \
--to=clemens@ladisch.de \
--cc=alsa-devel@alsa-project.org \
--cc=rolf.anderegg@weiss.ch \
--cc=uli.franke@weiss.ch \
--cc=weiss@weiss.ch \
/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.