I'm using subprocess.call commands like:

aplay --device=plughw:1,0 test.wav
aplay --device=plughw:0,0 test.wav

to play sounds on my headset or speakers, and that works fine. I'm deriving the above devices from sounddevice.query_devices()

and I'm also using:

amixer set Headphone 60%

where that name is derived from alsaaudio.mixers()

How do I use the hw:0,0 device to tell amixer which device I want to control the volume of? Or how do I translate hw:x,y devices to amixer names? Or am I approaching this all wrong?


Followup: Hmm, if I just say 'amixer' I get:

Simple mixer control 'PCM',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 338
  Front Left: Playback 169 [50%] [-31.72dB] [on]
  Front Right: Playback 169 [50%] [-31.72dB] [on]

and I can use amixer set PCM 60%, but nothing else works, and I can't see the name of the headset.

amixer set --device hw:0,0 60%
Specify what you want to set...
  • amixer has the option -c for you to select the card to manipulate. Since the device (y) does not matter in this context anyway, you only need to specify the card (x). (There's actually also an option -D which I have no idea under what circumstances one would need that specified.)
    – Tom Yan
    Jul 11, 2021 at 15:11
  • You are not reading. Run amixer -c 0 and amixer -c 1 to set what mixer controls they have respectively.
    – Tom Yan
    Jul 12, 2021 at 2:27
  • Ah, now I get it, thank you. More not comprehending than not reading, but I appreciate your patience. #OnceYouKnowItsObvious
    – wpns
    Jul 12, 2021 at 13:19


You must log in to answer this question.

Browse other questions tagged .