18c2ecf20Sopenharmony_ci==========================
28c2ecf20Sopenharmony_ciProc Files of ALSA Drivers
38c2ecf20Sopenharmony_ci==========================
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ciTakashi Iwai <tiwai@suse.de>
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ciGeneral
88c2ecf20Sopenharmony_ci=======
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ciALSA has its own proc tree, /proc/asound.  Many useful information are
118c2ecf20Sopenharmony_cifound in this tree.  When you encounter a problem and need debugging,
128c2ecf20Sopenharmony_cicheck the files listed in the following sections.
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ciEach card has its subtree cardX, where X is from 0 to 7. The
158c2ecf20Sopenharmony_cicard-specific files are stored in the ``card*`` subdirectories.
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ciGlobal Information
198c2ecf20Sopenharmony_ci==================
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_cicards
228c2ecf20Sopenharmony_ci	Shows the list of currently configured ALSA drivers,
238c2ecf20Sopenharmony_ci	index, the id string, short and long descriptions.
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_civersion
268c2ecf20Sopenharmony_ci	Shows the version string and compile date.
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_cimodules
298c2ecf20Sopenharmony_ci	Lists the module of each card
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_cidevices
328c2ecf20Sopenharmony_ci	Lists the ALSA native device mappings.
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_cimeminfo
358c2ecf20Sopenharmony_ci	Shows the status of allocated pages via ALSA drivers.
368c2ecf20Sopenharmony_ci	Appears only when ``CONFIG_SND_DEBUG=y``.
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_cihwdep
398c2ecf20Sopenharmony_ci	Lists the currently available hwdep devices in format of
408c2ecf20Sopenharmony_ci	``<card>-<device>: <name>``
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_cipcm
438c2ecf20Sopenharmony_ci	Lists the currently available PCM devices in format of
448c2ecf20Sopenharmony_ci	``<card>-<device>: <id>: <name> : <sub-streams>``
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_citimer
478c2ecf20Sopenharmony_ci	Lists the currently available timer devices
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_cioss/devices
518c2ecf20Sopenharmony_ci	Lists the OSS device mappings.
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_cioss/sndstat
548c2ecf20Sopenharmony_ci	Provides the output compatible with /dev/sndstat.
558c2ecf20Sopenharmony_ci	You can symlink this to /dev/sndstat.
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ciCard Specific Files
598c2ecf20Sopenharmony_ci===================
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ciThe card-specific files are found in ``/proc/asound/card*`` directories.
628c2ecf20Sopenharmony_ciSome drivers (e.g. cmipci) have their own proc entries for the
638c2ecf20Sopenharmony_ciregister dump, etc (e.g. ``/proc/asound/card*/cmipci`` shows the register
648c2ecf20Sopenharmony_cidump).  These files would be really helpful for debugging.
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ciWhen PCM devices are available on this card, you can see directories
678c2ecf20Sopenharmony_cilike pcm0p or pcm1c.  They hold the PCM information for each PCM
688c2ecf20Sopenharmony_cistream.  The number after ``pcm`` is the PCM device number from 0, and
698c2ecf20Sopenharmony_cithe last ``p`` or ``c`` means playback or capture direction.  The files in
708c2ecf20Sopenharmony_cithis subtree is described later.
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ciThe status of MIDI I/O is found in ``midi*`` files.  It shows the device
738c2ecf20Sopenharmony_ciname and the received/transmitted bytes through the MIDI device.
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ciWhen the card is equipped with AC97 codecs, there are ``codec97#*``
768c2ecf20Sopenharmony_cisubdirectories (described later).
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ciWhen the OSS mixer emulation is enabled (and the module is loaded),
798c2ecf20Sopenharmony_cioss_mixer file appears here, too.  This shows the current mapping of
808c2ecf20Sopenharmony_ciOSS mixer elements to the ALSA control elements.  You can change the
818c2ecf20Sopenharmony_cimapping by writing to this device.  Read OSS-Emulation.txt for
828c2ecf20Sopenharmony_cidetails.
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ciPCM Proc Files
868c2ecf20Sopenharmony_ci==============
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci``card*/pcm*/info``
898c2ecf20Sopenharmony_ci	The general information of this PCM device: card #, device #,
908c2ecf20Sopenharmony_ci	substreams, etc.
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ci``card*/pcm*/xrun_debug``
938c2ecf20Sopenharmony_ci	This file appears when ``CONFIG_SND_DEBUG=y`` and
948c2ecf20Sopenharmony_ci	``CONFIG_SND_PCM_XRUN_DEBUG=y``.
958c2ecf20Sopenharmony_ci	This shows the status of xrun (= buffer overrun/xrun) and
968c2ecf20Sopenharmony_ci	invalid PCM position debug/check of ALSA PCM middle layer.
978c2ecf20Sopenharmony_ci	It takes an integer value, can be changed by writing to this
988c2ecf20Sopenharmony_ci	file, such as::
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci		 # echo 5 > /proc/asound/card0/pcm0p/xrun_debug
1018c2ecf20Sopenharmony_ci
1028c2ecf20Sopenharmony_ci	The value consists of the following bit flags:
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci	* bit 0 = Enable XRUN/jiffies debug messages
1058c2ecf20Sopenharmony_ci	* bit 1 = Show stack trace at XRUN / jiffies check
1068c2ecf20Sopenharmony_ci	* bit 2 = Enable additional jiffies check
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ci	When the bit 0 is set, the driver will show the messages to
1098c2ecf20Sopenharmony_ci	kernel log when an xrun is detected.  The debug message is
1108c2ecf20Sopenharmony_ci	shown also when the invalid H/W pointer is detected at the
1118c2ecf20Sopenharmony_ci	update of periods (usually called from the interrupt
1128c2ecf20Sopenharmony_ci	handler).
1138c2ecf20Sopenharmony_ci
1148c2ecf20Sopenharmony_ci	When the bit 1 is set, the driver will show the stack trace
1158c2ecf20Sopenharmony_ci	additionally.  This may help the debugging.
1168c2ecf20Sopenharmony_ci
1178c2ecf20Sopenharmony_ci	Since 2.6.30, this option can enable the hwptr check using
1188c2ecf20Sopenharmony_ci	jiffies.  This detects spontaneous invalid pointer callback
1198c2ecf20Sopenharmony_ci	values, but can be lead to too much corrections for a (mostly
1208c2ecf20Sopenharmony_ci	buggy) hardware that doesn't give smooth pointer updates.
1218c2ecf20Sopenharmony_ci	This feature is enabled via the bit 2.
1228c2ecf20Sopenharmony_ci
1238c2ecf20Sopenharmony_ci``card*/pcm*/sub*/info``
1248c2ecf20Sopenharmony_ci	The general information of this PCM sub-stream.
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_ci``card*/pcm*/sub*/status``
1278c2ecf20Sopenharmony_ci	The current status of this PCM sub-stream, elapsed time,
1288c2ecf20Sopenharmony_ci	H/W position, etc.
1298c2ecf20Sopenharmony_ci
1308c2ecf20Sopenharmony_ci``card*/pcm*/sub*/hw_params``
1318c2ecf20Sopenharmony_ci	The hardware parameters set for this sub-stream.
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_ci``card*/pcm*/sub*/sw_params``
1348c2ecf20Sopenharmony_ci	The soft parameters set for this sub-stream.
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ci``card*/pcm*/sub*/prealloc``
1378c2ecf20Sopenharmony_ci	The buffer pre-allocation information.
1388c2ecf20Sopenharmony_ci
1398c2ecf20Sopenharmony_ci``card*/pcm*/sub*/xrun_injection``
1408c2ecf20Sopenharmony_ci	Triggers an XRUN to the running stream when any value is
1418c2ecf20Sopenharmony_ci	written to this proc file.  Used for fault injection.
1428c2ecf20Sopenharmony_ci	This entry is write-only.
1438c2ecf20Sopenharmony_ci
1448c2ecf20Sopenharmony_ciAC97 Codec Information
1458c2ecf20Sopenharmony_ci======================
1468c2ecf20Sopenharmony_ci
1478c2ecf20Sopenharmony_ci``card*/codec97#*/ac97#?-?``
1488c2ecf20Sopenharmony_ci	Shows the general information of this AC97 codec chip, such as
1498c2ecf20Sopenharmony_ci	name, capabilities, set up.
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_ci``card*/codec97#0/ac97#?-?+regs``
1528c2ecf20Sopenharmony_ci	Shows the AC97 register dump.  Useful for debugging.
1538c2ecf20Sopenharmony_ci
1548c2ecf20Sopenharmony_ci	When CONFIG_SND_DEBUG is enabled, you can write to this file for
1558c2ecf20Sopenharmony_ci	changing an AC97 register directly.  Pass two hex numbers.
1568c2ecf20Sopenharmony_ci	For example,
1578c2ecf20Sopenharmony_ci
1588c2ecf20Sopenharmony_ci::
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_ci	# echo 02 9f1f > /proc/asound/card0/codec97#0/ac97#0-0+regs
1618c2ecf20Sopenharmony_ci
1628c2ecf20Sopenharmony_ci
1638c2ecf20Sopenharmony_ciUSB Audio Streams
1648c2ecf20Sopenharmony_ci=================
1658c2ecf20Sopenharmony_ci
1668c2ecf20Sopenharmony_ci``card*/stream*``
1678c2ecf20Sopenharmony_ci	Shows the assignment and the current status of each audio stream
1688c2ecf20Sopenharmony_ci	of the given card.  This information is very useful for debugging.
1698c2ecf20Sopenharmony_ci
1708c2ecf20Sopenharmony_ci
1718c2ecf20Sopenharmony_ciHD-Audio Codecs
1728c2ecf20Sopenharmony_ci===============
1738c2ecf20Sopenharmony_ci
1748c2ecf20Sopenharmony_ci``card*/codec#*``
1758c2ecf20Sopenharmony_ci	Shows the general codec information and the attribute of each
1768c2ecf20Sopenharmony_ci	widget node.
1778c2ecf20Sopenharmony_ci
1788c2ecf20Sopenharmony_ci``card*/eld#*``
1798c2ecf20Sopenharmony_ci	Available for HDMI or DisplayPort interfaces.
1808c2ecf20Sopenharmony_ci	Shows ELD(EDID Like Data) info retrieved from the attached HDMI sink,
1818c2ecf20Sopenharmony_ci	and describes its audio capabilities and configurations.
1828c2ecf20Sopenharmony_ci
1838c2ecf20Sopenharmony_ci	Some ELD fields may be modified by doing ``echo name hex_value > eld#*``.
1848c2ecf20Sopenharmony_ci	Only do this if you are sure the HDMI sink provided value is wrong.
1858c2ecf20Sopenharmony_ci	And if that makes your HDMI audio work, please report to us so that we
1868c2ecf20Sopenharmony_ci	can fix it in future kernel releases.
1878c2ecf20Sopenharmony_ci
1888c2ecf20Sopenharmony_ci
1898c2ecf20Sopenharmony_ciSequencer Information
1908c2ecf20Sopenharmony_ci=====================
1918c2ecf20Sopenharmony_ci
1928c2ecf20Sopenharmony_ciseq/drivers
1938c2ecf20Sopenharmony_ci	Lists the currently available ALSA sequencer drivers.
1948c2ecf20Sopenharmony_ci
1958c2ecf20Sopenharmony_ciseq/clients
1968c2ecf20Sopenharmony_ci	Shows the list of currently available sequencer clients and
1978c2ecf20Sopenharmony_ci	ports.  The connection status and the running status are shown
1988c2ecf20Sopenharmony_ci	in this file, too.
1998c2ecf20Sopenharmony_ci
2008c2ecf20Sopenharmony_ciseq/queues
2018c2ecf20Sopenharmony_ci	Lists the currently allocated/running sequencer queues.
2028c2ecf20Sopenharmony_ci
2038c2ecf20Sopenharmony_ciseq/timer
2048c2ecf20Sopenharmony_ci	Lists the currently allocated/running sequencer timers.
2058c2ecf20Sopenharmony_ci
2068c2ecf20Sopenharmony_ciseq/oss
2078c2ecf20Sopenharmony_ci	Lists the OSS-compatible sequencer stuffs.
2088c2ecf20Sopenharmony_ci
2098c2ecf20Sopenharmony_ci
2108c2ecf20Sopenharmony_ciHelp For Debugging?
2118c2ecf20Sopenharmony_ci===================
2128c2ecf20Sopenharmony_ci
2138c2ecf20Sopenharmony_ciWhen the problem is related with PCM, first try to turn on xrun_debug
2148c2ecf20Sopenharmony_cimode.  This will give you the kernel messages when and where xrun
2158c2ecf20Sopenharmony_cihappened.
2168c2ecf20Sopenharmony_ci
2178c2ecf20Sopenharmony_ciIf it's really a bug, report it with the following information:
2188c2ecf20Sopenharmony_ci
2198c2ecf20Sopenharmony_ci- the name of the driver/card, show in ``/proc/asound/cards``
2208c2ecf20Sopenharmony_ci- the register dump, if available (e.g. ``card*/cmipci``)
2218c2ecf20Sopenharmony_ci
2228c2ecf20Sopenharmony_ciwhen it's a PCM problem,
2238c2ecf20Sopenharmony_ci
2248c2ecf20Sopenharmony_ci- set-up of PCM, shown in hw_parms, sw_params, and status in the PCM
2258c2ecf20Sopenharmony_ci  sub-stream directory
2268c2ecf20Sopenharmony_ci
2278c2ecf20Sopenharmony_ciwhen it's a mixer problem,
2288c2ecf20Sopenharmony_ci
2298c2ecf20Sopenharmony_ci- AC97 proc files, ``codec97#*/*`` files
2308c2ecf20Sopenharmony_ci
2318c2ecf20Sopenharmony_cifor USB audio/midi,
2328c2ecf20Sopenharmony_ci
2338c2ecf20Sopenharmony_ci- output of ``lsusb -v``
2348c2ecf20Sopenharmony_ci- ``stream*`` files in card directory
2358c2ecf20Sopenharmony_ci
2368c2ecf20Sopenharmony_ci
2378c2ecf20Sopenharmony_ciThe ALSA bug-tracking system is found at:
2388c2ecf20Sopenharmony_cihttps://bugtrack.alsa-project.org/alsa-bug/
239