1#
2#  USB-Audio.conf - configuration for USB Audio devices
3#
4#
5#  DO NO EDIT; this is an internal ALSA file.
6#  If you want to add your own definitions, put them into /etc/asound.conf or
7#  ~/.asoundrc, with "cards." before the "USB-Audio", e.g.:
8#
9#  cards.USB-Audio.pcm.use_dmix."NoiseBlaster 3000" no
10#
11#  If your device requires such a definition to work correctly, please report it
12#  to <alsa-devel@alsa-project.org>.
13
14
15# If a device has sample formats not supported by dmix, dmix can be disabled
16# here.
17USB-Audio.pcm.use_dmix {
18	"AudioPhile" no    # uses big-endian 24-bit samples
19	"Audiophile USB (tm)" no
20}
21
22# If a device does not have a four-channel mode for the front/rear outputs,
23# other modes can be selected here.
24# six_channels       - for devices that route the last two of the four channels
25#                      to the center/LFE outputs
26# two_stereo_devices - for devices that have two stereo audio interfaces
27USB-Audio.pcm.surround40_type {
28	"AudioPhile" two_stereo_devices
29	"Audiophile USB (tm)" two_stereo_devices
30	"OmniStudio" two_stereo_devices
31	"Quattro" two_stereo_devices
32	"SB Audigy 2 NX" six_channels
33}
34
35# If a device does not use the first PCM device for digital data, the device
36# number for the iec958 device can be changed here.
37USB-Audio.pcm.iec958_device {
38	# "NoiseBlaster 3000" 42
39
40	# The below don't have digital in/out, so prevent them from being opened.
41	"Blue Snowball" 999
42	"Logitech Speaker Lapdesk N700" 999	
43	"Logitech USB Headset" 999
44	"Logitech Wireless Headset" 999
45	"Plantronics GameCom 780" 999
46	"Plantronics USB Headset" 999
47	"Plantronics Wireless Audio" 999
48	"SB WoW Headset" 999
49	"Sennheiser USB headset" 999
50	"USB Device 0x46d:0x992" 999
51}
52
53
54# If a device requires non-standard definitions for front, surround40,
55# surround51, surround71 or iec958, they can be defined here.
56
57# M-Audio AudioPhile USB:
58# device 0: analog output, digital input
59# device 1: digital output, analog input
60USB-Audio."AudioPhile".pcm.default "cards.USB-Audio.Audiophile USB (tm).pcm.default"
61USB-Audio."Audiophile USB (tm)".pcm.default {
62	@args [ CARD ]
63	@args.CARD { type string }
64	type asym
65	playback.pcm {
66		type plug
67		slave.pcm {
68			type hw
69			card $CARD
70			device 0
71		}
72	}
73	capture.pcm {
74		type plug
75		slave.pcm {
76			@func concat
77			strings [ "dsnoop:DEVICE=1,CARD=" $CARD ]
78		}
79	}
80}
81USB-Audio."AudioPhile".pcm.iec958 "cards.USB-Audio.Audiophile USB (tm).pcm.iec958"
82USB-Audio."Audiophile USB (tm)".pcm.iec958 {
83	@args [ CARD AES0 AES1 AES2 AES3 ]
84	@args.CARD { type string }
85	@args.AES0 { type integer }
86	@args.AES1 { type integer }
87	@args.AES2 { type integer }
88	@args.AES3 { type integer }
89	type asym
90	playback.pcm {
91		type hw
92		card $CARD
93		device 1
94	}
95	capture.pcm {
96		type hw
97		card $CARD
98		device 0
99	}
100}
101
102
103################################################################################
104
105<confdir:pcm/front.conf>
106
107USB-Audio.pcm.front.0 {
108	@args [ CARD ]
109	@args.CARD { type string }
110	@func refer
111	name {
112		@func concat
113		strings [
114			"cards.USB-Audio."
115			{ @func card_name card $CARD }
116			".pcm.front:CARD=" $CARD
117		]
118	}
119	default {
120		# We could use softvol, but the driver might have guessed a
121		# wrong name for the real volume control.
122		type hw
123		card $CARD
124		device 0
125	}
126}	
127
128USB-Audio.pcm.default {
129	@args [ CARD ]
130	@args.CARD { type string }
131	type asym
132	playback.pcm {
133		type plug
134		slave.pcm {
135			@func refer
136			name {
137				@func concat
138				strings [
139					"cards.USB-Audio.pcm.default_playback_dmix_"
140					{
141						@func refer
142						name {
143							@func concat
144							strings [
145								"cards.USB-Audio.pcm.use_dmix."
146								{ @func card_name card $CARD }
147							]
148						}
149						default yes
150					}
151					":CARD=" $CARD
152				]
153			}
154		}
155	}
156	capture.pcm {
157		type plug
158		slave.pcm {
159			@func concat
160			strings [ "dsnoop:" $CARD ]
161		}
162	}
163}
164
165USB-Audio.pcm.default_playback_dmix_yes {
166	@args [ CARD ]
167	@args.CARD { type string }
168	@func concat
169	strings [ "dmix:" $CARD ]
170}
171
172USB-Audio.pcm.default_playback_dmix_no {
173	@args [ CARD ]
174	@args.CARD { type string }
175	type hw
176	card $CARD
177	device 0
178}
179
180<confdir:pcm/surround40.conf>
181
182USB-Audio.pcm.surround40.0 {
183	@args [ CARD ]
184	@args.CARD { type string }
185	@func refer
186	name {
187		@func concat
188		strings [
189			"cards.USB-Audio."
190			{ @func card_name card $CARD }
191			".pcm.surround40:CARD=" $CARD
192		]
193	}
194	default {
195		@func refer
196		name {
197			@func concat
198			strings [
199				"cards.USB-Audio.pcm.surround40_"
200				{
201					@func refer
202					name {
203						@func concat
204						strings [
205							"cards.USB-Audio.pcm.surround40_type."
206							{ @func card_name card $CARD }
207						]
208					}
209					default default
210				}
211				":CARD=" $CARD
212			]
213		}
214	}
215}
216
217USB-Audio.pcm.surround40_default {
218	@args [ CARD ]
219	@args.CARD { type string }
220	type hw
221	card $CARD
222	device 0
223}
224
225USB-Audio.pcm.surround40_six_channels {
226	@args [ CARD ]
227	@args.CARD { type string }
228	type route
229	ttable.0.0 1
230	ttable.1.1 1
231	ttable.2.4 1
232	ttable.3.5 1
233	slave {
234		pcm {
235			type hw
236			card $CARD
237			device 0
238		}
239		channels 6
240	}
241}
242
243USB-Audio.pcm.surround40_two_stereo_devices {
244	@args [ CARD ]
245	@args.CARD { type string }
246	type route
247	ttable.0.0 1
248	ttable.1.1 1
249	ttable.2.2 1
250	ttable.3.3 1
251	slave.pcm {
252		type multi
253		slaves {
254			a {
255				pcm {
256					type hw
257					card $CARD
258					device 0
259				}
260				channels 2
261			}
262			b {
263				pcm {
264					type hw
265					card $CARD
266					device 1
267				}
268				channels 2
269			}
270		}
271		bindings [
272			{ slave a channel 0 }
273			{ slave a channel 1 }
274			{ slave b channel 0 }
275			{ slave b channel 1 }
276		]
277	}
278}
279
280<confdir:pcm/surround41.conf>
281<confdir:pcm/surround50.conf>
282<confdir:pcm/surround51.conf>
283
284USB-Audio.pcm.surround51.0 {
285	@args [ CARD ]
286	@args.CARD { type string }
287	@func refer
288	name {
289		@func concat
290		strings [
291			"cards.USB-Audio."
292			{ @func card_name card $CARD }
293			".pcm.surround51:CARD=" $CARD
294		]
295	}
296	default {
297		type route
298		ttable.0.0 1
299		ttable.1.1 1
300		ttable.2.4 1
301		ttable.3.5 1
302		ttable.4.2 1
303		ttable.5.3 1
304		slave {
305			pcm {
306				type hw
307				card $CARD
308				device 0
309			}
310			channels 6
311		}
312	}
313}
314
315<confdir:pcm/surround71.conf>
316
317USB-Audio.pcm.surround71.0 {
318	@args [ CARD ]
319	@args.CARD { type string }
320	@func refer
321	name {
322		@func concat
323		strings [
324			"cards.USB-Audio."
325			{ @func card_name card $CARD }
326			".pcm.surround71:CARD=" $CARD
327		]
328	}
329	default {
330		type route
331		ttable.0.0 1
332		ttable.1.1 1
333		ttable.2.4 1
334		ttable.3.5 1
335		ttable.4.2 1
336		ttable.5.3 1
337		ttable.6.6 1
338		ttable.7.7 1
339		slave {
340			pcm {
341				type hw
342				card $CARD
343				device 0
344			}
345			channels 8
346		}
347	}
348}
349
350<confdir:pcm/iec958.conf>
351
352USB-Audio.pcm.iec958.0 {
353	@args [ CARD AES0 AES1 AES2 AES3 ]
354	@args.CARD { type string }
355	@args.AES0 { type integer }
356	@args.AES1 { type integer }
357	@args.AES2 { type integer }
358	@args.AES3 { type integer }
359	@func refer
360	name {
361		@func concat
362		strings [
363			"cards.USB-Audio."
364			{ @func card_name card $CARD }
365			".pcm.iec958:CARD=" $CARD
366			",AES0=" $AES0 ",AES1=" $AES1 ",AES2=" $AES2 ",AES3=" $AES3
367		]
368	}
369	default {
370		# FIXME: we cannot set the AES parameters
371		type hw
372		card $CARD
373		device {
374			@func refer
375			name {
376				@func concat
377				strings [
378					"cards.USB-Audio.pcm.iec958_device."
379					{ @func card_name card $CARD }
380				]
381			}
382			default 0
383		}
384	}
385}
386
387# vim: ft=alsaconf
388