Current Linux Audio

dos2unix

Well-Known Member
Joined
May 3, 2019
Messages
4,408
Reaction score
4,601
Credits
41,638
Linux Audio in 2026: Real Hardware Control, Routing Transparency, and Advantages Over Windows (and Sometimes macOS)
Linux’s audio stack exposes real hardware controls — device gain, DSP blocks, channel routing, and multichannel layouts — in ways Windows typically does not unless the vendor ships a full driver suite. macOS still has the most consistent pro‑audio stack (CoreAudio), but Linux beats both Windows and macOS in hardware transparency and user‑accessible routing.
Below is a clean explanation of concepts like volume vs gain, devices vs sinks, channels, the pw-* vs wp-* naming, plus a thorough troubleshooting section with practical commands.

Windows/macOS vs Linux (practical differences you’ll notice)
Windows
• Generic USB Audio drivers often expose only master volume (software attenuation).
• Device‑specific gain/mixer/DSP is hidden unless the vendor ships a full driver/control panel.
• Multichannel routing depends heavily on vendor drivers; updates can break ASIO/WASAPI chains.
macOS
• CoreAudio is stable and consistent; pro audio vendors target it first.
• Device routing is solid, but deep hardware mixer controls are not usually exposed to the user.
• Great for DAWs and plugins, less transparent at the hardware mixer level than Linux.
Linux (ALSA → PipeWire)
• ALSA reads class‑compliant descriptors and exposes actual hardware controls (gain, EQ/DSP, routing).
• PipeWire provides modern routing with per‑app steering and virtual nodes.
• You can reach the hardware mixer directly when you need engineer‑level control.
Volume vs Gain (and why Linux does this better)
Windows “volume” is software attenuation. It lowers the PCM level before it hits the device. If the device’s internal gain is hot (typical for some USB speakers/DACs), tiny changes like 3% → 6% → 12% feel huge. You also lose dynamic range at very low levels.
Linux exposes hardware gain when the device provides it. ALSA surfaces the control, and PipeWire allows you to use both the software volume and the device’s hardware gain. Result: smoother control, preserved dynamics, and no “3% is already too loud” problem.
Quick checks:
Code:
wpctl status         # View current sinks/devices/streams/defaults
alsamixer -c 1       # Adjust hardware gain for device #1 (use your card #)
qasmixer             # GUI for ALSA hardware mixer, EQ, routing (if exposed)
Devices, Sinks, Profiles, Channels — what these words actually mean
Device
• The actual ALSA hardware card (onboard, USB speakers, Sound Blaster AE‑5).
• Examples: hw:0, hw:1, hw:2
Profile
• The speaker layout/mode: stereo, 5.1, 7.1, SPDIF, HDMI, etc.
• Selected on the card (affects which sinks get created).
Sink
• A PipeWire output node created by the session manager (WirePlumber).
• Apps send audio to a sink, not directly to the hardware.
Channel (hardware routing)
• The individual hardware output paths: front, rear, center, LFE, side, etc.
• Controlled by ALSA mixer/DSP; not fully exposed via PipeWire GUIs yet.

Code:
Application Audio Streams
│
▼
PipeWire Sink (software output)
│
▼
PipeWire Profile (2.0 / 5.1 / 7.1 / SPDIF)
│
▼
ALSA Hardware Device (the actual sound card)
│
▼
Hardware Mixer / DSP / Channel Routing (front/rear/center/LFE)
This is why you can easily change the sink with wpctl, but still need ALSA tools for real hardware channels and DSP.
pw-* vs wp-* (and why the letters look “reversed”)
PipeWire shipped first, so its developer/diagnostic tools use “pw-*”:
• pw-top, pw-cli, pw-dump, pw-mon, pw-cat
WirePlumber (the PipeWire session manager) came later, and its user control tools use “wp-*”:
• wpctl, wpexec, wp-info
pw = PipeWire
wp = WirePlumber
So the letters aren’t random — they reflect which layer you’re talking to.
Useful commands (daily driver set)
Discover devices, sinks, streams:
Code:
wpctl status
pw-top
aplay -l
Set the speaker layout/profile:
Code:
pactl list cards short
pactl set-card-profile 1 output:analog-surround-51
Move a running app to a specific sink:
Code:
wpctl move-sink
Change default sink:
Code:
wpctl set-default
Hardware‑level mixer/DSP (AE‑5 and similar):
Code:
alsamixer -c <card#>
qasmixer
Troubleshooting PipeWire audio (common problems and quick fixes)
How to check which sink you’re using
Code:
wpctl status
Look under “Audio → Sinks”. The sink with a “*” is the current default output. Note the numeric ID for use with wpctl commands.
How to change the active sink (switch devices)
Code:
wpctl status
wpctl set-default
If an app is already playing and you want to move only that stream:
Code:
wpctl move-sink
How to check ALSA hardware cards (card numbering)
Code:
aplay -l
You’ll see something like:
• card 0: onboard
• card 1: USB DAC/speakers
• card 2: Sound Blaster AE‑5
Use those indices with alsamixer/qasmixer:
Code:
alsamixer -c 2
qasmixer
“Everything is stuck in stereo” (enable 5.1/7.1 profiles)
Code:
pactl list cards short
pactl set-card-profile <card#> output:analog-surround-51
or:
pactl set-card-profile <card#> output:analog-surround-71
Re‑check sinks:
Code:
wpctl status
You should now see sinks like:
• alsa_output.pci-0000_11_00.3.analog-surround-51
“Rear/center/LFE not working” (ALSA channel routing)
PipeWire sets the profile, but per‑channel toggles are in ALSA:
Code:
alsamixer -c <card#>
Look for controls like:
• Front/Rear/Center/LFE Playback
• Surround Volume
• Channel Mode
• PCM Send to Rear
• Digital Output (if SPDIF/HDMI is involved)
GUI alternative:
Code:
qasmixer
“Audio is coming out of HDMI instead of my speakers”

