This document is a WORK IN PROGRESS.
This is just a quick personal cheat sheet: treat its contents with caution!
ALSA (The Advanced Linux Sound Architecture) is a part of the kernel that provides sound card drivers, moreover it's a software framework for high level API development.
TODO: dedicated ALSA cheat sheet
PA (PulseAudio) is a sound server that provides a lot of features on top of the low-level audio interface ALSA.
ALSA can be used alone without
PulseAudio. For applications only supporting
apulse enable ALSA to be used instead.
TODO: dedicated PulseAudio cheat sheet
TODO: dedicated JACK cheat sheet
TODO: dedicated GStreamer cheat sheet
PipeWire PipeWire is a low-level multimedia framework. It aims to offer capture and playback for both audio and video with minimal latency and support for PulseAudio, JACK, ALSA and GStreamer-based applications. TODO
TODO: dedicated PipeWire cheat sheet
On Arch Linux, installing PipeWire is as easy as:
$ sudo pacman -S pipewire pipewire-pulse pipewire-jack wireplumber $ systemctl --user start pipewire-pulse $ pactl info && echo OK || echo KO
wireplumber and not
According to Debian wiki:
pipewire-media-session are two possible session
managers for PipeWire. The one often used by default,
pipewire-media-session, is primitive,
and is best when using PipeWire just for its basic functionality like screen sharing. When
using PipeWire as your system’s sound server, the maintainer recommends installing the more
You can use PulseAudio front-ends
pulsemixer) for managing PulseAudio thanks to
Table of contents¶
In order to find your audio driver, run this command and search for the "Audio device" section:
Now, a correct kernel config is needed:
$ cd /usr/src/linux # make nconfig # or `# make menuconfig` # ALSA ###### # Double check here: <https://wiki.gentoo.org/wiki/ALSA#Kernel> # > Device Drivers ---> > <*> Sound card support # Symbol: SOUND [=y] > <*> Advanced Linux Sound Architecture ---> # Symbol: SND [=y] > [*] PCI sound devices ---> # Symbol: SND_PCI [=y] # # Here enable the driver for your audio controller ### > Device Drivers ---> > <*> Sound card support # Symbol: SOUND [=y] > <*> Advanced Linux Sound Architecture ---> # Symbol: SND [=y] > HD-Audio ---> > <*> HD Audio PCI # Symbol: SND_HDA_INTEL [=y] # # Select a codec or enable all (every option starting with "build") # and let the generic parse choose the right one: # > [*] Build ... > [*] ... > ... > -*- Enable generic HD-audio codec parser # Symbol: SND_HDA_GENERIC [=y] > > General setup ---> > [*] System V IPC # Symbol: SYSVIPC [=y] # If the system has more than 8 sound outputs (Each HDMI output on a GPU will count as one), # the max number of sound cards will need to be increased: # > Device Drivers ---> > <*> Sound card support # Symbol: SOUND [=y] > <*> Advanced Linux Sound Architecture ---> # Symbol: SND [=y] > [*] Dynamic device file minor numbers # Symbol: SND_DYNAMIC_MINORS [=y] > (32) Max number of sound cards # Symbol: SND_MAX_CARDS [=32] ###### # PA #### # Double check here: <https://wiki.gentoo.org/wiki/PulseAudio#Kernel> # And here: <https://wiki.gentoo.org/wiki/PulseAudio#Permissions> # For motherboards containing Intel HDA sound cards, use the following kernel option for # improved power-saving: # > Device Drivers ---> > <*> Sound card support # Symbol: SOUND [=y] > <*> Advanced Linux Sound Architecture ---> # Symbol: SND [=y] > (2048) Pre-allocated buffer size for HD-audio driver # Symbol: SND_HDA_PREALLOC_SIZE [=2048] # CONFIG_HIGH_RES_TIMERS is needed to avoid (snd_pcm_recover) underrun errors and degraded audio # when some applications are using PA: # > General setup ---> > Timers subsystem ---> > [*] High Resolution Timer Support # Symbol: HIGH_RES_TIMERS [=y] # PA uses udev and ConsoleKit to dynamically give access to the soundcards to the # currently "active" nr. When running Systemd this will be handled without needing ConsoleKit. # To make this possible, ACLs (Access Control Lists) are required: # > File systems ---> > Pseudo filesystems ---> > [*] Tmpfs virtual memory file system support (former shm fs) # Symbol: TMPFS [=y] > [*] Tmpfs POSIX Access Control Lists # Symbol: TMPFS_POSIX_ACL [=y] ####
After configuring the kernel don't forget to do a kernel make and rebuild!
pulseaudio to the
USE variable in your
# euse -E lm_sensors # vi /etc/portage/make.conf # check that the use flag "pulseaudio" has been append: > ... > USE="... pulseaudio" > ...
After modifying the
USE variable in your
make.conf, don't forget to update the
system using the following command so the changes take effect:
# emerge --ask
--changed-use --deep @world
alsa-utils (e.g. for
amixer and other ALSA utility tools):
Check that consolekit is installed with the
acl use flag:
pambase is installed with the "consolekit" use flag:
ConsoleKit should be running:
If ConsoleKit isn't running, enable it at boot time:
Add this command to your
.xinitrc (really necessary?):
- ALSA troubleshooting
- PulseAudio troubleshooting
- JACK troubleshooting
- GStreamer troubleshooting
- PipeWire troubleshooting
Headphone Jack not working¶
No HDMI sound¶
If you have an HDMI port but no HDMI driver appears when running
$ aplay -L (or in
then this fix might help:
Create the following script in
locale.d (see https://wiki.gentoo.org/wiki//etc/local.d):
# sudo vi /etc/locale.d/fix-hdmi-audio-with-pci-bit.start > #!/bin/sh > > setpci -s 01:00.0 0x488.l=0x2000000:0x2000000 > echo 1 > /sys/bus/pci/devices/0000:01:00.0/remove > echo 1 > /sys/bus/pci/devices/0000:00:01.0/rescan
Then make it executable and add it to OpenRC:
$ aplay -l.
Crackeling/popping/stuttering/chopping/skipping/hiccups sound issues¶
Here are a few interesting links:
Most of this kind of issues can be solved by playing with some options in
e.g. like so:
$ sudo vi /etc/pulse/daemon.conf > ... > ; resample-method = speex-float-1 > resample-method = src-sinc-best-quality > > ; realtime-scheduling = yes > realtime-scheduling = no # if disabling `tsched` like described below > ...
And/or by disabling
$ sudo vi /etc/pulse/default.pa > ... > #load-module module-udev-detect > load-module module-udev-detect tsched=0 > ...
After saving changes in those files, don't forget to stop
pulseaudio (it will restart
automatically whenever an application requires it):
If this cheat sheet has been useful to you, then please consider leaving a star here.