Browse Source

Update ALSA configs

unInstance 1 year ago
parent
commit
4bf016aa0c
4 changed files with 70 additions and 90 deletions
  1. 59
    51
      alsa/etc/asound.conf
  2. 0
    28
      alsa/etc/asound/dummy_device.conf
  3. 0
    11
      alsa/etc/asound/sound_card.conf
  4. 11
    0
      alsa/etc/sound_card.conf

+ 59
- 51
alsa/etc/asound.conf View File

@@ -1,30 +1,48 @@
1 1
 # Includes (supports absolute paths only)
2 2
 #
3
-</etc/asound/sound_card.conf>	# Define sound_card to use
4
-</etc/asound/dummy_device.conf> # Define device to bypass plugins
3
+</etc/sound_card.conf> # Define sound_card to use
5 4
 
6 5
 # dmix plugin
7 6
 #
8
-# Configure software mixing (the ability to play sounds from different
9
-# applications at the same time through the same device)
10
-#
11
-# The dmix plugin is for mixing multiple output streams together. 
12
-# If you want multiple programs to access your microphone simultaneously
13
-# you need to use the dsnoop plugin.
14
-#
15
-# Set dsnoop to be asym plugin's capture slave if you need it.
7
+# Configure software mixing―the ability to play sounds from different
8
+# applications at the same time through the same device.
16 9
 #
17 10
 pcm.dmixed {
18 11
 	type dmix
19
-	ipc_key 1024
12
+	ipc_key 1024 # Must be unique across plugins!
20 13
 	slave {
21
-		pcm "sound_card"
14
+		pcm "sound_card" # Defined in sound_card.conf file.
15
+                channels 2
22 16
 		period_time 0
23 17
 		period_size 1024
24 18
 		buffer_size 8192
25 19
 		rate 44100
26 20
 	}
21
+	bindings {
22
+		0 0
23
+		1 1
24
+	}
25
+}
27 26
 
