Lars-Peter Clausen wrote:
On 03/16/2012 08:25 PM, Mark Brown wrote:
On Thu, Mar 15, 2012 at 05:28:13PM -0400, Trent Piepho wrote:
There is a race when the constraints change dynamically. See the fsl_ssi.c driver and the sample size constraint in synchronous mode.
This is just a limitation of the ALSA ABI - there's nothing we can do about it without changing the userspace interface so we just have to live with it and error out if an application ever manages to hit the race and pick something incompatible with other active streams (note that the symmetric rates support has a dev_warn() complaining about hitting the race).
I think the real problem with this is, that currently a userspace application will usually exit with an error when such a race occurs, while it should be possible to just restart the enumeration process and try with another format.
So I'm wondering if we can make it easier for userspace to detect that the constraints have changed and it may retry with other parameters?
Devices that have such a restriction must be marked with SNDRV_PCM_INFO_JOINT_DUPLEX. There is no indication that the race has actually happened, so applications that care have to retry just in case.
Regards, Clemens