Find the sink you want:

Code:
wpctl status

Set it as default:

Code:
wpctl set-default
If the desktop keeps auto‑selecting HDMI on login, disable or adjust auto‑routing via WirePlumber policy. One approach is to add or modify a policy script under:
Code:
~/.config/wireplumber/main.lua.d/
(Policy file names and contents vary by distro/version; the goal is to prefer your analog sink over HDMI.)
“My USB DAC/speakers are too loud at 5% volume”
Use ALSA to lower hardware gain first:
Code:
alsamixer -c <usb_card#>
Look for:
• Speaker Gain
• Output Amplifier
• PCM
If no hardware gain exists, consider a software limiter as a last resort (exact module names vary by distro; LADSPA/LV2 limiter plugins can be loaded via the PulseAudio compatibility layer).
“PipeWire isn’t running” (or audio disappeared after a crash)
Code:
systemctl --user status pipewire
systemctl --user start pipewire
systemctl --user enable pipewire
systemctl --user restart wireplumber
“Wrong profile / No 5.1 until I reboot” (clear session cache)
Code:
systemctl --user stop wireplumber
rm -rf ~/.local/state/wireplumber
systemctl --user start wireplumber
Quick decision hints: ALSA vs PipeWire vs WirePlumber
Code:
Glitches / crackles → PipeWire or kernel scheduling
Routing wrong → WirePlumber policy / default sink
Channels wrong (rear/center/LFE) → ALSA mixer/DSP
Device not detected → ALSA / USB subsystem
App can’t switch devices → choose the correct sink (wpctl move-sink)
Multichannel layouts missing → set profile with pactl
wpctl status: fast overview of “what is what, and what is being used”
wpctl status gives a human‑friendly snapshot of sinks, sources, clients, and devices. It’s a great first step in any troubleshooting session.
Run:
Code:
wpctl status
Example output:
Code:
Sinks:

62  alsa_output.pci-0000_0a_00.4.ae5-hifi
47  alsa_output.usb-Behringer_USB50.stereo

Sources:
90  alsa_input.pci-0000_0a_00.4.ae5-mic
51  alsa_input.usb-Logitech_Webcam.mono
Clients:
112  firefox
118  pipewire-pulse
121  obs
Devices:
0  pci-0000_11_00.3
1  usb-Behringer_USB50
2  pci-0000_0a_00.4
Notes:
• The “*” marks the current default sink.
• IDs can be used with wpctl to move streams or set defaults.
• If sound is going to the wrong place, this makes it obvious immediately.
Quick flowchart: fix sound in 10 seconds
Code:
No sound?
→ wpctl status

If default sink is wrong → wpctl set-default
If app stream on wrong sink → wpctl move-sink



Still wrong device list?
→ aplay -l (confirm hardware seen by ALSA)
→ systemctl --user restart wireplumber


Stuck in stereo?
→ pactl list cards short
→ pactl set-card-profile <card#> output:analog-surround-51


Rear/center/LFE silent?
→ alsamixer -c <card#> (enable channels / adjust hardware mixer)


Random HDMI hijack?
→ wpctl set-default
→ adjust WirePlumber policy (prefer analog over HDMI)


Too loud at tiny volumes?
→ alsamixer -c <usb_card#> (lower hardware gain if available)