27
+# dsnoop plugin
28
+#
29
+# The dmix plugin is for mixing multiple *output* streams together. If you want
30
+# multiple programs to access your microphone (*input* stream) simultaneously,
31
+# you need the dsnoop plugin.
32
+#
33
+pcm.dsnoopped {
34
+        type dsnoop
35
+        ipc_key 5978293 # Must be unique across plugins!
36
+        ipc_key_add_uid yes
37
+        slave {
38
+                pcm "sound_card" # Defined in sound_card.conf file.
39
+                channels 2
40
+                period_size 1024
41
+                buffer_size 4096
42
+                rate 44100
43
+                periods 0 
44
+                period_time 0
45
+        }
28 46
 	bindings {
29 47
 		0 0
30 48
 		1 1
@@ -38,42 +56,42 @@ pcm.dmixed {
38 56
 # use the microphone because dmix works with playback only.
39 57
 #
40 58
 # You have to combine both playback (output) and capture (input) streams
41
-# together with asym plugin and set it to be a single slave in pcm.default!
42
-#
43
-# I could have done that, but I want an equalizer. The equalizer has to affect
44
-# the playback stream only, therefore it has to wrap dmix (because dmix controls
45
-# playback from all applications).
59
+# together with asym plugin and set it to be a single slave in pcm.!default
46 60
 #
47 61
 # Dependency map:
48
-#	dmix: software mixing
49
-#	|
50
-#	v
51
-#	equal: equalizer
52
-#	|
53
-#	v
54
-#	asym: combine playback and capture strams in one
55
-#	|
56
-#	v
57
-#	YOUR CARD
62
+#	(1) YOUR CARD (playback)	YOUR CARD (capture)
63
+#	    |				|
64
+#	    v				v
65
+#	(2) dmix: playback mixing	dsnoop: capture mixing
66
+#	    |				|
67
+#	    v				v
68
+#	(3) asym: combine playback and capture strams in one
69
+#	    |
70
+#	    v
71
+#	(4) pcm.!default
72
+#
73
+# (1 and 2) We take the raw *playback* stream from the sound card and pipe it
74
+# through the dmix plugin in order to be able to play sound from more than one
75
+# program simultaneously. At the same layer we take the raw *capture* stream and
76
+# do the same with but with the use of dsnoop instead of dmix. (3) We combine
77
+# both the playback and capture streams into one just for the sake of ALSA. (4)
78
+# Make a device/interface that behaves the way we defined earlier and through
79
+# which programs in our computer can talk to the sound card.
58 80
 #
59 81
 pcm.asymed {
60 82
 	type asym
61
-	playback.pcm "equalized"
62
-	capture.pcm "sound_card"
83
+	playback.pcm "dmixed"
84
+	capture.pcm "dsnoopped"
63 85
 }
64 86
 
65
-# equal plugin
87
+# Define the above mentioned device/interface through which programs in our
88
+# computer can talk to the sound card. We call this device 'default' because, by
89
+# default every piece of software tries to talk to the device named 'default'.
90
+# So the 'default' name makes no special sense in ALSA but it does make it for
91
+# the programs that try to play sounds.
66 92
 #
67
-# Directs dmix into the equalizer. Note the 'dmixed' after the ':'. 
68
-# Make sure to specify 'pcm.dmixed' as the slave and not 'dmix'
93
+# '!' sign is used to override the original default value set by ALSA.
69 94
 #
70
-pcm.equalized {
71
-	type equal
72
-	controls ".config/alsaequal.bin" # The place to store equal's settings
73
-	slave.pcm "plug:dmixed"
74
-}
75
-
76
-# Specify the card to be controlled by the 'pcm.<name>' statements.
77 95
 pcm.!default = {
78 96
 	type plug
79 97
 	slave.pcm = "asymed"
@@ -84,7 +102,7 @@ pcm.!default = {
84 102
 # such as 'ctl.<name>', which let your alsamixer know which settings to show
85 103
 # when you start it.  For instance, if you open a terminal window and type in
86 104
 # 'alsamixer', you probably expect it to open sound card settings. But it does
87
-# NOT know about them. You have to specify them using ctl.default:
105
+# NOT know about them. You have to specify this using ctl.default:
88 106
 #
89 107
 #	ctl.!default { # '!' is used to override the original default set by ALSA
90 108
 #		type hw
@@ -113,14 +131,4 @@ pcm.!default = {
113 131
 # This sets the default inteface for alsamixer, the one that starts when you
114 132
 # launch alsamixer without any arguments.
115 133
 #
116
-ctl.!default = ctl.sound_card
117
-
118
-# 'ctl.eq' defines a new device - 'eq';
119
-# 'type equal' specifies that device 'eq' controls the equal plugin
120
-#
121
-# 'alsamixer -D eq' opens equalizer faders.
122
-#
123
-ctl.eq {
124
-	type equal
125
-	controls ".config/alsaequal.bin" # The place to store equal's settings
126
-}
134
+ctl.!default = ctl.sound_card # Defined in sound_card.conf file.

+ 0
- 28
alsa/etc/asound/dummy_device.conf View File

@@ -1,28 +0,0 @@
1
-# Includes (supports absolute paths only)
2
-#
3
-</etc/asound/sound_card.conf> # Define the sound_card to use
4
-
5
-# If you do not want some applications to be affected by the equalizer or any
6
-# other plugins, you can make them talk straight to dmix. There is a reason to
7
-# create this dummy device talking to dmix instead of using dmix directly,
8
-# interfaces being talked to directly must have 'ctl.<name>' defined
9
-# as well.
10
-#
11
-# I have MOC (Music On Console) use this device because it refuses to play some
12
-# songs with ALSA's equal plugin.
13
-#
14
-# Put this in ~/.moc/config to change the device:
15
-#	ALSADevice = dummy
16
-#
17
-# You may want to set this option as well to make MOC control the Master fader
18
-# while also changing volume:
19
-#	ALSAMixer1 = Master
20
-#
21
-pcm.dummy {
22
-	type plug
23
-	slave.pcm "dmixed"
24
-}
25
-
26
-# Read lines 8-9.
27
-#
28
-ctl.dummy = ctl.sound_card

+ 0
- 11
alsa/etc/asound/sound_card.conf View File

@@ -1,11 +0,0 @@
1
-# Define sound_card to be your sound card's name.
2
-#
3
-pcm.sound_card {
4
-	type hw
5
-	card 0 # Select your card from /proc/asound/cards.
6
-}
7
-
8
-ctl.sound_card {
9
-	type hw
10
-	card 0 # And here as well to be able to open it with alsamixer.
11
-}

+ 11
- 0
alsa/etc/sound_card.conf View File

@@ -0,0 +1,11 @@
1
+# Define sound_card to be your sound card's name.
2
+#
3
+pcm.sound_card {
4
+	type hw
5
+	card 1 # Select your card from /proc/asound/cards.
6
+}
7
+
8
+ctl.sound_card {
9
+	type hw
10
+	card 1 # And here as well to be able to open it with alsamixer.
11
+}

Loading…
Cancel
Save