CachyOS Audio Configuration - ryzendew/Linux-Tips-and-Tricks GitHub Wiki

CachyOS Audio Configuration Guide

Complete beginner-friendly guide to audio configuration on CachyOS, including PulseAudio, PipeWire, ALSA, and troubleshooting audio issues.


Table of Contents

  1. Understanding Linux Audio
  2. PulseAudio Configuration
  3. PipeWire Configuration
  4. ALSA Configuration
  5. Audio Device Management
  6. Troubleshooting Audio Issues
  7. Advanced Configuration

Understanding Linux Audio

Linux Audio Stack

Linux audio uses multiple layers:

  1. ALSA (Advanced Linux Sound Architecture)
  • What it is: Low-level audio driver
  • What it does: Direct communication with sound hardware
  • Level: Kernel level (closest to hardware)
  1. PulseAudio or PipeWire
  • What it is: Sound server (audio manager)
  • What it does: Manages audio streams, mixing, routing
  • Level: User level (application interface)
  1. Applications
  • What it is: Programs you use (browser, music player, etc.)
  • What it does: Produces audio
  • Level: Application level

How it works:

Application → PulseAudio/PipeWire → ALSA → Hardware

What each layer does:

  • Application: Produces audio (music, video, game sounds)
  • PulseAudio/PipeWire: Mixes multiple audio sources, routes to correct device
  • ALSA: Sends audio to actual sound hardware
  • Hardware: Speakers, headphones, etc.

PulseAudio vs PipeWire

PulseAudio:

  • What it is: Traditional sound server
  • Status: Mature, stable, widely used
  • Features: Audio mixing, routing, network audio
  • Default on: Most Linux distributions

PipeWire:

  • What it is: Modern replacement for PulseAudio
  • Status: Newer, actively developed
  • Features: Better low latency, video support, screen sharing
  • Default on: Some newer distributions (including some CachyOS setups)

Which to use:

  • PulseAudio: Stable, works everywhere, good for most users
  • PipeWire: Better for low latency, modern features, future-proof

CachyOS default:

  • May vary by desktop environment
  • Can switch between them
  • Both work well

PulseAudio Configuration

What is PulseAudio?

PulseAudio is a sound server that manages audio on Linux.

What it does:

  • Audio mixing: Combines multiple audio sources
  • Device management: Routes audio to correct device
  • Volume control: System-wide volume management
  • Network audio: Stream audio over network

Why it's needed:

  • Multiple applications: Can play audio simultaneously
  • Device switching: Easy to switch between speakers/headphones
  • Volume control: System-wide volume management
  • Better than ALSA alone: Easier to use, more features

Installing PulseAudio

Check if installed:

pacman -Q pulseaudio

Install PulseAudio:

sudo pacman -S pulseaudio pulseaudio-alsa pulseaudio-bluetooth

What these packages do:

  • pulseaudio: Main PulseAudio server
  • pulseaudio-alsa: ALSA compatibility layer
  • pulseaudio-bluetooth: Bluetooth audio support

Start PulseAudio:

# Start PulseAudio service
pulseaudio --start

# Or enable for user session
systemctl --user enable --now pulseaudio.service

What this does:

  • Starts PulseAudio server
  • Enables audio system
  • Makes audio available to applications

Using PulseAudio

Command Line Tools

Check if PulseAudio is running:

pulseaudio --check -v

What this does:

  • Checks if PulseAudio is running
  • -v: Verbose output (shows details)

List audio devices:

pactl list short sinks

What this does:

  • Lists available audio output devices
  • Shows device names and IDs
  • Sinks: Output devices (speakers, headphones)

Example output:

0	alsa_output.pci-0000_00_1f.3.analog-stereo	module-alsa-card.c	s16le 2ch 48000Hz	SUSPENDED
1	alsa_output.usb-0bda_4014-00.analog-stereo	module-alsa-card.c	s16le 2ch 48000Hz	IDLE

What this means:

  • 0, 1: Device IDs
  • alsa_output...: Device name
  • SUSPENDED/IDLE: Device status

List audio sources (microphones):

pactl list short sources

What this does:

  • Lists available audio input devices
  • Shows microphones and input devices
  • Sources: Input devices (microphones, line-in)

Set default output device:

pactl set-default-sink sink-name

What this does:

  • Sets default audio output
  • All audio goes to this device
  • sink-name: Device name from pactl list short sinks

Example:

pactl set-default-sink alsa_output.pci-0000_00_1f.3.analog-stereo

Set volume:

pactl set-sink-volume @DEFAULT_SINK@ 50%

What this does:

  • Sets volume to 50%
  • @DEFAULT_SINK@: Default output device
  • Can use 0-100% or 0-65536 (0-100%)

Mute/unmute:

# Mute
pactl set-sink-mute @DEFAULT_SINK@ 1

# Unmute
pactl set-sink-mute @DEFAULT_SINK@ 0