Cheat sheet (copy/paste essentials)
Code:
See sinks/devices/streams/defaults
wpctl status
Change default sink
wpctl set-default
Move one running app/stream to a sink
wpctl move-sink
Inspect ALSA devices (card numbers)
aplay -l
Set 5.1/7.1 profile on a card
pactl list cards short
pactl set-card-profile <card#> output:analog-surround-51
pactl set-card-profile <card#> output:analog-surround-71
Hardware mixer/DSP (per‑channel, EQ, gain)
alsamixer -c <card#>
qasmixer
Live graph/debug
pw-top
If things go sideways
systemctl --user restart wireplumber
Closing notes
Linux treats audio devices like real instruments, not black boxes. ALSA exposes the true hardware — gain, channel routing, EQ/DSP — and PipeWire makes everyday routing simple and per‑app controllable. If you remember the key distinctions (device vs profile vs sink vs channel), and keep wpctl/alsamixer/qasmixer handy, you’ll fix 90% of problems in under a minute — and enjoy better control than most vendor control panels on other platforms.
 
Last edited:


I've visted about a dozen recording studios here in the PNW. (Thats really a small sampling, as I understand there are almost 100). But even so, 8 of the were MacOS based. 4 were Linux, and none were Windows.

The fact is Linux currently has a MUCH better audio stack than Windows.
 
@dos2unix , thanks for post #1. I think that where it refers to "pwstatus", it looks like that is a command in the text, but the command:
wpctl status may be the appropriate one since there is actually no "pwstatus" command that I could find, but wpctl status does provide the info as mentioned later in the post.
 
@dos2unix :-

I'm getting a wee bit confused here, Ray. We start off explaining the distinction between Pipewire & Wireplumber; OK, I get this, 'cos these two are now being used by most mainstream distros....and lots of references to ALSA (which, as we know, sits at the bottom of everything else & communicates with the hardware directly).

Then, halfway through, we start getting references to 'pactl'. As I understand it, this is PulseAudio, yes?

Do I infer from this that all 3 are interchangeable, and can be used together in any combination? Or does Pipewire sit on top of Pulse, just as Pulse sits on top of ALSA? Some "clarification" would be appreciated here. Thanks.

(Understandable, too, is the unspoken assumption that the users's system is automatically using systemd by default.....Puppy uses its own highly-customised SysVinit.)

?????

I partly ask, because until fairly recently Puppy has always been pure ALSA-only.....most of this other stuff is still a mystery to me..!


Mike. o_O
 
Last edited:
Then, halfway through, we start getting references to 'pactl'. As I understand it, this is PulseAudio, yes?

Do I infer from this that all 3 are interchangeable, and can be used together in any combination? Or does Pipewire sit on top of Pulse, just as Pulse sits on top of ALSA? Some "clarification" would be appreciated here. Thanks.

You are correct. However pipewire can't do everything yet, my point was, you still need some PA tools to do some things.

For example, I can use the pipewire tools to select my device, and my sink.
But PW doesn't yet have the ability to slect channels on individual hardware devices, for example
I have to use pactl, to select front, back, center, bass channels on my soundblaster.
 
Last edited:
“Audio is coming out of HDMI instead of my speakers”

Find the sink you want:

Code:
wpctl status

Set it as default:

Code:
wpctl set-default
If the desktop keeps auto‑selecting HDMI on login, disable or adjust auto‑routing via WirePlumber policy. One approach is to add or modify a policy script under:
Code:
~/.config/wireplumber/main.lua.d/
An extremely useful post - thanks.
I have this problem on a mini PC currently running LMDE7. However, I don't have ~/.config/wireplumber/main.lua.d/, I don't have a wireplumber folder. I also don't have lua installed. (This really is just a basic install, with few additions)
I can get lua, of course but can you give an example entry for main.lua.d?
Could I also just add an entry to ~/.profile or ~./.bashrc like 'wpctl set-default 51'?
My system doesn't only default to HDMI on startup, it will also switch back after a suspend.
Thanks
 
Not all distro's use pipewire.

what is output of...

systemctl --user status pipewire

or

systemctl --user status pipewire-pulse

if those dont work.. try..

systemctl --user status pulseaudio

and...

pactl info | grep "Server Name"

also.. this usually works..

ps -e | grep -E "pipewire|pulseaudio"
 
After a little more research --

LMDE7 is a weird corner case because it uses PipeWire by default, but it does NOT ship WirePlumber anymore.
Debian 12/LMDE7 switched to PipeWire + pipewire-media-session, which means:

There is no ~/.config/wireplumber/
There is no main.lua.d/
You do not need Lua at all
All the guides referencing WirePlumber configs don’t apply
This also explains why your system keeps flipping back to HDMI on boot and after suspend — pipewire-media-session is very primitive compared to WirePlumber.

adding a command to your shell startup won’t work, because audio initializes before you log in.

However you can try this.

wpctl set-default 51

(51 = whatever the device is)
 


Follow Linux.org

Members online


Top