All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kirill Marinushkin <k.marinushkin@gmail.com>
To: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: Takashi Iwai <tiwai@suse.de>, alsa-devel@alsa-project.org
Subject: Re: [RFC, alsa-utils] RFC: alsamixer: Improve description of playback switches
Date: Tue, 27 Mar 2018 00:22:27 +0200	[thread overview]
Message-ID: <9394bffd-c895-65eb-497e-4e39918638eb@gmail.com> (raw)
In-Reply-To: <dc681602-acc5-618e-2c46-b4fcebd52ba4@sakamocchi.jp>

On 03/27/18 00:03, Takashi Sakamoto wrote:
> Hi,
>
> On Mar 27 2018 03:42, Kirill Marinushkin wrote:
>> On 03/26/18 10:19, Takashi Sakamoto wrote:
>>> Hi,
>>>
>>> On Mar 26 2018 14:11, Kirill Marinushkin wrote:
>>>> Currently, all playback switches are described as mute. It is shown as:
>>>>
>>>> [OO] == sound is on (left and right channels)
>>>> [MM] == sound is muted (left and right channels)
>>>>
>>>> But cards can have different kinds of switch controls, not only mute. At
>>>> least usb-audio provides boolean controls as playback switches for:
>>>>
>>>> * clock source validity (read only switch)
>>>> * processing features on/off (rw switch)
>>>> * potentially other similar use-cases
>>>>
>>>> It becames confusing, because it is shown as:
>>>>
>>>> [OO] == clock source is valid
>>>> [MM] == clock source is invalid
>>>>
>>>> [OO] == processing feature is on
>>>> [MM] == processing feature is off
>>>>
>>>> And from the help, it is not clear how to toggle such switches.
>>>
>>> Could you show such control elements to help reviewers? For example, output from 'amixer' might be enough.
>>>
>>
>> Hello Takashi Sakamoto,
>>
>> I misread your message. You mean the amixer output, not the alsamixer.
>> Below I attach the output from amixer.
>>
>> $ amixer -c2
>> Simple mixer control 'Clock Source 15 Validity',0
>>    Capabilities: pswitch pswitch-joined
>>    Playback channels: Mono
>>    Mono: Playback [on]
>> Simple mixer control 'Up Down',0
>>    Capabilities: pswitch pswitch-joined
>>    Playback channels: Mono
>>    Mono: Playback [on]
>> Simple mixer control 'Up Down Mode Select',0
>>    Capabilities: volume volume-joined
>>    Playback channels: Mono
>>    Capture channels: Mono
>>    Limits: 0 - 1
>>    Mono: 1 [100%]
>
> Thanks. Then you can see corresponding control elements with the same name in output of 'amixer -c2 contents'. I guess:
>
> $ amixer -c 2 contents | grep -B1 -A1 BOOLEAN
> ...
> numid=?,iface=MIXER,name='Clock Source 15 Validity'
>   ; type=BOOLEAN,access=rw------,values=1
>   : values=on
> numid=?,iface=MIXER,name='Up Down'
>   ; type=BOOLEAN,access=rw------,values=1
>   : values=on
> ...
>
> A control element of 'Up Down Mode Select' is not the one of BOOLEAN type so it's not issued one in your patch.
>
> For example, in my case (E-MU 0404 USB, kernel v4.13):
>
> $ amixer -c 1
> ...
> Simple mixer control 'AnalogueIn Soft Limit  ',0
>   Capabilities: pswitch pswitch-joined
>   Playback channels: Mono
>   Mono: Playback [on]
> Simple mixer control 'Clock rate Selector',0
>   Capabilities: volume volume-joined
>   Playback channels: Mono
>   Capture channels: Mono
>   Limits: 0 - 5
>   Mono: 0 [0%]
> Simple mixer control 'DigitalIn CLK source External',0
>   Capabilities: pswitch pswitch-joined
>   Playback channels: Mono
>   Mono: Playback [off]
> Simple mixer control 'DigitalOut format: SPDIF/AC3',0
>   Capabilities: pswitch pswitch-joined
>   Playback channels: Mono
>   Mono: Playback [off]
>
> These mixer elements are translated by alsa-lib's mixer API implementation from control elements maintained by ALSA control core. In my case:
>
> $ amixer -c 1 contents | grep -B1 -A1 BOOLEAN
> numid=4,iface=MIXER,name='PCM Playback Switch'
>   ; type=BOOLEAN,access=rw------,values=1
>   : values=on
> -- 
> numid=9,iface=MIXER,name='AnalogueIn Soft Limit  '
>   ; type=BOOLEAN,access=rw------,values=1
>   : values=on
> -- 
> numid=8,iface=MIXER,name='DigitalIn CLK source External'
>   ; type=BOOLEAN,access=rw------,values=1
>   : values=off
> numid=6,iface=MIXER,name='DigitalOut format: SPDIF/AC3'
>   ; type=BOOLEAN,access=rw------,values=1
>   : values=off
>
> Well, if your aim is just to focus on UI issue, it's enough to change alsamixer. On the other hand, developers tend to add any control element categorized to 'mixer' iface without enough care of its meaning. What you see is this kind of control elements, I guess. If you wish to suppress alsamixer to handle such non-traditional mixer controls (I mean they're not for gain/level/pan/mute etc), it's better to have extra care; e.g. backward compatibility.
>

Hello Takashi Sakamoto,

Maybe there is a misunderstanding. I don't want to suppress non-traditional mixer controls.
As I mentioned in the subject, I want to Improve their description.
I don't want to change the existing behavior.

I think I will just create an patch, and it will make things clear.

Best Regards,
Kirill

>
> Regards
>
> Takashi Sakamoto

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

      reply	other threads:[~2018-03-26 22:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-26  5:11 [RFC, alsa-utils] RFC: alsamixer: Improve description of playback switches Kirill Marinushkin
2018-03-26  7:38 ` Takashi Iwai
2018-03-26 18:32   ` Kirill Marinushkin
2018-03-26 20:41     ` Andrew Chant
2018-03-26 21:13       ` Kirill Marinushkin
2018-03-26 21:44         ` Takashi Sakamoto
2018-03-26 21:53           ` Kirill Marinushkin
2018-03-27 19:12             ` Kirill Marinushkin
2018-03-26  8:19 ` Takashi Sakamoto
2018-03-26 18:37   ` Kirill Marinushkin
2018-03-26 18:42   ` Kirill Marinushkin
2018-03-26 22:03     ` Takashi Sakamoto
2018-03-26 22:22       ` Kirill Marinushkin [this message]

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=9394bffd-c895-65eb-497e-4e39918638eb@gmail.com \
    --to=k.marinushkin@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=o-takashi@sakamocchi.jp \
    --cc=tiwai@suse.de \
    /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.