[alsa-devel] [PATCH v14 8/8] ASoC: sun4i-codec: Add Left Capture Select, Right Capture Select

Maxime Ripard maxime.ripard at bootlin.com
Mon May 14 16:11:26 CEST 2018


On Sat, May 05, 2018 at 12:40:50PM +0200, Danny Milosavljevic wrote:
> Hi Maxime,
> 
> On Thu, 3 May 2018 16:54:08 +0200
> Maxime Ripard <maxime.ripard at bootlin.com> wrote:
> 
> > > +static const char * const sun4i_codec_capture_source[] = {
> > > +	"Line",
> > > +	"FM",
> > > +	"Mic1",
> > > +	"Mic2",
> > > +	"Mic1,Mic2",
> > > +	"Mic1+Mic2",
> > > +	"Output Mixer",
> > > +	"Line,Mic1",
> > > +};  
> > 
> > Shouldn't that be defined in a more generic way? As far as I know,
> > there's no way to tell what the difference between "Mic1,Mic2" and
> > "Mic1+Mic2" would be from the userspace.
> 
> Sounds good - but how?
> 
> Here, "Mic1,Mic2" means the left channel captured is Mic1 and the right
> channel captured is Mic2.
> 
> On the other hand, "Mic1+Mic2" means that the signals from Mic1 and
> Mic2 are added together and that is captured (both as left and as right).
> 
> "Mic1" means both the left channel and the right channel captured is
> from Mic1.  Likewise "Mic2".

Right, and my point isn't that it is difficult to understand or
remember once you get it, but that it's difficult to get it in the
first place, and that this convention is solely based on the one used
in the datasheet, which is an abstraction violation in itself.

I guess that's really up to Mark here, but one solution would be to
allow to couple the controls explicitly instead of relying solely on
the fact that they share the same controls array pointer.

Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20180514/9e1abc0a/attachment.sig>


More information about the Alsa-devel mailing list