From: Mike Looijmans <mike.looijmans@topic.nl>
To: alsa-devel@alsa-project.org
Subject: Re: "Negative" volume settings in a kcontrol
Date: Tue, 28 May 2013 13:46:15 +0200 [thread overview]
Message-ID: <51A49907.70105@topic.nl> (raw)
In-Reply-To: <5187AEA5.1020108@ladisch.de>
On 05/06/2013 03:22 PM, Clemens Ladisch wrote:
> Mike Looijmans wrote:
>> Some codec registers need negative values. For example,
>> sound/soc/codecs/tlv320aic32x4.c specifies this:
>>
>> 78 SOC_DOUBLE_R_TLV("PCM Playback Volume", AIC32X4_LDACVOL,
>> 79 AIC32X4_RDACVOL, 0, 0x30, 0, tlv_step_0_5),
>>
>> It's incomplete. The actual range is from -63.5dB to +24dB in 0.5 dB steps.
>> The 8-bit value is interpreted as a signed 8-bit integer, so to get -3dB
>> the register value must be -6 or 0xFA.
>>
>> How do I explain that to Alsa?
>
> There are some ASoC helper macros that handle signed register fields, such
> as SOC_DOUBLE_S8_TLV and SOC_SINGLE_XR_SX. If those don't do what you want,
> you have to write your own.
SOC_DOUBLE_S8_TLV seems to be a misnamed hardware-specific macro. It
provides no way to specify the location of the left/right bits so the
macro name is misleading.
SOC_SINGLE_XR_SX is too new for my kernel. And from what I gather, I
cannot use it anyway for my purposes. So the solution turns out to be
"write my own". The SOC_DOUBLE_S8_TLV macro did provide a very nice
starting point though.
Thanks for the pointer though, it turned out to be the key to a solution.
>> (and on a side note "amixer" doesn't accept negative values either)
>
> A workaround would be to set the control value first to 0 and then to
> the desired negative value ... but this bug needs fixing.
I have no idea what you meant here.
Kind regards,
Mike.
next prev parent reply other threads:[~2013-05-28 11:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-02 10:55 idea: a reserve alsa plugin David Henningsson
2013-05-02 12:37 ` [pulseaudio-discuss] " Arun Raghavan
2013-05-02 13:23 ` David Henningsson
2013-05-02 14:13 ` "Negative" volume settings in a kcontrol Mike Looijmans
2013-05-06 13:22 ` Clemens Ladisch
2013-05-28 11:46 ` Mike Looijmans [this message]
2013-05-29 19:42 ` Mark Brown
2013-05-31 7:01 ` Mike Looijmans
2013-07-16 13:45 ` Need help diagnosing "hw_ptr skipping" message Mike Looijmans
2013-07-17 14:02 ` Clemens Ladisch
2013-05-02 14:28 ` idea: a reserve alsa plugin Tvrtko Ursulin
2013-05-02 14:37 ` [pulseaudio-discuss] " David Henningsson
2013-05-02 14:50 ` Tvrtko Ursulin
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=51A49907.70105@topic.nl \
--to=mike.looijmans@topic.nl \
--cc=alsa-devel@alsa-project.org \
/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.