[PATCH] kselftest: alsa: Check for event generation when we write to controls

Mark Brown broonie at kernel.org
Wed Feb 2 14:22:16 CET 2022


On Wed, Feb 02, 2022 at 10:56:01AM +0900, Takashi Sakamoto wrote:
> On Tue, Feb 01, 2022 at 03:15:51PM +0000, Mark Brown wrote:

> > +		/* The ID returned from the event is 1 less than numid */
> > +		mask = snd_ctl_event_elem_get_mask(event);
> > +		ev_id = snd_ctl_event_elem_get_numid(event);
> > +		if (ev_id != ctl->elem + 1) {

> As long as I know, the design of ALSA control core just exposes the
> numeric identification of a control element issued for notification in
> 'snd_ctl_event' structure. On the other hand, the above evaluation
> expects decremented value against position of queried list structure
> has come.

> I note that current design of ALSA control core is:
>  * 1 is selected for numeric identification of the first element in the
>    first element set added to sound card.
>  * at removal of element set, the series of assigned numeric identification
>    becomes blank (coded as hole).
>  * Userspace application can always add/remove element set to the card.
>  * the position of element in queried list structure does not
>    necessarily corresponds to numeric identification even if decremented
>    by 1 due to the hole.

Oh, I see - we have multiple IDs here which is what's confusing things.
This looked wrong when I was writing it and I was hoping someone would
confirm what was going on on review so thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20220202/36ac4181/attachment.sig>


More information about the Alsa-devel mailing list