What this does:

  • 1: Mute
  • 0: Unmute

GUI Tools

pavucontrol (PulseAudio Volume Control):

sudo pacman -S pavucontrol

What this does:

  • Installs graphical audio control
  • Easy-to-use interface
  • Manage all audio settings

Launch:

pavucontrol

Features:

  • Output Devices: Switch between speakers/headphones
  • Input Devices: Select microphone
  • Playback: Control individual application volumes
  • Recording: Control recording sources
  • Configuration: Device settings

pavucontrol tabs:

  • Playback: Control application volumes
  • Recording: Control recording sources
  • Output Devices: Select output device
  • Input Devices: Select input device
  • Configuration: Device settings

PulseAudio Configuration

Configuration directory:

~/.config/pulse/

Main config file:

~/.config/pulse/default.pa

Edit configuration:

nano ~/.config/pulse/default.pa

Common settings:

  • Default device
  • Sample rate
  • Buffer size
  • Network audio

After editing:

# Restart PulseAudio
pulseaudio -k
pulseaudio --start

What this does:

  • -k: Kill PulseAudio
  • --start: Start PulseAudio (loads new config)

PipeWire Configuration

What is PipeWire?

PipeWire is a modern replacement for PulseAudio and JACK.

What it does:

  • Audio management: Like PulseAudio
  • Video support: Screen sharing, video capture
  • Low latency: Better for professional audio
  • JACK compatibility: Works with JACK applications

Advantages:

  • Lower latency: Better for real-time audio
  • Video support: Screen sharing built-in
  • Modern: Actively developed
  • Future-proof: Becoming standard

Installing PipeWire

Install PipeWire:

sudo pacman -S pipewire pipewire-pulse pipewire-alsa pipewire-jack

What these packages do:

  • pipewire: Main PipeWire server
  • pipewire-pulse: PulseAudio compatibility
  • pipewire-alsa: ALSA compatibility
  • pipewire-jack: JACK compatibility

Remove PulseAudio (if switching):

sudo pacman -Rns pulseaudio pulseaudio-alsa

Start PipeWire:

# Start PipeWire service
systemctl --user enable --now pipewire.service pipewire-pulse.service

What this does:

  • Enables PipeWire for user session
  • Starts PipeWire server
  • Starts PulseAudio compatibility layer

Restart services:

systemctl --user restart pipewire pipewire-pulse

Using PipeWire

PipeWire uses same commands as PulseAudio:

  • pactl: Works the same
  • pavucontrol: Works the same
  • Applications: Work the same

Check if PipeWire is running:

pactl info | grep "Server Name"

Example output:

Server Name: PulseAudio (on PipeWire 0.3.xx)

What this means:

  • PipeWire is running
  • PulseAudio compatibility is active
  • Applications see it as PulseAudio

List devices:

pactl list short sinks
pactl list short sources

Same commands as PulseAudio - works identically.

PipeWire Configuration

Configuration directory:

~/.config/pipewire/

Config files:

  • pipewire.conf: Main configuration
  • pipewire-pulse.conf: PulseAudio compatibility

Edit configuration:

nano ~/.config/pipewire/pipewire.conf

Common settings:

  • Sample rate
  • Buffer size
  • Latency settings

After editing:

systemctl --user restart pipewire pipewire-pulse

ALSA Configuration

What is ALSA?

ALSA (Advanced Linux Sound Architecture) is the low-level audio driver.

What it does:

  • Hardware communication: Direct access to sound hardware
  • Driver layer: Kernel-level audio drivers
  • Foundation: PulseAudio/PipeWire use ALSA

When to use ALSA:

  • Troubleshooting: Check if hardware works
  • Direct access: Some applications use ALSA directly
  • Low-level: Advanced audio configuration

ALSA Tools

Install ALSA tools:

sudo pacman -S alsa-utils alsa-tools

What these packages do:

  • alsa-utils: ALSA utilities (alsamixer, aplay, etc.)
  • alsa-tools: Advanced ALSA tools

List sound cards:

aplay -l

What this does:

  • Lists ALSA sound devices
  • Shows card numbers and names
  • Cards: Sound hardware devices

Example output:

**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

What this means:

  • card 0: First sound card
  • PCH: Card name (Intel audio chip)
  • device 0: First device on card
  • ALC892 Analog: Device name

Test audio:

speaker-test -c 2

What this does:

  • Tests speakers
  • -c 2: Stereo (2 channels)
  • Plays test tones

Control volume (alsamixer):

alsamixer

What this does:

  • Opens ALSA mixer (text interface)
  • Control volume levels
  • Navigate with arrow keys

alsamixer controls:

  • Arrow keys: Navigate
  • Up/Down: Adjust volume
  • M: Mute/unmute
  • Esc: Exit

ALSA Configuration

Configuration file:

/etc/asound.conf

Or user config:

