Hi,

I'm a developer mainly for sound device driver of multi-channel devices, 
i.e. 40/40 PCM channels for playback/capture.

I have the same issue for my test devices.

On Apr 26 2016 08:52, Caleb Crome wrote:
> Hi there,
>    I'm working on a 16 channel XMOS based USB sound card.  It's working
> just fine, except that in alsamixer, the first 8 channels are mapped
> to:
>
> ch 0 -> front left
> ch 1 -> front right
> ch 2 -> rear left
> ch 3 -> rear right
> ch 4 -> center
> ch 5 -> woofer
> ch 6 -> side left
> ch 7 -> side right
>
> And channels 8 though 15 simply don't show up in the mixer.
>
> When I do amixer, I get:
> # amixer
> Simple mixer control 'XMOS Clock Selector',0
>    Capabilities: pvolume cvolume pswitch cswitch
>    Playback channels: Front Left - Front Right - Rear Left - Rear Right
> - Front Center - Woofer - Side Left - Side Right - Rear Center - ? - ?
> - ? - ? - ? - ? - ?
>    Capture channels: Front Left - Front Right - Rear Left - Rear Right
> - Front Center - Woofer - Side Left - Side Right - Rear Center - ? - ?
> - ? - ? - ? - ? - ?
>    Limits: Playback 0 - 127 Capture 0 - 127
>    Front Left: Playback 127 [100%] [0.00dB] [on] Capture 127 [100%] [0.00dB] 
> [on]
>    Front Right: Playback 127 [100%] [0.00dB] [on] Capture 127 [100%]
> [0.00dB] [on]
>    Rear Left: Playback 127 [100%] [0.00dB] [on] Capture 127 [100%] [0.00dB] 
> [on]
>    Rear Right: Playback 127 [100%] [0.00dB] [on] Capture 127 [100%] [0.00dB] 
> [on]
>    Front Center: Playback 127 [100%] [0.00dB] [on] Capture 127 [100%]
> [0.00dB] [on]
>    Woofer: Playback 127 [100%] [0.00dB] [on] Capture 127 [100%] [0.00dB] [on]
>    Side Left: Playback 127 [100%] [0.00dB] [on] Capture 127 [100%] [0.00dB] 
> [on]
>    Side Right: Playback 127 [100%] [0.00dB] [on] Capture 127 [100%] [0.00dB] 
> [on]
>    Rear Center: Playback 127 [100%] [0.00dB] [on] Capture 127 [100%]
> [0.00dB] [on]
>    ?: Playback 127 [100%] [0.00dB] [on] Capture 127 [100%] [0.00dB] [on]
>    ?: Playback 127 [100%] [0.00dB] [on] Capture 127 [100%] [0.00dB] [on]
>    ?: Playback 127 [100%] [0.00dB] [on] Capture 127 [100%] [0.00dB] [on]
>    ?: Playback 127 [100%] [0.00dB] [on] Capture 127 [100%] [0.00dB] [on]
>    ?: Playback 127 [100%] [0.00dB] [on] Capture 127 [100%] [0.00dB] [on]
>    ?: Playback 127 [100%] [0.00dB] [on] Capture 127 [100%] [0.00dB] [on]
>    ?: Playback 127 [100%] [0.00dB] [on] Capture 127 [100%] [0.00dB] [on]
> Simple mixer control 'XMOS Clock Selector',1
>    Capabilities: pvolume pvolume-joined cvolume cvolume-joined pswitch
> pswitch-joined cswitch cswitch-joined
>    Playback channels: Mono
>    Capture channels: Mono
>    Limits: Playback 0 - 127 Capture 0 - 127
>    Mono: Playback 127 [100%] [0.00dB] [on] Capture 127 [100%] [0.00dB] [on]
>
>
> which shows that all 16 controls are there, but only the first 8 have
> names, and the rest are named , "?" (question mark)
>
> How do I get alsamixer to recognize all the controls & channels and
> map them simply to names like:
>
> ch0, ch1, ch2, ch3, ... ch14, ch15 ?
>
> that is, I'd prefer simple channels, no bonded pairs, and all 16
> channels ennumerated out in alsamixer.
>
> I know the solution resides in .asoundrc configuration, but the
> solution eludes me.

When executing 'amixer' command without no options, the applications 
enumerates ALSA ctl elements with 'simple mixer' interface of alsa 
userspace library. For example,

 > 'Playback channels: Front Left - Front Right - Rear Left - Rear Right
 > - Front Center - Woofer - Side Left - Side Right - Rear Center - ? - ?
 > - ? - ? - ? - ? - ?'

This line is output in this code:
http://git.alsa-project.org/?p=alsa-utils.git;a=blob;f=amixer/amixer.c;h=f9b09cb54276dbb88c5abc6b197727e8fd58b8eb;hb=96db90e98a6040f680f4ebca1880268a2e1ab6cc#l844

In the codes, 'snd_mixer_selem_channel_name()' is called. In alsa-lib, 
the simple mixer API is described:
http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=src/mixer/simple.c;h=fd9ba93ee791557b255ecde8f1183bd637948670;hb=6a610e56aeef5048136336f7f54db05f061ee4d4#l219

You can see static constant array inner the function. When you pass 
channel number over 8 (= SND_MIXER_SCHN_REAR_CENTER), the API returns "?".

In short, ALSA simple mixer API application cannot display proper name 
for channel number over 8.

Furtheremore, 'alsamixer' has a limitation of displayed channels up to 
8. For example, see these lines:
http://git.alsa-project.org/?p=alsa-utils.git;a=blob;f=alsamixer/mixer_display.c;h=b1f79d06522157c80d438b8429648ebe5bb269f0;hb=96db90e98a6040f680f4ebca1880268a2e1ab6cc#l587


Anyway, you need to write patchset to improve them for your aim.
(I have little time for this issue, sorry...)


Regards

Takashi Sakamoto

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user

Reply via email to