Kostya
Kostya

Reputation: 21

How can i map control to it's device?

amixer -c 0 controls:

...
numid=22,iface=MIXER,name='Capture Switch'

numid=24,iface=MIXER,name='Capture Switch',index=1

numid=21,iface=MIXER,name='Capture Volume'

numid=23,iface=MIXER,name='Capture Volume',index=1

...

arecord -l:

card 0: PCH [HDA Intel PCH], device 0: ALC662 rev3 Analog [ALC662 rev3 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 2: ALC662 rev3 Alt Analog [ALC662 rev3 Alt Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

I have two controls with the same names. I know, that one is handle stream Card=0,device=0, second - Card=0,device=2. But how can i get from my program which control response for specific device? Contol with numid = 21 or control with numid = 23 handle device 2?

I can find some useful info about it in /proc/asound/cord0/codec#0. But I need to detect in from my code.

Upvotes: 2

Views: 66

Answers (1)

CL.
CL.

Reputation: 180182

Controls of interface MIXER are not directly associated with any device.

The only way to find out more would be to use some hardware-dependent mechanism. However, in the case of HDA, reading codec#x is not very useful because the exact algorithm the kernel uses to map widgets to controls is not guaranteed.

Upvotes: 1

Related Questions