~/.asoundrc

Edit configuration:

sudo nano /etc/asound.conf

Common settings:

  • Default device
  • Sample rate
  • Channel configuration

Audio Device Management

Switching Audio Devices

List available devices:

pactl list short sinks

Set default device:

pactl set-default-sink device-name

Using pavucontrol:

  1. Open pavucontrol
  2. Go to Output Devices tab
  3. Click device you want
  4. Click Set as fallback

Bluetooth Audio

Install Bluetooth audio support:

# For PulseAudio
sudo pacman -S pulseaudio-bluetooth

# For PipeWire
sudo pacman -S pipewire-pulse

Connect Bluetooth device:

bluetoothctl

In bluetoothctl:

power on
scan on
pair [device MAC]
connect [device MAC]

What this does:

  • power on: Turn on Bluetooth
  • scan on: Scan for devices
  • pair: Pair with device
  • connect: Connect to device

After connecting:

  • Device should appear in pactl list short sinks
  • Set as default if needed

Multiple Audio Devices

Use multiple devices simultaneously:

  • Each application can use different device
  • Configure in pavucontrol
  • Or use pactl commands

Example:

# Set application to specific device
pactl move-sink-input input-id sink-name

What this does:

  • Moves application audio to specific device
  • input-id: Application audio stream ID
  • sink-name: Target device

Troubleshooting Audio Issues

No Sound

Check if audio service is running:

# PulseAudio
pulseaudio --check -v

# PipeWire
systemctl --user status pipewire

Restart audio service:

# PulseAudio
pulseaudio -k
pulseaudio --start

# PipeWire
systemctl --user restart pipewire pipewire-pulse

Check if device is muted:

pactl list sinks | grep -A 15 "Sink #"

Unmute:

pactl set-sink-mute @DEFAULT_SINK@ 0

Check volume:

pactl list sinks | grep "Volume:"

Set volume:

pactl set-sink-volume @DEFAULT_SINK@ 100%

Wrong Device Selected

List devices:

pactl list short sinks

Set correct device:

pactl set-default-sink device-name

Or use pavucontrol:

  • Open pavucontrol
  • Go to Output Devices
  • Select correct device
  • Set as fallback

Audio Stuttering/Crackling

Increase buffer size:

# Edit PulseAudio config
nano ~/.config/pulse/daemon.conf

Add:

default-fragments = 4
default-fragment-size-msec = 25

Restart PulseAudio:

pulseaudio -k
pulseaudio --start

For PipeWire:

# Edit PipeWire config
nano ~/.config/pipewire/pipewire.conf

Adjust buffer settings:

  • Increase buffer size
  • Adjust sample rate

Microphone Not Working

List input devices:

pactl list short sources

Set default input:

pactl set-default-source source-name

Check if muted:

pactl list sources | grep -A 10 "Source #"

Unmute microphone:

pactl set-source-mute @DEFAULT_SOURCE@ 0

Test microphone:

# Record test
arecord -d 5 test.wav

# Play back
aplay test.wav

Application-Specific Issues

Application not playing audio:

  • Check application volume in pavucontrol
  • Check if application is muted
  • Restart application

Application using wrong device:

  • Configure in pavucontrol
  • Or use pactl move-sink-input

Advanced Configuration

Network Audio

PulseAudio network audio:

# Enable network module
pactl load-module module-native-protocol-tcp

What this does:

  • Enables network audio streaming
  • Allows audio over network
  • Useful for remote audio

Low Latency Configuration

PipeWire low latency:

# Edit config
nano ~/.config/pipewire/pipewire.conf

Adjust settings:

  • Reduce buffer size
  • Lower latency settings
  • Adjust sample rate

Restart:

systemctl --user restart pipewire pipewire-pulse

Professional Audio (JACK)

Install JACK:

sudo pacman -S jack2

With PipeWire:

  • PipeWire provides JACK compatibility
  • Use pipewire-jack package

Start JACK:

jack_control start

Additional Resources


Summary

This guide covered:

  1. Understanding Linux audio - Audio stack and layers
  2. PulseAudio - Traditional sound server
  3. PipeWire - Modern sound server
  4. ALSA - Low-level audio driver
  5. Audio device management - Switching devices, Bluetooth
  6. Troubleshooting - Common audio issues
  7. Advanced configuration - Network audio, low latency, JACK

Key Takeaways:

  • Linux audio uses multiple layers (ALSA → PulseAudio/PipeWire → Applications)
  • PulseAudio is traditional, PipeWire is modern
  • Use pactl and pavucontrol to manage audio
  • Check if service is running if audio doesn't work
  • Verify device selection and volume levels
  • Both PulseAudio and PipeWire work well on CachyOS

This guide is based on the CachyOS Wiki and Arch Linux Wiki and expanded with detailed explanations for beginners. For the most up-to-date audio configuration information, always refer to the official documentation.