-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot.asoundrc
115 lines (102 loc) · 2.93 KB
/
dot.asoundrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Seems reasonable quality, low CPU usage
defaults.pcm.rate_converter "speexrate_medium"
# Check that e.g. ut2004 still works, if default is redefined.
# Flash, etc. use this "default" entry.
pcm.!default {
type plug
# Would need to always output to all 6 channels, so the dmixer actually works if e.g. 6-channel is attempted to be started, while 2-channel is playing.
slave.pcm "dmixed"
hint.description "Dmix Audio"
# slave.pcm "jack"
# hint.description "Jack Audio"
}
pcm.dmixed {
type asym
playback.pcm {
# See plugin:dmix at http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html
type dmix
# Don't block other users, e.g. the Timidity midi-player daemon
# http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html
ipc_key_add_uid true
ipc_key 5678293
ipc_perm 0660
ipc_gid audio
# Don't put the rate here! Otherwise it resets the rate & channels set below, as shown by: cat /proc/asound/card0/pcm0p/sub0/hw_params
slave {
# 2 for stereo, 6 for surround51, 8 for surround71
channels 2
pcm {
# mplayer chooses S32_LE, but others usually S16_LE
#format S32_LE
format S16_LE
# 44100 or 48000
# 44100 for music, 48000 is compatible with most h/w
#rate 44100
rate 48000
# http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html
# Maybe helps
nonblock true
type hw
card 1
device 1
subdevice 0
}
# mplayer2 chooses 1024
# period_size 512 with buffer_size 16384 stops crackling in xmame
# 320 breaks flash - https://bbs.archlinux.org/viewtopic.php?id=129458
#period_size 512
period_size 1024
#period_size 512
# 4096 might make sound crackle
# mplayer2 chooses 8192. Half-Life 2 chooses 16384.
# If too large, use CONFIG_SND_HDA_PREALLOC_SIZE=2048
buffer_size 8192
}
}
# apulse (a cut-down replacement for pulseaudio) needs dsnoop
# https://bbs.archlinux.org/viewtopic.php?id=187258
capture.pcm "dsnoop"
}
# If get error "Slave PCM not usable", then need to use plug:
# If get error "Cannot find rate converter", then install libsamplerate and alsa-plugins
# Lunar Linux: lin ladspa-bs2b
# listplugins
# analyseplugin bs2b
pcm.bs2b {
type ladspa
path "/usr/lib/ladspa"
plugins {
0 {
id 4221 # Bauer stereophonic-to-binaural (4221/bs2b)
input {
controls [ 700 6 ]
}
}
}
# http://bbs.archlinux.org/viewtopic.php?id=95582
slave.pcm "surround20"
}
# speaker-test -D headphones -c 2 -t wav
# audacious uses less CPU when running bs2b as a listed plugin, probably because of samplerate_best
# Posted at http://bbs.archlinux.org/viewtopic.php?pid=626573#p626573
pcm.headphones {
type rate
slave {
pcm "plug:bs2b"
#pcm "plug:narrower"
#rate 44100
rate 48000
}
#converter "speexrate_medium"
hint {
show on
description "Headphones"
}
}
# http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/PerfectSetup/
pcm.pulse {
type pulse
}
ctl.pulse {
type pulse
}