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