How to check & adjust sound volume from the command line with pipewire-pulse?

Question about checking and adjusting sound volume from the command line with PipeWire and PulseAudio. To manipulate the sound volume using the command line in a PipeWire or PulseAudio environment, you can use command-line tools such as `pactl` or `pamixer`. Here's how you can do it:


1. **Using `pactl`**:


   - To increase the volume:

     ```bash

     pactl set-sink-volume @DEFAULT_SINK@ +5%

     ```

     This command increases the volume by 5%. You can adjust the percentage as needed.


   - To decrease the volume:

     ```bash

     pactl set-sink-volume @DEFAULT_SINK@ -5%

     ```


   - To set a specific volume level (e.g., 50%):

     ```bash

     pactl set-sink-volume @DEFAULT_SINK@ 50%

     ```


2. **Using `pamixer`**:


   - `pamixer` is a dedicated command-line volume control tool for PulseAudio and PipeWire. To adjust the volume, you can use it like this:


     - Increase the volume:

       ```bash

       pamixer --increase 5

       ```


     - Decrease the volume:

       ```bash

       pamixer --decrease 5

       ```


     - Set a specific volume level (e.g., 50%):

       ```bash

       pamixer --set-volume 50

       ```


3. **Mute/Unmute**:


   - To mute or unmute the audio, you can use `pactl`:

     - Mute:

       ```bash

       pactl set-sink-mute @DEFAULT_SINK@ 1

       ```


     - Unmute:

       ```bash

       pactl set-sink-mute @DEFAULT_SINK@ 0

       ```


4. **List Available Sinks**:


   - To list available sinks and their properties, use `pactl`:

     ```bash

     pactl list sinks

     ```


   This will show information about the sinks, including the default sink, which is important for the above volume adjustment commands.


Make sure you have the necessary permissions to adjust audio settings. If you encounter any permission issues, consider running these commands with `sudo`, or add your user to relevant groups (e.g., `audio`) to grant the necessary permissions.


These commands should work for both PipeWire and PulseAudio environments, as they use the common PulseAudio client commands for sound control.

Comments

Popular posts from this blog

bad character U+002D '-' in my helm template

GitLab pipeline stopped working with invalid yaml error

How do I add a printer in OpenSUSE which is being shared by a CUPS print server?