Results 1 to 2 of 2

Thread: Pulseaudio command to turn up / down volume via terminal

  1. #1
    Join Date
    Aug 2006
    Location
    Madrid (Spain)
    Beans
    160
    Distro
    Kubuntu 10.04 Lucid Lynx

    Pulseaudio command to turn up / down volume via terminal

    Hi,

    I have two sound cards and I use LIRC to control music, videos, ...

    Since I use pulseaudio I cannot use the remote control to turn up volume to both sound cards at the same time.
    I used the following command to turn up volume and have a notification of the volume

    Code:
    amixer -set Master 7%+; notify-send -i /usr/share/pixmaps/gnome-logo-icon.png -t 1000 "`amixer -c 1 sget Master | tail -2 | cut --delimiter=" "  --fields=6 | tail -1` volumen"
    Now, the only way to turn up volume to both sound card that I know is:


    Code:
    amixer -c 0 set Master 7%+; amixer -c 1 set Master 7%+; notify-send -i /usr/share/pixmaps/gnome-logo-icon.png -t 1000 "`amixer -c 0 sget Master | tail -2 | cut --delimiter=" "  --fields=6 | tail -1` volumen card 0"; notify-send -i /usr/share/pixmaps/gnome-logo-icon.png -t 1000 "`amixer -c 1 sget Master | tail -2 | cut --delimiter=" "  --fields=6 | tail -1` volumen card 1"
    Is there any way to use a terminal command to turn up/down volume in Master/PCM to both sound card in one way?
    I use also pavucontrol to redirect sound between programs and sound cards.

    Thanks in advance.
    Best regards
    Software Libre, Ubuntu y mucho más en habla hispano en http://magarto.com/

  2. #2
    Join Date
    Oct 2010
    Location
    Dayton, Ohio
    Beans
    75
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Pulseaudio command to turn up / down volume via terminal

    I was using this up until... well, today. Unfortunately, using the ALSA mixer causes problems when you're dealing with multiple sinks in PulseAudio.

    I'm using a ruby script that actually changes all sinks at the same time - which comes in handy when you've suddenly started using an external USB speaker and all your keybound scripts work with only one sink.

    I can't take credit for most of it - I forked and tweaked it a tiny bit. The original script is here: https://gist.github.com/814634; I couldn't get it to run because of something in the muting code, so I fixed that and added in some output in case someone wants to send it to notify-osd or somesuch. Mine's at: https://gist.github.com/1791270.
    I inject people with radioactive stuff for a living. But only to serve the forces of good.
    webpage | blog

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •