[PATCH] ASoC: rt715: add main capture switch and main capture volume control
Jaroslav Kysela
perex at perex.cz
Tue Dec 15 11:39:04 CET 2020
Dne 14. 12. 20 v 18:12 Pierre-Louis Bossart napsal(a):
> Hi Jaroslav,
>
>>>>> Add main capture switch and main capture volume for callback to be in
>>>>> single operation.
>>>>
>>>> Could you be more verbose, what you're trying to do in the patch description?
>>
>> I see that it's just additional volume coupling functionality (one control,
>> set all four output volume/switch registers, right?).
>>
>> Some points:
>>
>> 1) the separate volume controls don't send change events back to the user
>> space when the coupled capture settings is applied and versa vice - no sync
>> 2) we have already virtual master API - sound/core/vmaster.c which should
>> cover this requirement
>> 3) I don't see the purpose for this coupling (the capture direction)
>
> That was for UCM integration - agree the context was not well captured
> in the commit message
>
> We have 'Capture Switch' and 'Capture Volume' statements that are
> required, and currently mistakenly set to SOF controls when they should
> be codec controls.
>
> So when we have several possible inputs controls for the codec (ADC 07
> or ADC 27) depending on the microphone settings, which one should be
> used in UCM?
>
> We thought this would simplify the UCM integration by adding one generic
> control. If you have a better suggestion we are all ears.
So, it's for the microphone array with four microphones, right? Ideally there
should be one multi-channel control exported to the user space with the exact
number of the connected links in hardware. But I know, SoC has universal codec
drivers which exports the functionality without the detailed knowledge of the
controlled hardware.
For UCM (without one control for volume and switch), the situation is more
difficult, because we need to export only one volume/switch control to the
applications (abstract layer). I see the requirement to describe the more
complex control mechanism. I have an idea to extend the alsa-lib (mixer
interface) to allow this description via the alsa-lib configuration files
which may be eventually part of the UCM configuration. The nice thing is that
we can specify the custom mixer and control devices for PA already (my latest
UCM updates in PA 14.0), so there's a room to improve things in the user space.
My suggestions are (pick one):
1) create one multichannel control and remove the stereo controls when the
hardware is detected (no functionality dup)
2) create proper vmaster control like for HDA playback
3) wait until UCM can describe this hardware and set the DAC values manually
to a sensible value via sequences (the specific hardware levels can be set
using the conditions in UCM)
BTW: I see lack of analog volume level controls also for other SDW hardware
(with the RT1308 amplifier). It's a bit pitty that the audio basics are
ignored here. Everyone wants to control the analog levels at first for audio
I/O and then to modify the samples in the digital stream.
Jaroslav
--
Jaroslav Kysela <perex at perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
More information about the Alsa-devel
mailing list