Announcement

Collapse
No announcement yet.

How to control system volume from terminal

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] How to control system volume from terminal

    After much searching about pulse and alsa audio I am totally confused about how to change the audio volume in Kubuntu 18.04.01 from the terminal. Can anybody point me in the right direction please.

    #2
    From Ask Ubuntu - it works well here.
    Using pactl: you can set the volumes for a specific device as follows:
    You can use percents or integers, but the integers are slow and may not be your thing. And if you have more than one audio card you'll have to figure out the # of the card you want to control if only one card is in the machine it should be 0.

    pactl set-sink-volume 0 +10%
    This makes the volume 10% up. If you want it 10% down:

    pactl set-sink-volume 0 -10%
    If you need the volume at 50%:

    pactl set-sink-volume 0 50%
    If you need to rock the entire place:

    pactl set-sink-volume 0 150%

    pactl/pacmd (unlike amixer) allows to increase volume over 100% :-).
    Hope that's of help. You can always install alsa mixer that will give you a volume control you can use in the terminal but it won't allow the 150% volume PA does.
    Last edited by kc1di; Sep 15, 2018, 08:20 AM.
    Dave Kubuntu 20.04 Registered Linux User #462608

    Wireless Script: http://ubuntuforums.org/showthread.p...5#post12350385

    Comment


      #3
      kc1di, you are indeed a wonderful human being. I was successful in changing the volume from my keyboard. As an aside I only have the built-in-to-the-cpu sound card but i need to specify card number 1.

      Comment


        #4
        Originally posted by shag00 View Post
        As an aside I only have the built-in-to-the-cpu sound card but i need to specify card number 1.
        I found somewhere (an Arch wiki I think) to use @DEFAULT_SINK@ for the sink index:
        Code:
        pactl set-sink-volume @DEFAULT_SINK@ +5%%
        If your default sink might change on occasion, this might be better. If the default sink is not what you want, it can be set in either ~/.config/pulse/default.pa or /etc/pulse/default.pa.
        Regards, John Little

        Comment


          #5
          jlittle, thanks for your response, what I did to cover all my bases was to find out how many "cards" I had and set the volume for all of them:
          Code:
          pactl set-sink-volume 0 50%
          pactl set-sink-volume 1 50%

          Comment


            #6
            Glad it worked for you, Enjoy
            Dave Kubuntu 20.04 Registered Linux User #462608

            Wireless Script: http://ubuntuforums.org/showthread.p...5#post12350385

            Comment

            Working...
            X