All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: Brian Austin <brian.austin@cirrus.com>
Cc: alsa-devel@alsa-project.org, broonie@kernel.org,
	lgirdwood@gmail.com, paul.handrigan@cirrus.com
Subject: Re: [PATCH] ASoC: cs42l51: Fix SOC_DOUBLE_R_SX_TLV shift values for ADC, PCM, and Analog kcontrols
Date: Thu, 17 Apr 2014 16:26:25 +0200	[thread overview]
Message-ID: <20140417162625.21d072e7@skate> (raw)
In-Reply-To: <1395243602-18012-1-git-send-email-brian.austin@cirrus.com>

Dear Brian Austin,

On Wed, 19 Mar 2014 10:40:02 -0500, Brian Austin wrote:
> The shift values for the ADC,PCM, and Analog kcontrols were wrong causing wrong values for the SOC_DOUBLE_R_SX_TLV macros
> Fixed the TLV for aout_tlv to show -102dB correctly
> 
> Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Signed-off-by: Brian Austin <brian.austin@cirrus.com>
> ---
>  sound/soc/codecs/cs42l51.c |    9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)

Thanks for this patch. Unfortunately, it still doesn't solve completely
the situation. When I start alsamixer, it shows that:

 * PCM is at 102 (so above the maximum 100 value)
 * Both ADC Mixers are at 102
 * Analog is at 174 (so way above the maximum 100 value)

Changing the value of PCM works (but of course I can then only change
it between 0 and 100, not up to 102). However, as soon as I change the
"Analog" value, even if I raise it up to 174, there isn't any sound
anymore. Probably because the alsamixer range 0-100 doesn't allow to
reach a high enough volume to be audible.

Here is the amixer output right after boot (without changing any
value) :

=================================================================
# amixer 
Simple mixer control 'Bass',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 15
  Mono: 7 [47%] [0.00dB]
Simple mixer control 'Treble',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 15
  Mono: 7 [47%] [0.00dB]
Simple mixer control 'PCM',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 102
  Mono:
  Front Left: Playback 103 [101%] [0.00dB] [off]
  Front Right: Playback 103 [101%] [0.00dB] [off]
Simple mixer control 'PCM channel mixer',0
  Capabilities: enum
  Items: 'L R' 'L+R' 'R L'
  Item0: 'L R'
Simple mixer control 'Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 1
  Front Left: 0 [0%] [16.00dB]
  Front Right: 0 [0%] [16.00dB]
Simple mixer control 'Playback Deemphasis',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'ADC Mixer',0
  Capabilities: volume pswitch
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 102
  Front Left: 103 [101%] [0.00dB] Playback [off]
  Front Right: 103 [101%] [0.00dB] Playback [off]
Simple mixer control 'Analog',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 176
  Mono:
  Front Left: Playback 204 [116%] [0.00dB]
  Front Right: Playback 204 [116%] [0.00dB]
Simple mixer control 'Auto-Mute',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'PGA-ADC Mux Left',0
  Capabilities: enum
  Items: 'AIN1 Left' 'AIN2 Left' 'MIC Left' 'MIC+preamp Left'
  Item0: 'AIN1 Left'
Simple mixer control 'PGA-ADC Mux Right',0
  Capabilities: enum
  Items: 'AIN1 Right' 'AIN2 Right' 'MIC Right' 'MIC+preamp Right'
  Item0: 'AIN1 Right'
Simple mixer control 'Soft Ramp',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
# 
=================================================================

See also an alsamixer screenshot at
http://free-electrons.com/~thomas/pub/alsamixer-issue.png.

I wanted to give you the raw state of the codec registers, but for some
reason, the codec_reg file is empty here (I'm on 3.15-rc1) :

=================================================================
# cat /sys/kernel/debug/asoc/a370db/cs42l51-codec.0-004a/codec_reg 
# 
=================================================================

Note that if I revert back the cs42l51 code to the state before
1d99f2436d0d1c7741d6dfd9d27b5376cdbbca40 ('ASoC: core: Rework
SOC_DOUBLE_R_SX_TLV add SOC_SINGLE_SX_TLV'), then the volume control
works normally.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  parent reply	other threads:[~2014-04-17 14:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-19 15:40 [PATCH] ASoC: cs42l51: Fix SOC_DOUBLE_R_SX_TLV shift values for ADC, PCM, and Analog kcontrols Brian Austin
2014-03-19 16:38 ` Mark Brown
2014-04-17 14:26 ` Thomas Petazzoni [this message]
2014-04-17 15:00   ` Brian Austin
2014-04-17 15:08   ` Brian Austin
     [not found]     ` <20140418112355.4c1fe3ac@skate>
2014-04-18 12:22       ` Austin, Brian
2014-04-18 14:00       ` Brian Austin
2014-04-18 14:21         ` Thomas Petazzoni

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=20140417162625.21d072e7@skate \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=brian.austin@cirrus.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=paul.handrigan@cirrus.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.