Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 353487
b: refs/heads/master
c: 43cd8bf
h: refs/heads/master
i:
  353485: d2af7af
  353483: b86b6d2
  353479: ce7f183
  353471: cb8f757
v: v3
  • Loading branch information
Mark Brown committed Feb 12, 2013
1 parent 975c84c commit c3b0c29
Show file tree
Hide file tree
Showing 60 changed files with 17,456 additions and 16,357 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f3c90242a3b9e32f510229c4c1313df6ca7f1667
refs/heads/master: 43cd8bf1c8d8f6e897ed0f2c4bd50a4266b5c36e
58 changes: 29 additions & 29 deletions trunk/Documentation/DocBook/writing-an-alsa-driver.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -871,8 +871,9 @@
<para>
This function itself doesn't allocate the data space. The data
must be allocated manually beforehand, and its pointer is passed
as the argument. This pointer (<parameter>chip</parameter> in the
above example) is used as the identifier for the instance.
as the argument. This pointer is used as the
(<parameter>chip</parameter> identifier in the above example)
for the instance.
</para>

<para>
Expand Down Expand Up @@ -2303,7 +2304,7 @@ struct _snd_pcm_runtime {
<constant>SNDRV_PCM_INFO_XXX</constant>. Here, at least, you
have to specify whether the mmap is supported and which
interleaved format is supported.
When the hardware supports mmap, add the
When the is supported, add the
<constant>SNDRV_PCM_INFO_MMAP</constant> flag here. When the
hardware supports the interleaved or the non-interleaved
formats, <constant>SNDRV_PCM_INFO_INTERLEAVED</constant> or
Expand Down Expand Up @@ -2897,7 +2898,7 @@ struct _snd_pcm_runtime {

<para>
When the pcm supports the pause operation (given in the info
field of the hardware table), the <constant>PAUSE_PUSH</constant>
field of the hardware table), the <constant>PAUSE_PUSE</constant>
and <constant>PAUSE_RELEASE</constant> commands must be
handled here, too. The former is the command to pause the pcm,
and the latter to restart the pcm again.
Expand Down Expand Up @@ -3084,7 +3085,7 @@ struct _snd_pcm_runtime {
<section id="pcm-interface-interrupt-handler-timer">
<title>High frequency timer interrupts</title>
<para>
This happens when the hardware doesn't generate interrupts
This happense when the hardware doesn't generate interrupts
at the period boundary but issues timer interrupts at a fixed
timer rate (e.g. es1968 or ymfpci drivers).
In this case, you need to check the current hardware
Expand Down Expand Up @@ -3250,19 +3251,18 @@ struct _snd_pcm_runtime {
<title>Example of Hardware Constraints for Channels</title>
<programlisting>
<![CDATA[
static int hw_rule_channels_by_format(struct snd_pcm_hw_params *params,
static int hw_rule_format_by_channels(struct snd_pcm_hw_params *params,
struct snd_pcm_hw_rule *rule)
{
struct snd_interval *c = hw_param_interval(params,
SNDRV_PCM_HW_PARAM_CHANNELS);
SNDRV_PCM_HW_PARAM_CHANNELS);
struct snd_mask *f = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
struct snd_interval ch;
struct snd_mask fmt;
snd_interval_any(&ch);
if (f->bits[0] == SNDRV_PCM_FMTBIT_S16_LE) {
ch.min = ch.max = 1;
ch.integer = 1;
return snd_interval_refine(c, &ch);
snd_mask_any(&fmt); /* Init the struct */
if (c->min < 2) {
fmt.bits[0] &= SNDRV_PCM_FMTBIT_S16_LE;
return snd_mask_refine(f, &fmt);
}
return 0;
}
Expand All @@ -3278,35 +3278,35 @@ struct _snd_pcm_runtime {
<programlisting>
<![CDATA[
snd_pcm_hw_rule_add(substream->runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
hw_rule_channels_by_format, NULL,
SNDRV_PCM_HW_PARAM_FORMAT, -1);
hw_rule_channels_by_format, 0, SNDRV_PCM_HW_PARAM_FORMAT,
-1);
]]>
</programlisting>
</informalexample>
</para>

<para>
The rule function is called when an application sets the PCM
format, and it refines the number of channels accordingly.
But an application may set the number of channels before
setting the format. Thus you also need to define the inverse rule:
The rule function is called when an application sets the number of
channels. But an application can set the format before the number of
channels. Thus you also need to define the inverse rule:

<example>
<title>Example of Hardware Constraints for Formats</title>
<title>Example of Hardware Constraints for Channels</title>
<programlisting>
<![CDATA[
static int hw_rule_format_by_channels(struct snd_pcm_hw_params *params,
static int hw_rule_channels_by_format(struct snd_pcm_hw_params *params,
struct snd_pcm_hw_rule *rule)
{
struct snd_interval *c = hw_param_interval(params,
SNDRV_PCM_HW_PARAM_CHANNELS);
SNDRV_PCM_HW_PARAM_CHANNELS);
struct snd_mask *f = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
struct snd_mask fmt;
struct snd_interval ch;
snd_mask_any(&fmt); /* Init the struct */
if (c->min < 2) {
fmt.bits[0] &= SNDRV_PCM_FMTBIT_S16_LE;
return snd_mask_refine(f, &fmt);
snd_interval_any(&ch);
if (f->bits[0] == SNDRV_PCM_FMTBIT_S16_LE) {
ch.min = ch.max = 1;
ch.integer = 1;
return snd_interval_refine(c, &ch);
}
return 0;
}
Expand All @@ -3321,8 +3321,8 @@ struct _snd_pcm_runtime {
<programlisting>
<![CDATA[
snd_pcm_hw_rule_add(substream->runtime, 0, SNDRV_PCM_HW_PARAM_FORMAT,
hw_rule_format_by_channels, NULL,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
hw_rule_format_by_channels, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
-1);
]]>
</programlisting>
</informalexample>
Expand Down
5 changes: 2 additions & 3 deletions trunk/Documentation/sound/alsa/ALSA-Configuration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -890,9 +890,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
enable_msi - Enable Message Signaled Interrupt (MSI) (default = off)
power_save - Automatic power-saving timeout (in second, 0 =
disable)
power_save_controller - Support runtime D3 of HD-audio controller
(-1 = on for supported chip (default), false = off,
true = force to on even for unsupported hardware)
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
Expand Down
2 changes: 1 addition & 1 deletion trunk/Documentation/sound/alsa/HD-Audio-Models.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ALC882/883/885/888/889
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)
no-primary-hp VAIO Z workaround (for fixed speaker DAC)

ALC861/660
==========
Expand Down
126 changes: 25 additions & 101 deletions trunk/Documentation/sound/alsa/HD-Audio.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,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 (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.
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.

What `model` option values are available depends on the codec chip.
Check your codec chip from the codec proc file (see "Codec Proc-File"
Expand All @@ -199,12 +199,17 @@ 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.

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.
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.

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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -382,8 +387,9 @@ 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 `jack_detect = no`
will disable the jack detection of the machine completely.
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.
init_pin_configs::
Shows the initial pin default config values set by BIOS.
driver_pin_configs::
Expand Down Expand Up @@ -415,61 +421,6 @@ 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_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_out_jack_modes (bool): add "xxx Jack Mode" enum controls to each
output jack for allowing to change the headphone amp capability
- add_in_jack_modes (bool): add "xxx Jack Mode" enum controls to each
input jack for allowing to change the mic bias vref
- power_down_unused (bool): power down the unused widgets
- 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
Expand All @@ -494,7 +445,7 @@ A patch file is a plain text file which looks like below:
0x20 0x400 0xff

[hint]
jack_detect = no
hp_detect = yes
------------------------------------------------------------------------

The file needs to have a line `[codec]`. The next line should contain
Expand Down Expand Up @@ -580,13 +531,6 @@ 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
~~~~~~~~~~~
Expand Down Expand Up @@ -643,9 +587,8 @@ The latest development codes for HD-audio are found on sound git tree:
- 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 development for the current
and next kernels are found in for-linus and for-next branches,
respectively.
development branches in general while the HD-audio specific patches
are committed in topic/hda branch.

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
Expand Down Expand Up @@ -756,11 +699,7 @@ 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 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:
The hda-verb program is found in the ftp directory:

- ftp://ftp.suse.com/pub/people/tiwai/misc/

Expand Down Expand Up @@ -838,18 +777,3 @@ 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

46 changes: 0 additions & 46 deletions trunk/Documentation/sound/alsa/compress_offload.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,52 +145,6 @@ Modifications include:
- 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
Expand Down
Loading

0 comments on commit c3b0c29

Please sign in to comment.