Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-01-2015, 01:18 AM
|
#1
|
Senior Member
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,571
Rep: 
|
How do I query amixer?
I want to get the current volume, for display with osdctl.
Code:
~> amixer scontrols
Simple mixer control 'Master',0
Simple mixer control 'Headphone',0
Simple mixer control 'Speaker',0
Simple mixer control 'PCM',0
Simple mixer control 'Mic',0
Simple mixer control 'Mic Boost',0
Simple mixer control 'Beep',0
Simple mixer control 'Capture',0
Simple mixer control 'Auto-Mute Mode',0
Simple mixer control 'Digital',0
~> amixer cget Master
Wrong control identifier: Master
~> amixer cget Master 0
Wrong control identifier: Master
~> amixer cget PCM 0
Wrong control identifier: PCM
~> amixer cget PCM
Wrong control identifier: PCM
Dammit.
'amixer get Master' gives me what I want, but it's verbose and I'll have to write a script to parse and isolate the exact value. I can do that, but surely I am using the cget command wrong, and maybe it will make it all simpler.
Last edited by lucmove; 04-01-2015 at 01:21 AM.
|
|
|
04-01-2015, 01:39 AM
|
#2
|
Senior Member
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Rep: 
|
awk -F"[][]" '/dB/ { print $2 }' <(amixer sget Master)
---------- Post added 04-01-15 at 02:40 AM ----------
Let's try that again...
Quote:
awk -F"[][]" '/dB/ { print $2 }' <(amixer sget Master)
|
---------- Post added 04-01-15 at 02:40 AM ----------
Let's try that again...
Quote:
awk -F"[][]" '/dB/ { print $2 }' <(amixer sget Master)
|
|
|
|
04-01-2015, 02:04 AM
|
#3
|
Senior Member
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Rep: 
|
Downloaded and installed AlienBobs Plasma desktop, was running like a champ, very light and responsive, however this double post thing started after I switched to it, if you would be so kind as to let me test this in fluxbox and see if the double post issue is related to the plasma environment...
|
|
|
04-01-2015, 07:26 AM
|
#4
|
Senior Member
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,571
Original Poster
Rep: 
|
Thanks, but I already knew how to parse the verbose output. I still don't know how to use the 'amixer cget' command.
|
|
|
04-01-2015, 08:05 AM
|
#5
|
Senior Member
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Rep: 
|
Sorry, looked at your question and assumed the 'c' was a typo.
Quote:
cget - A utility that retrieves a specified file from each node of a cluster and places it into the specified target directory.
|
Once you get the amixer.state from each member of the cluster, you'll still have to grind it for the data you want.
|
|
|
All times are GMT -5. The time now is 09:48 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|