• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1CRAS = ChromeOS Audio Server
2
3Directories
4src/server - the source for the sound server
5src/libcras - client library for interacting with cras
6src/common - files common to both the server and library
7src/tests - tests for cras and libcras
8
9Building from source:
10./git_prepare.sh
11./configure
12make
13sudo make install
14
15---------------------
16Configuration:
17---------------------
18
19Device Blacklisting:
20--------------------
21Blacklist of certain USB output device(s) is possible by modifying the config
22file /etc/cras/device_blacklist.
23
24The format of this file is as follows:
25
26[USB_Outputs]
27  <vendor_id>_<product_id>_<checksum>_<device_index> = 1
28
29Where vendor_id and product id are the USB identifiers for the card to
30blacklist. The checksum is the output of "cksum" command applied to the
31sysfs "descriptors" file of the device. The device index specifies the
32index of the output device in the card to blacklist.  This is a bool
33parameter, so '= 1' enables the option.
34
35Example, blacklisting the non-functional output device reported by the C-Media
36based CAD-u1 mic:
37
38[USB_Outputs]
39  0d8c_0008_00000000_0 = 1
40
41Card Configuration:
42-------------------
43There can be a config file for each sound alsa card on the system.  This file
44lives in /etc/cras/.  The file should be named with the card name returned by
45ALSA, the string in the second set of '[]' in the aplay -l output.  The ini file
46has the following format.
47
48[<output-node-name>] ; Name of the mixer control for this output.
49  <config-option> = <config-value>
50
51output-node-name can be speficied in a few ways to link with the real node:
52  UCM device name - The name string following the SectionDevice label in UCM
53    config, i.e. HiFi.conf
54  Jack name - Name of the mixer control for mixer jack, or the gpio jack name
55    listed by 'evtest' command.
56  Mixer control name - e.g. "Headphone" or "Speaker", listed by
57    'amixer scontrols' command.
58
59Note that an output node matches to the output-node-name label in card config by
60priorty ordered above. For example if a node has UCM device, it will first
61search the config file for the UCM device name. When not found, jack name will
62be used for searching, and lastly the mixer output control name.
63
64config-option can be the following:
65  volume_curve - The type of volume curve, "simple_step" or "explicit".
66  Options valid and mandatory when volume_curve = simple_step:
67    max_volume - The maximum volume for this output specified in dBFS * 100.
68    volume_step - Number of dB per volume 'tick' specified in  dBFS * 100.
69  Options valid and mandatory when volume_curve = explicit:
70    dB_at_N - The value in dB*100 that should be used for the volume at step
71      "N".  There must be one of these for each setting from N=0 to 100
72      inclusive.
73
74
75Example:
76This example configures the Headphones to have a max volume of -3dBFS with a
77step size of 0.75dBFS and the Speaker to have the curve specified by the steps
78given, which is a 1dBFS per step curve from max = +0.5dBFS to min = -99.5dBFS
79(volume step 10 is -89.5dBFS).
80
81[Headphone]
82  volume_curve = simple_step
83  volume_step = 75
84  max_volume = -300
85[Speaker]
86  volume_curve = explicit
87  dB_at_0 = -9950
88  dB_at_1 = -9850
89  dB_at_2 = -9750
90  dB_at_3 = -9650
91  dB_at_4 = -9550
92  dB_at_5 = -9450
93  dB_at_6 = -9350
94  dB_at_7 = -9250
95  dB_at_8 = -9150
96  dB_at_9 = -9050
97  dB_at_10 = -8950
98  dB_at_11 = -8850
99  dB_at_12 = -8750
100  dB_at_13 = -8650
101  dB_at_14 = -8550
102  dB_at_15 = -8450
103  dB_at_16 = -8350
104  dB_at_17 = -8250
105  dB_at_18 = -8150
106  dB_at_19 = -8050
107  dB_at_20 = -7950
108  dB_at_21 = -7850
109  dB_at_22 = -7750
110  dB_at_23 = -7650
111  dB_at_24 = -7550
112  dB_at_25 = -7450
113  dB_at_26 = -7350
114  dB_at_27 = -7250
115  dB_at_28 = -7150
116  dB_at_29 = -7050
117  dB_at_30 = -6950
118  dB_at_31 = -6850
119  dB_at_32 = -6750
120  dB_at_33 = -6650
121  dB_at_34 = -6550
122  dB_at_35 = -6450
123  dB_at_36 = -6350
124  dB_at_37 = -6250
125  dB_at_38 = -6150
126  dB_at_39 = -6050
127  dB_at_40 = -5950
128  dB_at_41 = -5850
129  dB_at_42 = -5750
130  dB_at_43 = -5650
131  dB_at_44 = -5550
132  dB_at_45 = -5450
133  dB_at_46 = -5350
134  dB_at_47 = -5250
135  dB_at_48 = -5150
136  dB_at_49 = -5050
137  dB_at_50 = -4950
138  dB_at_51 = -4850
139  dB_at_52 = -4750
140  dB_at_53 = -4650
141  dB_at_54 = -4550
142  dB_at_55 = -4450
143  dB_at_56 = -4350
144  dB_at_57 = -4250
145  dB_at_58 = -4150
146  dB_at_59 = -4050
147  dB_at_60 = -3950
148  dB_at_61 = -3850
149  dB_at_62 = -3750
150  dB_at_63 = -3650
151  dB_at_64 = -3550
152  dB_at_65 = -3450
153  dB_at_66 = -3350
154  dB_at_67 = -3250
155  dB_at_68 = -3150
156  dB_at_69 = -3050
157  dB_at_70 = -2950
158  dB_at_71 = -2850
159  dB_at_72 = -2750
160  dB_at_73 = -2650
161  dB_at_74 = -2550
162  dB_at_75 = -2450
163  dB_at_76 = -2350
164  dB_at_77 = -2250
165  dB_at_78 = -2150
166  dB_at_79 = -2050
167  dB_at_80 = -1950
168  dB_at_81 = -1850
169  dB_at_82 = -1750
170  dB_at_83 = -1650
171  dB_at_84 = -1550
172  dB_at_85 = -1450
173  dB_at_86 = -1350
174  dB_at_87 = -1250
175  dB_at_88 = -1150
176  dB_at_89 = -1050
177  dB_at_90 = -950
178  dB_at_91 = -850
179  dB_at_92 = -750
180  dB_at_93 = -650
181  dB_at_94 = -550
182  dB_at_95 = -450
183  dB_at_96 = -350
184  dB_at_97 = -250
185  dB_at_98 = -150
186  dB_at_99 = -50
187  dB_at_100 = 50
188