Detailed changes v1.2.3.1 v1.2.3.2

From AlsaProject
Jump to navigation Jump to search

Detailed changelog between 1.2.3.1 and 1.2.3.2 releases

Changelog between 1.2.3.1 and 1.2.3.2 releases

alsa-lib

Core

- Release v1.2.3.2

Control API

- control: Fix a bug that prevented namehint behaviour

Looks like the documented behaviour was broken in commit 1ba513f9 in
2006, with the introduction of multiple fields.

I've chosen to match the described behaviour. Prior to this patch,
using namehint could be made to work by exploiting the lack of escaping
of the "name", populating the other fields:

  "plug:front|DESCDo all conversions for front speakers"

rather than that which is documented and presumed to be the intention
for asoundrc files:

  "plug:front|Do all conversions for front speakers"

Everything seems to strongly suggest nobody is using this feature; I can
find no working examples through a web search and probably someone
would have hit this bug. It's not documented in configuration, only in
the snd_device_name_hint() call. So it would probably clutter things to
provide compatibility for the old behaviour.

I have found it to be very useful since working in Chromium, where it is
the only way to expose chosen ALSA devices to web applications.

A temporary buffer is required to null-terminate the string.  I see no
use of alloca() in the code, presumably to avoid unbounded stack size.
So memory is allocated on the heap.

- control: Fix typos in the namehint example

Ths "namehint" is a list, and there doesn't seem to have been any
history where the separator would be a colon.

PCM API

- pcm: Annotate the _avail functions

I took time to understand these functions in the context of the
rest of the code, which would have been a lot quicker with a comment
like this.

- dsnoop: Make use of the (previously unused) function

Match the equivalent funciton for playback. This is on the assumption
that values should be capped at zero, which is what _rewindable()
implements.

- dsnoop: Another bug where the empty, not full, part of the ringbuffer was observed

This looks like a simple mistake dating back to 2003 (commit 7470a5b9)
where code originated from dmix.

- dsnoop: The stop threshold was not implemented correctly

The previous implementation would mean that stop_threshold behaved
erratically. The intent is to detect that the buffer is too full,
and stop.

In practice, I don't think this was a bug in practice for applications
which don't adjust the stop_threshold. The line above catches those cases.

- pcm: Annotate the _delay functions based on findings from the previous bug - dsnoop: The delay presented to snd_pcm_status_delay() was incorrect

This was the original bug that caused me to start looking at the
ring buffer functions.

In the API this is documented as:

  "Delay is distance between current application frame position and
   sound frame position. It's positive and less than buffer size in
   normal situation, negative on playback underrun and greater than
   buffer size on capture overrun. "

Because dsnoop was returning the buffer space available to the hardware
the return value was always quite large, and moved in the wrong
direction.

With this patch, dsnoop now gives results which are comparable to using
the "hw" device directly. My test case was with snd-echo3g (Layla3G).

Use Case Manager API

- ucm: Allow empty strings in "${var:...}" substitutions

Recent ucm-conf changes introduce checks like this one in various places:

If.mspk {
        Condition {
                Type String
                Empty "${var:MonoSpeaker}"
        }
        True ...
        False ...
}

The 'Empty "${var:MonoSpeaker}"' part can only every succeed if we do:

Define.MonoSpeaker ""

But so far that would result in an error like this one:

ALSA lib ucm_subs.c:367:(uc_mgr_get_substituted_value) variable '${var:MonoSpeaker}' is not defined in this context!
ALSA lib main.c:983:(snd_use_case_mgr_open) error: failed to import cht-bsw-rt5672 use case configuration -22
alsaucm: error failed to open sound card cht-bsw-rt5672: Invalid argument

This commit fixes this by allowing empty values for "${var:...}"
substitutions.

Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

- ucm: implement AlwaysTrue Condition.Type - ucm: simplify get_by_card() in parser.c - ucm: fix the possible buffer overflow (substitution)

Configuration

- alsa.conf: load /etc/asound.conf or /usr/etc/asound.conf not both - conf: Add /usr/etc to the default search paths

There's been some recent action to move the distribution-default setup
from /etc to /usr/etc, and we should follow that, too.

This patch adds /usr/etc/alsa.conf.d and /usr/etc/alsa.conf to the
default search paths.