* Audio codec volume control
@ 2012-09-20 7:56 Rajeev kumar
2012-09-20 9:58 ` Peter Ujfalusi
0 siblings, 1 reply; 6+ messages in thread
From: Rajeev kumar @ 2012-09-20 7:56 UTC (permalink / raw)
To: Mark Brown, alsa-devel@alsa-project.org
Hello Mark,
We have three volume control in audio codec.
1. Master volume: control both left and right channel volume
2. left volume: control left channel vol
3. right volume: control right channel vol.
So we can provide interfaces for all volume control to the user. Please
find below the control I can provide to the user space
case 1:
1. Provide master volume control
2. Provide Left channel volume control.
3. Provide Right channel volume control.
case 2:
1. Provide master volume control
2. Instead of providing separate control for left and right channel,
combined it and provide a single control to user space. so that left and
right volume is always in sync.
Please let me know which case is better and why?
Thank you very much for your support.
Best Regards
Rajeev
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Audio codec volume control
2012-09-20 7:56 Audio codec volume control Rajeev kumar
@ 2012-09-20 9:58 ` Peter Ujfalusi
2012-09-20 10:08 ` Rajeev kumar
0 siblings, 1 reply; 6+ messages in thread
From: Peter Ujfalusi @ 2012-09-20 9:58 UTC (permalink / raw)
To: Rajeev kumar; +Cc: alsa-devel@alsa-project.org, Mark Brown
On 09/20/2012 10:56 AM, Rajeev kumar wrote:
> Hello Mark,
>
> We have three volume control in audio codec.
> 1. Master volume: control both left and right channel volume
> 2. left volume: control left channel vol
> 3. right volume: control right channel vol.
>
> So we can provide interfaces for all volume control to the user. Please
> find below the control I can provide to the user space
>
> case 1:
> 1. Provide master volume control
> 2. Provide Left channel volume control.
> 3. Provide Right channel volume control.
>
> case 2:
>
> 1. Provide master volume control
> 2. Instead of providing separate control for left and right channel,
> combined it and provide a single control to user space. so that left and right
> volume is always in sync.
case 3:
1. Provide master volume control
2. stereo volume control for the left/right channel
--
Péter
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Audio codec volume control
2012-09-20 9:58 ` Peter Ujfalusi
@ 2012-09-20 10:08 ` Rajeev kumar
2012-09-20 10:19 ` Peter Ujfalusi
0 siblings, 1 reply; 6+ messages in thread
From: Rajeev kumar @ 2012-09-20 10:08 UTC (permalink / raw)
To: Peter Ujfalusi; +Cc: alsa-devel@alsa-project.org, Mark Brown
Hello Peter
On 9/20/2012 3:28 PM, Peter Ujfalusi wrote:
> On 09/20/2012 10:56 AM, Rajeev kumar wrote:
>> Hello Mark,
>>
>> We have three volume control in audio codec.
>> 1. Master volume: control both left and right channel volume
>> 2. left volume: control left channel vol
>> 3. right volume: control right channel vol.
>>
>> So we can provide interfaces for all volume control to the user. Please
>> find below the control I can provide to the user space
>>
>> case 1:
>> 1. Provide master volume control
>> 2. Provide Left channel volume control.
>> 3. Provide Right channel volume control.
>>
>> case 2:
>>
>> 1. Provide master volume control
>> 2. Instead of providing separate control for left and right channel,
>> combined it and provide a single control to user space. so that left and right
>> volume is always in sync.
>
> case 3:
> 1. Provide master volume control
> 2. stereo volume control for the left/right channel
>
You mean to say
Left and Right should be a single stereo control which can be provided
with SOC_DOUBLE. Actually case 2 corresponds to the same setting which
you are suggesting.
But why this is better option?
In case user wants a separate left/right volume control then how this
setting is going to help.
Best Rgds
~Rajeev
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Audio codec volume control
2012-09-20 10:08 ` Rajeev kumar
@ 2012-09-20 10:19 ` Peter Ujfalusi
2012-09-20 10:39 ` Rajeev kumar
0 siblings, 1 reply; 6+ messages in thread
From: Peter Ujfalusi @ 2012-09-20 10:19 UTC (permalink / raw)
To: Rajeev kumar; +Cc: alsa-devel@alsa-project.org, Mark Brown
On 09/20/2012 01:08 PM, Rajeev kumar wrote:
>> case 3:
>> 1. Provide master volume control
>> 2. stereo volume control for the left/right channel
>>
>
> You mean to say
> Left and Right should be a single stereo control which can be provided with
> SOC_DOUBLE. Actually case 2 corresponds to the same setting which you are
> suggesting.
>
> But why this is better option?
You have less controls for the codec -> easier for users.
Users still can adjust the left/right differently if they want.
> In case user wants a separate left/right volume control then how this setting
> is going to help.
In most cases you change both left/right channel:
amixer sset 'PCM' 8 # left/right volume is 8
but users can set different volume per channel:
amixer sset 'PCM' 8,1 # left volume is 8, right is 1
it is better than:
amixer sset 'PCM Left' 8 # left volume is 8
amixer sset 'PCM Right' 8 # left volume is 8
or
amixer sset 'PCM Left' 8 # left volume is 8
amixer sset 'PCM Right' 1 # left volume is 1
--
Péter
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Audio codec volume control
2012-09-20 10:19 ` Peter Ujfalusi
@ 2012-09-20 10:39 ` Rajeev kumar
2012-09-20 10:46 ` Peter Ujfalusi
0 siblings, 1 reply; 6+ messages in thread
From: Rajeev kumar @ 2012-09-20 10:39 UTC (permalink / raw)
To: Peter Ujfalusi; +Cc: alsa-devel@alsa-project.org, Mark Brown
Hello Peter,
On 9/20/2012 3:49 PM, Peter Ujfalusi wrote:
> On 09/20/2012 01:08 PM, Rajeev kumar wrote:
>>> case 3:
>>> 1. Provide master volume control
>>> 2. stereo volume control for the left/right channel
>>>
>>
>> You mean to say
>> Left and Right should be a single stereo control which can be provided with
>> SOC_DOUBLE. Actually case 2 corresponds to the same setting which you are
>> suggesting.
>>
>> But why this is better option?
>
> You have less controls for the codec -> easier for users.
> Users still can adjust the left/right differently if they want.
>
>> In case user wants a separate left/right volume control then how this setting
>> is going to help.
>
> In most cases you change both left/right channel:
> amixer sset 'PCM' 8 # left/right volume is 8
>
> but users can set different volume per channel:
> amixer sset 'PCM' 8,1 # left volume is 8, right is 1
>
> it is better than:
> amixer sset 'PCM Left' 8 # left volume is 8
> amixer sset 'PCM Right' 8 # left volume is 8
>
> or
> amixer sset 'PCM Left' 8 # left volume is 8
> amixer sset 'PCM Right' 1 # left volume is 1
>
Thanks for the info.
Please find below the controls I have provided
static const char *pwm_mode_text[] = { "Binary", "Headphone", "Ternary",
"Phase-shift"};
static const DECLARE_TLV_DB_SCALE(out_gain_tlv, -9150, 50, 0);
static const DECLARE_TLV_DB_SCALE(master_vol_tlv, -12750, 50, 0);
static const SOC_ENUM_SINGLE_DECL(pwm_src, STA529_FFXCFG1, 4,
pwm_mode_text);
static const struct snd_kcontrol_new sta529_snd_controls[] = {
SOC_DOUBLE_R_TLV("Digital Playback Volume", STA529_LVOL,
STA529_RVOL, 0,
127, 0, out_gain_tlv),
SOC_SINGLE_TLV("Master Playback Volume", STA529_MVOL, 0, 127, 1,
master_vol_tlv),
SOC_ENUM("PWM Select", pwm_src),
};
So in our amixer output I am not getting any separate numid for
left/right volume, so that user can control it.
Is there something I am missing in my code.
Best Regards
Rajeev
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Audio codec volume control
2012-09-20 10:39 ` Rajeev kumar
@ 2012-09-20 10:46 ` Peter Ujfalusi
0 siblings, 0 replies; 6+ messages in thread
From: Peter Ujfalusi @ 2012-09-20 10:46 UTC (permalink / raw)
To: Rajeev kumar; +Cc: alsa-devel@alsa-project.org, Mark Brown
On 09/20/2012 01:39 PM, Rajeev kumar wrote:
> Hello Peter,
>
> On 9/20/2012 3:49 PM, Peter Ujfalusi wrote:
> Thanks for the info.
>
> Please find below the controls I have provided
>
> static const char *pwm_mode_text[] = { "Binary", "Headphone", "Ternary",
> "Phase-shift"};
>
> static const DECLARE_TLV_DB_SCALE(out_gain_tlv, -9150, 50, 0);
> static const DECLARE_TLV_DB_SCALE(master_vol_tlv, -12750, 50, 0);
> static const SOC_ENUM_SINGLE_DECL(pwm_src, STA529_FFXCFG1, 4, pwm_mode_text);
>
> static const struct snd_kcontrol_new sta529_snd_controls[] = {
> SOC_DOUBLE_R_TLV("Digital Playback Volume", STA529_LVOL, STA529_RVOL, 0,
> 127, 0, out_gain_tlv),
> SOC_SINGLE_TLV("Master Playback Volume", STA529_MVOL, 0, 127, 1,
> master_vol_tlv),
> SOC_ENUM("PWM Select", pwm_src),
> };
>
> So in our amixer output I am not getting any separate numid for left/right
> volume, so that user can control it.
You should have single numid for the stereo control:
amixer sget Digital
amixer sget Master
You should see something like this with the stereo control:
beagle-gentoo dapm # amixer sget Headset
Simple mixer control 'Headset',0
Capabilities: pvolume penum
Playback channels: Front Left - Front Right
Limits: Playback 0 - 3
Mono:
Front Left: Playback 2 [67%] [0.00dB]
Front Right: Playback 2 [67%] [0.00dB]
>
> Is there something I am missing in my code.
Looks fine for me.
--
Péter
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-09-20 10:46 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-20 7:56 Audio codec volume control Rajeev kumar
2012-09-20 9:58 ` Peter Ujfalusi
2012-09-20 10:08 ` Rajeev kumar
2012-09-20 10:19 ` Peter Ujfalusi
2012-09-20 10:39 ` Rajeev kumar
2012-09-20 10:46 ` Peter Ujfalusi
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).