Alsa Volume Control from script [SOLVED]

I currently have arch setup with a custom desktop environment with Compiz as my window manager and dmenu for launching apps. I love this setup, it's lean, mean and clean. However I would like to be able to control my computers volume by setting a custom command in ccsm and link it to a keyboard shortcut but I don't know how to directly control alsa via the command line to up and down the volume. If this at all possible. it would be very appreciated. Many thanks in advance.
Last edited by martin101 (2012-01-30 13:59:37)

skunktrader wrote:man amixer
Thanks for the quick reply, my word the syntax to control amixer seems rather convoluted. But thanks nonetheless.

Similar Messages

  • Mapping Alsa Volume Control for USB SoundCard (C-Media 650)

    Hello everyone who is interested in helping me solve my volume control problem!
    Lets see, I have sound playback working, currently I am listening to some Foo Fighters mp3s in XMMS using the Alsa plugin, so I can't complain too much.
    However, volume control doesn't work. If I set the alsa plugin to use software volume control, then I have volume control but its not ideal and it doesn't help me when I'm not using xmms. When I run alsamixer or open the gnome volume control, I have multiple volume controls for the "Speaker" device. The 1st pair of volume controls do nothing, I can mute them and my music keeps playing... no idea what they're controlling. The 2nd pair ("Speaker 1") DOES control the sound volume. I just need to find a way to remap it or something so I can configure my applications/tray icon/etc to use it. (And preferabbly not the other 6 channels)
    In the Gnome sound control, the devices are:
    "Speaker" - stereo control that doesn't do anything
    and "Speaker 1" - a 7.1 channel (8 sliders) with the first two controlling front left and right sound for my stereo speakers.
    I've tried setting xmms to use "speaker 1", but the option is not in the drop-box, tried typing it manually but that didnt work.
    I set my tray icon to control "speaker 1" but the sliders don't seem to lock properly and the volume just jumps around, unlocking the channels and not staying balanced or scaling with the slider.
    The only way to get the volume to change as expected is to open the gnome volume manager, make sure the channels of "Speaker 1" are UNLOCKED and slide the first 2 sliders to the desired volume.
    So I was thinking if I could just remap the first two channels of "speaker 1" to something else using an alias or link or editing asound.state (which just confused me) for example, then I could use my alias to control the sound in my applications. Thanks for any help with this!
    Here's some system info that may or may not help:
    AMD Athlon 5400 X2
    Asus M2N-E SLi /w C-Media 650 onboard 8-channel audio CODEC (transfer audio signal over USB bus)
    Fully uptodate Arch Linux 64-bit (pacman -Syu'd this morning)
    aplay -L
    default:CARD=default
    PnP Audio Device , USB Audio
    Default Audio Device
    front:CARD=default,DEV=0
    PnP Audio Device , USB Audio
    Front speakers
    surround40:CARD=default,DEV=0
    PnP Audio Device , USB Audio
    4.0 Surround output to Front and Rear speakers
    surround41:CARD=default,DEV=0
    PnP Audio Device , USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
    surround50:CARD=default,DEV=0
    PnP Audio Device , USB Audio
    5.0 Surround output to Front, Center and Rear speakers
    surround51:CARD=default,DEV=0
    PnP Audio Device , USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
    surround71:CARD=default,DEV=0
    PnP Audio Device , USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
    iec958:CARD=default,DEV=0
    PnP Audio Device , USB Audio
    IEC958 (S/PDIF) Digital Audio Output
    null
    $ cat /proc/asound/devices
    2: : timer
    3: : sequencer
    4: [ 0- 0]: digital audio playback
    5: [ 0- 0]: digital audio capture
    6: [ 0] : control
    asound.state:
    state.default {
    control.1 {
    comment.access 'read write'
    comment.type BOOLEAN
    comment.count 1
    iface MIXER
    name 'Mic Playback Switch'
    value false
    control.2 {
    comment.access 'read write'
    comment.type INTEGER
    comment.count 2
    comment.range '0 - 8065'
    comment.dbmin -2400
    comment.dbmax -2400
    iface MIXER
    name 'Mic Playback Volume'
    value.0 6144
    value.1 6144
    control.3 {
    comment.access 'read write'
    comment.type BOOLEAN
    comment.count 1
    iface MIXER
    name 'CD Playback Switch'
    value true
    control.4 {
    comment.access 'read write'
    comment.type INTEGER
    comment.count 2
    comment.range '0 - 8065'
    comment.dbmin -2400
    comment.dbmax -2400
    iface MIXER
    name 'CD Playback Volume'
    value.0 5575
    value.1 5575
    control.5 {
    comment.access 'read write'
    comment.type BOOLEAN
    comment.count 1
    iface MIXER
    name 'Speaker Playback Switch'
    value false
    control.6 {
    comment.access 'read write'
    comment.type INTEGER
    comment.count 2
    comment.range '0 - 8065'
    comment.dbmin -2400
    comment.dbmax -2400
    iface MIXER
    name 'Speaker Playback Volume'
    value.0 6144
    value.1 6144
    control.7 {
    comment.access 'read write'
    comment.type BOOLEAN
    comment.count 1
    iface MIXER
    name 'Speaker Playback Switch'
    index 1
    value true
    control.8 {
    comment.access 'read write'
    comment.type INTEGER
    comment.count 8
    comment.range '0 - 197'
    comment.dbmin -3693
    comment.dbmax -147
    iface MIXER
    name 'Speaker Playback Volume'
    index 1
    value.0 196
    value.1 196
    value.2 196
    value.3 196
    value.4 196
    value.5 196
    value.6 196
    value.7 196
    control.9 {
    comment.access 'read write'
    comment.type BOOLEAN
    comment.count 1
    iface MIXER
    name 'Mic Capture Switch'
    value true
    control.10 {
    comment.access 'read write'
    comment.type INTEGER
    comment.count 2
    comment.range '0 - 6928'
    comment.dbmin -1600
    comment.dbmax -1600
    iface MIXER
    name 'Mic Capture Volume'
    value.0 4096
    value.1 4096
    control.11 {
    comment.access 'read write'
    comment.type BOOLEAN
    comment.count 1
    iface MIXER
    name 'PCM Capture Switch'
    value true
    control.12 {
    comment.access 'read write'
    comment.type INTEGER
    comment.count 2
    comment.range '0 - 6928'
    comment.dbmin -1600
    comment.dbmax -1600
    iface MIXER
    name 'PCM Capture Volume'
    value.0 4096
    value.1 4096
    control.13 {
    comment.access 'read write'
    comment.type BOOLEAN
    comment.count 1
    iface MIXER
    name 'CD Capture Switch'
    value true
    control.14 {
    comment.access 'read write'
    comment.type INTEGER
    comment.count 2
    comment.range '0 - 6928'
    comment.dbmin -1600
    comment.dbmax -1600
    iface MIXER
    name 'CD Capture Volume'
    value.0 0
    value.1 0
    control.15 {
    comment.access 'read write'
    comment.type BOOLEAN
    comment.count 1
    iface MIXER
    name 'PCM Capture Switch'
    index 1
    value true
    control.16 {
    comment.access 'read write'
    comment.type INTEGER
    comment.count 2
    comment.range '0 - 6928'
    comment.dbmin -1600
    comment.dbmax -1600
    iface MIXER
    name 'PCM Capture Volume'
    index 1
    value.0 4096
    value.1 4096
    control.17 {
    comment.access 'read write'
    comment.type ENUMERATED
    comment.count 1
    comment.item.0 Mic
    comment.item.1 Mixer
    comment.item.2 'CD '
    comment.item.3 'Input 3'
    iface MIXER
    name 'PCM Capture Source'
    value Mic
    Thanks again!

    Some other observations that may be helpful (and, hopefully, get closer to the heart of the problem)...
    (1) Whenever VLC is playing audio (as mentioned in previous post, it is only application that works in desired manner), it will show up in Kmix's "Playback Streams" tab. Whenever Wine and Firefox are playing, they do NOT show up in the "Playback Streams" tab.
    (2) Kmix will not allow more than one open application to grab the UA-5 sound (e.g. If I open Firefox and play audio, stop playing audio (while leaving Firefox open), then open VLC and try to play audio, VLC will not play audio (unless Firefox is closed)). This is likely a related problem to the problem outlined in the previous post, but it might not be. If it isn't, I'll take advice on how to let KMIX grab multiple audio sources simultaneously on the same sound card.
    Thanks for reading!

  • The volume controls from my earphones doesnt seem to work on my white iPhone4

    i just adquired my white iPhone 4, but the volume controls attached to the earphones doesnt respond when i try to increase or decrease volume, mic works well tho

    Are you trying to publish to a MobileMe account? The Apple server is closing down at the end of this month. Is your account still active?
    What version of OS X are you using? If its Lion you may need to log out of iCloud and into MobileMe

  • Volume control from terminal

    Hi Guys,
    I want to write a small script so that I can have my computer connect and stream the radio from the internet when I wake up. It was fairly simple to open the radio stream and have it come on at the right time with crontab.
    One thing I forgot, though, is that the volume is what ever it was when I left it last - this morning it was a bit deafening!! I expect there will be times when I mute the volume before bed too, which is also no good.
    What I am after is a command line tool that will set the system volume to what I want it and not to what it was last set to. Does something exist to do this? I have searched google, and the mac osx hints and tips sites. I did find osascript, but that is an applescript tool and I don't really want to use that.
    Thanks

    Here is what I wanted it for. It's not particularly difficult to do, but it did show me how to use crontab for simple scheduled jobs and wakes me up in the morning (without deafening me at the same time
    A simple alarm clock. I found the command 'say' the other day, so this could easily be modified to speak the contents of a file (possibly an RSS feed) when you wake up
    --> wake_up.bash
    #!/bin/bash
    ## set radio 1 to come on in the morning
    open http://www.bbc.co.uk/radio/aod/mainframe.shtml?http://www.bbc.co.uk/radio/aod/ra dio1.shtml
    ## set volume to gradually increase to 3/4 max
    for((i=0;i<75;i++)); do
    osascript -e "set volume output volume $i"
    done
    -->mycrontask
    SHELL=/bin/bash
    PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
    HOME=/var/log
    #min hour mday month wday command
    07 07 * * 0-5 ~/alarmclock/wakeup

  • State control from script block

    Hello, my Flex SWF is receiving a local connection from
    another embedded SWF.
    When this local connection is made and the relevant function
    is called by the sender SWF, what is the best way to initiate a
    state change within the parent receiver SWF ?
    i,e. how do I initiate a Flex state change from withing a
    CDATA script block ?
    Thanks for any help.

    That can work. I assume you've already seen:
    http://learn.adobe.com/wiki/display/Flex/Local+Connections
    the AS would simply be something like:
    currentState = 'myNewState';

  • ITunes disables my Windows sounds and takes away the volume control

    I have searched and found no answer to this- others have posted this same question.
    I installed itunes and it removed my volume control from the task bar. It disabled my Windows sounds and took away the volume control from the System Tray next to clock. My media buttons no longer affect the volume either. I have to go into control panel to change my system volume.
    At first- it only happened when my daughter would plug in her iPod and use iTunes, and then after we'd reboot the computer, the volume control would come back and no longer be disabled. Each time she used iTunes, it would happen again. Then a computer restart would bring it back. Now all of a sudden, nothing brings it back. I have to go about 4-5 screens deep into Control Panel to adjust the volume there. This is ridiculous and an absolutely unacceptable side effect of iTunes.
    Does someone have an answer or do we need to delete iTunes and never again buy a crappy apple product?
    Message was edited by: sjs.chowchow

    Figured it out!
    Go to Control Panel -> Sound
    In the “Playback” tab, click on your Speakers to highlight it, then click Properties. In the “Advanced” tab, under “Exclusive Mode”, uncheck the box that says “Allow applications to take exclusive control of this device”. I restarted my computer after that, but I am not sure if you need to.
    Then you can go to your taskbar and right-click and choose “Properties”. In the “Notification Area” tab, under System icons, “Volume” is no longer grayed out and you can now check the box to make it show up down near your clock again.

  • Emu 0404 USB Constantly Set to Mute By Volume Control

    I had my emu 0404 running with my onboard sound for a short while (because the 0404 would not work with voice chat software such as ventrillo).
    I have since disabled the onboard sound and uninstalled the driver, but now upon every reboot of my system the sndvolume32.exe (aka Volume Control icon on the taskbar) will set the Wave component of the emu 0404 to mute. I'd rather not have to open up volume control everytime i reboot to unmute my sound. I have tried going through my registry and deleting any remaining trace of the onboard sound (RealTek HD Audio) but no good. I have even uninstalled and reinstalled the emu 0404 drivers many times, still no good. I'm also using XP 64-bit, but i don't know if that matters.
    Can anyone tell me how I can stop volume control from setting the Wav output to mute upon rebooting?
    Message Edited by infinitydose on 05-02-2008 06:22 PM
    Message Edited by infinitydose on 05-02-2008 06:23 PM

    Have you set the S/PDIF mode switch to coax and how 'bout monitoring settings? I've read some issues w/ those switches too (you may need to toggle On/Off couple of times to get switch working properly). There is also thei Unofficial E-MU Forum you can check/ask advicing - http://www.productionforums.com/index.php?f=52
    jutapa

  • Volume control on X1 HD box

    Just picked up a rgn150n and cant control the box volume like old HD boxes.After reading around it doesn't support this option.Is there on that has volume option i need it for my game room just because on my set up. This one is in living room and loving it but not being able to control volume is a bummer would really like one on my nice TV in computer room.Are there any X1 HD *non DVR* boxes that have this option?

    demo23019 wrote:
    good for you that doesn't help me out at all like i said i need the volume control from the box for my speaker set up not the TV speakers.Im using bose companion 5 pc speakers with 3.5 jack to tv and only way i can adjust volume from TV is from the box.When i get around to getting optical out speakers ill come back to x1 but for now back to old box.Hmm.  I have an a/v receiver with my X1 STB connected to it and my TV connected to it. I am able to control the receiver volume and mute with my XR5 remote. The XR5 will accept codes for both the TV and the receiver.  It can control the power to the receiver and the TV. http://forums.xfinity.com/t5/X1/XR5-and-XR11-quot-Voice-Remote-quot-Code-Lists/td-p/2550616   

  • Sound Volume control gone with earbuds

    Is there a setting on an iPhone 4S that would disable the volume control from earbuds?  The stop/start works fine, but I cannot raise or lower the volume?  Thanks.

    Make sure the jack is inserted completely.
    Clean out the connector in the iPhone with compressed air.

  • Aluminum Keyboard Volume Controls for iTunes?

    Hi,
    is it possible to use the Volume Controls from the Aluminum Keyboard for iTunes?
    I use the Digital output for Audio on my Macs. So using this Key for iTunes would be the best usage for me.
    Thanks!

    You are aware if you use the Digital output (Optical, Fiber cable), like in my case the Volume keys don't have no function anymore.
    So if there is a trick to use this Keys for iTunes (when using the Digital output) that would rock the Banana house full of Squirrels!

  • TS1630 Hi I have a problem with my iPhone 4S,  I have no sound from my speaker ,keyboard or notifications ,  and my volume control buttons are not working is anyone experiencing this? Any help would be great full, also I have reset the iPhone many times.

    Hi I have a problem with my iPhone 4S I have no sound from my speaker , keyboard, notifications.   or volume controls,  I have reset my iphone many times and still the same, any advise will be greatful
    Thanks

    I don't think that a software update from Apple will solve the issues that you are having. You have a rogue installation. After you posted I have just done the following:
    Disk Utility can verify  my partitioned Volume (including my boot disk) AND REPAIR the non-boot disks on the same Volume without a glitch. It repairs the non-boot disks containing data smoothly.
    I have used Mail to send some mails from some Yahoo and Hotmail accounts to my Thunderbird client containing GMail accounts - absolutely normal.
    I have iLife '09 but my iMovie '09 and iPhoto '09 open in a jiffy and I see no issues here. I have 6GB RAM (Maximum) on an early 2008 Macbook Pro with a 750GB hard drive partitioned with 120GB reserved for the Boot Drive.
    I am sorry that I cannot help further but I am sure there must be a way to reinstall the software without having to revert to restoring your ML backup. I have two clones and if you have such I would attempt to do that through that rather than through Time Machine - that is of course if you have a cloned drive.
    Good luck!

  • For best sound quality should volume be controlled from iPad or BlueTooth speaker?

    For best sound quality when listening to music, should the volume be controlled from iPad or from a connected Bluetooth speaker?

    Pajaro wrote:
    For good sound quality, flat response is the most important thing. Take a look at qloud, http://aur.archlinux.org/packages.php?ID=34412, and find yourself a very good microphone.
    Then you will probably want to set a global equalizer for your machine. You can try with alsa, http://krustev.net/w/articles/Global_eq … _for_ALSA/.
    If ALSA isn't finegrained enough, jack has a lot more flexibility, except for the fact that it doesn't allow you to set default output device, so you will need a helper application to redirect all output connections to your equalizer.
    Well, i would say this is quite subjective. Untouched signal is superior to any equalized sound in my opinion, but i know this debate is never satisfying

  • Is there any way to iconify a volume control? solved

    I know how to adjust the alsa volume.
    What I'm wanting is to iconify some sort of volume control to place in the kicker panel so I don't have to open alsa up every time to adjust the volume.
    Anyone know of a way to do that?
    Shouldn't make a diff but if it does I'm using kdemod.
    Last edited by windtalker (2008-03-19 04:18:10)

    Pfft!
    I had just got done removing the kde from the original install and replacing it with kdemod.
    The original kde didn't have the mixer icon, i opened kmix up and the mixer icon popped up on the kicker.
    Cool!

  • [SOLVED] Keyboard volume control in Openbox

    Hi guys, I have been trying to get my keyboard keys control the volume in openbox. I have pnmixer installed, systray applet shows on tint2 and I also have xfce4-volumed installed from the AUR. Nothing seems to work. Any suggestions?
    Last edited by okubax (2013-05-27 07:16:43)

    okubax wrote:
    Did that, I thought it was one or the other. rc.xml way or xfce4-volumed ?
    Thanks keyboard control works now.
    Now, how to get a notification on volume change+-/mute?
    You're welcome. Glad you worked it out. Don't forget to mark your post as solved. As to the other question I am unsure. I do not use this feature. If it is something that is handled by xfce4-volumed I would think maybe installing "xfce4-notifyd" or similar may work but I don't know (assuming you're talking about some kind of osd style thing where bubbles come up on the desktop and show you stuff). Other than that no clue on my end.

  • 5.1 Option has vanished from Creative volume control...

    I have Creative's 5800 5.1 speaker system, and creative volume control on my computer. Used to be, I could just select 5.1 in the creative volume control settings and there you have it. Magically this seems to have vanished from the Speaker/headphone selection options leaving me only with 4.1 and 7.1 as options. Any idea why or how I may get the 5.1 option back?

    Managed to answer my own question if you install the creative console launcher version 2.60.29 it installs the volume panel as well and you can then install the newer version of the console launcher which will uninstall the older console launcher but leave the volume panel in place. i would say one thing though i'm surprised creative seem to have removed this usefull add-on (volume panel) installer from the newest creaitve console launcher install as i find it a far better volume control than windows and would think they would ship it with all versions of the console launcher not just the older one avaliable for [email protected]

Maybe you are looking for

  • How can I transfer photos from my macbook to my emac

    Hi, I used my Macbook while travelling and downloaded about 6000 photos. I am now home and wish to transfer part of these photos to my desk top eMac. How can i do this quickly?Thanks

  • My FaceTime constantly fails and the wifi switches to 3G by its self.

    It's been happening for awhile now. I can FaceTime from my mac just fine it only happens with my iPhone 4. I'd appreciate some help.

  • Permissions ( error -5000 )

    Im working on an xserve with several groups and users and today while organizing group privilges I ran into a snag, after propigating promissions on the main hard drive. What happend was that the group which I gave permissions to the hard drive no on

  • How to install Logic 9 (from app store) on second computer?

    Hi, I bought Logic pro in the app store and run it for now on my MacAir. I have, after successful installation, deleted the virtual intallation drive. I know it is possible and allowed to use it on my iMac as well. Question: How can I install it ther

  • How to Select Part of Video Timeline?

    I'm just starting to learn Adobe Premiere Elements 11.   Basic operations are pretty intuitive so far, but how would I select a part of a video clip timeline and cut this, so I could paste it elsewhere?