alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Martin Kepplinger <martin.kepplinger@puri.sm>
Cc: alsa-devel@alsa-project.org, kernel@puri.sm,
	patches@opensource.cirrus.com, tiwai@suse.com,
	lgirdwood@gmail.com, broonie@kernel.org, geert@glider.be,
	daniel.baluta@nxp.com
Subject: Re: [PATCH] wm8962: add a simple DMIC enable control
Date: Wed, 2 Mar 2022 13:40:17 +0000	[thread overview]
Message-ID: <20220302134017.GL38351@ediswmail.ad.cirrus.com> (raw)
In-Reply-To: <ebede30e994b8178c4a929814c7f85739656c621.camel@puri.sm>

On Wed, Mar 02, 2022 at 12:48:28PM +0100, Martin Kepplinger wrote:
> Am Dienstag, dem 01.03.2022 um 15:00 +0100 schrieb Martin Kepplinger:
> > Am Dienstag, dem 01.03.2022 um 13:44 +0000 schrieb Charles Keepax:
> > > On Mon, Feb 07, 2022 at 02:21:29PM +0000, Charles Keepax wrote:
> > > > On Mon, Feb 07, 2022 at 11:49:32AM +0100, Martin Kepplinger
> > > > > Am Freitag, dem 04.02.2022 um 17:21 +0000 schrieb Charles
> > > > > > On Fri, Feb 04, 2022 at 10:43:53AM +0100, Martin Kepplinger
> > that's really nice of you to ask. Sorry for not replying earlier.
> > Mainly cset "name='MIXINR PGA Volume' 0,0" made things much better
> > indeed. I took a break from this then and the issue is still open,
> > here:
> > https://source.puri.sm/Librem5/librem5-base/-/merge_requests/296
> > or if you want to look at the current ucm file:
> > https://source.puri.sm/Librem5/librem5-base/-/blob/bb48912242dd0db1f35c6de8425984414c6d37bb/default/audio/ucm2/Librem_5/HiFi.conf
> > 
> > As you know I'm no expert with the codec and this definitely can be
> > improved: When visualizing the signal, it doesn't look "good" yet and
> > the signal strength seems to only go to 50% of the available scale
> > (in
> > the gnome volume setting). Actually I'll talk about this to Guido
> > tomorrow and even though it is kind of usable now, I hope to that we
> > can come up with a profile that we're preliminarliy happy with.
> Let me forward the commit message I just did for the ucm settings here,
> now that I have a *bit* of an overview of the codec:
> 
> There are 3 Volume controls for the analog parts, all before the ADC.
> In order from Jack to ADC, they are:
> 
> numid=10,iface=MIXER,name='Capture Volume'
>    ; type=INTEGER,access=rw---R--,values=2,min=0,max=63,step=0
>    : values=63,63
>    | dBscale-min=-23.25dB,step=0.75dB,mute=0
> 
> "Input PGA Volume Control". 31=0dB. We use 39=+6dB.
> 
> numid=7,iface=MIXER,name='MIXINR PGA Volume'
>    ; type=INTEGER,access=rw---R--,values=1,min=0,max=7,step=0
>    : values=7
>    | dBrange-
>      rangemin=0,,rangemax=1
>        | dBscale-min=0.00dB,step=6.00dB,mute=0
>      rangemin=2,,rangemax=2
>        | dBscale-min=13.00dB,step=13.00dB,mute=0
>      rangemin=3,,rangemax=4
>        | dBscale-min=18.00dB,step=2.00dB,mute=0
>      rangemin=5,,rangemax=5
>        | dBscale-min=24.00dB,step=0.00dB,mute=0
>      rangemin=6,,rangemax=7
>        | dBscale-min=27.00dB,step=3.00dB,mute=0
> 
> "Right input PGA to Right input Boost-Mixer Gain"
> 0=0dB. we use 1=+3dB.
> 
> 
> numid=8,iface=MIXER,name='MIXINR IN3R Volume'
>   ; type=INTEGER,access=rw---R--,values=1,min=0,max=7,step=0
>   : values=6
>   | dBscale-min=-15.00dB,step=3.00dB,mute=0
> 
> 5=0dB. we use 6=+3dB. That's a later amplifier, "Boost-Mixer Gain".
> 
> ("quotes" are from the datasheet)
> 
> Still, the recording sounds pretty good I think, but since gnome sound-
> recording doesn't visualize the signal waves - whatever that means :)
> I'll look at the file in audacity or something similar later.
> 

Yeah I have been having a look at your patch you linked. I think
there are still maybe a couple things I am not sure on. I would
try removing these two lines:

cset "name='MIXINR IN3R Switch' on"
cset "name='MIXINR IN3R Volume' 6"

I am pretty sure we want to be using the PGA path here. If you
check Figure 13 in the datasheet, you can route IN3R to
MIXINR either through the IN3R input or through the PGA input.
I suspect we want to come through the PGA. Using the IN3R path
should mean the PGA volume has no effect, it is effectively
bypassing the PGA. You may need to also add:

cset "name='MIXINR PGA Switch' on"

Although your previous control dumps had that input set
on. I suspect if you have both enabled you will get some slightly
weird effects, there is probably a slightly phase delay through
the PGA and there won't be on the direct path, so when they mix
together it will likely sound weird.

Hopefully that gets us to a clean signal. The settings described
in your commit message give +9dB analogue gain which seems
reasonable to me, and from the patch itself looks like you have
+15dB digital gain, which feels a little high but not total
unreasonable.

Thanks,
Charles

  reply	other threads:[~2022-03-02 13:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220201150113.880330-1-martin.kepplinger@puri.sm>
2022-02-02  9:53 ` [PATCH] wm8962: add a simple DMIC enable control Charles Keepax
     [not found]   ` <3542af028b622ec1513810b014c35a94b82a94c0.camel@puri.sm>
2022-02-02 10:46     ` Charles Keepax
     [not found]       ` <99b847d17e8ac399dba10842ec20091df926aa06.camel@puri.sm>
2022-02-02 13:35         ` Charles Keepax
2022-02-03  9:57           ` Martin Kepplinger
2022-02-03 11:05             ` Charles Keepax
2022-02-04  9:43               ` Martin Kepplinger
2022-02-04  9:50                 ` Martin Kepplinger
2022-02-04 17:21                 ` Charles Keepax
2022-02-07 10:49                   ` Martin Kepplinger
2022-02-07 14:21                     ` Charles Keepax
2022-03-01 13:44                       ` Charles Keepax
2022-03-01 14:00                         ` Martin Kepplinger
2022-03-02 11:48                           ` Martin Kepplinger
2022-03-02 13:40                             ` Charles Keepax [this message]
2022-03-02 14:11                               ` Martin Kepplinger
2022-03-03 11:27                                 ` Charles Keepax

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220302134017.GL38351@ediswmail.ad.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=daniel.baluta@nxp.com \
    --cc=geert@glider.be \
    --cc=kernel@puri.sm \
    --cc=lgirdwood@gmail.com \
    --cc=martin.kepplinger@puri.sm \
    --cc=patches@opensource.cirrus.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).