LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 04-01-2015, 01:18 AM   #1
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,432

Rep: Reputation: 110Reputation: 110
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.
 
Old 04-01-2015, 01:39 AM   #2
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
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)
 
Old 04-01-2015, 02:04 AM   #3
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
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...
 
Old 04-01-2015, 07:26 AM   #4
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,432

Original Poster
Rep: Reputation: 110Reputation: 110
Thanks, but I already knew how to parse the verbose output. I still don't know how to use the 'amixer cget' command.
 
Old 04-01-2015, 08:05 AM   #5
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sh: put all of amixer up, with sh frenchn00b Programming 3 11-03-2008 05:49 PM
amixer set CD 31 fof3 Linux - Newbie 1 06-08-2005 12:19 PM
amixer error Phonics3k Linux - Software 5 12-23-2004 07:58 PM
Incrementing volume through amixer mpn Linux - General 1 10-30-2004 08:42 PM
Amixer nutshell Linux - General 1 02-27-2003 11:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration