Documentsview-and-set-an-audio-output-interface

View and Set an Audio Output Interface

List the audio outputs on your Pi, pick the default one and set its volume.

This guide covers viewing all audio output interfaces on a device, setting one as the default and setting its volume.

This applies only to players running the PulseAudio sound server, not PipeWire. To check on a Raspberry Pi, run alsamixer and look at the top-left corner. The Card and Chip details should mention PulseAudio. Press Esc to exit alsamixer.

alsamixer

See also Setting the audio volume and Audio output on 3.5mm port.

View all audio output interfaces in detail

This shows details for every audio interface on the device, including state, volume and channel data.

pacmd list-sinks

View only the index and description

This lists the Index of each interface. You need the index to change the volume or set the default interface. An asterisk next to an index marks the interface currently in use.

pacmd list-sinks | grep -e 'index:' -e 'device.description'

Set the default audio output interface

Replace <interface-index> with the index of the interface you want.

pacmd set-default-sink <interface-index>

For example, for index 7:

pacmd set-default-sink 7

Set the volume of the current audio output interface

Replace <interface-index> with the index and <volume-percentage> with the level you want.

pactl set-sink-volume <interface-index> <volume-percentage>

For example, to set index 6 to 100%:

pactl set-sink-volume 6 100%

Fix a suspended audio device

A sink can become suspended after being idle for a long time, or when it is suspended manually. In the pacmd list-sinks output the state shows as SUSPENDED.

  1. Get the device name of the current active index. For example, index 0 has the device name alsa_output.platform-107c701400.hdmi.hdmi-stereo. If a different device needs unsuspending, set it as the default first using the steps above.
  2. Run the suspend-sink command with the device name and 0. The 0 unsets the suspend-sink flag.
    pacmd suspend-sink <audio-output-device-name> 0
    pacmd suspend-sink alsa_output.platform-107c701400.hdmi.hdmi-stereo 0
    
  3. Reboot the Raspberry Pi.
    sudo reboot
    

If the device keeps suspending after being idle

  1. Change to the /etc/pulse directory.
    cd /etc/pulse
    
  2. Open default.pa with sudo.
    sudo nano default.pa
    
  3. Find the load-module module-suspend-on-idle line under this comment:
    ### Automatically suspend sinks/sources that become idle for too long
    load-module module-suspend-on-idle
    
  4. Comment the line out with #:
    ### Automatically suspend sinks/sources that become idle for too long
    #load-module module-suspend-on-idle
    
    Or let this command do it for you:
    sudo sed -i 's/^load-module module-suspend-on-idle/#load-module module-suspend-on-idle/' /etc/pulse/default.pa
    
  5. Save the file and reboot.
    sudo reboot