xref: /OK3568_Linux_fs/kernel/Documentation/sound/designs/procfile.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun==========================
2*4882a593SmuzhiyunProc Files of ALSA Drivers
3*4882a593Smuzhiyun==========================
4*4882a593Smuzhiyun
5*4882a593SmuzhiyunTakashi Iwai <tiwai@suse.de>
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunGeneral
8*4882a593Smuzhiyun=======
9*4882a593Smuzhiyun
10*4882a593SmuzhiyunALSA has its own proc tree, /proc/asound.  Many useful information are
11*4882a593Smuzhiyunfound in this tree.  When you encounter a problem and need debugging,
12*4882a593Smuzhiyuncheck the files listed in the following sections.
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunEach card has its subtree cardX, where X is from 0 to 7. The
15*4882a593Smuzhiyuncard-specific files are stored in the ``card*`` subdirectories.
16*4882a593Smuzhiyun
17*4882a593Smuzhiyun
18*4882a593SmuzhiyunGlobal Information
19*4882a593Smuzhiyun==================
20*4882a593Smuzhiyun
21*4882a593Smuzhiyuncards
22*4882a593Smuzhiyun	Shows the list of currently configured ALSA drivers,
23*4882a593Smuzhiyun	index, the id string, short and long descriptions.
24*4882a593Smuzhiyun
25*4882a593Smuzhiyunversion
26*4882a593Smuzhiyun	Shows the version string and compile date.
27*4882a593Smuzhiyun
28*4882a593Smuzhiyunmodules
29*4882a593Smuzhiyun	Lists the module of each card
30*4882a593Smuzhiyun
31*4882a593Smuzhiyundevices
32*4882a593Smuzhiyun	Lists the ALSA native device mappings.
33*4882a593Smuzhiyun
34*4882a593Smuzhiyunmeminfo
35*4882a593Smuzhiyun	Shows the status of allocated pages via ALSA drivers.
36*4882a593Smuzhiyun	Appears only when ``CONFIG_SND_DEBUG=y``.
37*4882a593Smuzhiyun
38*4882a593Smuzhiyunhwdep
39*4882a593Smuzhiyun	Lists the currently available hwdep devices in format of
40*4882a593Smuzhiyun	``<card>-<device>: <name>``
41*4882a593Smuzhiyun
42*4882a593Smuzhiyunpcm
43*4882a593Smuzhiyun	Lists the currently available PCM devices in format of
44*4882a593Smuzhiyun	``<card>-<device>: <id>: <name> : <sub-streams>``
45*4882a593Smuzhiyun
46*4882a593Smuzhiyuntimer
47*4882a593Smuzhiyun	Lists the currently available timer devices
48*4882a593Smuzhiyun
49*4882a593Smuzhiyun
50*4882a593Smuzhiyunoss/devices
51*4882a593Smuzhiyun	Lists the OSS device mappings.
52*4882a593Smuzhiyun
53*4882a593Smuzhiyunoss/sndstat
54*4882a593Smuzhiyun	Provides the output compatible with /dev/sndstat.
55*4882a593Smuzhiyun	You can symlink this to /dev/sndstat.
56*4882a593Smuzhiyun
57*4882a593Smuzhiyun
58*4882a593SmuzhiyunCard Specific Files
59*4882a593Smuzhiyun===================
60*4882a593Smuzhiyun
61*4882a593SmuzhiyunThe card-specific files are found in ``/proc/asound/card*`` directories.
62*4882a593SmuzhiyunSome drivers (e.g. cmipci) have their own proc entries for the
63*4882a593Smuzhiyunregister dump, etc (e.g. ``/proc/asound/card*/cmipci`` shows the register
64*4882a593Smuzhiyundump).  These files would be really helpful for debugging.
65*4882a593Smuzhiyun
66*4882a593SmuzhiyunWhen PCM devices are available on this card, you can see directories
67*4882a593Smuzhiyunlike pcm0p or pcm1c.  They hold the PCM information for each PCM
68*4882a593Smuzhiyunstream.  The number after ``pcm`` is the PCM device number from 0, and
69*4882a593Smuzhiyunthe last ``p`` or ``c`` means playback or capture direction.  The files in
70*4882a593Smuzhiyunthis subtree is described later.
71*4882a593Smuzhiyun
72*4882a593SmuzhiyunThe status of MIDI I/O is found in ``midi*`` files.  It shows the device
73*4882a593Smuzhiyunname and the received/transmitted bytes through the MIDI device.
74*4882a593Smuzhiyun
75*4882a593SmuzhiyunWhen the card is equipped with AC97 codecs, there are ``codec97#*``
76*4882a593Smuzhiyunsubdirectories (described later).
77*4882a593Smuzhiyun
78*4882a593SmuzhiyunWhen the OSS mixer emulation is enabled (and the module is loaded),
79*4882a593Smuzhiyunoss_mixer file appears here, too.  This shows the current mapping of
80*4882a593SmuzhiyunOSS mixer elements to the ALSA control elements.  You can change the
81*4882a593Smuzhiyunmapping by writing to this device.  Read OSS-Emulation.txt for
82*4882a593Smuzhiyundetails.
83*4882a593Smuzhiyun
84*4882a593Smuzhiyun
85*4882a593SmuzhiyunPCM Proc Files
86*4882a593Smuzhiyun==============
87*4882a593Smuzhiyun
88*4882a593Smuzhiyun``card*/pcm*/info``
89*4882a593Smuzhiyun	The general information of this PCM device: card #, device #,
90*4882a593Smuzhiyun	substreams, etc.
91*4882a593Smuzhiyun
92*4882a593Smuzhiyun``card*/pcm*/xrun_debug``
93*4882a593Smuzhiyun	This file appears when ``CONFIG_SND_DEBUG=y`` and
94*4882a593Smuzhiyun	``CONFIG_SND_PCM_XRUN_DEBUG=y``.
95*4882a593Smuzhiyun	This shows the status of xrun (= buffer overrun/xrun) and
96*4882a593Smuzhiyun	invalid PCM position debug/check of ALSA PCM middle layer.
97*4882a593Smuzhiyun	It takes an integer value, can be changed by writing to this
98*4882a593Smuzhiyun	file, such as::
99*4882a593Smuzhiyun
100*4882a593Smuzhiyun		 # echo 5 > /proc/asound/card0/pcm0p/xrun_debug
101*4882a593Smuzhiyun
102*4882a593Smuzhiyun	The value consists of the following bit flags:
103*4882a593Smuzhiyun
104*4882a593Smuzhiyun	* bit 0 = Enable XRUN/jiffies debug messages
105*4882a593Smuzhiyun	* bit 1 = Show stack trace at XRUN / jiffies check
106*4882a593Smuzhiyun	* bit 2 = Enable additional jiffies check
107*4882a593Smuzhiyun
108*4882a593Smuzhiyun	When the bit 0 is set, the driver will show the messages to
109*4882a593Smuzhiyun	kernel log when an xrun is detected.  The debug message is
110*4882a593Smuzhiyun	shown also when the invalid H/W pointer is detected at the
111*4882a593Smuzhiyun	update of periods (usually called from the interrupt
112*4882a593Smuzhiyun	handler).
113*4882a593Smuzhiyun
114*4882a593Smuzhiyun	When the bit 1 is set, the driver will show the stack trace
115*4882a593Smuzhiyun	additionally.  This may help the debugging.
116*4882a593Smuzhiyun
117*4882a593Smuzhiyun	Since 2.6.30, this option can enable the hwptr check using
118*4882a593Smuzhiyun	jiffies.  This detects spontaneous invalid pointer callback
119*4882a593Smuzhiyun	values, but can be lead to too much corrections for a (mostly
120*4882a593Smuzhiyun	buggy) hardware that doesn't give smooth pointer updates.
121*4882a593Smuzhiyun	This feature is enabled via the bit 2.
122*4882a593Smuzhiyun
123*4882a593Smuzhiyun``card*/pcm*/sub*/info``
124*4882a593Smuzhiyun	The general information of this PCM sub-stream.
125*4882a593Smuzhiyun
126*4882a593Smuzhiyun``card*/pcm*/sub*/status``
127*4882a593Smuzhiyun	The current status of this PCM sub-stream, elapsed time,
128*4882a593Smuzhiyun	H/W position, etc.
129*4882a593Smuzhiyun
130*4882a593Smuzhiyun``card*/pcm*/sub*/hw_params``
131*4882a593Smuzhiyun	The hardware parameters set for this sub-stream.
132*4882a593Smuzhiyun
133*4882a593Smuzhiyun``card*/pcm*/sub*/sw_params``
134*4882a593Smuzhiyun	The soft parameters set for this sub-stream.
135*4882a593Smuzhiyun
136*4882a593Smuzhiyun``card*/pcm*/sub*/prealloc``
137*4882a593Smuzhiyun	The buffer pre-allocation information.
138*4882a593Smuzhiyun
139*4882a593Smuzhiyun``card*/pcm*/sub*/xrun_injection``
140*4882a593Smuzhiyun	Triggers an XRUN to the running stream when any value is
141*4882a593Smuzhiyun	written to this proc file.  Used for fault injection.
142*4882a593Smuzhiyun	This entry is write-only.
143*4882a593Smuzhiyun
144*4882a593SmuzhiyunAC97 Codec Information
145*4882a593Smuzhiyun======================
146*4882a593Smuzhiyun
147*4882a593Smuzhiyun``card*/codec97#*/ac97#?-?``
148*4882a593Smuzhiyun	Shows the general information of this AC97 codec chip, such as
149*4882a593Smuzhiyun	name, capabilities, set up.
150*4882a593Smuzhiyun
151*4882a593Smuzhiyun``card*/codec97#0/ac97#?-?+regs``
152*4882a593Smuzhiyun	Shows the AC97 register dump.  Useful for debugging.
153*4882a593Smuzhiyun
154*4882a593Smuzhiyun	When CONFIG_SND_DEBUG is enabled, you can write to this file for
155*4882a593Smuzhiyun	changing an AC97 register directly.  Pass two hex numbers.
156*4882a593Smuzhiyun	For example,
157*4882a593Smuzhiyun
158*4882a593Smuzhiyun::
159*4882a593Smuzhiyun
160*4882a593Smuzhiyun	# echo 02 9f1f > /proc/asound/card0/codec97#0/ac97#0-0+regs
161*4882a593Smuzhiyun
162*4882a593Smuzhiyun
163*4882a593SmuzhiyunUSB Audio Streams
164*4882a593Smuzhiyun=================
165*4882a593Smuzhiyun
166*4882a593Smuzhiyun``card*/stream*``
167*4882a593Smuzhiyun	Shows the assignment and the current status of each audio stream
168*4882a593Smuzhiyun	of the given card.  This information is very useful for debugging.
169*4882a593Smuzhiyun
170*4882a593Smuzhiyun
171*4882a593SmuzhiyunHD-Audio Codecs
172*4882a593Smuzhiyun===============
173*4882a593Smuzhiyun
174*4882a593Smuzhiyun``card*/codec#*``
175*4882a593Smuzhiyun	Shows the general codec information and the attribute of each
176*4882a593Smuzhiyun	widget node.
177*4882a593Smuzhiyun
178*4882a593Smuzhiyun``card*/eld#*``
179*4882a593Smuzhiyun	Available for HDMI or DisplayPort interfaces.
180*4882a593Smuzhiyun	Shows ELD(EDID Like Data) info retrieved from the attached HDMI sink,
181*4882a593Smuzhiyun	and describes its audio capabilities and configurations.
182*4882a593Smuzhiyun
183*4882a593Smuzhiyun	Some ELD fields may be modified by doing ``echo name hex_value > eld#*``.
184*4882a593Smuzhiyun	Only do this if you are sure the HDMI sink provided value is wrong.
185*4882a593Smuzhiyun	And if that makes your HDMI audio work, please report to us so that we
186*4882a593Smuzhiyun	can fix it in future kernel releases.
187*4882a593Smuzhiyun
188*4882a593Smuzhiyun
189*4882a593SmuzhiyunSequencer Information
190*4882a593Smuzhiyun=====================
191*4882a593Smuzhiyun
192*4882a593Smuzhiyunseq/drivers
193*4882a593Smuzhiyun	Lists the currently available ALSA sequencer drivers.
194*4882a593Smuzhiyun
195*4882a593Smuzhiyunseq/clients
196*4882a593Smuzhiyun	Shows the list of currently available sequencer clients and
197*4882a593Smuzhiyun	ports.  The connection status and the running status are shown
198*4882a593Smuzhiyun	in this file, too.
199*4882a593Smuzhiyun
200*4882a593Smuzhiyunseq/queues
201*4882a593Smuzhiyun	Lists the currently allocated/running sequencer queues.
202*4882a593Smuzhiyun
203*4882a593Smuzhiyunseq/timer
204*4882a593Smuzhiyun	Lists the currently allocated/running sequencer timers.
205*4882a593Smuzhiyun
206*4882a593Smuzhiyunseq/oss
207*4882a593Smuzhiyun	Lists the OSS-compatible sequencer stuffs.
208*4882a593Smuzhiyun
209*4882a593Smuzhiyun
210*4882a593SmuzhiyunHelp For Debugging?
211*4882a593Smuzhiyun===================
212*4882a593Smuzhiyun
213*4882a593SmuzhiyunWhen the problem is related with PCM, first try to turn on xrun_debug
214*4882a593Smuzhiyunmode.  This will give you the kernel messages when and where xrun
215*4882a593Smuzhiyunhappened.
216*4882a593Smuzhiyun
217*4882a593SmuzhiyunIf it's really a bug, report it with the following information:
218*4882a593Smuzhiyun
219*4882a593Smuzhiyun- the name of the driver/card, show in ``/proc/asound/cards``
220*4882a593Smuzhiyun- the register dump, if available (e.g. ``card*/cmipci``)
221*4882a593Smuzhiyun
222*4882a593Smuzhiyunwhen it's a PCM problem,
223*4882a593Smuzhiyun
224*4882a593Smuzhiyun- set-up of PCM, shown in hw_parms, sw_params, and status in the PCM
225*4882a593Smuzhiyun  sub-stream directory
226*4882a593Smuzhiyun
227*4882a593Smuzhiyunwhen it's a mixer problem,
228*4882a593Smuzhiyun
229*4882a593Smuzhiyun- AC97 proc files, ``codec97#*/*`` files
230*4882a593Smuzhiyun
231*4882a593Smuzhiyunfor USB audio/midi,
232*4882a593Smuzhiyun
233*4882a593Smuzhiyun- output of ``lsusb -v``
234*4882a593Smuzhiyun- ``stream*`` files in card directory
235*4882a593Smuzhiyun
236*4882a593Smuzhiyun
237*4882a593SmuzhiyunThe ALSA bug-tracking system is found at:
238*4882a593Smuzhiyunhttps://bugtrack.alsa-project.org/alsa-bug/
239