-
Notifications
You must be signed in to change notification settings - Fork 4
/
asound.conf
209 lines (188 loc) · 10.3 KB
/
asound.conf
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# This declares an ALSA device that you can specify to playback programs.
# You can use any name you wish that ALSA supports not just camilladsp.
# To use it you specify it to alsa like "aplay -D camilladsp"
pcm.camilladsp {
# type cdsp must be present - it declares to use this plugin.
# The type is NOT a variable name you can choose.
# You can however create multiple type cdsp plugins with different names
# if you want to specify different parameters selected by specifying a
# different ALSA device.
type cdsp
#######################################################################
#######################################################################
# Required parameters.
# The parameters in this section must be specified as a valid set.
#######################################################################
#######################################################################
# cpath specifies the absolute path to the CamillaDSP executable.
# CamillaDSP must have executable permission for any user that runs an
# audio program that uses this plugin.
cpath "/path/to/camilladsp"
# config_out is the absolute path that will be passed to CamillaDSP as
# the YAML config file argument. The file must be readable by any user
# that runs an audio program that uses this plugin. If the config_in
# or config_cmd options are chosen (see below) it must also be writable
# by those users.
config_out "/path/to/config_out.yaml"
#######################################################################
# Parameter Passing Options
#
# There are three mutually exclusive ways to send the updated hw_params
# and extra_samples to CamillaDSP. One and only one method must be
# specified. The three methods are config_in, config_cmd, and
# config_cdsp.
#######################################################################
# config_in is an absolute path to a YAML template the plugin will read
# and pass along to CamillaDSP after making simple token substitutions.
# It must be readable by any user that runs an audio program that uses
# this plugin.
config_in "/path/to/config_in.yaml"
# config_in processing does a simple search and replace of four tokens
# representing format, channels, sample rate, and extra samples
# replacing the tokens with the appropriate parameters. The following
# entries show the default tokens. They can be changed to custom
# tokens by uncommenting the lines below and replacing the default
# tokens with the desired tokens wrapped in quotes.
#format_token "$format$"
#samplerate_token "$samplerate$"
#channels_token "$channels$"
#extrasamples_token "$extrasamples$"
# config_cmd is the absolute path to a command that will be called
# whenever the hw_params change with arguments "format rate channels".
# It should create the YAML file CamillaDSP will load and place it in
# the location specified by the config_out parameter.
# Note that the extra_samples parameters specified below are NOT
# passed in any way to this command.
#config_cmd "/path/to/more_complex_yaml_creator"
# config_cdsp says to use the new CamillaDSP internal substitutions.
# When config_cdsp is set to an integer != 0 the hw_params and
# extra samples are passed to CamillaDSP on the command line as
# -f format -r samplerate -n channels -e extra_samples
#config_cdsp 1
#######################################################################
# End Parameter Passing Options
#######################################################################
#######################################################################
# Capability Enumeration
#
# The plugin will announce the hw_params it supports based on the
# following settings. Channels and sample rates must be specified.
# The plugin will automatically enumerate all the formats that
# CamillaDSP supports.
#######################################################################
# Channels can be specified as a single value like this.
channels 2
# Or a range like this. (Uncomment the lines.)
#min_channels 1
#max_channels 2
# But only one method can be used.
# Sample rates can be configured as a specific list like this.
# (Up to 100 entries.)
rates = [
44100
48000
88200
96000
176400
192000
352800
384000
]
# Or as a range like this. (Uncomment the lines.)
#min_rate 44100
#max_rate 384000
# Note that if you use a range like this ALSA will accept ANYTHING in
# that range. Even something odd like 45873. If you aren't using
# CamillaDSP's resampler and don't have a very unusual DAC you are
# probably better off with the list format above.
#######################################################################
# End Capability Enumeration
#######################################################################
#######################################################################
#######################################################################
# End Required Parameters
#######################################################################
#######################################################################
#######################################################################
#######################################################################
# Optional Parameters
#######################################################################
#######################################################################
# If you wish to specify additional arguments to CamillaDSP you can
# specify them using the cargs array. Numeric arguments must be quoted
# in strings or the plugin will fail to load. You should not specify
# the hw_params arguments here as the plugin will take care of that as
# they change.
cargs [
-p "1234"
-a "0.0.0.0"
-l warn
]
# Extra samples can be provided in a rate scaling way for the two most
# common audio base rates. This is under the assumption your filters
# will be N times as long at N times the base rate. Any of the
# following three values can be set or excluded in any combination.
# If no valid extra_samples parameter is set for a given sample rate
# the extra_samples token replacement will not occur in config_in mode
# and the -e argument will not be issued in config_cdsp mode.
# All extra_samples arguments must be integers >= 0.
# extra_samples is used when the sample rate is not an integer multiple
# of 44100 or 48000 or when the corresponding rate matching
# extra_samples option is not set.
#
# If using config_cdsp this is the only version of extra_samples
# that should be specified as CamillaDSP does its own sample rate
# based scaling of the extra samples.
extra_samples 0
# extra_samples_44100 is used when the sample rate is an integer
# multiple of 44100. In this case {extrasamples} will be replaced with
# {samplerate/44100 * extra_samples_44100}.
extra_samples_44100 8192
# extra_samples_48000 is used when the sample rate is an integer
# multiple of 48000. In this case {extrasamples} will be replaced with
# {samplerate/48000 * extra_samples_48000}.
extra_samples_48000 8916
# An option not directly related to camilladsp. A command to run when
# the plugin is first created. (Meaning when a playback program opens
# the audio device.) Use it for whatever you want. Set gpio pins on a
# raspberry pi to turn on your amp for example.
start_cmd "/path/to/start_command"
# An option not directly related to camilladsp. A command to run when
# the CamillaDSP process is closed. (Meaning when a playback program
# closes the audio device or changes the HW params.) Use it for
# whatever you want. A good example is storing the gain and mute
# settings of CamillaDSP for use with the vol_file option below.
#
# Note this command is called just before the CamillaDSP process is
# closed. That is not necessarily when you are done listening to music.
# So unlike the start_cmd this might not work well as a signal to turn
# off your amp. Also note that CamillaDSP is still expecting audio
# while this command is running so it may cause a harmless warning
# about a buffer underrun to be emitted by CamillaDSP if you have
# CamillaDSP's log level set sufficiently high.
camilla_exit_cmd "/path/to/camilla_exit_command"
# Volume Parameter Passing Option
# This options allows the plugin to pass gain and mute options on the
# command line to CamillaDSP in case one uses CamillaDSP's Volume or
# Loudness filters. It can help to maintain gain and mute settings
# across restarts of CamillaDSP as is done by this plugin anytime
# the player opens or closes the plugin or on any HW parameter change.
#
# If the option below is set to a valid file that contains two numbers
# on a single line separated by a space this plugin will read them and
# pass them along as gain and mute to CamillaDSP.
#
# The first number can be a integer or floating pointing value and is
# passed to CamillaDSP as the gain. The second number should be an
# integer >= 0. If > 0 the -m (mute) option is passed to CamillaDSP.
# If == 0 the -m is omitted.
#
# If the file is missing or improperly formatted the plugin will
# thrown an error during HW parameter setup.
#
# To be useful another means of updating this file will have to exist.
# One possibility is a program called by the exit_cmd option that
# queries CamillaDSP's websocket for volume and mute values and writes
# them to this file.
vol_file "/path/to/volume_file_with_gain_and_mute_values"
}