audio - bunnyamin/bunnix GitHub Wiki
| Command | Example |
|---|---|
| List all soundcards | $ cat /proc/asound/cards |
| List platback hardware devices | $ aplay --list-devices |
| List programs using sound drivers | $ fuser -v /dev/snd/* |
| List sound PCI devices | $ lspci | grep -i audio |
| List soundcard codecs | $ cat /proc/asound/<CARD>/codec* | grep Codec |
| Loaded sound drivers | $ /sbin/lsmod | grep snd |
| Command | Example |
|---|---|
| Restart | alsactl restore |
| File | Comment |
|---|---|
/etc/modprobe.d/alsa-base.conf |
|
/etc/asound.conf |
Generic user configuration. |
~/.asoundrc |
Specefic user configuration. |
Amplify the sound in order to increase the maximal sound level if it is perceived as too low.
Added the following code to ~/.asoundrc and closed Alsa mixer and any program
that use audio, whereafter restarting Alsa and then the Alsa mixer the new
"pre-amp" controller was available. That is, no reboot was required.
pcm.!default {
type plug
slave.pcm "softvol"
}
pcm.softvol {
type softvol
slave {
pcm "dmix"
}
control {
name "Pre-Amp"
card 0
}
min_dB -5.0
max_dB 20.0
resolution 6
}
Verfiy playback from device.
# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC887-VD Analog [ALC887-VD Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 9: HDMI 3 [HDMI 3]
Subdevices: 1/1
Subdevice #0: subdevice #0
aplay -D plughw:<CARD>,<DEVICE> /usr/share/sounds/alsa/Noise.wav
Start server as systemctl service:
-
systemctl --user enable --now pipewireIt may take a minute or so before taking effect.
/sub/user/sub/.config/pipewire/pipewire.conf
- Have not tried: default.configured.audio.sink = { "name": "your_device_name" }
~/.config/pulse//etc/pulse/
Change the Profile for onboard audio from "Analog Stereo Duplex" to "Analaog Stereo Output".
-
Ensure that the RTP module is installed for Pulseaudio on server and client.
-
On server, copy
/etc/pulse/default.pato~/.config/pulse/from where to stream audio.- Add
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;192.168.0.0/16in~/.config/pulse/default.pa. - Use
auth-anonymous=trueto allow access from everywhere. - If neither authorization method is assigned then pulseaudio defaults to the use of
~/.config/pulse/cookie, which must be the same on clients and server. - Pulseaudio is automatically started through the
pulseaudio.socket, control usingsystemctl --user status pulseaudio. - Verify that Pulseaudio is listining to port.
- If server inside qemu: forward port
<HOST PORT>to<VM PORT> - If behind a firewall, open
<HOST PORT>.
- Add
-
On client, copy
/etc/pulse/client.confto~/.config/pulse/from where to connect to server.- Uncomment and assign server IP or hostname
default-server = <SERVER:PORT>192.168.2.101:4999. - Query connection to server with with
pactl -s <SERVER IP>:<SERVER PORT> info.
- Uncomment and assign server IP or hostname
pacmd list-cardspacmd list-sinks
| Event | Error | Cause | Consequence | Remedy |
|---|---|---|---|---|
| Distortion, crackling reverb echo | The sound driver cannot handle the PulseAudio timer-based scheduling, which allows for better latency management and reduced CPU usage. | |||
| No sound | Unknown, "glitch"? | |||
pactl info |
Connection failure: Connection refused |
Invalid configuration files. | Cannot start pulseaudio. | Remove configuration files in ~/.config/pulse/*. |
systemctl start --user pulseaudio |
... stat('/etc/pulse/default.pa.d'): No such file or directory |
The directory is missing. | No identified consequences. | mkdir -p /etc/pulse/default.pa.d |