Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

On my hardware platform I have a LOT of lines.

Is there a way to set the volume of all of these? Or mute all of these?

If not, is there a way I can for loop this?

If I change hardware platforms, is there a way I can get amixer to output a list of lines so that I can write a hardware agnostic volume controller?

See all my lines:

Simple mixer control 'PCM',0
Simple mixer control 'Line',0
Simple mixer control 'Line DAC',0
Simple mixer control 'Line Line2 Bypass',0
Simple mixer control 'Line PGA Bypass',0
Simple mixer control 'Mono',0
Simple mixer control 'Mono DAC',0
Simple mixer control 'Mono Line2 Bypass',0
Simple mixer control 'Mono Mixer DACL1',0
Simple mixer control 'Mono Mixer DACR1',0
Simple mixer control 'Mono Mixer Line2L Bypass',0
Simple mixer control 'Mono Mixer Line2R Bypass',0
Simple mixer control 'Mono Mixer PGAL Bypass',0
Simple mixer control 'Mono Mixer PGAR Bypass',0
Simple mixer control 'Mono PGA Bypass',0
Simple mixer control 'ADC HPF Cut-off',0
Simple mixer control 'AGC',0
Simple mixer control 'HP',0
Simple mixer control 'HP DAC',0
Simple mixer control 'HP Line2 Bypass',0
Simple mixer control 'HP PGA Bypass',0
Simple mixer control 'HPCOM',0
Simple mixer control 'HPCOM DAC',0
Simple mixer control 'HPCOM Line2 Bypass',0
Simple mixer control 'HPCOM PGA Bypass',0
Simple mixer control 'Left DAC Mux',0
Simple mixer control 'Left HP Mixer DACL1',0
Simple mixer control 'Left HP Mixer DACR1',0
Simple mixer control 'Left HP Mixer Line2L Bypass',0
Simple mixer control 'Left HP Mixer Line2R Bypass',0
Simple mixer control 'Left HP Mixer PGAL Bypass',0
Simple mixer control 'Left HP Mixer PGAR Bypass',0
Simple mixer control 'Left HPCOM Mixer DACL1',0
Simple mixer control 'Left HPCOM Mixer DACR1',0
Simple mixer control 'Left HPCOM Mixer Line2L Bypass',0
Simple mixer control 'Left HPCOM Mixer Line2R Bypass',0
Simple mixer control 'Left HPCOM Mixer PGAL Bypass',0
Simple mixer control 'Left HPCOM Mixer PGAR Bypass',0
Simple mixer control 'Left HPCOM Mux',0
Simple mixer control 'Left Line Mixer DACL1',0
Simple mixer control 'Left Line Mixer DACR1',0
Simple mixer control 'Left Line Mixer Line2L Bypass',0
Simple mixer control 'Left Line Mixer Line2R Bypass',0
Simple mixer control 'Left Line Mixer PGAL Bypass',0
Simple mixer control 'Left Line Mixer PGAR Bypass',0
Simple mixer control 'Left Line2L Mux',0
Simple mixer control 'Left PGA Mixer Line1L',0
Simple mixer control 'Left PGA Mixer Line1R',0
Simple mixer control 'Left PGA Mixer Line2L',0
Simple mixer control 'Left PGA Mixer Mic3L',0
Simple mixer control 'Left PGA Mixer Mic3R',0
Simple mixer control 'PGA',0
Simple mixer control 'Right DAC Mux',0
Simple mixer control 'Right HP Mixer DACL1',0
Simple mixer control 'Right HP Mixer DACR1',0
Simple mixer control 'Right HP Mixer Line2L Bypass',0
Simple mixer control 'Right HP Mixer Line2R Bypass',0
Simple mixer control 'Right HP Mixer PGAL Bypass',0
Simple mixer control 'Right HP Mixer PGAR Bypass',0
Simple mixer control 'Right HPCOM Mixer DACL1',0
Simple mixer control 'Right HPCOM Mixer DACR1',0
Simple mixer control 'Right HPCOM Mixer Line2L Bypass',0
Simple mixer control 'Right HPCOM Mixer Line2R Bypass',0
Simple mixer control 'Right HPCOM Mixer PGAL Bypass',0
Simple mixer control 'Right HPCOM Mixer PGAR Bypass',0
Simple mixer control 'Right HPCOM Mux',0
Simple mixer control 'Right Line Mixer DACL1',0
Simple mixer control 'Right Line Mixer DACR1',0
Simple mixer control 'Right Line Mixer Line2L Bypass',0
Simple mixer control 'Right Line Mixer Line2R Bypass',0
Simple mixer control 'Right Line Mixer PGAL Bypass',0
Simple mixer control 'Right Line Mixer PGAR Bypass',0
Simple mixer control 'Right Line2R Mux',0
Simple mixer control 'Right PGA Mixer Line1L',0
Simple mixer control 'Right PGA Mixer Line1R',0
Simple mixer control 'Right PGA Mixer Line2R',0
Simple mixer control 'Right PGA Mixer Mic3L',0
Simple mixer control 'Right PGA Mixer Mic3R',0
share|improve this question
    
I was hoping to make a generic master volume control that was hardware agnostic. So rather than have to figure out which line controlled which speaker, I'd just mute or unmute them all. This would also prevent a user from tampering with an obscure line I hadn't considered. –  lm317 Sep 22 '13 at 15:36

1 Answer 1

up vote 2 down vote accepted

Use alsactl --file /some/file store to save the current value of all mixer controls into a file.

Edit the values as desired, remove all entries you don't want to change, and call alsactl --file /some/file --no-init-fallback restore to load the values from the file.


Mixer controls are hardware specific.

share|improve this answer
    
Thanks. Reading from a file will definitely be a handy trick and make it much easier to implement. –  lm317 Sep 22 '13 at 15:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.