diff options
Diffstat (limited to 'Documentation/sound')
30 files changed, 1334 insertions, 708 deletions
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt index d0eb696d32e..7ccf933bfbe 100644 --- a/Documentation/sound/alsa/ALSA-Configuration.txt +++ b/Documentation/sound/alsa/ALSA-Configuration.txt @@ -322,7 +322,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.      "port" needs to match the BASE ADDRESS jumper on the card (0x220 or 0x240)      or the value stored in the card's EEPROM for cards that have an EEPROM and      their "CONFIG MODE" jumper set to "EEPROM SETTING". The other values can -    be choosen freely from the options enumerated above. +    be chosen freely from the options enumerated above.      If dma2 is specified and different from dma1, the card will operate in      full-duplex mode. When dma1=3, only dma2=0 is valid and the only way to @@ -356,7 +356,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.      "port" needs to match the BASE ADDRESS jumper on the card (0x220 or 0x240)      or the value stored in the card's EEPROM for cards that have an EEPROM and      their "CONFIG MODE" jumper set to "EEPROM SETTING". The other values can -    be choosen freely from the options enumerated above. +    be chosen freely from the options enumerated above.      If dma2 is specified and different from dma1, the card will operate in      full-duplex mode. When dma1=3, only dma2=0 is valid and the only way to @@ -616,7 +616,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.      As default, snd-dummy drivers doesn't allocate the real buffers      but either ignores read/write or mmap a single dummy page to all -    buffer pages, in order to save the resouces.  If your apps need +    buffer pages, in order to save the resources.  If your apps need      the read/ written buffer data to be consistent, pass fake_buffer=0      option. @@ -860,7 +860,14 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.      [Multiple options for each card instance]      model	- force the model name -    position_fix - Fix DMA pointer (0 = auto, 1 = use LPIB, 2 = POSBUF) +    position_fix - Fix DMA pointer +		  -1 = system default: choose appropriate one per controller +			hardware +		  0 = auto: falls back to LPIB when POSBUF doesn't work +		  1 = use LPIB +		  2 = POSBUF: use position buffer +		  3 = VIACOMBO: VIA-specific workaround for capture +		  4 = COMBO: use LPIB for playback, auto for capture stream      probe_mask  - Bitmask to probe codecs (default = -1, meaning all slots)      		  When the bit 8 (0x100) is set, the lower 8 bits are used  		  as the "fixed" codec slots; i.e. the driver probes the @@ -874,8 +881,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.      		setup before initializing the codecs.  This option is  		available only when CONFIG_SND_HDA_PATCH_LOADER=y is set.  		See HD-Audio.txt for details. -    beep_mode	- Selects the beep registration mode (0=off, 1=on, 2= -		dynamic registration via mute switch on/off); the default +    beep_mode	- Selects the beep registration mode (0=off, 1=on); default  		value is set via CONFIG_SND_HDA_INPUT_BEEP_MODE kconfig.      [Single (global) options] @@ -886,6 +892,12 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.  		disable)      power_save_controller - Reset HD-audio controller in power-saving mode  		(default = on) +    align_buffer_size - Force rounding of buffer/period sizes to multiples +    		      of 128 bytes. This is more efficient in terms of memory +		      access but isn't required by the HDA spec and prevents +		      users from specifying exact period/buffer sizes. +		      (default = on) +    snoop	- Enable/disable snooping (default = on)      This module supports multiple cards and autoprobe. @@ -899,7 +911,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.      models depending on the codec chip.  The list of available models      is found in HD-Audio-Models.txt -    The model name "genric" is treated as a special case.  When this +    The model name "generic" is treated as a special case.  When this      model is given, the driver uses the generic codec parser without      "codec-patch".  It's sometimes good for testing and debugging. @@ -919,6 +931,11 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.  	    (Usually SD_LPIB register is more accurate than the  	    position buffer.) +	    position_fix=3 is specific to VIA devices.  The position +	    of the capture stream is checked from both LPIB and POSBUF +	    values.  position_fix=4 is a combination mode, using LPIB +	    for playback and POSBUF for capture. +      NB: If you get many "azx_get_response timeout" messages at      loading, it's likely a problem of interrupts (e.g. ACPI irq      routing).  Try to boot with options like "pci=noacpi".  Also, you @@ -931,7 +948,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.      avoided as much as possible...      MORE NOTES ON "azx_get_response timeout" PROBLEMS: -    On some hardwares, you may need to add a proper probe_mask option +    On some hardware, you may need to add a proper probe_mask option      to avoid the "azx_get_response timeout" problem above, instead.      This occurs when the access to non-existing or non-working codec slot      (likely a modem one) causes a stall of the communication via HD-audio @@ -974,13 +991,6 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.      See hdspm.txt for details. -  Module snd-hifier -  ----------------- - -    Module for the MediaTek/TempoTec HiFier Fantasia sound card. - -    This module supports autoprobe and multiple cards. -    Module snd-ice1712    ------------------ @@ -1114,7 +1124,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.      buggy_irq     - Enable workaround for buggy interrupts on some                      motherboards (default yes on nForce chips,  		    otherwise off) -    buggy_semaphore - Enable workaround for hardwares with buggy +    buggy_semaphore - Enable workaround for hardware with buggy  		    semaphores (e.g. on some ASUS laptops)  		    (default off)      spdif_aclink  - Use S/PDIF over AC-link instead of direct connection @@ -1237,6 +1247,13 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.      This module supports multiple cards.      The driver requires the firmware loader support on kernel. +  Module snd-lola +  --------------- + +    Module for Digigram Lola PCI-e boards + +    This module supports multiple cards. +    Module snd-lx6464es    ------------------- @@ -1531,15 +1548,20 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.    Module snd-oxygen    ----------------- -    Module for sound cards based on the C-Media CMI8788 chip: +    Module for sound cards based on the C-Media CMI8786/8787/8788 chip:      * Asound A-8788 +    * Asus Xonar DG/DGX      * AuzenTech X-Meridian +    * AuzenTech X-Meridian 2G      * Bgears b-Enspirer      * Club3D Theatron DTS      * HT-Omega Claro (plus)      * HT-Omega Claro halo (XT) +    * Kuroutoshikou CMI8787-HG2PCI      * Razer Barracuda AC-1      * Sondigo Inferno +    * TempoTec HiFier Fantasia +    * TempoTec HiFier Serenade      This module supports autoprobe and multiple cards. @@ -1577,7 +1599,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.      Module supports autoprobe a chip. -    Note: the driver may have problems regarding endianess. +    Note: the driver may have problems regarding endianness.      The power-management is supported. @@ -1883,7 +1905,6 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.      vid             - Vendor ID for the device (optional)      pid             - Product ID for the device (optional)      nrpacks	    - Max. number of packets per URB (default: 8) -    async_unlink    - Use async unlink mode (default: yes)      device_setup    - Device specific magic number (optional)                      - Influence depends on the device                      - Default: 0x0000  @@ -1895,8 +1916,6 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.      NB: nrpacks parameter can be modified dynamically via sysfs.          Don't put the value over 20.  Changing via sysfs has no sanity  	check. -    NB: async_unlink=0 would cause Oops.  It remains just for -        debugging purpose (if any).      NB: ignore_ctl_error=1 may help when you get an error at accessing          the mixer element such as URB error -22.  This happens on some          buggy USB device or the controller. @@ -2006,9 +2025,9 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.    Module snd-virtuoso    ------------------- -    Module for sound cards based on the Asus AV100/AV200 chips, -    i.e., Xonar D1, DX, D2, D2X, DS, HDAV1.3 (Deluxe), Essence ST -    (Deluxe) and Essence STX. +    Module for sound cards based on the Asus AV66/AV100/AV200 chips, +    i.e., Xonar D1, DX, D2, D2X, DS, Essence ST (Deluxe), Essence STX, +    HDAV1.3 (Deluxe), and HDAV1.3 Slim.      This module supports autoprobe and multiple cards. @@ -2027,7 +2046,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.      Install the necessary firmware files in alsa-firmware package.      When no hotplug fw loader is available, you need to load the      firmware via vxloader utility in alsa-tools package.  To invoke -    vxloader automatically, add the following to /etc/modprobe.conf +    vxloader automatically, add the following to /etc/modprobe.d/alsa.conf  	install snd-vx222 /sbin/modprobe --first-time -i snd-vx222 && /usr/bin/vxloader @@ -2151,10 +2170,10 @@ corresponds to the card index of ALSA.  Usually, define this  as the same card module.  An example configuration for a single emu10k1 card is like below: ------ /etc/modprobe.conf +----- /etc/modprobe.d/alsa.conf  alias snd-card-0 snd-emu10k1  alias sound-slot-0 snd-emu10k1 ------ /etc/modprobe.conf +----- /etc/modprobe.d/alsa.conf  The available number of auto-loaded sound cards depends on the module  option "cards_limit" of snd module.  As default it's set to 1. @@ -2167,7 +2186,7 @@ cards is kept consistent.  An example configuration for two sound cards is like below: ------ /etc/modprobe.conf +----- /etc/modprobe.d/alsa.conf  # ALSA portion  options snd cards_limit=2  alias snd-card-0 snd-interwave @@ -2177,7 +2196,7 @@ options snd-ens1371 index=1  # OSS/Free portion  alias sound-slot-0 snd-interwave  alias sound-slot-1 snd-ens1371 ------ /etc/modprobe.conf +----- /etc/modprobe.d/alsa.conf  In this example, the interwave card is always loaded as the first card  (index 0) and ens1371 as the second (index 1). @@ -2231,7 +2250,7 @@ Proc interfaces (/proc/asound)  /proc/asound/card#/pcm#[cp]/oss  ------------------------------- -  String "erase" - erase all additional informations about OSS applications +  String "erase" - erase all additional information about OSS applications    String "<app_name> <fragments> <fragment_size> [<options>]"     <app_name> - name of application with (higher priority) or without path diff --git a/Documentation/sound/alsa/Audiophile-Usb.txt b/Documentation/sound/alsa/Audiophile-Usb.txt index a4c53d8961e..e7a5ed4dcae 100644 --- a/Documentation/sound/alsa/Audiophile-Usb.txt +++ b/Documentation/sound/alsa/Audiophile-Usb.txt @@ -232,7 +232,7 @@ The parameter can be given:     # modprobe snd-usb-audio index=1 device_setup=0x09   * Or while configuring the modules options in your modules configuration file -   - For Fedora distributions, edit the /etc/modprobe.conf file: +   (typically a .conf file in /etc/modprobe.d/ directory:         alias snd-card-1 snd-usb-audio         options snd-usb-audio index=1 device_setup=0x09 @@ -253,7 +253,7 @@ CAUTION when initializing the device     - first turn off the device     - de-register the snd-usb-audio module (modprobe -r)     - change the device_setup parameter by changing the device_setup -     option in /etc/modprobe.conf  +     option in /etc/modprobe.d/*.conf     - turn on the device   * A workaround for this last issue has been applied to kernel 2.6.23, but it may not     be enough to ensure the 'stability' of the device initialization. diff --git a/Documentation/sound/alsa/CMIPCI.txt b/Documentation/sound/alsa/CMIPCI.txt index 16935c8561f..4e36e6e809c 100644 --- a/Documentation/sound/alsa/CMIPCI.txt +++ b/Documentation/sound/alsa/CMIPCI.txt @@ -87,7 +87,7 @@ with 4 channels,  and use the interleaved 4 channel data. -There are some control switchs affecting to the speaker connections: +There are some control switches affecting to the speaker connections:  "Line-In Mode"	- an enum control to change the behavior of line-in  	jack.  Either "Line-In", "Rear Output" or "Bass Output" can diff --git a/Documentation/sound/alsa/Channel-Mapping-API.txt b/Documentation/sound/alsa/Channel-Mapping-API.txt new file mode 100644 index 00000000000..3c43d1a4ca0 --- /dev/null +++ b/Documentation/sound/alsa/Channel-Mapping-API.txt @@ -0,0 +1,153 @@ +ALSA PCM channel-mapping API +============================ +					Takashi Iwai <tiwai@suse.de> + +GENERAL +------- + +The channel mapping API allows user to query the possible channel maps +and the current channel map, also optionally to modify the channel map +of the current stream. + +A channel map is an array of position for each PCM channel. +Typically, a stereo PCM stream has a channel map of +  { front_left, front_right } +while a 4.0 surround PCM stream has a channel map of +  { front left, front right, rear left, rear right }. + +The problem, so far, was that we had no standard channel map +explicitly, and applications had no way to know which channel +corresponds to which (speaker) position.  Thus, applications applied +wrong channels for 5.1 outputs, and you hear suddenly strange sound +from rear.  Or, some devices secretly assume that center/LFE is the +third/fourth channels while others that C/LFE as 5th/6th channels. + +Also, some devices such as HDMI are configurable for different speaker +positions even with the same number of total channels.  However, there +was no way to specify this because of lack of channel map +specification.  These are the main motivations for the new channel +mapping API. + + +DESIGN +------ + +Actually, "the channel mapping API" doesn't introduce anything new in +the kernel/user-space ABI perspective.  It uses only the existing +control element features. + +As a ground design, each PCM substream may contain a control element +providing the channel mapping information and configuration.  This +element is specified by: +	iface = SNDRV_CTL_ELEM_IFACE_PCM +	name = "Playback Channel Map" or "Capture Channel Map" +	device = the same device number for the assigned PCM substream +	index = the same index number for the assigned PCM substream + +Note the name is different depending on the PCM substream direction. + +Each control element provides at least the TLV read operation and the +read operation.  Optionally, the write operation can be provided to +allow user to change the channel map dynamically. + +* TLV + +The TLV operation gives the list of available channel +maps.  A list item of a channel map is usually a TLV of +	type data-bytes ch0 ch1 ch2... +where type is the TLV type value, the second argument is the total +bytes (not the numbers) of channel values, and the rest are the +position value for each channel. + +As a TLV type, either SNDRV_CTL_TLVT_CHMAP_FIXED, +SNDRV_CTL_TLV_CHMAP_VAR or SNDRV_CTL_TLVT_CHMAP_PAIRED can be used. +The _FIXED type is for a channel map with the fixed channel position +while the latter two are for flexible channel positions.  _VAR type is +for a channel map where all channels are freely swappable and _PAIRED +type is where pair-wise channels are swappable.  For example, when you +have {FL/FR/RL/RR} channel map, _PAIRED type would allow you to swap +only {RL/RR/FL/FR} while _VAR type would allow even swapping FL and +RR. + +These new TLV types are defined in sound/tlv.h. + +The available channel position values are defined in sound/asound.h, +here is a cut: + +/* channel positions */ +enum { +	SNDRV_CHMAP_UNKNOWN = 0, +	SNDRV_CHMAP_NA,		/* N/A, silent */ +	SNDRV_CHMAP_MONO,	/* mono stream */ +	/* this follows the alsa-lib mixer channel value + 3 */ +	SNDRV_CHMAP_FL,		/* front left */ +	SNDRV_CHMAP_FR,		/* front right */ +	SNDRV_CHMAP_RL,		/* rear left */ +	SNDRV_CHMAP_RR,		/* rear right */ +	SNDRV_CHMAP_FC,		/* front center */ +	SNDRV_CHMAP_LFE,	/* LFE */ +	SNDRV_CHMAP_SL,		/* side left */ +	SNDRV_CHMAP_SR,		/* side right */ +	SNDRV_CHMAP_RC,		/* rear center */ +	/* new definitions */ +	SNDRV_CHMAP_FLC,	/* front left center */ +	SNDRV_CHMAP_FRC,	/* front right center */ +	SNDRV_CHMAP_RLC,	/* rear left center */ +	SNDRV_CHMAP_RRC,	/* rear right center */ +	SNDRV_CHMAP_FLW,	/* front left wide */ +	SNDRV_CHMAP_FRW,	/* front right wide */ +	SNDRV_CHMAP_FLH,	/* front left high */ +	SNDRV_CHMAP_FCH,	/* front center high */ +	SNDRV_CHMAP_FRH,	/* front right high */ +	SNDRV_CHMAP_TC,		/* top center */ +	SNDRV_CHMAP_TFL,	/* top front left */ +	SNDRV_CHMAP_TFR,	/* top front right */ +	SNDRV_CHMAP_TFC,	/* top front center */ +	SNDRV_CHMAP_TRL,	/* top rear left */ +	SNDRV_CHMAP_TRR,	/* top rear right */ +	SNDRV_CHMAP_TRC,	/* top rear center */ +	SNDRV_CHMAP_LAST = SNDRV_CHMAP_TRC, +}; + +When a PCM stream can provide more than one channel map, you can +provide multiple channel maps in a TLV container type.  The TLV data +to be returned will contain such as: +	SNDRV_CTL_TLVT_CONTAINER 96 +	    SNDRV_CTL_TLVT_CHMAP_FIXED 4 SNDRV_CHMAP_FC +	    SNDRV_CTL_TLVT_CHMAP_FIXED 8 SNDRV_CHMAP_FL SNDRV_CHMAP_FR +	    SNDRV_CTL_TLVT_CHMAP_FIXED 16 NDRV_CHMAP_FL SNDRV_CHMAP_FR \ +		SNDRV_CHMAP_RL SNDRV_CHMAP_RR + +The channel position is provided in LSB 16bits.  The upper bits are +used for bit flags. + +#define SNDRV_CHMAP_POSITION_MASK	0xffff +#define SNDRV_CHMAP_PHASE_INVERSE	(0x01 << 16) +#define SNDRV_CHMAP_DRIVER_SPEC		(0x02 << 16) + +SNDRV_CHMAP_PHASE_INVERSE indicates the channel is phase inverted, +(thus summing left and right channels would result in almost silence). +Some digital mic devices have this. + +When SNDRV_CHMAP_DRIVER_SPEC is set, all the channel position values +don't follow the standard definition above but driver-specific. + +* READ OPERATION + +The control read operation is for providing the current channel map of +the given stream.  The control element returns an integer array +containing the position of each channel. + +When this is performed before the number of the channel is specified +(i.e. hw_params is set), it should return all channels set to +UNKNOWN. + +* WRITE OPERATION + +The control write operation is optional, and only for devices that can +change the channel configuration on the fly, such as HDMI.  User needs +to pass an integer value containing the valid channel positions for +all channels of the assigned PCM substream. + +This operation is allowed only at PCM PREPARED state.  When called in +other states, it shall return an error. diff --git a/Documentation/sound/alsa/HD-Audio-Controls.txt b/Documentation/sound/alsa/HD-Audio-Controls.txt new file mode 100644 index 00000000000..e9621e349e1 --- /dev/null +++ b/Documentation/sound/alsa/HD-Audio-Controls.txt @@ -0,0 +1,116 @@ +This file explains the codec-specific mixer controls. + +Realtek codecs +-------------- + +* Channel Mode +  This is an enum control to change the surround-channel setup, +  appears only when the surround channels are available. +  It gives the number of channels to be used, "2ch", "4ch", "6ch", +  and "8ch".  According to the configuration, this also controls the +  jack-retasking of multi-I/O jacks. + +* Auto-Mute Mode +  This is an enum control to change the auto-mute behavior of the +  headphone and line-out jacks.  If built-in speakers and headphone +  and/or line-out jacks are available on a machine, this controls +  appears. +  When there are only either headphones or line-out jacks, it gives +  "Disabled" and "Enabled" state.  When enabled, the speaker is muted +  automatically when a jack is plugged. + +  When both headphone and line-out jacks are present, it gives +  "Disabled", "Speaker Only" and "Line-Out+Speaker".  When +  speaker-only is chosen, plugging into a headphone or a line-out jack +  mutes the speakers, but not line-outs.  When line-out+speaker is +  selected, plugging to a headphone jack mutes both speakers and +  line-outs. + + +IDT/Sigmatel codecs +------------------- + +* Analog Loopback +  This control enables/disables the analog-loopback circuit.  This +  appears only when "loopback" is set to true in a codec hint +  (see HD-Audio.txt).  Note that on some codecs the analog-loopback +  and the normal PCM playback are exclusive, i.e. when this is on, you +  won't hear any PCM stream. + +* Swap Center/LFE +  Swaps the center and LFE channel order.  Normally, the left +  corresponds to the center and the right to the LFE.  When this is +  ON, the left to the LFE and the right to the center. + +* Headphone as Line Out +  When this control is ON, treat the headphone jacks as line-out +  jacks.  That is, the headphone won't auto-mute the other line-outs, +  and no HP-amp is set to the pins. + +* Mic Jack Mode, Line Jack Mode, etc +  These enum controls the direction and the bias of the input jack +  pins.  Depending on the jack type, it can set as "Mic In" and "Line  +  In", for determining the input bias, or it can be set to "Line Out" +  when the pin is a multi-I/O jack for surround channels. + + +VIA codecs +---------- + +* Smart 5.1 +  An enum control to re-task the multi-I/O jacks for surround outputs. +  When it's ON, the corresponding input jacks (usually a line-in and a +  mic-in) are switched as the surround and the CLFE output jacks. + +* Independent HP +  When this enum control is enabled, the headphone output is routed +  from an individual stream (the third PCM such as hw:0,2) instead of +  the primary stream.  In the case the headphone DAC is shared with a +  side or a CLFE-channel DAC, the DAC is switched to the headphone +  automatically. + +* Loopback Mixing +  An enum control to determine whether the analog-loopback route is +  enabled or not.  When it's enabled, the analog-loopback is mixed to +  the front-channel.  Also, the same route is used for the headphone +  and speaker outputs.  As a side-effect, when this mode is set, the +  individual volume controls will be no longer available for +  headphones and speakers because there is only one DAC connected to a +  mixer widget. + +* Dynamic Power-Control +  This control determines whether the dynamic power-control per jack +  detection is enabled or not.  When enabled, the widgets power state +  (D0/D3) are changed dynamically depending on the jack plugging +  state for saving power consumptions.  However, if your system +  doesn't provide a proper jack-detection, this won't work; in such a +  case, turn this control OFF. + +* Jack Detect +  This control is provided only for VT1708 codec which gives no proper +  unsolicited event per jack plug.  When this is on, the driver polls +  the jack detection so that the headphone auto-mute can work, while  +  turning this off would reduce the power consumption. + + +Conexant codecs +--------------- + +* Auto-Mute Mode +  See Reatek codecs. + + +Analog codecs +-------------- + +* Channel Mode +  This is an enum control to change the surround-channel setup, +  appears only when the surround channels are available. +  It gives the number of channels to be used, "2ch", "4ch" and "6ch". +  According to the configuration, this also controls the +  jack-retasking of multi-I/O jacks. + +* Independent HP +  When this enum control is enabled, the headphone output is routed +  from an individual stream (the third PCM such as hw:0,2) instead of +  the primary stream. diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt b/Documentation/sound/alsa/HD-Audio-Models.txt index 37c6aad5e59..d1ab5e17eb1 100644 --- a/Documentation/sound/alsa/HD-Audio-Models.txt +++ b/Documentation/sound/alsa/HD-Audio-Models.txt @@ -8,196 +8,64 @@ ALC880    5stack-digout	5-jack in back, 2-jack in front, a SPDIF out    6stack	6-jack in back, 2-jack in front    6stack-digout	6-jack with a SPDIF out -  w810		3-jack -  z71v		3-jack (HP shared SPDIF) -  asus		3-jack (ASUS Mobo) -  asus-w1v	ASUS W1V -  asus-dig	ASUS with SPDIF out -  asus-dig2	ASUS with SPDIF out (using GPIO2) -  uniwill	3-jack -  fujitsu	Fujitsu Laptops (Pi1536) -  F1734		2-jack -  lg		LG laptop (m1 express dual) -  lg-lw		LG LW20/LW25 laptop -  tcl		TCL S700 -  clevo		Clevo laptops (m520G, m665n) -  medion	Medion Rim 2150 -  test		for testing/debugging purpose, almost all controls can be -		adjusted.  Appearing only when compiled with -		$CONFIG_SND_DEBUG=y -  auto		auto-config reading BIOS (default)  ALC260  ====== -  hp		HP machines -  hp-3013	HP machines (3013-variant) -  hp-dc7600	HP DC7600 -  fujitsu	Fujitsu S7020 -  acer		Acer TravelMate -  will		Will laptops (PB V7900) -  replacer	Replacer 672V -  favorit100	Maxdata Favorit 100XS -  basic		fixed pin assignment (old default model) -  test		for testing/debugging purpose, almost all controls can -		adjusted.  Appearing only when compiled with -		$CONFIG_SND_DEBUG=y -  auto		auto-config reading BIOS (default) +  N/A  ALC262  ====== -  fujitsu	Fujitsu Laptop -  hp-bpc	HP xw4400/6400/8400/9400 laptops -  hp-bpc-d7000	HP BPC D7000 -  hp-tc-t5735	HP Thin Client T5735 -  hp-rp5700	HP RP5700 -  benq		Benq ED8 -  benq-t31	Benq T31 -  hippo		Hippo (ATI) with jack detection, Sony UX-90s -  hippo_1	Hippo (Benq) with jack detection -  sony-assamd	Sony ASSAMD -  toshiba-s06	Toshiba S06 -  toshiba-rx1	Toshiba RX1 -  tyan		Tyan Thunder n6650W (S2915-E) -  ultra		Samsung Q1 Ultra Vista model -  lenovo-3000	Lenovo 3000 y410 -  nec		NEC Versa S9100 -  basic		fixed pin assignment w/o SPDIF -  auto		auto-config reading BIOS (default) +  inv-dmic	Inverted internal mic workaround  ALC267/268  ========== -  quanta-il1	Quanta IL1 mini-notebook -  3stack	3-stack model -  toshiba	Toshiba A205 -  acer		Acer laptops -  acer-dmic	Acer laptops with digital-mic -  acer-aspire	Acer Aspire One -  dell		Dell OEM laptops (Vostro 1200) -  zepto		Zepto laptops -  test		for testing/debugging purpose, almost all controls can -		adjusted.  Appearing only when compiled with -		$CONFIG_SND_DEBUG=y -  auto		auto-config reading BIOS (default) +  inv-dmic	Inverted internal mic workaround -ALC269 +ALC269/270/275/276/28x/29x  ====== -  basic		Basic preset -  quanta	Quanta FL1 -  laptop-amic	Laptops with analog-mic input -  laptop-dmic	Laptops with digital-mic input -  fujitsu	FSC Amilo -  lifebook	Fujitsu Lifebook S6420 -  auto		auto-config reading BIOS (default) - -ALC662/663/272 +  laptop-amic		Laptops with analog-mic input +  laptop-dmic		Laptops with digital-mic input +  alc269-dmic		Enable ALC269(VA) digital mic workaround +  alc271-dmic		Enable ALC271X digital mic workaround +  inv-dmic		Inverted internal mic workaround +  headset-mic		Indicates a combined headset (headphone+mic) jack +  lenovo-dock   	Enables docking station I/O for some Lenovos +  dell-headset-multi	Headset jack, which can also be used as mic-in +  dell-headset-dock	Headset jack (without mic-in), and also dock I/O + +ALC66x/67x/892  ============== -  3stack-dig	3-stack (2-channel) with SPDIF -  3stack-6ch	 3-stack (6-channel) -  3stack-6ch-dig 3-stack (6-channel) with SPDIF -  6stack-dig	 6-stack with SPDIF -  lenovo-101e	 Lenovo laptop -  eeepc-p701	ASUS Eeepc P701 -  eeepc-ep20	ASUS Eeepc EP20 -  ecs		ECS/Foxconn mobo -  m51va		ASUS M51VA -  g71v		ASUS G71V -  h13		ASUS H13 -  g50v		ASUS G50V -  asus-mode1	ASUS -  asus-mode2	ASUS -  asus-mode3	ASUS -  asus-mode4	ASUS -  asus-mode5	ASUS -  asus-mode6	ASUS -  asus-mode7	ASUS -  asus-mode8	ASUS -  dell		Dell with ALC272 -  dell-zm1	Dell ZM1 with ALC272 -  samsung-nc10	Samsung NC10 mini notebook -  auto		auto-config reading BIOS (default) +  mario			Chromebook mario model fixup +  asus-mode1		ASUS +  asus-mode2		ASUS +  asus-mode3		ASUS +  asus-mode4		ASUS +  asus-mode5		ASUS +  asus-mode6		ASUS +  asus-mode7		ASUS +  asus-mode8		ASUS +  inv-dmic		Inverted internal mic workaround +  dell-headset-multi	Headset jack, which can also be used as mic-in  ALC680  ====== -  base		Base model (ASUS NX90) -  auto		auto-config reading BIOS (default) +  N/A -ALC882/883/885/888/889 +ALC88x/898/1150  ====================== -  3stack-dig	3-jack with SPDIF I/O -  6stack-dig	6-jack digital with SPDIF I/O -  arima		Arima W820Di1 -  targa		Targa T8, MSI-1049 T8 -  asus-a7j	ASUS A7J -  asus-a7m	ASUS A7M -  macpro	MacPro support -  mb5		Macbook 5,1 -  macmini3	Macmini 3,1 -  mba21		Macbook Air 2,1 -  mbp3		Macbook Pro rev3 -  imac24	iMac 24'' with jack detection -  imac91	iMac 9,1 -  w2jc		ASUS W2JC -  3stack-2ch-dig	3-jack with SPDIF I/O (ALC883) -  alc883-6stack-dig	6-jack digital with SPDIF I/O (ALC883) -  3stack-6ch    3-jack 6-channel -  3stack-6ch-dig 3-jack 6-channel with SPDIF I/O -  6stack-dig-demo  6-jack digital for Intel demo board -  acer		Acer laptops (Travelmate 3012WTMi, Aspire 5600, etc) -  acer-aspire	Acer Aspire 9810 -  acer-aspire-4930g Acer Aspire 4930G -  acer-aspire-6530g Acer Aspire 6530G -  acer-aspire-7730g Acer Aspire 7730G -  acer-aspire-8930g Acer Aspire 8930G -  medion	Medion Laptops -  medion-md2	Medion MD2 -  targa-dig	Targa/MSI -  targa-2ch-dig	Targa/MSI with 2-channel -  targa-8ch-dig Targa/MSI with 8-channel (MSI GX620) -  laptop-eapd   3-jack with SPDIF I/O and EAPD (Clevo M540JE, M550JE) -  lenovo-101e	Lenovo 101E -  lenovo-nb0763	Lenovo NB0763 -  lenovo-ms7195-dig Lenovo MS7195 -  lenovo-sky	Lenovo Sky -  haier-w66	Haier W66 -  3stack-hp	HP machines with 3stack (Lucknow, Samba boards) -  6stack-dell	Dell machines with 6stack (Inspiron 530) -  mitac		Mitac 8252D -  clevo-m540r	Clevo M540R (6ch + digital) -  clevo-m720	Clevo M720 laptop series -  fujitsu-pi2515 Fujitsu AMILO Pi2515 -  fujitsu-xa3530 Fujitsu AMILO XA3530 -  3stack-6ch-intel Intel DG33* boards -  intel-alc889a	Intel IbexPeak with ALC889A -  intel-x58	Intel DX58 with ALC889 -  asus-p5q	ASUS P5Q-EM boards -  mb31		MacBook 3,1 -  sony-vaio-tt  Sony VAIO TT -  auto		auto-config reading BIOS (default) +  acer-aspire-4930g	Acer Aspire 4930G/5930G/6530G/6930G/7730G +  acer-aspire-8930g	Acer Aspire 8330G/6935G +  acer-aspire		Acer Aspire others +  inv-dmic		Inverted internal mic workaround +  no-primary-hp		VAIO Z/VGC-LN51JGB workaround (for fixed speaker DAC)  ALC861/660  ========== -  3stack	3-jack -  3stack-dig	3-jack with SPDIF I/O -  6stack-dig	6-jack with SPDIF I/O -  3stack-660	3-jack (for ALC660) -  uniwill-m31	Uniwill M31 laptop -  toshiba	Toshiba laptop support -  asus		Asus laptop support -  asus-laptop	ASUS F2/F3 laptops -  auto		auto-config reading BIOS (default) +  N/A  ALC861VD/660VD  ============== -  3stack	3-jack -  3stack-dig	3-jack with SPDIF OUT -  6stack-dig	6-jack with SPDIF OUT -  3stack-660	3-jack (for ALC660VD) -  3stack-660-digout 3-jack with SPDIF OUT (for ALC660VD) -  lenovo	Lenovo 3000 C200 -  dallas	Dallas laptops -  hp		HP TX1000 -  asus-v1s	ASUS V1Sn -  auto		auto-config reading BIOS (default) +  N/A  CMI9880  ======= @@ -210,7 +78,8 @@ CMI9880  AD1882 / AD1882A  ================ -  3stack	3-stack mode (default) +  3stack	3-stack mode +  3stack-automute 3-stack with automute front HP (default)    6stack	6-stack mode  AD1884A / AD1883 / AD1984A / AD1984B @@ -290,13 +159,13 @@ Conexant 5051    hp-dv6736	HP dv6736    hp-f700	HP Compaq Presario F700    ideapad	Lenovo IdeaPad laptop -  lenovo-x200	Lenovo X200 laptop    toshiba	Toshiba Satellite M300  Conexant 5066  =============    laptop	Basic Laptop config (default)    hp-laptop	HP laptops, e g G60 +  asus		Asus K52JU, Lenovo G560    dell-laptop	Dell laptops    dell-vostro	Dell Vostro    olpc-xo-1_5	OLPC XO 1.5 @@ -376,6 +245,7 @@ STAC9227/9228/9229/927x    5stack-no-fp	D965 5stack without front panel    dell-3stack	Dell Dimension E520    dell-bios	Fixes with Dell BIOS setup +  dell-bios-amic Fixes with Dell BIOS setup including analog mic    volknob	Fixes with volume-knob widget 0x24    auto		BIOS setup (default) @@ -408,10 +278,19 @@ STAC92HD83*    ref		Reference board    mic-ref	Reference board with power management for ports    dell-s14	Dell laptop -  hp		HP laptops with (inverted) mute-LED +  dell-vostro-3500	Dell Vostro 3500 laptop    hp-dv7-4000	HP dv-7 4000 +  hp_cNB11_intquad HP CNB models with 4 speakers +  hp-zephyr	HP Zephyr +  hp-led	HP with broken BIOS for mute LED +  hp-inv-led	HP with broken BIOS for inverted mute LED    auto		BIOS setup (default) +STAC92HD95 +========== +  hp-led	LED support for HP laptops +  hp-bass	Bass HPF setup for HP Spectre 13 +  STAC9872  ========    vaio		VAIO laptop without SPDIF @@ -423,6 +302,12 @@ Cirrus Logic CS4206/4207    imac27	IMac 27 Inch    auto		BIOS setup (default) +Cirrus Logic CS4208 +=================== +  mba6		MacBook Air 6,1 and 6,2 +  gpio0		Enable GPIO 0 amp +  auto		BIOS setup (default) +  VIA VT17xx/VT18xx/VT20xx  ========================    auto		BIOS setup (default) diff --git a/Documentation/sound/alsa/HD-Audio.txt b/Documentation/sound/alsa/HD-Audio.txt index c82beb00763..42a0a39b77e 100644 --- a/Documentation/sound/alsa/HD-Audio.txt +++ b/Documentation/sound/alsa/HD-Audio.txt @@ -59,7 +59,12 @@ a case, you can change the default method via `position_fix` option.  `position_fix=1` means to use LPIB method explicitly.  `position_fix=2` means to use the position-buffer.  `position_fix=3` means to use a combination of both methods, needed -for some VIA and ATI controllers.  0 is the default value for all other +for some VIA controllers.  The capture stream position is corrected +by comparing both LPIB and position-buffer values. +`position_fix=4` is another combination available for all controllers, +and uses LPIB for the playback and the position-buffer for the capture +streams. +0 is the default value for all other  controllers, the automatic check and fallback to LPIB as described in  the above.  If you get a problem of repeated sounds, this option might  help. @@ -171,14 +176,14 @@ support the automatic probing (yet as of 2.6.28).  And, BIOS is often,  yes, pretty often broken.  It sets up wrong values and screws up the  driver. -The preset model is provided basically to overcome such a situation. -When the matching preset model is found in the white-list, the driver -assumes the static configuration of that preset and builds the mixer -elements and PCM streams based on the static information.  Thus, if -you have a newer machine with a slightly different PCI SSID from the -existing one, you may have a good chance to re-use the same model. -You can pass the `model` option to specify the preset model instead of -PCI SSID look-up. +The preset model (or recently called as "fix-up") is provided +basically to overcome such a situation.  When the matching preset +model is found in the white-list, the driver assumes the static +configuration of that preset with the correct pin setup, etc. +Thus, if you have a newer machine with a slightly different PCI SSID +(or codec SSID) from the existing one, you may have a good chance to +re-use the same model.  You can pass the `model` option to specify the +preset model instead of PCI (and codec-) SSID look-up.  What `model` option values are available depends on the codec chip.  Check your codec chip from the codec proc file (see "Codec Proc-File" @@ -194,17 +199,12 @@ non-working HD-audio hardware is to check HD-audio codec and several  different `model` option values.  If you have any luck, some of them  might suit with your device well. -Some codecs such as ALC880 have a special model option `model=test`. -This configures the driver to provide as many mixer controls as -possible for every single pin feature except for the unsolicited -events (and maybe some other specials).  Adjust each mixer element and -try the I/O in the way of trial-and-error until figuring out the whole -I/O pin mappings. +There are a few special model option values: +- when 'nofixup' is passed, the device-specific fixups in the codec +  parser are skipped. +- when `generic` is passed, the codec-specific parser is skipped and +  only the generic parser is used. -Note that `model=generic` has a special meaning.  It means to use the -generic parser regardless of the codec.  Usually the codec-specific -parser is much better than the generic parser (as now).  Thus this -option is more about the debugging purpose.  Speaker and Headphone Output  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -382,9 +382,8 @@ init_verbs::    (separated with a space).  hints::    Shows / stores hint strings for codec parsers for any use. -  Its format is `key = value`.  For example, passing `hp_detect = yes` -  to IDT/STAC codec parser will result in the disablement of the -  headphone detection. +  Its format is `key = value`.  For example, passing `jack_detect = no` +  will disable the jack detection of the machine completely.  init_pin_configs::    Shows the initial pin default config values set by BIOS.  driver_pin_configs:: @@ -416,6 +415,65 @@ re-configure based on that state, run like below:  ------------------------------------------------------------------------ +Hint Strings +~~~~~~~~~~~~ +The codec parser have several switches and adjustment knobs for +matching better with the actual codec or device behavior.  Many of +them can be adjusted dynamically via "hints" strings as mentioned in +the section above.  For example, by passing `jack_detect = no` string +via sysfs or a patch file, you can disable the jack detection, thus +the codec parser will skip the features like auto-mute or mic +auto-switch.  As a boolean value, either `yes`, `no`, `true`, `false`, +`1` or `0` can be passed. + +The generic parser supports the following hints: + +- jack_detect (bool): specify whether the jack detection is available +  at all on this machine; default true +- inv_jack_detect (bool): indicates that the jack detection logic is +  inverted +- trigger_sense (bool): indicates that the jack detection needs the +  explicit call of AC_VERB_SET_PIN_SENSE verb +- inv_eapd (bool): indicates that the EAPD is implemented in the +  inverted logic +- pcm_format_first (bool): sets the PCM format before the stream tag +  and channel ID +- sticky_stream (bool): keep the PCM format, stream tag and ID as long +  as possible; default true +- spdif_status_reset (bool): reset the SPDIF status bits at each time +  the SPDIF stream is set up +-  pin_amp_workaround (bool): the output pin may have multiple amp +  values +- single_adc_amp (bool): ADCs can have only single input amps +- auto_mute (bool): enable/disable the headphone auto-mute feature; +  default true +- auto_mic (bool): enable/disable the mic auto-switch feature; default +  true +- line_in_auto_switch (bool): enable/disable the line-in auto-switch +  feature; default false +- need_dac_fix (bool): limits the DACs depending on the channel count +- primary_hp (bool): probe headphone jacks as the primary outputs; +  default true +- multi_io (bool): try probing multi-I/O config (e.g. shared +  line-in/surround, mic/clfe jacks) +- multi_cap_vol (bool): provide multiple capture volumes +- inv_dmic_split (bool): provide split internal mic volume/switch for +  phase-inverted digital mics +- indep_hp (bool): provide the independent headphone PCM stream and +  the corresponding mixer control, if available +- add_stereo_mix_input (bool): add the stereo mix (analog-loopback +  mix) to the input mux if available +- add_jack_modes (bool): add "xxx Jack Mode" enum controls to each +  I/O jack for allowing to change the headphone amp and mic bias VREF +  capabilities +- power_down_unused (bool): power down the unused widgets +- add_hp_mic (bool): add the headphone to capture source if possible +- hp_mic_detect (bool): enable/disable the hp/mic shared input for a +  single built-in mic case; default true +- mixer_nid (int): specifies the widget NID of the analog-loopback +  mixer + +  Early Patching  ~~~~~~~~~~~~~~  When CONFIG_SND_HDA_PATCH_LOADER=y is set, you can pass a "patch" as a @@ -440,14 +498,17 @@ A patch file is a plain text file which looks like below:    0x20 0x400 0xff    [hint] -  hp_detect = yes +  jack_detect = no  ------------------------------------------------------------------------  The file needs to have a line `[codec]`.  The next line should contain  three numbers indicating the codec vendor-id (0x12345678 in the  example), the codec subsystem-id (0xabcd1234) and the address (2) of  the codec.  The rest patch entries are applied to this specified codec -until another codec entry is given. +until another codec entry is given.  Passing 0 or a negative number to +the first or the second value will make the check of the corresponding +field be skipped.  It'll be useful for really broken devices that don't +initialize SSID properly.  The `[model]` line allows to change the model name of the each codec.  In the example above, it will be changed to model=auto. @@ -491,7 +552,7 @@ Also, the codec chip name can be rewritten via `[chip_name]` line.  The hd-audio driver reads the file via request_firmware().  Thus,  a patch file has to be located on the appropriate firmware path,  typically, /lib/firmware.  For example, when you pass the option -`patch=hda-init.fw`, the file /lib/firmware/hda-init-fw must be +`patch=hda-init.fw`, the file /lib/firmware/hda-init.fw must be  present.  The patch module option is specific to each card instance, and you @@ -523,16 +584,72 @@ cable is unplugged.  Thus, if you hear noises, suspect first the  power-saving.  See /sys/module/snd_hda_intel/parameters/power_save to  check the current value.  If it's non-zero, the feature is turned on. +The recent kernel supports the runtime PM for the HD-audio controller +chip, too.  It means that the HD-audio controller is also powered up / +down dynamically.  The feature is enabled only for certain controller +chips like Intel LynxPoint.  You can enable/disable this feature +forcibly by setting `power_save_controller` option, which is also +available at /sys/module/snd_hda_intel/parameters directory. + + +Tracepoints +~~~~~~~~~~~ +The hd-audio driver gives a few basic tracepoints. +`hda:hda_send_cmd` traces each CORB write while `hda:hda_get_response` +traces the response from RIRB (only when read from the codec driver). +`hda:hda_bus_reset` traces the bus-reset due to fatal error, etc, +`hda:hda_unsol_event` traces the unsolicited events, and +`hda:hda_power_down` and `hda:hda_power_up` trace the power down/up +via power-saving behavior. + +Enabling all tracepoints can be done like +------------------------------------------------------------------------ +  # echo 1 > /sys/kernel/debug/tracing/events/hda/enable +------------------------------------------------------------------------ +then after some commands, you can traces from +/sys/kernel/debug/tracing/trace file.  For example, when you want to +trace what codec command is sent, enable the tracepoint like: +------------------------------------------------------------------------ +  # cat /sys/kernel/debug/tracing/trace +  # tracer: nop +  # +  #       TASK-PID    CPU#    TIMESTAMP  FUNCTION +  #          | |       |          |         | +         <...>-7807  [002] 105147.774889: hda_send_cmd: [0:0] val=e3a019 +         <...>-7807  [002] 105147.774893: hda_send_cmd: [0:0] val=e39019 +         <...>-7807  [002] 105147.999542: hda_send_cmd: [0:0] val=e3a01a +         <...>-7807  [002] 105147.999543: hda_send_cmd: [0:0] val=e3901a +         <...>-26764 [001] 349222.837143: hda_send_cmd: [0:0] val=e3a019 +         <...>-26764 [001] 349222.837148: hda_send_cmd: [0:0] val=e39019 +         <...>-26764 [001] 349223.058539: hda_send_cmd: [0:0] val=e3a01a +         <...>-26764 [001] 349223.058541: hda_send_cmd: [0:0] val=e3901a +------------------------------------------------------------------------ +Here `[0:0]` indicates the card number and the codec address, and +`val` shows the value sent to the codec, respectively.  The value is +a packed value, and you can decode it via hda-decode-verb program +included in hda-emu package below.  For example, the value e3a019 is +to set the left output-amp value to 25. +------------------------------------------------------------------------ +  % hda-decode-verb 0xe3a019 +  raw value = 0x00e3a019 +  cid = 0, nid = 0x0e, verb = 0x3a0, parm = 0x19 +  raw value: verb = 0x3a0, parm = 0x19 +  verbname = set_amp_gain_mute +  amp raw val = 0xa019 +  output, left, idx=0, mute=0, val=25 +------------------------------------------------------------------------ +  Development Tree  ~~~~~~~~~~~~~~~~  The latest development codes for HD-audio are found on sound git tree: -- git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git +- git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git  The master branch or for-next branches can be used as the main -development branches in general while the HD-audio specific patches -are committed in topic/hda branch. +development branches in general while the development for the current +and next kernels are found in for-linus and for-next branches, +respectively.  If you are using the latest Linus tree, it'd be better to pull the  above GIT tree onto it.  If you are using the older kernels, an easy @@ -543,7 +660,7 @@ is, installed via the usual spells: configure, make and make  install(-modules).  See INSTALL in the package.  The snapshot tarballs  are found at: -- ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/snapshot/ +- ftp://ftp.suse.com/pub/people/tiwai/snapshot/  Sending a Bug Report @@ -643,9 +760,13 @@ won't be always updated.  For example, the volume values are usually  cached in the driver, and thus changing the widget amp value directly  via hda-verb won't change the mixer value. -The hda-verb program is found in the ftp directory: +The hda-verb program is included now in alsa-tools: + +- git://git.alsa-project.org/alsa-tools.git + +Also, the old stand-alone package is found in the ftp directory: -- ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/misc/ +- ftp://ftp.suse.com/pub/people/tiwai/misc/  Also a git repository is available: @@ -713,7 +834,7 @@ operation, the jack plugging simulation, etc.  The package is found in: -- ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/misc/ +- ftp://ftp.suse.com/pub/people/tiwai/misc/  A git repository is available: @@ -721,3 +842,18 @@ A git repository is available:  See README file in the tarball for more details about hda-emu  program. + + +hda-jack-retask +~~~~~~~~~~~~~~~ +hda-jack-retask is a user-friendly GUI program to manipulate the +HD-audio pin control for jack retasking.  If you have a problem about +the jack assignment, try this program and check whether you can get +useful results.  Once when you figure out the proper pin assignment, +it can be fixed either in the driver code statically or via passing a +firmware patch file (see "Early Patching" section). + +The program is included in alsa-tools now: + +- git://git.alsa-project.org/alsa-tools.git + diff --git a/Documentation/sound/alsa/MIXART.txt b/Documentation/sound/alsa/MIXART.txt index ef42c44fa1f..4ee35b4fbe4 100644 --- a/Documentation/sound/alsa/MIXART.txt +++ b/Documentation/sound/alsa/MIXART.txt @@ -76,9 +76,9 @@ FIRMWARE   when CONFIG_FW_LOADER is set.  The mixartloader is necessary only   for older versions or when you build the driver into kernel.] -For loading the firmware automatically after the module is loaded, use -the post-install command.  For example, add the following entry to -/etc/modprobe.conf for miXart driver: +For loading the firmware automatically after the module is loaded, use a +install command.  For example, add the following entry to +/etc/modprobe.d/mixart.conf for miXart driver:  	install snd-mixart /sbin/modprobe --first-time -i snd-mixart && \  			   /usr/bin/mixartloader diff --git a/Documentation/sound/alsa/OSS-Emulation.txt b/Documentation/sound/alsa/OSS-Emulation.txt index 022aaeb0e9d..152ca2a3f1b 100644 --- a/Documentation/sound/alsa/OSS-Emulation.txt +++ b/Documentation/sound/alsa/OSS-Emulation.txt @@ -19,7 +19,7 @@ the card number and the minor unit number.  Usually you don't have to  define these aliases by yourself.  Only necessary step for auto-loading of OSS modules is to define the -card alias in /etc/modprobe.conf, such as +card alias in /etc/modprobe.d/alsa.conf, such as  	alias sound-slot-0 snd-emu10k1 diff --git a/Documentation/sound/alsa/README.maya44 b/Documentation/sound/alsa/README.maya44 index 0e41576fa13..67b2ea1cc31 100644 --- a/Documentation/sound/alsa/README.maya44 +++ b/Documentation/sound/alsa/README.maya44 @@ -120,7 +120,7 @@ Mic Phantom+48V: switch for +48V phantom power for electrostatic microphones on      Make sure this is not turned on while any other source is connected to input 1/2.      It might damage the source and/or the maya44 card. -Mic/Line input: if switch is is on, input jack 1/2 is microphone input (mono), otherwise line input (stereo). +Mic/Line input: if switch is on, input jack 1/2 is microphone input (mono), otherwise line input (stereo).  Bypass: analogue bypass from ADC input to output for channel 1+2. Same as "Monitor" in the windows driver.  Bypass 1: same for channel 3+4. diff --git a/Documentation/sound/alsa/SB-Live-mixer.txt b/Documentation/sound/alsa/SB-Live-mixer.txt index f5639d40521..f4b5988f450 100644 --- a/Documentation/sound/alsa/SB-Live-mixer.txt +++ b/Documentation/sound/alsa/SB-Live-mixer.txt @@ -87,14 +87,14 @@ accumulator. ALSA uses accumulators 0 and 1 for left and right PCM.  The result is forwarded to the ADC capture FIFO (thus to the standard capture  PCM device). -name='Music Playback Volume',index=0 +name='Synth Playback Volume',index=0  This control is used to attenuate samples for left and right MIDI FX-bus  accumulators. ALSA uses accumulators 4 and 5 for left and right MIDI samples.  The result samples are forwarded to the front DAC PCM slots of the AC97 codec. -name='Music Capture Volume',index=0 -name='Music Capture Switch',index=0 +name='Synth Capture Volume',index=0 +name='Synth Capture Switch',index=0  These controls are used to attenuate samples for left and right MIDI FX-bus  accumulator. ALSA uses accumulators 4 and 5 for left and right PCM. diff --git a/Documentation/sound/alsa/compress_offload.txt b/Documentation/sound/alsa/compress_offload.txt new file mode 100644 index 00000000000..630c492c3dc --- /dev/null +++ b/Documentation/sound/alsa/compress_offload.txt @@ -0,0 +1,234 @@ +		compress_offload.txt +		===================== +	Pierre-Louis.Bossart <pierre-louis.bossart@linux.intel.com> +		Vinod Koul <vinod.koul@linux.intel.com> + +Overview + +Since its early days, the ALSA API was defined with PCM support or +constant bitrates payloads such as IEC61937 in mind. Arguments and +returned values in frames are the norm, making it a challenge to +extend the existing API to compressed data streams. + +In recent years, audio digital signal processors (DSP) were integrated +in system-on-chip designs, and DSPs are also integrated in audio +codecs. Processing compressed data on such DSPs results in a dramatic +reduction of power consumption compared to host-based +processing. Support for such hardware has not been very good in Linux, +mostly because of a lack of a generic API available in the mainline +kernel. + +Rather than requiring a compatibility break with an API change of the +ALSA PCM interface, a new 'Compressed Data' API is introduced to +provide a control and data-streaming interface for audio DSPs. + +The design of this API was inspired by the 2-year experience with the +Intel Moorestown SOC, with many corrections required to upstream the +API in the mainline kernel instead of the staging tree and make it +usable by others. + +Requirements + +The main requirements are: + +- separation between byte counts and time. Compressed formats may have +  a header per file, per frame, or no header at all. The payload size +  may vary from frame-to-frame. As a result, it is not possible to +  estimate reliably the duration of audio buffers when handling +  compressed data. Dedicated mechanisms are required to allow for +  reliable audio-video synchronization, which requires precise +  reporting of the number of samples rendered at any given time. + +- Handling of multiple formats. PCM data only requires a specification +  of the sampling rate, number of channels and bits per sample. In +  contrast, compressed data comes in a variety of formats. Audio DSPs +  may also provide support for a limited number of audio encoders and +  decoders embedded in firmware, or may support more choices through +  dynamic download of libraries. + +- Focus on main formats. This API provides support for the most +  popular formats used for audio and video capture and playback. It is +  likely that as audio compression technology advances, new formats +  will be added. + +- Handling of multiple configurations. Even for a given format like +  AAC, some implementations may support AAC multichannel but HE-AAC +  stereo. Likewise WMA10 level M3 may require too much memory and cpu +  cycles. The new API needs to provide a generic way of listing these +  formats. + +- Rendering/Grabbing only. This API does not provide any means of +  hardware acceleration, where PCM samples are provided back to +  user-space for additional processing. This API focuses instead on +  streaming compressed data to a DSP, with the assumption that the +  decoded samples are routed to a physical output or logical back-end. + + - Complexity hiding. Existing user-space multimedia frameworks all +  have existing enums/structures for each compressed format. This new +  API assumes the existence of a platform-specific compatibility layer +  to expose, translate and make use of the capabilities of the audio +  DSP, eg. Android HAL or PulseAudio sinks. By construction, regular +  applications are not supposed to make use of this API. + + +Design + +The new API shares a number of concepts with the PCM API for flow +control. Start, pause, resume, drain and stop commands have the same +semantics no matter what the content is. + +The concept of memory ring buffer divided in a set of fragments is +borrowed from the ALSA PCM API. However, only sizes in bytes can be +specified. + +Seeks/trick modes are assumed to be handled by the host. + +The notion of rewinds/forwards is not supported. Data committed to the +ring buffer cannot be invalidated, except when dropping all buffers. + +The Compressed Data API does not make any assumptions on how the data +is transmitted to the audio DSP. DMA transfers from main memory to an +embedded audio cluster or to a SPI interface for external DSPs are +possible. As in the ALSA PCM case, a core set of routines is exposed; +each driver implementer will have to write support for a set of +mandatory routines and possibly make use of optional ones. + +The main additions are + +- get_caps +This routine returns the list of audio formats supported. Querying the +codecs on a capture stream will return encoders, decoders will be +listed for playback streams. + +- get_codec_caps For each codec, this routine returns a list of +capabilities. The intent is to make sure all the capabilities +correspond to valid settings, and to minimize the risks of +configuration failures. For example, for a complex codec such as AAC, +the number of channels supported may depend on a specific profile. If +the capabilities were exposed with a single descriptor, it may happen +that a specific combination of profiles/channels/formats may not be +supported. Likewise, embedded DSPs have limited memory and cpu cycles, +it is likely that some implementations make the list of capabilities +dynamic and dependent on existing workloads. In addition to codec +settings, this routine returns the minimum buffer size handled by the +implementation. This information can be a function of the DMA buffer +sizes, the number of bytes required to synchronize, etc, and can be +used by userspace to define how much needs to be written in the ring +buffer before playback can start. + +- set_params +This routine sets the configuration chosen for a specific codec. The +most important field in the parameters is the codec type; in most +cases decoders will ignore other fields, while encoders will strictly +comply to the settings + +- get_params +This routines returns the actual settings used by the DSP. Changes to +the settings should remain the exception. + +- get_timestamp +The timestamp becomes a multiple field structure. It lists the number +of bytes transferred, the number of samples processed and the number +of samples rendered/grabbed. All these values can be used to determine +the average bitrate, figure out if the ring buffer needs to be +refilled or the delay due to decoding/encoding/io on the DSP. + +Note that the list of codecs/profiles/modes was derived from the +OpenMAX AL specification instead of reinventing the wheel. +Modifications include: +- Addition of FLAC and IEC formats +- Merge of encoder/decoder capabilities +- Profiles/modes listed as bitmasks to make descriptors more compact +- Addition of set_params for decoders (missing in OpenMAX AL) +- Addition of AMR/AMR-WB encoding modes (missing in OpenMAX AL) +- Addition of format information for WMA +- Addition of encoding options when required (derived from OpenMAX IL) +- Addition of rateControlSupported (missing in OpenMAX AL) + +Gapless Playback +================ +When playing thru an album, the decoders have the ability to skip the encoder +delay and padding and directly move from one track content to another. The end +user can perceive this as gapless playback as we dont have silence while +switching from one track to another + +Also, there might be low-intensity noises due to encoding. Perfect gapless is +difficult to reach with all types of compressed data, but works fine with most +music content. The decoder needs to know the encoder delay and encoder padding. +So we need to pass this to DSP. This metadata is extracted from ID3/MP4 headers +and are not present by default in the bitstream, hence the need for a new +interface to pass this information to the DSP. Also DSP and userspace needs to +switch from one track to another and start using data for second track. + +The main additions are: + +- set_metadata +This routine sets the encoder delay and encoder padding. This can be used by +decoder to strip the silence. This needs to be set before the data in the track +is written. + +- set_next_track +This routine tells DSP that metadata and write operation sent after this would +correspond to subsequent track + +- partial drain +This is called when end of file is reached. The userspace can inform DSP that +EOF is reached and now DSP can start skipping padding delay. Also next write +data would belong to next track + +Sequence flow for gapless would be: +- Open +- Get caps / codec caps +- Set params +- Set metadata of the first track +- Fill data of the first track +- Trigger start +- User-space finished sending all, +- Indicaite next track data by sending set_next_track +- Set metadata of the next track +- then call partial_drain to flush most of buffer in DSP +- Fill data of the next track +- DSP switches to second track +(note: order for partial_drain and write for next track can be reversed as well) + +Not supported: + +- Support for VoIP/circuit-switched calls is not the target of this +  API. Support for dynamic bit-rate changes would require a tight +  coupling between the DSP and the host stack, limiting power savings. + +- Packet-loss concealment is not supported. This would require an +  additional interface to let the decoder synthesize data when frames +  are lost during transmission. This may be added in the future. + +- Volume control/routing is not handled by this API. Devices exposing a +  compressed data interface will be considered as regular ALSA devices; +  volume changes and routing information will be provided with regular +  ALSA kcontrols. + +- Embedded audio effects. Such effects should be enabled in the same +  manner, no matter if the input was PCM or compressed. + +- multichannel IEC encoding. Unclear if this is required. + +- Encoding/decoding acceleration is not supported as mentioned +  above. It is possible to route the output of a decoder to a capture +  stream, or even implement transcoding capabilities. This routing +  would be enabled with ALSA kcontrols. + +- Audio policy/resource management. This API does not provide any +  hooks to query the utilization of the audio DSP, nor any preemption +  mechanisms. + +- No notion of underrun/overrun. Since the bytes written are compressed +  in nature and data written/read doesn't translate directly to +  rendered output in time, this does not deal with underrun/overrun and +  maybe dealt in user-library + +Credits: +- Mark Brown and Liam Girdwood for discussions on the need for this API +- Harsha Priya for her work on intel_sst compressed API +- Rakesh Ughreja for valuable feedback +- Sing Nallasellan, Sikkandar Madar and Prasanna Samaga for +  demonstrating and quantifying the benefits of audio offload on a +  real platform. diff --git a/Documentation/sound/alsa/hdspm.txt b/Documentation/sound/alsa/hdspm.txt index 7a67ff71a9f..7ba31948dea 100644 --- a/Documentation/sound/alsa/hdspm.txt +++ b/Documentation/sound/alsa/hdspm.txt @@ -359,4 +359,4 @@ Calling Parameter:     enable_monitor int array (min = 1, max = 8),        "Enable Analog Out on Channel 63/64 by default." -      note: here the analog output is enabled (but not routed).
\ No newline at end of file +      note: here the analog output is enabled (but not routed). diff --git a/Documentation/sound/alsa/seq_oss.html b/Documentation/sound/alsa/seq_oss.html index d9776cf60c0..9663b45f6fd 100644 --- a/Documentation/sound/alsa/seq_oss.html +++ b/Documentation/sound/alsa/seq_oss.html @@ -285,7 +285,7 @@ sample data.  <H4>  7.2.4 Close Callback</H4>  The <TT>close</TT> callback is called when this device is closed by the -applicaion. If any private data was allocated in open callback, it must +application. If any private data was allocated in open callback, it must  be released in the close callback. The deletion of ALSA port should be  done here, too. This callback must not be NULL.  <H4> diff --git a/Documentation/sound/alsa/soc/DPCM.txt b/Documentation/sound/alsa/soc/DPCM.txt new file mode 100644 index 00000000000..0110180b7ac --- /dev/null +++ b/Documentation/sound/alsa/soc/DPCM.txt @@ -0,0 +1,380 @@ +Dynamic PCM +=========== + +1. Description +============== + +Dynamic PCM allows an ALSA PCM device to digitally route its PCM audio to +various digital endpoints during the PCM stream runtime. e.g. PCM0 can route +digital audio to I2S DAI0, I2S DAI1 or PDM DAI2. This is useful for on SoC DSP +drivers that expose several ALSA PCMs and can route to multiple DAIs. + +The DPCM runtime routing is determined by the ALSA mixer settings in the same +way as the analog signal is routed in an ASoC codec driver. DPCM uses a DAPM +graph representing the DSP internal audio paths and uses the mixer settings to +determine the patch used by each ALSA PCM. + +DPCM re-uses all the existing component codec, platform and DAI drivers without +any modifications. + + +Phone Audio System with SoC based DSP +------------------------------------- + +Consider the following phone audio subsystem. This will be used in this +document for all examples :- + +| Front End PCMs    |  SoC DSP  | Back End DAIs | Audio devices | + +                    ************* +PCM0 <------------> *           * <----DAI0-----> Codec Headset +                    *           * +PCM1 <------------> *           * <----DAI1-----> Codec Speakers +                    *   DSP     * +PCM2 <------------> *           * <----DAI2-----> MODEM +                    *           * +PCM3 <------------> *           * <----DAI3-----> BT +                    *           * +                    *           * <----DAI4-----> DMIC +                    *           * +                    *           * <----DAI5-----> FM +                    ************* + +This diagram shows a simple smart phone audio subsystem. It supports Bluetooth, +FM digital radio, Speakers, Headset Jack, digital microphones and cellular +modem. This sound card exposes 4 DSP front end (FE) ALSA PCM devices and +supports 6 back end (BE) DAIs. Each FE PCM can digitally route audio data to any +of the BE DAIs. The FE PCM devices can also route audio to more than 1 BE DAI. + + + +Example - DPCM Switching playback from DAI0 to DAI1 +--------------------------------------------------- + +Audio is being played to the Headset. After a while the user removes the headset +and audio continues playing on the speakers. + +Playback on PCM0 to Headset would look like :- + +                    ************* +PCM0 <============> *           * <====DAI0=====> Codec Headset +                    *           * +PCM1 <------------> *           * <----DAI1-----> Codec Speakers +                    *   DSP     * +PCM2 <------------> *           * <----DAI2-----> MODEM +                    *           * +PCM3 <------------> *           * <----DAI3-----> BT +                    *           * +                    *           * <----DAI4-----> DMIC +                    *           * +                    *           * <----DAI5-----> FM +                    ************* + +The headset is removed from the jack by user so the speakers must now be used :- + +                    ************* +PCM0 <============> *           * <----DAI0-----> Codec Headset +                    *           * +PCM1 <------------> *           * <====DAI1=====> Codec Speakers +                    *   DSP     * +PCM2 <------------> *           * <----DAI2-----> MODEM +                    *           * +PCM3 <------------> *           * <----DAI3-----> BT +                    *           * +                    *           * <----DAI4-----> DMIC +                    *           * +                    *           * <----DAI5-----> FM +                    ************* + +The audio driver processes this as follows :- + + 1) Machine driver receives Jack removal event. + + 2) Machine driver OR audio HAL disables the Headset path. + + 3) DPCM runs the PCM trigger(stop), hw_free(), shutdown() operations on DAI0 +    for headset since the path is now disabled. + + 4) Machine driver or audio HAL enables the speaker path. + + 5) DPCM runs the PCM ops for startup(), hw_params(), prepapre() and +    trigger(start) for DAI1 Speakers since the path is enabled. + +In this example, the machine driver or userspace audio HAL can alter the routing +and then DPCM will take care of managing the DAI PCM operations to either bring +the link up or down. Audio playback does not stop during this transition. + + + +DPCM machine driver +=================== + +The DPCM enabled ASoC machine driver is similar to normal machine drivers +except that we also have to :- + + 1) Define the FE and BE DAI links. + + 2) Define any FE/BE PCM operations. + + 3) Define widget graph connections. + + +1 FE and BE DAI links +--------------------- + +| Front End PCMs    |  SoC DSP  | Back End DAIs | Audio devices | + +                    ************* +PCM0 <------------> *           * <----DAI0-----> Codec Headset +                    *           * +PCM1 <------------> *           * <----DAI1-----> Codec Speakers +                    *   DSP     * +PCM2 <------------> *           * <----DAI2-----> MODEM +                    *           * +PCM3 <------------> *           * <----DAI3-----> BT +                    *           * +                    *           * <----DAI4-----> DMIC +                    *           * +                    *           * <----DAI5-----> FM +                    ************* + +For the example above we have to define 4 FE DAI links and 6 BE DAI links. The +FE DAI links are defined as follows :- + +static struct snd_soc_dai_link machine_dais[] = { +	{ +		.name = "PCM0 System", +		.stream_name = "System Playback", +		.cpu_dai_name = "System Pin", +		.platform_name = "dsp-audio", +		.codec_name = "snd-soc-dummy", +		.codec_dai_name = "snd-soc-dummy-dai", +		.dynamic = 1, +		.trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, +		.dpcm_playback = 1, +	}, +	.....< other FE and BE DAI links here > +}; + +This FE DAI link is pretty similar to a regular DAI link except that we also +set the DAI link to a DPCM FE with the "dynamic = 1". The supported FE stream +directions should also be set with the "dpcm_playback" and "dpcm_capture" +flags. There is also an option to specify the ordering of the trigger call for +each FE. This allows the ASoC core to trigger the DSP before or after the other +components (as some DSPs have strong requirements for the ordering DAI/DSP +start and stop sequences). + +The FE DAI above sets the codec and code DAIs to dummy devices since the BE is +dynamic and will change depending on runtime config. + +The BE DAIs are configured as follows :- + +static struct snd_soc_dai_link machine_dais[] = { +	.....< FE DAI links here > +	{ +		.name = "Codec Headset", +		.cpu_dai_name = "ssp-dai.0", +		.platform_name = "snd-soc-dummy", +		.no_pcm = 1, +		.codec_name = "rt5640.0-001c", +		.codec_dai_name = "rt5640-aif1", +		.ignore_suspend = 1, +		.ignore_pmdown_time = 1, +		.be_hw_params_fixup = hswult_ssp0_fixup, +		.ops = &haswell_ops, +		.dpcm_playback = 1, +		.dpcm_capture = 1, +	}, +	.....< other BE DAI links here > +}; + +This BE DAI link connects DAI0 to the codec (in this case RT5460 AIF1). It sets +the "no_pcm" flag to mark it has a BE and sets flags for supported stream +directions using "dpcm_playback" and "dpcm_capture" above. + +The BE has also flags set for ignoring suspend and PM down time. This allows +the BE to work in a hostless mode where the host CPU is not transferring data +like a BT phone call :- + +                    ************* +PCM0 <------------> *           * <----DAI0-----> Codec Headset +                    *           * +PCM1 <------------> *           * <----DAI1-----> Codec Speakers +                    *   DSP     * +PCM2 <------------> *           * <====DAI2=====> MODEM +                    *           * +PCM3 <------------> *           * <====DAI3=====> BT +                    *           * +                    *           * <----DAI4-----> DMIC +                    *           * +                    *           * <----DAI5-----> FM +                    ************* + +This allows the host CPU to sleep whilst the DSP, MODEM DAI and the BT DAI are +still in operation. + +A BE DAI link can also set the codec to a dummy device if the code is a device +that is managed externally. + +Likewise a BE DAI can also set a dummy cpu DAI if the CPU DAI is managed by the +DSP firmware. + + +2 FE/BE PCM operations +---------------------- + +The BE above also exports some PCM operations and a "fixup" callback. The fixup +callback is used by the machine driver to (re)configure the DAI based upon the +FE hw params. i.e. the DSP may perform SRC or ASRC from the FE to BE. + +e.g. DSP converts all FE hw params to run at fixed rate of 48k, 16bit, stereo for +DAI0. This means all FE hw_params have to be fixed in the machine driver for +DAI0 so that the DAI is running at desired configuration regardless of the FE +configuration. + +static int dai0_fixup(struct snd_soc_pcm_runtime *rtd, +			struct snd_pcm_hw_params *params) +{ +	struct snd_interval *rate = hw_param_interval(params, +			SNDRV_PCM_HW_PARAM_RATE); +	struct snd_interval *channels = hw_param_interval(params, +						SNDRV_PCM_HW_PARAM_CHANNELS); + +	/* The DSP will covert the FE rate to 48k, stereo */ +	rate->min = rate->max = 48000; +	channels->min = channels->max = 2; + +	/* set DAI0 to 16 bit */ +	snd_mask_set(¶ms->masks[SNDRV_PCM_HW_PARAM_FORMAT - +				    SNDRV_PCM_HW_PARAM_FIRST_MASK], +				    SNDRV_PCM_FORMAT_S16_LE); +	return 0; +} + +The other PCM operation are the same as for regular DAI links. Use as necessary. + + +3 Widget graph connections +-------------------------- + +The BE DAI links will normally be connected to the graph at initialisation time +by the ASoC DAPM core. However, if the BE codec or BE DAI is a dummy then this +has to be set explicitly in the driver :- + +/* BE for codec Headset -  DAI0 is dummy and managed by DSP FW */ +{"DAI0 CODEC IN", NULL, "AIF1 Capture"}, +{"AIF1 Playback", NULL, "DAI0 CODEC OUT"}, + + +Writing a DPCM DSP driver +========================= + +The DPCM DSP driver looks much like a standard platform class ASoC driver +combined with elements from a codec class driver. A DSP platform driver must +implement :- + + 1) Front End PCM DAIs - i.e. struct snd_soc_dai_driver. + + 2) DAPM graph showing DSP audio routing from FE DAIs to BEs. + + 3) DAPM widgets from DSP graph. + + 4) Mixers for gains, routing, etc. + + 5) DMA configuration. + + 6) BE AIF widgets. + +Items 6 is important for routing the audio outside of the DSP. AIF need to be +defined for each BE and each stream direction. e.g for BE DAI0 above we would +have :- + +SND_SOC_DAPM_AIF_IN("DAI0 RX", NULL, 0, SND_SOC_NOPM, 0, 0), +SND_SOC_DAPM_AIF_OUT("DAI0 TX", NULL, 0, SND_SOC_NOPM, 0, 0), + +The BE AIF are used to connect the DSP graph to the graphs for the other +component drivers (e.g. codec graph). + + +Hostless PCM streams +==================== + +A hostless PCM stream is a stream that is not routed through the host CPU. An +example of this would be a phone call from handset to modem. + + +                    ************* +PCM0 <------------> *           * <----DAI0-----> Codec Headset +                    *           * +PCM1 <------------> *           * <====DAI1=====> Codec Speakers/Mic +                    *   DSP     * +PCM2 <------------> *           * <====DAI2=====> MODEM +                    *           * +PCM3 <------------> *           * <----DAI3-----> BT +                    *           * +                    *           * <----DAI4-----> DMIC +                    *           * +                    *           * <----DAI5-----> FM +                    ************* + +In this case the PCM data is routed via the DSP. The host CPU in this use case +is only used for control and can sleep during the runtime of the stream. + +The host can control the hostless link either by :- + + 1) Configuring the link as a CODEC <-> CODEC style link. In this case the link +    is enabled or disabled by the state of the DAPM graph. This usually means +    there is a mixer control that can be used to connect or disconnect the path +    between both DAIs. + + 2) Hostless FE. This FE has a virtual connection to the BE DAI links on the DAPM +    graph. Control is then carried out by the FE as regular PCM operations. +    This method gives more control over the DAI links, but requires much more +    userspace code to control the link. Its recommended to use CODEC<->CODEC +    unless your HW needs more fine grained sequencing of the PCM ops. + + +CODEC <-> CODEC link +-------------------- + +This DAI link is enabled when DAPM detects a valid path within the DAPM graph. +The machine driver sets some additional parameters to the DAI link i.e. + +static const struct snd_soc_pcm_stream dai_params = { +	.formats = SNDRV_PCM_FMTBIT_S32_LE, +	.rate_min = 8000, +	.rate_max = 8000, +	.channels_min = 2, +	.channels_max = 2, +}; + +static struct snd_soc_dai_link dais[] = { +	< ... more DAI links above ... > +	{ +		.name = "MODEM", +		.stream_name = "MODEM", +		.cpu_dai_name = "dai2", +		.codec_dai_name = "modem-aif1", +		.codec_name = "modem", +		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF +				| SND_SOC_DAIFMT_CBM_CFM, +		.params = &dai_params, +	} +	< ... more DAI links here ... > + +These parameters are used to configure the DAI hw_params() when DAPM detects a +valid path and then calls the PCM operations to start the link. DAPM will also +call the appropriate PCM operations to disable the DAI when the path is no +longer valid. + + +Hostless FE +----------- + +The DAI link(s) are enabled by a FE that does not read or write any PCM data. +This means creating a new FE that is connected with a virtual path to both +DAI links. The DAI links will be started when the FE PCM is started and stopped +when the FE PCM is stopped. Note that the FE PCM cannot read or write data in +this configuration. + + diff --git a/Documentation/sound/alsa/soc/codec.txt b/Documentation/sound/alsa/soc/codec.txt index 37ba3a72cb7..db5f9c9ae14 100644 --- a/Documentation/sound/alsa/soc/codec.txt +++ b/Documentation/sound/alsa/soc/codec.txt @@ -1,22 +1,23 @@ -ASoC Codec Driver -================= +ASoC Codec Class Driver +======================= -The codec driver is generic and hardware independent code that configures the -codec to provide audio capture and playback. It should contain no code that is -specific to the target platform or machine. All platform and machine specific -code should be added to the platform and machine drivers respectively. +The codec class driver is generic and hardware independent code that configures +the codec, FM, MODEM, BT or external DSP to provide audio capture and playback. +It should contain no code that is specific to the target platform or machine. +All platform and machine specific code should be added to the platform and +machine drivers respectively. -Each codec driver *must* provide the following features:- +Each codec class driver *must* provide the following features:-   1) Codec DAI and PCM configuration - 2) Codec control IO - using I2C, 3 Wire(SPI) or both APIs + 2) Codec control IO - using RegMap API   3) Mixers and audio controls   4) Codec audio operations + 5) DAPM description. + 6) DAPM event handler.  Optionally, codec drivers can also provide:- - 5) DAPM description. - 6) DAPM event handler.   7) DAC Digital mute control.  Its probably best to use this guide in conjunction with the existing codec @@ -27,67 +28,46 @@ ASoC Codec driver breakdown  1 - Codec DAI and PCM configuration  ----------------------------------- -Each codec driver must have a struct snd_soc_codec_dai to define its DAI and +Each codec driver must have a struct snd_soc_dai_driver to define its DAI and  PCM capabilities and operations. This struct is exported so that it can be  registered with the core by your machine driver.  e.g. -struct snd_soc_codec_dai wm8731_dai = { -	.name = "WM8731", -	/* playback capabilities */ +static struct snd_soc_dai_ops wm8731_dai_ops = { +	.prepare	= wm8731_pcm_prepare, +	.hw_params	= wm8731_hw_params, +	.shutdown	= wm8731_shutdown, +	.digital_mute	= wm8731_mute, +	.set_sysclk	= wm8731_set_dai_sysclk, +	.set_fmt	= wm8731_set_dai_fmt, +}; + +struct snd_soc_dai_driver wm8731_dai = { +	.name = "wm8731-hifi",  	.playback = {  		.stream_name = "Playback",  		.channels_min = 1,  		.channels_max = 2,  		.rates = WM8731_RATES,  		.formats = WM8731_FORMATS,}, -	/* capture capabilities */  	.capture = {  		.stream_name = "Capture",  		.channels_min = 1,  		.channels_max = 2,  		.rates = WM8731_RATES,  		.formats = WM8731_FORMATS,}, -	/* pcm operations - see section 4 below */ -	.ops = { -		.prepare = wm8731_pcm_prepare, -		.hw_params = wm8731_hw_params, -		.shutdown = wm8731_shutdown, -	}, -	/* DAI operations - see DAI.txt */ -	.dai_ops = { -		.digital_mute = wm8731_mute, -		.set_sysclk = wm8731_set_dai_sysclk, -		.set_fmt = wm8731_set_dai_fmt, -	} +	.ops = &wm8731_dai_ops, +	.symmetric_rates = 1,  }; -EXPORT_SYMBOL_GPL(wm8731_dai);  2 - Codec control IO  --------------------  The codec can usually be controlled via an I2C or SPI style interface -(AC97 combines control with data in the DAI). The codec drivers provide -functions to read and write the codec registers along with supplying a -register cache:- - -	/* IO control data and register cache */ -	void *control_data; /* codec control (i2c/3wire) data */ -	void *reg_cache; - -Codec read/write should do any data formatting and call the hardware -read write below to perform the IO. These functions are called by the -core and ALSA when performing DAPM or changing the mixer:- - -    unsigned int (*read)(struct snd_soc_codec *, unsigned int); -    int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); - -Codec hardware IO functions - usually points to either the I2C, SPI or AC97 -read/write:- - -	hw_write_t hw_write; -	hw_read_t hw_read; +(AC97 combines control with data in the DAI). The codec driver should use the +Regmap API for all codec IO. Please see include/linux/regmap.h and existing +codec drivers for example regmap usage.  3 - Mixers and audio controls @@ -131,7 +111,7 @@ Defines a stereo enumerated control  4 - Codec Audio Operations  -------------------------- -The codec driver also supports the following ALSA operations:- +The codec driver also supports the following ALSA PCM operations:-  /* SoC audio ops */  struct snd_soc_ops { @@ -186,13 +166,14 @@ when the mute is applied or freed.  i.e. -static int wm8974_mute(struct snd_soc_codec *codec, -	struct snd_soc_codec_dai *dai, int mute) +static int wm8974_mute(struct snd_soc_dai *dai, int mute)  { -	u16 mute_reg = wm8974_read_reg_cache(codec, WM8974_DAC) & 0xffbf; -	if(mute) -		wm8974_write(codec, WM8974_DAC, mute_reg | 0x40); +	struct snd_soc_codec *codec = dai->codec; +	u16 mute_reg = snd_soc_read(codec, WM8974_DAC) & 0xffbf; + +	if (mute) +		snd_soc_write(codec, WM8974_DAC, mute_reg | 0x40);  	else -		wm8974_write(codec, WM8974_DAC, mute_reg); +		snd_soc_write(codec, WM8974_DAC, mute_reg);  	return 0;  } diff --git a/Documentation/sound/alsa/soc/dapm.txt b/Documentation/sound/alsa/soc/dapm.txt index 05bf5a0eee4..6faab488000 100644 --- a/Documentation/sound/alsa/soc/dapm.txt +++ b/Documentation/sound/alsa/soc/dapm.txt @@ -21,7 +21,7 @@ level power systems.  There are 4 power domains within DAPM -   1. Codec domain - VREF, VMID (core codec and audio power) +   1. Codec bias domain - VREF, VMID (core codec and audio power)        Usually controlled at codec probe/remove and suspend/resume, although        can be set at stream time if power is not needed for sidetone, etc. @@ -30,7 +30,7 @@ There are 4 power domains within DAPM        machine driver and responds to asynchronous events e.g when HP        are inserted -   3. Path domain - audio susbsystem signal paths +   3. Path domain - audio subsystem signal paths        Automatically set when mixer and mux settings are changed by the user.        e.g. alsamixer, amixer. @@ -63,14 +63,22 @@ Audio DAPM widgets fall into a number of types:-   o Line       - Line Input/Output (and optional Jack)   o Speaker    - Speaker   o Supply     - Power or clock supply widget used by other widgets. + o Regulator  - External regulator that supplies power to audio components. + o Clock      -	External clock that supplies clock to audio components. + o AIF IN     - Audio Interface Input (with TDM slot mask). + o AIF OUT    - Audio Interface Output (with TDM slot mask). + o Siggen     - Signal Generator. + o DAI IN     - Digital Audio Interface Input. + o DAI OUT    - Digital Audio Interface Output. + o DAI Link   - DAI Link between two DAI structures */   o Pre        - Special PRE widget (exec before all others)   o Post       - Special POST widget (exec after all others)  (Widgets are defined in include/sound/soc-dapm.h) -Widgets are usually added in the codec driver and the machine driver. There are -convenience macros defined in soc-dapm.h that can be used to quickly build a -list of widgets of the codecs and machines DAPM widgets. +Widgets can be added to the sound card by any of the component driver types. +There are convenience macros defined in soc-dapm.h that can be used to quickly +build a list of widgets of the codecs and machines DAPM widgets.  Most widgets have a name, register, shift and invert. Some widgets have extra  parameters for stream name and kcontrols. @@ -80,11 +88,13 @@ parameters for stream name and kcontrols.  -------------------------  Stream Widgets relate to the stream power domain and only consist of ADCs -(analog to digital converters) and DACs (digital to analog converters). +(analog to digital converters), DACs (digital to analog converters), +AIF IN and AIF OUT.  Stream widgets have the following format:-  SND_SOC_DAPM_DAC(name, stream name, reg, shift, invert), +SND_SOC_DAPM_AIF_IN(name, stream, slot, reg, shift, invert)  NOTE: the stream name must match the corresponding stream name in your codec  snd_soc_codec_dai. @@ -94,6 +104,11 @@ e.g. stream widgets for HiFi playback and capture  SND_SOC_DAPM_DAC("HiFi DAC", "HiFi Playback", REG, 3, 1),  SND_SOC_DAPM_ADC("HiFi ADC", "HiFi Capture", REG, 2, 1), +e.g. stream widgets for AIF + +SND_SOC_DAPM_AIF_IN("AIF1RX", "AIF1 Playback", 0, SND_SOC_NOPM, 0, 0), +SND_SOC_DAPM_AIF_OUT("AIF1TX", "AIF1 Capture", 0, SND_SOC_NOPM, 0, 0), +  2.2 Path Domain Widgets  ----------------------- @@ -121,12 +136,14 @@ If you dont want the mixer elements prefixed with the name of the mixer widget,  you can use SND_SOC_DAPM_MIXER_NAMED_CTL instead. the parameters are the same  as for SND_SOC_DAPM_MIXER. -2.3 Platform/Machine domain Widgets ------------------------------------ + +2.3 Machine domain Widgets +--------------------------  Machine widgets are different from codec widgets in that they don't have a  codec register bit associated with them. A machine widget is assigned to each -machine audio component (non codec) that can be independently powered. e.g. +machine audio component (non codec or DSP) that can be independently +powered. e.g.   o Speaker Amp   o Microphone Bias @@ -146,12 +163,12 @@ static int spitz_mic_bias(struct snd_soc_dapm_widget* w, int event)  SND_SOC_DAPM_MIC("Mic Jack", spitz_mic_bias), -2.4 Codec Domain ----------------- +2.4 Codec (BIAS) Domain +----------------------- -The codec power domain has no widgets and is handled by the codecs DAPM event -handler. This handler is called when the codec powerstate is changed wrt to any -stream event or by kernel PM events. +The codec bias power domain has no widgets and is handled by the codecs DAPM +event handler. This handler is called when the codec powerstate is changed wrt +to any stream event or by kernel PM events.  2.5 Virtual Widgets @@ -169,15 +186,16 @@ After all the widgets have been defined, they can then be added to the DAPM  subsystem individually with a call to snd_soc_dapm_new_control(). -3. Codec Widget Interconnections -================================ +3. Codec/DSP Widget Interconnections +==================================== -Widgets are connected to each other within the codec and machine by audio paths -(called interconnections). Each interconnection must be defined in order to -create a map of all audio paths between widgets. +Widgets are connected to each other within the codec, platform and machine by +audio paths (called interconnections). Each interconnection must be defined in +order to create a map of all audio paths between widgets. -This is easiest with a diagram of the codec (and schematic of the machine audio -system), as it requires joining widgets together via their audio signal paths. +This is easiest with a diagram of the codec or DSP (and schematic of the machine +audio system), as it requires joining widgets together via their audio signal +paths.  e.g., from the WM8731 output mixer (wm8731.c) @@ -247,16 +265,9 @@ machine and includes the codec. e.g.   o Mic Jack   o Codec Pins -When a codec pin is NC it can be marked as not used with a call to - -snd_soc_dapm_set_endpoint(codec, "Widget Name", 0); - -The last argument is 0 for inactive and 1 for active. This way the pin and its -input widget will never be powered up and consume power. - -This also applies to machine widgets. e.g. if a headphone is connected to a -jack then the jack can be marked active. If the headphone is removed, then -the headphone jack can be marked inactive. +Endpoints are added to the DAPM graph so that their usage can be determined in +order to save power. e.g. NC codecs pins will be switched OFF, unconnected +jacks can also be switched OFF.  5 DAPM Widget Events diff --git a/Documentation/sound/alsa/soc/machine.txt b/Documentation/sound/alsa/soc/machine.txt index 2524c75557d..74056dba52b 100644 --- a/Documentation/sound/alsa/soc/machine.txt +++ b/Documentation/sound/alsa/soc/machine.txt @@ -1,8 +1,10 @@  ASoC Machine Driver  =================== -The ASoC machine (or board) driver is the code that glues together the platform -and codec drivers. +The ASoC machine (or board) driver is the code that glues together all the +component drivers (e.g. codecs, platforms and DAIs). It also describes the +relationships between each componnent which include audio paths, GPIOs, +interrupts, clocking, jacks and voltage regulators.  The machine driver can contain codec and platform specific code. It registers  the audio subsystem with the kernel as a platform device and is represented by @@ -12,6 +14,8 @@ the following struct:-  struct snd_soc_card {  	char *name; +	... +  	int (*probe)(struct platform_device *pdev);  	int (*remove)(struct platform_device *pdev); @@ -22,12 +26,13 @@ struct snd_soc_card {  	int (*resume_pre)(struct platform_device *pdev);  	int (*resume_post)(struct platform_device *pdev); -	/* machine stream operations */ -	struct snd_soc_ops *ops; +	...  	/* CPU <--> Codec DAI links  */  	struct snd_soc_dai_link *dai_link;  	int num_links; + +	...  };  probe()/remove() @@ -42,18 +47,12 @@ of any machine audio tasks that have to be done before or after the codec, DAIs  and DMA is suspended and resumed. Optional. -Machine operations ------------------- -The machine specific audio operations can be set here. Again this is optional. - -  Machine DAI Configuration  -------------------------  The machine DAI configuration glues all the codec and CPU DAIs together. It can  also be used to set up the DAI system clock and for any machine related DAI  initialisation e.g. the machine audio map can be connected to the codec audio -map, unconnected codec pins can be set as such. Please see corgi.c, spitz.c -for examples. +map, unconnected codec pins can be set as such.  struct snd_soc_dai_link is used to set up each DAI in your machine. e.g. @@ -61,8 +60,10 @@ struct snd_soc_dai_link is used to set up each DAI in your machine. e.g.  static struct snd_soc_dai_link corgi_dai = {  	.name = "WM8731",  	.stream_name = "WM8731", -	.cpu_dai = &pxa_i2s_dai, -	.codec_dai = &wm8731_dai, +	.cpu_dai_name = "pxa-is2-dai", +	.codec_dai_name = "wm8731-hifi", +	.platform_name = "pxa-pcm-audio", +	.codec_name = "wm8713-codec.0-001a",  	.init = corgi_wm8731_init,  	.ops = &corgi_ops,  }; @@ -77,34 +78,13 @@ static struct snd_soc_card snd_soc_corgi = {  }; -Machine Audio Subsystem ------------------------ - -The machine soc device glues the platform, machine and codec driver together. -Private data can also be set here. e.g. - -/* corgi audio private data */ -static struct wm8731_setup_data corgi_wm8731_setup = { -	.i2c_address = 0x1b, -}; - -/* corgi audio subsystem */ -static struct snd_soc_device corgi_snd_devdata = { -	.machine = &snd_soc_corgi, -	.platform = &pxa2xx_soc_platform, -	.codec_dev = &soc_codec_dev_wm8731, -	.codec_data = &corgi_wm8731_setup, -}; - -  Machine Power Map  -----------------  The machine driver can optionally extend the codec power map and to become an  audio power map of the audio subsystem. This allows for automatic power up/down  of speaker/HP amplifiers, etc. Codec pins can be connected to the machines jack -sockets in the machine init function. See soc/pxa/spitz.c and dapm.txt for -details. +sockets in the machine init function.  Machine Controls diff --git a/Documentation/sound/alsa/soc/overview.txt b/Documentation/sound/alsa/soc/overview.txt index 138ac88c146..ff88f52eec9 100644 --- a/Documentation/sound/alsa/soc/overview.txt +++ b/Documentation/sound/alsa/soc/overview.txt @@ -49,18 +49,23 @@ features :-    * Machine specific controls: Allow machines to add controls to the sound card      (e.g. volume control for speaker amplifier). -To achieve all this, ASoC basically splits an embedded audio system into 3 -components :- +To achieve all this, ASoC basically splits an embedded audio system into +multiple re-usable component drivers :- -  * Codec driver: The codec driver is platform independent and contains audio -    controls, audio interface capabilities, codec DAPM definition and codec IO -    functions. +  * Codec class drivers: The codec class driver is platform independent and +    contains audio controls, audio interface capabilities, codec DAPM +    definition and codec IO functions. This class extends to BT, FM and MODEM +    ICs if required. Codec class drivers should be generic code that can run +    on any architecture and machine. -  * Platform driver: The platform driver contains the audio DMA engine and audio -    interface drivers (e.g. I2S, AC97, PCM) for that platform. +  * Platform class drivers: The platform class driver includes the audio DMA +    engine driver, digital audio interface (DAI) drivers (e.g. I2S, AC97, PCM) +    and any audio DSP drivers for that platform. -  * Machine driver: The machine driver handles any machine specific controls and -    audio events (e.g. turning on an amp at start of playback). +  * Machine class driver: The machine driver class acts as the glue that +    decribes and binds the other component drivers together to form an ALSA +    "sound card device". It handles any machine specific controls and +    machine level audio events (e.g. turning on an amp at start of playback).  Documentation @@ -84,3 +89,7 @@ machine.txt: Machine driver internals.  pop_clicks.txt: How to minimise audio artifacts.  clocking.txt: ASoC clocking for best power performance. + +jack.txt: ASoC jack detection. + +DPCM.txt: Dynamic PCM - Describes DPCM with DSP examples. diff --git a/Documentation/sound/alsa/soc/platform.txt b/Documentation/sound/alsa/soc/platform.txt index 06d835987c6..3a08a2c9150 100644 --- a/Documentation/sound/alsa/soc/platform.txt +++ b/Documentation/sound/alsa/soc/platform.txt @@ -1,9 +1,9 @@  ASoC Platform Driver  ==================== -An ASoC platform driver can be divided into audio DMA and SoC DAI configuration -and control. The platform drivers only target the SoC CPU and must have no board -specific code. +An ASoC platform driver class can be divided into audio DMA drivers, SoC DAI +drivers and DSP drivers. The platform drivers only target the SoC CPU and must +have no board specific code.  Audio DMA  ========= @@ -20,9 +20,10 @@ struct snd_soc_ops {  	int (*trigger)(struct snd_pcm_substream *, int);  }; -The platform driver exports its DMA functionality via struct snd_soc_platform:- +The platform driver exports its DMA functionality via struct +snd_soc_platform_driver:- -struct snd_soc_platform { +struct snd_soc_platform_driver {  	char *name;  	int (*probe)(struct platform_device *pdev); @@ -34,6 +35,13 @@ struct snd_soc_platform {  	int (*pcm_new)(struct snd_card *, struct snd_soc_codec_dai *, struct snd_pcm *);  	void (*pcm_free)(struct snd_pcm *); +	/* +	 * For platform caused delay reporting. +	 * Optional. +	 */ +	snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *, +		struct snd_soc_dai *); +  	/* platform stream ops */  	struct snd_pcm_ops *pcm_ops;  }; @@ -56,3 +64,16 @@ Each SoC DAI driver must provide the following features:-   5) Suspend and resume (optional)  Please see codec.txt for a description of items 1 - 4. + + +SoC DSP Drivers +=============== + +Each SoC DSP driver usually supplies the following features :- + + 1) DAPM graph + 2) Mixer controls + 3) DMA IO to/from DSP buffers (if applicable) + 4) Definition of DSP front end (FE) PCM devices. + +Please see DPCM.txt for a description of item 4. diff --git a/Documentation/sound/oss/ALS b/Documentation/sound/oss/ALS index d01ffbfd580..bf10bed4574 100644 --- a/Documentation/sound/oss/ALS +++ b/Documentation/sound/oss/ALS @@ -57,10 +57,10 @@ The resulting sound driver will provide the following capabilities:      DSP/PCM/audio out (L&R), FM (L&R) and Mic in (mono).  Jonathan Woithe -jwoithe@physics.adelaide.edu.au +jwoithe@just42.net  30 March 1998  Modified 2000-02-26 by Dave Forrest, drf5n@virginia.edu to add ALS100/ALS200  Modified 2000-04-10 by Paul Laufer, pelaufer@csupomona.edu to add ISAPnP info. -Modified 2000-11-19 by Jonathan Woithe, jwoithe@physics.adelaide.edu.au +Modified 2000-11-19 by Jonathan Woithe, jwoithe@just42.net   - updated information for kernel 2.4.x. diff --git a/Documentation/sound/oss/AudioExcelDSP16 b/Documentation/sound/oss/AudioExcelDSP16 index c0f08922993..ea8549faede 100644 --- a/Documentation/sound/oss/AudioExcelDSP16 +++ b/Documentation/sound/oss/AudioExcelDSP16 @@ -1,10 +1,10 @@  Driver  ------ -Informations about Audio Excel DSP 16 driver can be found in the source +Information about Audio Excel DSP 16 driver can be found in the source  file aedsp16.c  Please, read the head of the source before using it. It contain useful -informations. +information.  Configuration  ------------- @@ -41,7 +41,7 @@ mpu_base	I/O base address for activate MPU-401 mode  		(0x300, 0x310, 0x320 or 0x330)  mpu_irq		MPU-401 irq line (5, 7, 9, 10 or 0) -The /etc/modprobe.conf will have lines like this: +A configuration file in /etc/modprobe.d/ directory will have lines like this:  options opl3 io=0x388  options ad1848 io=0x530 irq=11 dma=3 @@ -51,11 +51,11 @@ Where the aedsp16 options are the options for this driver while opl3 and  ad1848 are the corresponding options for the MSS and OPL3 modules.  Loading MSS and OPL3 needs to pre load the aedsp16 module to set up correctly -the sound card. Installation dependencies must be written in the modprobe.conf -file: +the sound card. Installation dependencies must be written in configuration +files under /etc/modprobe.d/ directory: -install ad1848 /sbin/modprobe aedsp16 && /sbin/modprobe -i ad1848 -install opl3 /sbin/modprobe aedsp16 && /sbin/modprobe -i opl3 +softdep ad1848 pre: aedsp16 +softdep opl3 pre: aedsp16  Then you must load the sound modules stack in this order:  sound -> aedsp16 -> [ ad1848, opl3 ] @@ -68,7 +68,7 @@ Sound cards supported  This driver supports the SC-6000 and SC-6600 based Gallant's sound card.  It don't support the Audio Excel DSP 16 III (try the SC-6600 code).  I'm working on the III version of the card: if someone have useful -informations about it, please let me know. +information about it, please let me know.  For all the non-supported audio cards, you have to boot MS-DOS (or WIN95)  activating the audio card with the MS-DOS device driver, then you have to  <ctrl>-<alt>-<del> and boot Linux. diff --git a/Documentation/sound/oss/CMI8330 b/Documentation/sound/oss/CMI8330 index 9c439f1a6db..8a5fd1611c6 100644 --- a/Documentation/sound/oss/CMI8330 +++ b/Documentation/sound/oss/CMI8330 @@ -143,11 +143,10 @@ CONFIG_SOUND_MSS=m -Alma Chao <elysian@ethereal.torsion.org> suggests the following /etc/modprobe.conf: +Alma Chao <elysian@ethereal.torsion.org> suggests the following in +a /etc/modprobe.d/*conf file:  alias sound ad1848  alias synth0 opl3  options ad1848 io=0x530 irq=7 dma=0 soundpro=1  options opl3 io=0x388 - -	 diff --git a/Documentation/sound/oss/Introduction b/Documentation/sound/oss/Introduction index 75d967ff926..42da2d8fa37 100644 --- a/Documentation/sound/oss/Introduction +++ b/Documentation/sound/oss/Introduction @@ -167,8 +167,8 @@ in a file such as /root/soundon.sh.  MODPROBE:  ========= -If loading via modprobe, these common files are automatically loaded  -when requested by modprobe.  For example, my /etc/modprobe.conf contains: +If loading via modprobe, these common files are automatically loaded when +requested by modprobe.  For example, my /etc/modprobe.d/oss.conf contains:  alias sound sb   options sb io=0x240 irq=9 dma=3 dma16=5 mpu_io=0x300 @@ -228,7 +228,7 @@ http://www.opensound.com.  Before loading the commercial sound  driver, you should do the following:  1.  remove sound modules (detailed above) -2.  remove the sound modules from /etc/modprobe.conf +2.  remove the sound modules from /etc/modprobe.d/*.conf  3.  move the sound modules from /lib/modules/<kernel>/misc      (for example, I make a /lib/modules/<kernel>/misc/tmp      directory and copy the sound module files to that  @@ -265,7 +265,7 @@ twice, you need to do the following:      sb.o could be copied (or symlinked) to sb1.o for the      second SoundBlaster. -2.  Make a second entry in /etc/modprobe.conf, for example, +2.  Make a second entry in /etc/modprobe.d/*conf, for example,      sound1 or sb1.  This second entry should refer to the      new module names for example sb1, and should include      the I/O, etc. for the second sound card. @@ -369,7 +369,7 @@ There are several ways of configuring your sound:  2)  On the command line when using insmod or in a bash script      using command line calls to load sound. -3)  In /etc/modprobe.conf when using modprobe. +3)  In /etc/modprobe.d/*conf when using modprobe.  4)  Via Red Hat's GPL'd /usr/sbin/sndconfig program (text based). diff --git a/Documentation/sound/oss/Opti b/Documentation/sound/oss/Opti index c15af3c07d4..4cd5d9ab358 100644 --- a/Documentation/sound/oss/Opti +++ b/Documentation/sound/oss/Opti @@ -18,7 +18,7 @@ force the card into a mode in which it can be programmed.  If you have another OS installed on your computer it is recommended  that Linux and the other OS use the same resources. -Also, it is recommended that resources specified in /etc/modprobe.conf +Also, it is recommended that resources specified in /etc/modprobe.d/*.conf  and resources specified in /etc/isapnp.conf agree.  Compiling the sound driver @@ -67,11 +67,7 @@ address is hard-coded into the driver.  Using kmod and autoloading the sound driver  ------------------------------------------- -Comment: as of linux-2.1.90 kmod is replacing kerneld. -The config file '/etc/modprobe.conf' is used as before. - -This is the sound part of my /etc/modprobe.conf file. -Following that I will explain each line. +Config files in '/etc/modprobe.d/' are used as below:  alias mixer0 mad16  alias audio0 mad16 diff --git a/Documentation/sound/oss/PAS16 b/Documentation/sound/oss/PAS16 index 951b3dce51b..5c27229eec8 100644 --- a/Documentation/sound/oss/PAS16 +++ b/Documentation/sound/oss/PAS16 @@ -60,8 +60,7 @@ With PAS16 you can use two audio device files at the same time. /dev/dsp (and  The new stuff for 2.3.99 and later  ============================================================================ -The following configuration options from Documentation/Configure.help -are relevant to configuring the PAS16: +The following configuration options are relevant to configuring the PAS16:  Sound card support  CONFIG_SOUND @@ -129,7 +128,7 @@ CONFIG_SOUND_YM3812    You can then get OPL3 functionality by issuing the command:    insmod opl3    In addition, you must either add the following line to  -  /etc/modprobe.conf: +  /etc/modprobe.d/*.conf:    options opl3 io=0x388    or else add the following line to /etc/lilo.conf:    opl3=0x388 @@ -159,5 +158,5 @@ following line would be appropriate:  append="pas2=0x388,10,3,-1,0,-1,-1,-1 opl3=0x388"  If sound is built totally modular, the above options may be  -specified in /etc/modprobe.conf for pas2, sb and opl3 +specified in /etc/modprobe.d/*.conf for pas2, sb and opl3  respectively.  diff --git a/Documentation/sound/oss/README.OSS b/Documentation/sound/oss/README.OSS index c615debbf08..4be259428a1 100644 --- a/Documentation/sound/oss/README.OSS +++ b/Documentation/sound/oss/README.OSS @@ -1352,7 +1352,7 @@ OSS-mixer.  The PCM20 contains a radio tuner, which is also controlled by  ACI. This radio tuner is supported by the ACI driver together with the  miropcm20.o module. Also the 7-band equalizer is integrated -(limited by the OSS-design). Developement has started and maybe +(limited by the OSS-design). Development has started and maybe  finished for the RDS decoder on this card, too. You will be able to  read RadioText, the Programme Service name, Programme TYpe and  others. Even the v4l radio module benefits from it with a refined diff --git a/Documentation/sound/oss/README.modules b/Documentation/sound/oss/README.modules index e691d74e1e5..cdc039421a4 100644 --- a/Documentation/sound/oss/README.modules +++ b/Documentation/sound/oss/README.modules @@ -26,7 +26,7 @@ Note that it is no longer necessary or possible to configure sound in the  drivers/sound dir. Now one simply configures and makes one's kernel and  modules in the usual way. - Then, add to your /etc/modprobe.conf something like: + Then, add to your /etc/modprobe.d/oss.conf something like:  alias char-major-14-* sb  install sb /sbin/modprobe -i sb && /sbin/modprobe adlib_card @@ -36,7 +36,7 @@ options adlib_card io=0x388     # FM synthesizer   Alternatively, if you have compiled in kernel level ISAPnP support:  alias char-major-14 sb -post-install sb /sbin/modprobe "-k" "adlib_card" +softdep sb post: adlib_card  options adlib_card io=0x388    The effect of this is that the sound driver and all necessary bits and @@ -66,12 +66,12 @@ args are expected.   Note that at present there is no way to configure the io, irq and other  parameters for the modular drivers as one does for the wired drivers.. One  needs to pass the modules the necessary parameters as arguments, either -with /etc/modprobe.conf or with command-line args to modprobe, e.g. +with /etc/modprobe.d/*.conf or with command-line args to modprobe, e.g.  modprobe sb io=0x220 irq=7 dma=1 dma16=5 mpu_io=0x330  modprobe adlib_card io=0x388 - recommend using /etc/modprobe.conf. + recommend using /etc/modprobe.d/*.conf.  Persistent DMA Buffers: @@ -89,7 +89,7 @@ wasteful of RAM, but it guarantees that sound always works.  To make the sound driver use persistent DMA buffers we need to pass the  sound.o module a "dmabuf=1" command-line argument. This is normally done -in /etc/modprobe.conf like so: +in /etc/modprobe.d/*.conf files like so:  options sound		dmabuf=1 diff --git a/Documentation/sound/oss/README.ymfsb b/Documentation/sound/oss/README.ymfsb index af8a7d3a4e8..b6b77906b58 100644 --- a/Documentation/sound/oss/README.ymfsb +++ b/Documentation/sound/oss/README.ymfsb @@ -5,7 +5,7 @@ FIRST OF ALL  ============    This code references YAMAHA's sample codes and data sheets. -  I respect and thank for all people they made open the informations +  I respect and thank for all people they made open the information    about YMF7xx cards.    And this codes heavily based on Jeff Garzik <jgarzik@pobox.com>'s diff --git a/Documentation/sound/oss/vwsnd b/Documentation/sound/oss/vwsnd deleted file mode 100644 index 4c6cbdb3c54..00000000000 --- a/Documentation/sound/oss/vwsnd +++ /dev/null @@ -1,293 +0,0 @@ -vwsnd - Sound driver for the Silicon Graphics 320 and 540 Visual -Workstations' onboard audio. - -Copyright 1999 Silicon Graphics, Inc.  All rights reserved. - - -At the time of this writing, March 1999, there are two models of -Visual Workstation, the 320 and the 540.  This document only describes -those models.  Future Visual Workstation models may have different -sound capabilities, and this driver will probably not work on those -boxes. - -The Visual Workstation has an Analog Devices AD1843 "SoundComm" audio -codec chip.  The AD1843 is accessed through the Cobalt I/O ASIC, also -known as Lithium.  This driver programs both chips. - -============================================================================== -QUICK CONFIGURATION - -	# insmod soundcore -	# insmod vwsnd - -============================================================================== -I/O CONNECTIONS - -On the Visual Workstation, only three of the AD1843 inputs are hooked -up.  The analog line in jacks are connected to the AD1843's AUX1 -input.  The CD audio lines are connected to the AD1843's AUX2 input. -The microphone jack is connected to the AD1843's MIC input.  The mic -jack is mono, but the signal is delivered to both the left and right -MIC inputs.  You can record in stereo from the mic input, but you will -get the same signal on both channels (within the limits of A/D -accuracy).  Full scale on the Line input is +/- 2.0 V.  Full scale on -the MIC input is 20 dB less, or +/- 0.2 V. - -The AD1843's LOUT1 outputs are connected to the Line Out jacks.  The -AD1843's HPOUT outputs are connected to the speaker/headphone jack. -LOUT2 is not connected.  Line out's maximum level is +/- 2.0 V peak to -peak.  The speaker/headphone out's maximum is +/- 4.0 V peak to peak. - -The AD1843's PCM input channel and one of its output channels (DAC1) -are connected to Lithium.  The other output channel (DAC2) is not -connected. - -============================================================================== -CAPABILITIES - -The AD1843 has PCM input and output (Pulse Code Modulation, also known -as wavetable).  PCM input and output can be mono or stereo in any of -four formats.  The formats are 16 bit signed and 8 bit unsigned, -u-Law, and A-Law format.  Any sample rate from 4 KHz to 49 KHz is -available, in 1 Hz increments. - -The AD1843 includes an analog mixer that can mix all three input -signals (line, mic and CD) into the analog outputs.  The mixer has a -separate gain control and mute switch for each input. - -There are two outputs, line out and speaker/headphone out.  They -always produce the same signal, and the speaker always has 3 dB more -gain than the line out.  The speaker/headphone output can be muted, -but this driver does not export that function. - -The hardware can sync audio to the video clock, but this driver does -not have a way to specify syncing to video. - -============================================================================== -PROGRAMMING - -This section explains the API supported by the driver.  Also see the -Open Sound Programming Guide at http://www.opensound.com/pguide/ . -This section assumes familiarity with that document. - -The driver has two interfaces, an I/O interface and a mixer interface. -There is no MIDI or sequencer capability. - -============================================================================== -PROGRAMMING PCM I/O - -The I/O interface is usually accessed as /dev/audio or /dev/dsp. -Using the standard Open Sound System (OSS) ioctl calls, the sample -rate, number of channels, and sample format may be set within the -limitations described above.  The driver supports triggering.  It also -supports getting the input and output pointers with one-sample -accuracy. - -The SNDCTL_DSP_GETCAP ioctl returns these capabilities. - -	DSP_CAP_DUPLEX - driver supports full duplex. - -	DSP_CAP_TRIGGER - driver supports triggering. - -	DSP_CAP_REALTIME - values returned by SNDCTL_DSP_GETIPTR -	and SNDCTL_DSP_GETOPTR are accurate to a few samples. - -Memory mapping (mmap) is not implemented. - -The driver permits subdivided fragment sizes from 64 to 4096 bytes. -The number of fragments can be anything from 3 fragments to however -many fragments fit into 124 kilobytes.  It is up to the user to -determine how few/small fragments can be used without introducing -glitches with a given workload.  Linux is not realtime, so we can't -promise anything.  (sigh...) - -When this driver is switched into or out of mu-Law or A-Law mode on -output, it may produce an audible click.  This is unavoidable.  To -prevent clicking, use signed 16-bit mode instead, and convert from -mu-Law or A-Law format in software. - -============================================================================== -PROGRAMMING THE MIXER INTERFACE - -The mixer interface is usually accessed as /dev/mixer.  It is accessed -through ioctls.  The mixer allows the application to control gain or -mute several audio signal paths, and also allows selection of the -recording source. - -Each of the constants described here can be read using the -MIXER_READ(SOUND_MIXER_xxx) ioctl.  Those that are not read-only can -also be written using the MIXER_WRITE(SOUND_MIXER_xxx) ioctl.  In most -cases, <sys/soundcard.h> defines constants SOUND_MIXER_READ_xxx and -SOUND_MIXER_WRITE_xxx which work just as well. - -SOUND_MIXER_CAPS	Read-only - -This is a mask of optional driver capabilities that are implemented. -This driver's only capability is SOUND_CAP_EXCL_INPUT, which means -that only one recording source can be active at a time. - -SOUND_MIXER_DEVMASK	Read-only - -This is a mask of the sound channels.  This driver's channels are PCM, -LINE, MIC, CD, and RECLEV. - -SOUND_MIXER_STEREODEVS	Read-only - -This is a mask of which sound channels are capable of stereo.  All -channels are capable of stereo.  (But see caveat on MIC input in I/O -CONNECTIONS section above). - -SOUND_MIXER_OUTMASK	Read-only - -This is a mask of channels that route inputs through to outputs. -Those are LINE, MIC, and CD. - -SOUND_MIXER_RECMASK	Read-only - -This is a mask of channels that can be recording sources.  Those are -PCM, LINE, MIC, CD. - -SOUND_MIXER_PCM		Default: 0x5757 (0 dB) - -This is the gain control for PCM output.  The left and right channel -gain are controlled independently.  This gain control has 64 levels, -which range from -82.5 dB to +12.0 dB in 1.5 dB steps.  Those 64 -levels are mapped onto 100 levels at the ioctl, see below. - -SOUND_MIXER_LINE	Default: 0x4a4a (0 dB) - -This is the gain control for mixing the Line In source into the -outputs.  The left and right channel gain are controlled -independently.  This gain control has 32 levels, which range from --34.5 dB to +12.0 dB in 1.5 dB steps.  Those 32 levels are mapped onto -100 levels at the ioctl, see below. - -SOUND_MIXER_MIC		Default: 0x4a4a (0 dB) - -This is the gain control for mixing the MIC source into the outputs. -The left and right channel gain are controlled independently.  This -gain control has 32 levels, which range from -34.5 dB to +12.0 dB in -1.5 dB steps.  Those 32 levels are mapped onto 100 levels at the -ioctl, see below. - -SOUND_MIXER_CD		Default: 0x4a4a (0 dB) - -This is the gain control for mixing the CD audio source into the -outputs.  The left and right channel gain are controlled -independently.  This gain control has 32 levels, which range from --34.5 dB to +12.0 dB in 1.5 dB steps.  Those 32 levels are mapped onto -100 levels at the ioctl, see below. - -SOUND_MIXER_RECLEV	 Default: 0 (0 dB) - -This is the gain control for PCM input (RECording LEVel).  The left -and right channel gain are controlled independently.  This gain -control has 16 levels, which range from 0 dB to +22.5 dB in 1.5 dB -steps.  Those 16 levels are mapped onto 100 levels at the ioctl, see -below. - -SOUND_MIXER_RECSRC	 Default: SOUND_MASK_LINE - -This is a mask of currently selected PCM input sources (RECording -SouRCes).  Because the AD1843 can only have a single recording source -at a time, only one bit at a time can be set in this mask.  The -allowable values are SOUND_MASK_PCM, SOUND_MASK_LINE, SOUND_MASK_MIC, -or SOUND_MASK_CD.  Selecting SOUND_MASK_PCM sets up internal -resampling which is useful for loopback testing and for hardware -sample rate conversion.  But software sample rate conversion is -probably faster, so I don't know how useful that is. - -SOUND_MIXER_OUTSRC	DEFAULT: SOUND_MASK_LINE|SOUND_MASK_MIC|SOUND_MASK_CD - -This is a mask of sources that are currently passed through to the -outputs.  Those sources whose bits are not set are muted. - -============================================================================== -GAIN CONTROL - -There are five gain controls listed above.  Each has 16, 32, or 64 -steps.  Each control has 1.5 dB of gain per step.  Each control is -stereo. - -The OSS defines the argument to a channel gain ioctl as having two -components, left and right, each of which ranges from 0 to 100.  The -two components are packed into the same word, with the left side gain -in the least significant byte, and the right side gain in the second -least significant byte.  In C, we would say this. - -	#include <assert.h> - -	... - -	 	assert(leftgain >= 0 && leftgain <= 100); -		assert(rightgain >= 0 && rightgain <= 100); -		arg = leftgain | rightgain << 8; - -So each OSS gain control has 101 steps.  But the hardware has 16, 32, -or 64 steps.  The hardware steps are spread across the 101 OSS steps -nearly evenly.  The conversion formulas are like this, given N equals -16, 32, or 64. - -	int round = N/2 - 1; -	OSS_gain_steps = (hw_gain_steps * 100 + round) / (N - 1); -	hw_gain_steps = (OSS_gain_steps * (N - 1) + round) / 100; - -Here is a snippet of C code that will return the left and right gain -of any channel in dB.  Pass it one of the predefined gain_desc_t -structures to access any of the five channels' gains. - -	typedef struct gain_desc { -		float min_gain; -		float gain_step; -		int nbits; -		int chan; -	} gain_desc_t; - -	const gain_desc_t gain_pcm    = { -82.5, 1.5, 6, SOUND_MIXER_PCM    }; -	const gain_desc_t gain_line   = { -34.5, 1.5, 5, SOUND_MIXER_LINE   }; -	const gain_desc_t gain_mic    = { -34.5, 1.5, 5, SOUND_MIXER_MIC    }; -	const gain_desc_t gain_cd     = { -34.5, 1.5, 5, SOUND_MIXER_CD     }; -	const gain_desc_t gain_reclev = {   0.0, 1.5, 4, SOUND_MIXER_RECLEV }; - -	int get_gain_dB(int fd, const gain_desc_t *gp, -			float *left, float *right) -	{ -		int word; -		int lg, rg; -		int mask = (1 << gp->nbits) - 1; - -		if (ioctl(fd, MIXER_READ(gp->chan), &word) != 0) -			return -1;	/* fail */ -		lg = word & 0xFF; -		rg = word >> 8 & 0xFF; -		lg = (lg * mask + mask / 2) / 100; -		rg = (rg * mask + mask / 2) / 100; -		*left = gp->min_gain + gp->gain_step * lg; -		*right = gp->min_gain + gp->gain_step * rg; -		return 0; -	}	 - -And here is the corresponding routine to set a channel's gain in dB. - -	int set_gain_dB(int fd, const gain_desc_t *gp, float left, float right) -	{ -		float max_gain = -			gp->min_gain + (1 << gp->nbits) * gp->gain_step; -		float round = gp->gain_step / 2; -		int mask = (1 << gp->nbits) - 1; -		int word; -		int lg, rg; - -		if (left < gp->min_gain || right < gp->min_gain) -			return EINVAL; -		lg = (left - gp->min_gain + round) / gp->gain_step; -		rg = (right - gp->min_gain + round) / gp->gain_step; -		if (lg >= (1 << gp->nbits) || rg >= (1 << gp->nbits)) -			return EINVAL; -		lg = (100 * lg + mask / 2) / mask; -		rg = (100 * rg + mask / 2) / mask; -		word = lg | rg << 8; - -		return ioctl(fd, MIXER_WRITE(gp->chan), &word); -	} -  | 
