On 21. 04. 23 10:55, Takashi Iwai wrote:
On Thu, 20 Apr 2023 18:18:46 +0200,
Oswald Buddenhagen wrote:
i suppose we'd have to add SNDRV_CTL_ELEM_ACCESS_{PLAYBACK,CAPTURE}.
both could be set for unspecific and actually bidirectional
controls. if neither is set, user space would fall back to the keyword
based rules (and exceptions ...) - that would be backwards compatible
and would enable a gradual migration.
The backward compatibility isn't really easy as you wrote, I'm
afraid. If you run an old user-space stuff on the new kernel, you
must not fill that new information bit but translate it to the string
suffix instead; and that has to be done inside the kernel
automagically.
Also, I think that playback/capture flags are too limited for the current use.
The original naming scheme expected to build something more complex later, but
we did not realize that.
Given the fact, that the ASoC tree is completely crazy about naming, I would
propose to check drivers using the Tone controls (only few is using them) and
if all are for playback, the alsa-lib code can set the playback direction in
the simple mixer API for them (workaround, fine-tune the specification in
control-names.rst).
But if someone has a power to design the API extensions, we can talk about it.
Picking one minor thing without a complex view is not so ideal.
The drivers can mark all associated controls for a PCM stream, for example. So
the direction classification can be taken from this information.
Jaroslav
--
Jaroslav Kysela <perex@xxxxxxxx>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.