[alsa-devel] [PATCH v9 0/2] sun4i-codec: Add Line-In, FM-In, Mic 2, Capture Source, Differential Line-In
This patch adds support for some mixer controls: * Line-In * FM-In * Mic 2 * Capture Source * Differential Line-In
v9 changes compared to v8 are: - added Line Differential Capture Switch. - split Capture Source into Left Capture Select, Right Capture Select. - added Line Capture Volume. - rename "sun4i_codec_widgets" to "sun4i_codec_controls" for consistency with the struct field it's used in. - rename "Line-In" to "Line". - rename "Power Amplifier Playback Volume" to "Headphone Playback Volume".
v8 changes compared to v7 are: - fixed the routes for line and mic capturing.
v7 changes compared to v6 are: - preparation for different A20, A10 controls is now in an extra patch. - all register definitions are now at the top. - sun7i-specific things (A20-specific things) are now less grouped-together. - rename "Power Amplifier Volume" to "Power Amplifier Playback Volume".
v6 changes compared to v5 are: - Mic preamplifier special cases for A20 and A10 now are now not icky: There are two different _widget arrays and the probe() function now selects the right one to pass to snd_soc_register_codec() unmodified. - sun7i-specific things (A20-specific things) are now grouped together.
v5 changes compared to v4 are: - Mic preamplifier controls have more common names now. - Mic preamplifier scale has a 0 dB entry as well now, as documented in the A20 user manual. - Mic preamplifier has special cases for A20 and A10 now. - Gain controls have "Gain" in the name now.
v4 changes compared to v3 are: - names of the input are not uppercase anymore. - bit index constants are now named as in the A20 user manual v1.4. - added Mic1-In, Mac2-In. - added Mic1 and Mic2 Pre-Amplifiers.
v3 changes compared to v2 are: - added DAPM routes.
v2 changes compared to v1 are: - moved Line-In and FM-In playback switches to their respective sun4i_codec_*_mixer_controls.
v1 changes: - added linein, fmin output volumes and switches.
Danny Milosavljevic (2): ASoC: sun4i-codec: Distinguish sun4i from sun7i Add mixer controls: Line-In, FM-In, Mic 2, Capture Source, Differential Line-In.
sound/soc/sunxi/sun4i-codec.c | 278 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 259 insertions(+), 19 deletions(-)
This distinguishes sun4i from sun7i. It is necessary because they use different registers for the audio mixer. --- sound/soc/sunxi/sun4i-codec.c | 44 +++++++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 10 deletions(-)
Note: Mic1 Capture Volume is in a different register on A20 than on A10. Note: Mic2 Capture Volume is in a different register on A20 than on A10. --- sound/soc/sunxi/sun4i-codec.c | 256 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 236 insertions(+), 20 deletions(-)
On 29 August 2016 at 20:03, Danny Milosavljevic dannym@scratchpost.org wrote:
Note: Mic1 Capture Volume is in a different register on A20 than on A10. Note: Mic2 Capture Volume is in a different register on A20 than on A10.
sound/soc/sunxi/sun4i-codec.c | 256 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 236 insertions(+), 20 deletions(-)
Hi Danny, I think this should be delivered in a series of patches like what I've attempted to do here https://github.com/codekipper/linux-sunxi/commits/sunxi-wip?page=2 I haven't worked with my A20 for a while which is why I haven't delivered these changes, however summer is coming to an end and should be able to retest and deliver soon. I can see that there is a difference like you've mentioned between the A10 and A20 with the MIC pre-amps so approve of the use of a common array. Something also looks wrong with the whitespacing for sun4i_codec_codec. BR, CK
-- You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Hi CK,
On Tue, 30 Aug 2016 08:49:40 +0200 Code Kipper codekipper@gmail.com wrote:
On 29 August 2016 at 20:03, Danny Milosavljevic dannym@scratchpost.org wrote: I think this should be delivered in a series of patches like what I've attempted to do here https://github.com/codekipper/linux-sunxi/commits/sunxi-wip?page=2
Feel free to do it. But I've gotten questions from users why they have to apply my patch manually again and again, so let's get this done one way or another.
I haven't worked with my A20 for a while which is why I haven't delivered these changes, however summer is coming to an end and should be able to retest and deliver soon.
Good :)
Please check whether you use the same routes and registers in your version - my patch has been in use by multiple people for months so I'm quite positive that it works, whatever cosmetic issues there may be.
Especially pay attention to Line Playback Volume - it has two possible values.
0 means -1.5 dB and 1 means 0 dB. Many userspace tools seem to be confused about it not being a boolean and alsa-lib also did stupid stuff with it depending on the name. So make sure that it does work.
Also if someone tests my patch, please also test this.
(It has been notoriously difficult to reproduce this problem reliably in the past with different people's setups)
I can see that there is a difference like you've mentioned between the A10 and A20 with the MIC pre-amps so approve of the use of a common array.
Yeah, it's necessary.
Something also looks wrong with the whitespacing for sun4i_codec_codec.
Depends on your tab width - the committed version used Tab characters in order to line up the equals signs. So it was really just luck how it looked.
That means that depending on the tab width it did either line up or not (it didn't line up for me).
Now it's using spaces around the equal sign and so it shows up the same for everyone - lined up. I fixed this because I touched the line anyway.
On Tue, 30 Aug 2016 09:12:48 -0400 Stefan Monnier monnier@iro.umontreal.ca wrote:
- rename "Line-In" to "Line".
Curious: why?
Documentation/sound/alsa/ControlNames.txt line 49
participants (3)
-
Code Kipper
-
Danny Milosavljevic
-
Stefan Monnier