skuep / AIOC

Ham Radio All-in-one-Cable
MIT License
764 stars 60 forks source link

`amixer` reports different `numid`s for seemingly the same function #47

Closed kx1t closed 12 months ago

kx1t commented 12 months ago

amixer reports different numids for seemingly the same function. Which one should I use to set volume, etc? Examples: numids 8 and 9, 10 and 11, 3 and 4, 5 and 6 in the output paste below:

$ amixer -c 0 contents
numid=7,iface=CARD,name='AIOC Audio In - Input Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=on
numid=8,iface=MIXER,name='AIOC Audio In Capture Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=9,iface=MIXER,name='AIOC Audio In Capture Switch',index=1
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=10,iface=MIXER,name='AIOC Audio In Capture Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=24576,step=0
  : values=24576
  | dBminmax-min=-96.00dB,max=0.00dB
numid=11,iface=MIXER,name='AIOC Audio In Capture Volume',index=1
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=24576,step=0
  : values=24576
  | dBminmax-min=-96.00dB,max=0.00dB
numid=3,iface=MIXER,name='AIOC Audio Out Volume Playback Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=4,iface=MIXER,name='AIOC Audio Out Volume Playback Switch',index=1
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=5,iface=MIXER,name='AIOC Audio Out Volume Playback Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=24576,step=0
  : values=24576
  | dBminmax-min=-96.00dB,max=0.00dB
numid=6,iface=MIXER,name='AIOC Audio Out Volume Playback Volume',index=1
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=24576,step=0
  : values=24576
  | dBminmax-min=-96.00dB,max=0.00dB
numid=2,iface=PCM,name='Capture Channel Map'
  ; type=INTEGER,access=r----R--,values=1,min=0,max=36,step=0
  : values=2
  | container
    | chmap-fixed=MONO
numid=1,iface=PCM,name='Playback Channel Map'
  ; type=INTEGER,access=r----R--,values=1,min=0,max=36,step=0
  : values=2
  | container
    | chmap-fixed=MONO
skuep commented 12 months ago

That's a good question actually. I think numid=10 is the master volume for the microphone and numid=11 is the volume for the first channel of the microphone input. Same with 5 and 6 on the speaker output. I think the master volume Feature is not implemented in software (value is ignored) so I would try numids 11 and 6.

kx1t commented 12 months ago

Actually, I tried it the other way around (changing 5 and 10) and it worked. They show up in alsamixer as separate controls.

The thing is that I wrote a container for DireWolf that automates the whole thing, and for now I try to detect only those NumIDs that don't have an index in them. (here ICYMC). That will probably break sometime :)

In any case, thanks for the advice, I'll close the issue