162306a36Sopenharmony_ci==========================
262306a36Sopenharmony_ciProc Files of ALSA Drivers
362306a36Sopenharmony_ci==========================
462306a36Sopenharmony_ci
562306a36Sopenharmony_ciTakashi Iwai <tiwai@suse.de>
662306a36Sopenharmony_ci
762306a36Sopenharmony_ciGeneral
862306a36Sopenharmony_ci=======
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ciALSA has its own proc tree, /proc/asound.  Many useful information are
1162306a36Sopenharmony_cifound in this tree.  When you encounter a problem and need debugging,
1262306a36Sopenharmony_cicheck the files listed in the following sections.
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ciEach card has its subtree cardX, where X is from 0 to 7. The
1562306a36Sopenharmony_cicard-specific files are stored in the ``card*`` subdirectories.
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ciGlobal Information
1962306a36Sopenharmony_ci==================
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_cicards
2262306a36Sopenharmony_ci	Shows the list of currently configured ALSA drivers,
2362306a36Sopenharmony_ci	index, the id string, short and long descriptions.
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_civersion
2662306a36Sopenharmony_ci	Shows the version string and compile date.
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_cimodules
2962306a36Sopenharmony_ci	Lists the module of each card
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_cidevices
3262306a36Sopenharmony_ci	Lists the ALSA native device mappings.
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_cimeminfo
3562306a36Sopenharmony_ci	Shows the status of allocated pages via ALSA drivers.
3662306a36Sopenharmony_ci	Appears only when ``CONFIG_SND_DEBUG=y``.
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_cihwdep
3962306a36Sopenharmony_ci	Lists the currently available hwdep devices in format of
4062306a36Sopenharmony_ci	``<card>-<device>: <name>``
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_cipcm
4362306a36Sopenharmony_ci	Lists the currently available PCM devices in format of
4462306a36Sopenharmony_ci	``<card>-<device>: <id>: <name> : <sub-streams>``
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_citimer
4762306a36Sopenharmony_ci	Lists the currently available timer devices
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_cioss/devices
5162306a36Sopenharmony_ci	Lists the OSS device mappings.
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_cioss/sndstat
5462306a36Sopenharmony_ci	Provides the output compatible with /dev/sndstat.
5562306a36Sopenharmony_ci	You can symlink this to /dev/sndstat.
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_ciCard Specific Files
5962306a36Sopenharmony_ci===================
6062306a36Sopenharmony_ci
6162306a36Sopenharmony_ciThe card-specific files are found in ``/proc/asound/card*`` directories.
6262306a36Sopenharmony_ciSome drivers (e.g. cmipci) have their own proc entries for the
6362306a36Sopenharmony_ciregister dump, etc (e.g. ``/proc/asound/card*/cmipci`` shows the register
6462306a36Sopenharmony_cidump).  These files would be really helpful for debugging.
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ciWhen PCM devices are available on this card, you can see directories
6762306a36Sopenharmony_cilike pcm0p or pcm1c.  They hold the PCM information for each PCM
6862306a36Sopenharmony_cistream.  The number after ``pcm`` is the PCM device number from 0, and
6962306a36Sopenharmony_cithe last ``p`` or ``c`` means playback or capture direction.  The files in
7062306a36Sopenharmony_cithis subtree is described later.
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_ciThe status of MIDI I/O is found in ``midi*`` files.  It shows the device
7362306a36Sopenharmony_ciname and the received/transmitted bytes through the MIDI device.
7462306a36Sopenharmony_ci
7562306a36Sopenharmony_ciWhen the card is equipped with AC97 codecs, there are ``codec97#*``
7662306a36Sopenharmony_cisubdirectories (described later).
7762306a36Sopenharmony_ci
7862306a36Sopenharmony_ciWhen the OSS mixer emulation is enabled (and the module is loaded),
7962306a36Sopenharmony_cioss_mixer file appears here, too.  This shows the current mapping of
8062306a36Sopenharmony_ciOSS mixer elements to the ALSA control elements.  You can change the
8162306a36Sopenharmony_cimapping by writing to this device.  Read OSS-Emulation.txt for
8262306a36Sopenharmony_cidetails.
8362306a36Sopenharmony_ci
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_ciPCM Proc Files
8662306a36Sopenharmony_ci==============
8762306a36Sopenharmony_ci
8862306a36Sopenharmony_ci``card*/pcm*/info``
8962306a36Sopenharmony_ci	The general information of this PCM device: card #, device #,
9062306a36Sopenharmony_ci	substreams, etc.
9162306a36Sopenharmony_ci
9262306a36Sopenharmony_ci``card*/pcm*/xrun_debug``
9362306a36Sopenharmony_ci	This file appears when ``CONFIG_SND_DEBUG=y`` and
9462306a36Sopenharmony_ci	``CONFIG_SND_PCM_XRUN_DEBUG=y``.
9562306a36Sopenharmony_ci	This shows the status of xrun (= buffer overrun/xrun) and
9662306a36Sopenharmony_ci	invalid PCM position debug/check of ALSA PCM middle layer.
9762306a36Sopenharmony_ci	It takes an integer value, can be changed by writing to this
9862306a36Sopenharmony_ci	file, such as::
9962306a36Sopenharmony_ci
10062306a36Sopenharmony_ci		 # echo 5 > /proc/asound/card0/pcm0p/xrun_debug
10162306a36Sopenharmony_ci
10262306a36Sopenharmony_ci	The value consists of the following bit flags:
10362306a36Sopenharmony_ci
10462306a36Sopenharmony_ci	* bit 0 = Enable XRUN/jiffies debug messages
10562306a36Sopenharmony_ci	* bit 1 = Show stack trace at XRUN / jiffies check
10662306a36Sopenharmony_ci	* bit 2 = Enable additional jiffies check
10762306a36Sopenharmony_ci
10862306a36Sopenharmony_ci	When the bit 0 is set, the driver will show the messages to
10962306a36Sopenharmony_ci	kernel log when an xrun is detected.  The debug message is
11062306a36Sopenharmony_ci	shown also when the invalid H/W pointer is detected at the
11162306a36Sopenharmony_ci	update of periods (usually called from the interrupt
11262306a36Sopenharmony_ci	handler).
11362306a36Sopenharmony_ci
11462306a36Sopenharmony_ci	When the bit 1 is set, the driver will show the stack trace
11562306a36Sopenharmony_ci	additionally.  This may help the debugging.
11662306a36Sopenharmony_ci
11762306a36Sopenharmony_ci	Since 2.6.30, this option can enable the hwptr check using
11862306a36Sopenharmony_ci	jiffies.  This detects spontaneous invalid pointer callback
11962306a36Sopenharmony_ci	values, but can be lead to too much corrections for a (mostly
12062306a36Sopenharmony_ci	buggy) hardware that doesn't give smooth pointer updates.
12162306a36Sopenharmony_ci	This feature is enabled via the bit 2.
12262306a36Sopenharmony_ci
12362306a36Sopenharmony_ci``card*/pcm*/sub*/info``
12462306a36Sopenharmony_ci	The general information of this PCM sub-stream.
12562306a36Sopenharmony_ci
12662306a36Sopenharmony_ci``card*/pcm*/sub*/status``
12762306a36Sopenharmony_ci	The current status of this PCM sub-stream, elapsed time,
12862306a36Sopenharmony_ci	H/W position, etc.
12962306a36Sopenharmony_ci
13062306a36Sopenharmony_ci``card*/pcm*/sub*/hw_params``
13162306a36Sopenharmony_ci	The hardware parameters set for this sub-stream.
13262306a36Sopenharmony_ci
13362306a36Sopenharmony_ci``card*/pcm*/sub*/sw_params``
13462306a36Sopenharmony_ci	The soft parameters set for this sub-stream.
13562306a36Sopenharmony_ci
13662306a36Sopenharmony_ci``card*/pcm*/sub*/prealloc``
13762306a36Sopenharmony_ci	The buffer pre-allocation information.
13862306a36Sopenharmony_ci
13962306a36Sopenharmony_ci``card*/pcm*/sub*/xrun_injection``
14062306a36Sopenharmony_ci	Triggers an XRUN to the running stream when any value is
14162306a36Sopenharmony_ci	written to this proc file.  Used for fault injection.
14262306a36Sopenharmony_ci	This entry is write-only.
14362306a36Sopenharmony_ci
14462306a36Sopenharmony_ciAC97 Codec Information
14562306a36Sopenharmony_ci======================
14662306a36Sopenharmony_ci
14762306a36Sopenharmony_ci``card*/codec97#*/ac97#?-?``
14862306a36Sopenharmony_ci	Shows the general information of this AC97 codec chip, such as
14962306a36Sopenharmony_ci	name, capabilities, set up.
15062306a36Sopenharmony_ci
15162306a36Sopenharmony_ci``card*/codec97#0/ac97#?-?+regs``
15262306a36Sopenharmony_ci	Shows the AC97 register dump.  Useful for debugging.
15362306a36Sopenharmony_ci
15462306a36Sopenharmony_ci	When CONFIG_SND_DEBUG is enabled, you can write to this file for
15562306a36Sopenharmony_ci	changing an AC97 register directly.  Pass two hex numbers.
15662306a36Sopenharmony_ci	For example,
15762306a36Sopenharmony_ci
15862306a36Sopenharmony_ci::
15962306a36Sopenharmony_ci
16062306a36Sopenharmony_ci	# echo 02 9f1f > /proc/asound/card0/codec97#0/ac97#0-0+regs
16162306a36Sopenharmony_ci
16262306a36Sopenharmony_ci
16362306a36Sopenharmony_ciUSB Audio Streams
16462306a36Sopenharmony_ci=================
16562306a36Sopenharmony_ci
16662306a36Sopenharmony_ci``card*/stream*``
16762306a36Sopenharmony_ci	Shows the assignment and the current status of each audio stream
16862306a36Sopenharmony_ci	of the given card.  This information is very useful for debugging.
16962306a36Sopenharmony_ci
17062306a36Sopenharmony_ci
17162306a36Sopenharmony_ciHD-Audio Codecs
17262306a36Sopenharmony_ci===============
17362306a36Sopenharmony_ci
17462306a36Sopenharmony_ci``card*/codec#*``
17562306a36Sopenharmony_ci	Shows the general codec information and the attribute of each
17662306a36Sopenharmony_ci	widget node.
17762306a36Sopenharmony_ci
17862306a36Sopenharmony_ci``card*/eld#*``
17962306a36Sopenharmony_ci	Available for HDMI or DisplayPort interfaces.
18062306a36Sopenharmony_ci	Shows ELD(EDID Like Data) info retrieved from the attached HDMI sink,
18162306a36Sopenharmony_ci	and describes its audio capabilities and configurations.
18262306a36Sopenharmony_ci
18362306a36Sopenharmony_ci	Some ELD fields may be modified by doing ``echo name hex_value > eld#*``.
18462306a36Sopenharmony_ci	Only do this if you are sure the HDMI sink provided value is wrong.
18562306a36Sopenharmony_ci	And if that makes your HDMI audio work, please report to us so that we
18662306a36Sopenharmony_ci	can fix it in future kernel releases.
18762306a36Sopenharmony_ci
18862306a36Sopenharmony_ci
18962306a36Sopenharmony_ciSequencer Information
19062306a36Sopenharmony_ci=====================
19162306a36Sopenharmony_ci
19262306a36Sopenharmony_ciseq/drivers
19362306a36Sopenharmony_ci	Lists the currently available ALSA sequencer drivers.
19462306a36Sopenharmony_ci
19562306a36Sopenharmony_ciseq/clients
19662306a36Sopenharmony_ci	Shows the list of currently available sequencer clients and
19762306a36Sopenharmony_ci	ports.  The connection status and the running status are shown
19862306a36Sopenharmony_ci	in this file, too.
19962306a36Sopenharmony_ci
20062306a36Sopenharmony_ciseq/queues
20162306a36Sopenharmony_ci	Lists the currently allocated/running sequencer queues.
20262306a36Sopenharmony_ci
20362306a36Sopenharmony_ciseq/timer
20462306a36Sopenharmony_ci	Lists the currently allocated/running sequencer timers.
20562306a36Sopenharmony_ci
20662306a36Sopenharmony_ciseq/oss
20762306a36Sopenharmony_ci	Lists the OSS-compatible sequencer stuffs.
20862306a36Sopenharmony_ci
20962306a36Sopenharmony_ci
21062306a36Sopenharmony_ciHelp For Debugging?
21162306a36Sopenharmony_ci===================
21262306a36Sopenharmony_ci
21362306a36Sopenharmony_ciWhen the problem is related with PCM, first try to turn on xrun_debug
21462306a36Sopenharmony_cimode.  This will give you the kernel messages when and where xrun
21562306a36Sopenharmony_cihappened.
21662306a36Sopenharmony_ci
21762306a36Sopenharmony_ciIf it's really a bug, report it with the following information:
21862306a36Sopenharmony_ci
21962306a36Sopenharmony_ci- the name of the driver/card, show in ``/proc/asound/cards``
22062306a36Sopenharmony_ci- the register dump, if available (e.g. ``card*/cmipci``)
22162306a36Sopenharmony_ci
22262306a36Sopenharmony_ciwhen it's a PCM problem,
22362306a36Sopenharmony_ci
22462306a36Sopenharmony_ci- set-up of PCM, shown in hw_parms, sw_params, and status in the PCM
22562306a36Sopenharmony_ci  sub-stream directory
22662306a36Sopenharmony_ci
22762306a36Sopenharmony_ciwhen it's a mixer problem,
22862306a36Sopenharmony_ci
22962306a36Sopenharmony_ci- AC97 proc files, ``codec97#*/*`` files
23062306a36Sopenharmony_ci
23162306a36Sopenharmony_cifor USB audio/midi,
23262306a36Sopenharmony_ci
23362306a36Sopenharmony_ci- output of ``lsusb -v``
23462306a36Sopenharmony_ci- ``stream*`` files in card directory
23562306a36Sopenharmony_ci
23662306a36Sopenharmony_ci
23762306a36Sopenharmony_ciThe ALSA bug-tracking system is found at:
23862306a36Sopenharmony_cihttps://bugtrack.alsa-project.org/alsa-bug/
239