Detailed changes v1.1.8 v1.1.9

From AlsaProject
Revision as of 09:16, 10 May 2019 by Perex (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Detailed changelog between 1.1.8 and 1.1.9 releases

Changelog between 1.1.8 and 1.1.9 releases

alsa-lib

Core

- Release v1.1.9
- add support for GCC's LTO
- add snd_strlcpy() and use it everywhere
- ucm: Add ucm files for DB820c board
DB820c board is based of MSM8996 Qualcomm SoC, which has support for both
Digital and Analog audio. Digital audio is over HDMI and analog is over
WCD9335 codec via SLIMbus.
Board itself has HDMI port, a 3.5mm audio Jack and an Audio expansion
connector.
This patch adds support for HDMI port and 3.5mm jack.

Control API

- add support for GCC's LTO
- Print unsigned ints with %u instead of %i. (snd_ctl_ascii_elem_id_get)
- add snd_strlcpy() and use it everywhere

PCM API

- add support for GCC's LTO
- pcm: multi plugin: reset hw/appl pointers in prepare/reset functions
- pcm: multi plugin: detach the hw_ptr and appl_ptr from master_slave
Unfortunately, the master_slave buffer pointers are not always in sync with
the presented avail value and the higher layers (like write_areas) got
confused. Create own hw_ptr and appl_ptr.
This commit also tries to fix the hwsync and delay implementation (iterate
through all slaves).
The multi plugin was designed only for hardware which runs really in sync.
Anyway, users are trying to use this plugin for other purposes.
- pcm: fix wait condition in snd_pcm_write_areas() to avoid return zero
The hw_ptr might be updated during the snd_pcm_may_wait_for_avail_min() call,
so even if it returns zero (OK), the avail must be updated again.
- pcm: multi plugin - fix wait_for_avail_min
All slaves should be asked to wait otherwise the write loop might
be interrupted and zero frames might be returned.
- pcm: null: Do not allow a period size of 0
Some applications do not expect that get_period_size_min() could
return 0. Therefore these applications cannot use the null plugin without
this patch.
Due to there is no use case for having a period size of 0 this patch
disallows a period size of 0 when using the null plugin.
- pcm: rate plugin - fix signess in snd_pcm_rate_avail_update() comparison
- add snd_strlcpy() and use it everywhere
- pcm: add the missing <strings.h> include
To define the prototype of ffs. See 'man ffs'.
- pcm: dshare: Fix overflow when slave_hw_ptr rolls over boundary
In snd_pcm_dshare_sync_area() when 'slave_hw_ptr' rolls over
'slave_boundary', the wrong variable is checked ('dshare->slave_hw_ptr' vs
the local 'slave_hw_ptr'). In some cases, this results in 'slave_hw_ptr'
not rolling over correctly. 'slave_size' and 'size' are then much too
large, and the for loop blocks for several minutes copying samples.
This was likely only triggered on 32-bit systems, since the PCM boundary
is computed based on LONG_MAX and is much larger on 64-bit systems.
This same change was made to pcm_dmix in commit
6c7f60f7a982fdba828e4530a9d7aa0aa2b704ae ("Fix boundary overlap”) from
June 2005.
- pcm: Preserve period_event in snd_pcm_hw_sw_params() call
snd_pcm_hw_sw_params() in pcm_hw.c tries to abuse the reserved bits
for passing period_Event flag. In this hackish way, we clear the
reserved bits at beginning, and restore before returning. However,
the code paths that return earlier don't restore the value, hence when
user calls this function twice, it may pass an unexpected value.
This patch fixes the failure, restoring the value always before
returning from the function.
Reported-by: Jamey Sharp <jamey@minilop.net>

Sequencer API

- add snd_strlcpy() and use it everywhere

Timer API

- add support for GCC's LTO

Topology API

- Close topology config file after parsing it.
- add snd_strlcpy() and use it everywhere

Use Case Manager API

- Android: avoid using versionsort
Android doesn't have versionsort yet.

/include/Makefile.am

- Drop -I$includedir/alsa from alsa.pc
We used to put the additional include path $includedir/alsa in
pkgconfig just because some applications have included asoundlib.h
like
#include <asoundlib.h>
although the canonical form should be
#include <alsa/asoundlib.h>
However, adding this include path is significantly dangerous due to
possible conflicts of file names like version.h. It's already the
reason to discourage people using alsa.pc for the packages.
In this patch, the additional include path from alsa.pc is dropped
finally. At the same time, as a rescue plan for the programs
including via <asoundlib.h>, a stub header file is provided in
include/sound/asoundlib.h. It just includes alsa/asoundlib.h with a
warning to suggest for replacing with alsa/asoundlib.h.
Actually this is the same file as we install into sys/asoundlib.h, so
the whole changes are very minimal here.

ALSA Lisp

- alisp: add the missing include
Commit d4e08c5e865 changed to use internal versioned functions.
However, the header is not included. It generates the errors:
In file included from external/alsa-lib/src/alisp/alisp.c:3038:
external/alsa-lib/src/alisp/alisp_snd.c:583:64: error: implicit declaration of function '__snd_ctl_elem_info_get_dimension' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
p2 = add_cons2(instance, p2, idx > 0, new_integer(instance, INTERNAL(snd_ctl_elem_info_get_dimension)(&info, idx)));
^
external/alsa-lib/include/alsa-symbols.h:30:24: note: expanded from macro 'INTERNAL'
#define INTERNAL(Name) INTERNAL_CONCAT2_2(__, Name)
^
external/alsa-lib/include/alsa-symbols.h:29:39: note: expanded from macro 'INTERNAL_CONCAT2_2'
#define INTERNAL_CONCAT2_2(Pre, Post) Pre##Post
^
<scratch space>:396:1: note: expanded from here
__snd_ctl_elem_info_get_dimension
^
external/alsa-lib/src/alisp/alisp_snd.c:583:64: note: did you mean '__snd_ctl_elem_info_get_dimensions'?
external/alsa-lib/include/alsa-symbols.h:30:24: note: expanded from macro 'INTERNAL'
#define INTERNAL(Name) INTERNAL_CONCAT2_2(__, Name)
^
external/alsa-lib/include/alsa-symbols.h:29:39: note: expanded from macro 'INTERNAL_CONCAT2_2'
#define INTERNAL_CONCAT2_2(Pre, Post) Pre##Post
^
<scratch space>:396:1: note: expanded from here
__snd_ctl_elem_info_get_dimension
^
external/alsa-lib/src/alisp/alisp_snd.c:578:8: note: '__snd_ctl_elem_info_get_dimensions' declared here
err = INTERNAL(snd_ctl_elem_info_get_dimensions)(&info);
^
external/alsa-lib/include/alsa-symbols.h:30:24: note: expanded from macro 'INTERNAL'
#define INTERNAL(Name) INTERNAL_CONCAT2_2(__, Name)
^
external/alsa-lib/include/alsa-symbols.h:29:39: note: expanded from macro 'INTERNAL_CONCAT2_2'
#define INTERNAL_CONCAT2_2(Pre, Post) Pre##Post
^
<scratch space>:395:1: note: expanded from here
__snd_ctl_elem_info_get_dimensions
^
2 errors generated.
Fixes: d4e08c5e865 ("control: Proper reference of internal versioned functions")

Configuration

- Android: avoid using versionsort
Android doesn't have versionsort yet.
- conf: pcm dmix - add CHANNELS argument
It seems that some audio devices do use only mono audio for some
applications (RPi).
- ucm: bytcr/PlatformEnableSeq.conf update some comments
Commit f91cc3c7d6b7 ("Update chtrt5645 ucm variants to use
bytcr/PlatformEnableSeq.conf component") updated the
following 2 comments:
# codec0_out settings (used if SSP2 is connected to aif1)
# modem_out settings (used if SSP0 is connected to aif2)
Specifically it added the " to aif1" resp. " to aif2" part of the comments.
This is not correct, AIF1 / AIF2 are something which is present on
Realtek codecs only, and either one can be used indepedent of
SSP0 or SSP2 being used (the comments in the chtrt5645 UCM profile
before this change were wrong / outdated).
Besides there not being any relationship between SSP0 or SSP2 being
used, bytcr/PlatformEnableSeq.conf is also used with other codecs,
e.g. the ESS8316 codec where this is not applicable at all.
Therefor this commit removes the " to aif?" part of the comments again
to avoid confusing people reading this in the future.
- ucm: Add ucm files for DB820c board
DB820c board is based of MSM8996 Qualcomm SoC, which has support for both
Digital and Analog audio. Digital audio is over HDMI and analog is over
WCD9335 codec via SLIMbus.
Board itself has HDMI port, a 3.5mm audio Jack and an Audio expansion
connector.
This patch adds support for HDMI port and 3.5mm jack.
- Revert "conf/ucm: Add a UCM profile for Dell WD19 Dock USB-audio"
This reverts commit d8013619c942dd996c32337a9ade429bfaf455ee.
The USB driver defines identical profile as for WD15.
- conf/ucm: Add a UCM profile for Dell WD19 Dock USB-audio
USB-audio device on Dell WD19 docking station provides two individual
output PCM streams, one for headphone Jack and another for speaker out
Jack. A UCM profile gives the proper roles for these.

Dynamic Loader helpers

- add support for GCC's LTO

Error handler

- add snd_strlcpy() and use it everywhere

Test/Example code

- Printf unsigned longs with %lu instead of %ld (playmidi1.c)
- Printf unsigned ints with %u instead of %i (pcm.c)
- Printf unsigned long longs with %llu (mixtest.c)
- Printf unsigned longs with %lu instead of %li (midifile.c)
- Printf unsigned long with %lu instead of %li (latency.c)
- test/latency: use frame bytes correctly in writebuf()
Reported-by: Alessandro Lapini <alessandro.lapini@gmail.com>

Utils

- Drop -I$includedir/alsa from alsa.pc
We used to put the additional include path $includedir/alsa in
pkgconfig just because some applications have included asoundlib.h
like
#include <asoundlib.h>
although the canonical form should be
#include <alsa/asoundlib.h>
However, adding this include path is significantly dangerous due to
possible conflicts of file names like version.h. It's already the
reason to discourage people using alsa.pc for the packages.
In this patch, the additional include path from alsa.pc is dropped
finally. At the same time, as a rescue plan for the programs
including via <asoundlib.h>, a stub header file is provided in
include/sound/asoundlib.h. It just includes alsa/asoundlib.h with a
warning to suggest for replacing with alsa/asoundlib.h.
Actually this is the same file as we install into sys/asoundlib.h, so
the whole changes are very minimal here.

alsa-utils

Core

- Release v1.1.9
- axfer: add an entry of axfer to README
Axfer has beed added as a rework of aplay with robust design to
support recent features of Linux sound subsystem.
This commit adds an entry to README.

ALSA Control (alsactl)

- alsactl: monitor - remove dead code in run_dispatcher() (coverity)
- alsactl: simple coverity fix

Audio Transfer utility

- axfer/test: fix uninitialized warning
This commit fixes uninitialized return value from a call of test_mux() and
text_demux() to suppress warnings below:
$ make check
...
gcc -DHAVE_CONFIG_H -I. -I../../include -O2 -Wall -pipe -g -MT mapper-test.o -MD -MP -MF .deps/mapper-test.Tpo -c -o mapper-test.o mapper-test.c
mapper-test.c: In function ‘test_mapper’:
mapper-test.c:241:9: warning: ‘err’ may be used uninitialized in this function [-Wmaybe-uninitialized]
return err;
^~~
mapper-test.c:231:5: warning: ‘err’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (err < 0)
^
Fixes: 39d1ab8a0cb4: ('axfer: add a unit test for mapper interface')
- axfer/test: fix uninitialized warning
This commit fixes uninitialized return value from a call of test_vector()
to suppress a warning below.
gcc -DHAVE_CONFIG_H -I. -I../../include -O2 -Wall -pipe -g -MT mapper-test.o -MD -MP -MF .deps/mapper-test.Tpo -c -o mapper-test.o mapper-test.c
mapper-test.c: In function ‘test_vector’:
mapper-test.c:293:6: warning: ‘err’ may be used uninitialized in this function [-Wmaybe-uninitialized]
int err;
^~~
Fixes: 39d1ab8a0cb4: ('axfer: add a unit test for mapper interface')
- axfer: Declare global variables as 'extern' in header
This avoids multiple definitions of the same global variable (one in
each file that includes this header), and fixes a linking error when
compiled with -fno-common.
Fixes: 96110793b3e5 ("axfer: add support for a container of raw data")
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
- axfer: Fix creation of v1.2 headers on big-endian systems
struct block_v120_format defines these members as uint8_t. On
little-endian systems, no swapping is done, and the generated block
header is fine. However, on big-endian machines, the value is swapped to
the high byte and then truncated by the assignment, causing both
bits_per_sample and samples_per_frame to be zero.
This fixes an assertion failure in container-test when later
parsing the header ["assert(*samples_per_frame > 0);" in
container_context_pre_process()].
Fixes: 4ab7510f3a18: ("axfer: add support for a container of Creative Tech. voice format")
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
- xfer: fix possible minor memory leak in xfer_options_parse_args() (coverity)
- axfer: return back unsigned avail variable, do proper retype in xfer-libasound-irq-mmap.c
- axfer: coverity fixes
- container-voc.c - out of array access
- container-voc.c - handle correctly eof
- frame_cache.c - correct memory allocation
- container.c - byte_count might be used uninitialized
- xfer-libasound-irq-mmap.c - fix avail signess
- xfer-options.c - fix potential 32-bit wrap for duration
- axfer: add missing header file of unit test to distribution
The file 'axfer/test/generator.h' is missing in distribution and brings
FTBFS for unit tests of axfer.
This commit fixes to add it.
Reported-by: Elimar Riesebieter <riesebie@lxtec.de>
Fixes: b878df1ff0b0: ('axfer: add unit test for container interface')
Fixes: 39d1ab8a0cb4: ('axfer: add a unit test for mapper interface')
- axfer: allow to be compiled with glibc-2.11 or former
The program, axfer, was developed in userspace with glibc-2.28. This
userspace is mostly compliant to POSIX:2008 and some additional macros
for poll event are officially available. The glibc supports them as a
default since its v2.12 release. It will be failed to be compiled with
old glibc or the other libraries for C standard APIs.
One of the purpose of axfer is an better alternative of aplay. In a
point of the purpose, it's preferable to be compiled with the old
libraries.
This commit adds conditional macros to be compiled with libraries for
old compliance level of POSIX.
Reported-by: Jay Foster <jay@systech.com>
Fixes: fce16d9279b6 ('axfer: add an implementation of waiter for select(2)')
- axfer: correct invalid usage of escape of itaric text
A dot sign is valid for a prefix of instruction.
- axfer: supplement value of options for the manual of transfer subcommand
This commit supplements value of options for the manual of transfer
subcommand.
- axfer: correct message to notice that help text is implemented
Now help message is available to give help option to command line.
- axfer: correct description about snoop mode of libffado
The libffado library can listen to isochronous channels to which unit on
IEEE 1394 bus transfers packets as long as the unit allows software to
read the channel from its register.
This commit corrects description about snoop mode.
- axfer: fulfill section for backward compatibitity for chmap option
At present, axfer losts backward compatibility to aplay in a point of
'chmap' option.
This commit filfills a section to describe lose of backward compatibility
of chmap option.
- axfer: add a section about unit test
Two unit tests are available to check internal implementation of axfer.
They perform file I/O for many times and take much time to finish.
This commit adds a section about it.

alsa-info.sh

- alsa-info.sh: cleanups
- fix awk arguments
- backticks/gravemarks removal
- some cosmetic and indentation changes
- add REQUIRES to check the basic tools

alsaloop

- alsaloop: remove unused assignment warning (coverity)

alsamixer

- alsamixer: define _GNU_SOURCE to get exp10
Fixes Master, Headphones and Speaker stuck at -8 percentage after
building with Clang 7.0.1 and getting warned about implicit declaration
of exp10, which is behind _GNU_SOURCE as a non-standard feature. Thanks
Takashi Iwai for the CFLAGS suggestion on the mailing list. GCC build is
not affected, so not adding a compiler check to the configure script.
uClibc-ng has got exp10 since 1.0.12, so the fallback macro is no longer
needed. However, alsa-utils relies on gettext so might need further
patches to actually work on uClibc systems.

amixer

- amixer: define _GNU_SOURCE to get exp10
Get rid of a warning about implicit declaration of exp10, which is
behind _GNU_SOURCE as a non-standard feature. The same problem was fixed
for alsamixer in commit 116488e5f2f1b897084bd151381ee254e1cc177d.

aplay/arecord

- aplay: check the return value for snd_pcm_sw_params_current() (coverity)
- aplay: fix the multiple open file descriptors for the raw capture

aplaymidi/arecordmidi

- arecordmidi: simple coverity fix
- seq: arecordmidi: Add num-events option
Add a command line option to automatically exit after recording a fixed
number of MIDI events. This allows a program using arecordmidi to expect
a MIDI file to be written automatically when the specified number of
events have been received, instead of having to send a SIGINT or SIGTERM
programmatically.
It also avoids the need to have the arecordmidi process running in the
background, and then constantly stat the output file to check if any
bytes have been written to it (this makes for less predictable and
longer-running tests).
This functionality finds use in Chrome OS functional testing, since
having to send SIGTERM/SIGINT programmatically and then wait for the
output file adds unpredictability and delay to the tests.
The addition of this command-line option should (hopefully) not break
any existing usage.

alsa-plugins

Core

- Release v1.1.9
- configure: Fix unexpanded ALSA_DATA_DIR
When no --with-alsadatadir is given, configure scripts takes
$datadir/alsa as the default location, while it's expanded to
$prefix/data/alsa. Although ALSA_DATA_DIR is set via
AC_DEFINE_UNQUOTED(), this expands only $alsadatadir itself and not
about the $prefix in the content. For resolving this, we need to do
eval twice.
- configure: use $sysconfdir instead of /etc
Use $sysconfdir as prefix for ALSA_LCONF_DIR by default. Otherwise install
fails on non-FHS distros.

Alsa support for Maemo SDK (n770)

- maemo: Fix a few crashing bugs
maemo plugin has two crashes I was able to see in a valgrind log from
another user:
* maximum write size was calculated in words (16bit), but checked against
byte-size length. This causes memcpy later to overflow the buffer
(normally by up to 12KB).
* remove a double free (by marking free'd data with NULL)
* mmap returns MMAP_FAILED on error, not NULL
I suspect that this plugin/driver might have other issues aswell, since I
am unable to find any logic for checking DSP buffer status, and no
implementation for odelay reporting.

Documentation

- doc: Add forgotten aaf.txt to EXTRA_DIST

Jack PCM plugin

- jack: use correct port names in 50-jack.conf
Change port names in 50-jack.conf from "alsa_pcm" to "system".
JACK1 v0.125.0 still provides alsa_pcm:playback_* and alsa_pcm:capture_*
port names, but only as aliases:
$ jack_lsp -A
system:capture_1
alsa_pcm:capture_1
system:capture_2
alsa_pcm:capture_2
system:playback_1
alsa_pcm:playback_1
system:playback_2
alsa_pcm:playback_2
JACK2 v1.9.12 doesn't support alsa_pcm:playback_* and alsa_pcm:capture_*
aliases anymore, so 50-jack.conf will fail for JACK2 users:
$ jack_lsp -A
system:capture_1
alsa_pcm:hw:0:out1
system:capture_2
alsa_pcm:hw:0:out2
system:playback_1
alsa_pcm:hw:0:in1
system:playback_2
alsa_pcm:hw:0:in2
As you see in both cases system:playback_* and system:capture_* are
correct port names.
- jack: Support to connect multiple JACK ports with same ALSA channel
The following example will connect ALSA channel 0 to JACK port
"system:playback_1" and "system:playback_3" and ALSA channel 1 to JACK
port "system:playback_2" and "system:playback_4":
pcm.jack {
type jack
playback_ports {
0 [ system:playback_1 system:playback_3 ]
1 [ system:playback_2 system:playback_4 ]
}
}
The old syntax with only one port for one channel is still supported:
playback_ports {
0 system:playback_1
1 system:playback_2
}
Without this patch an additional JACK client has to be used to
automatically connect the second JACK port but this could take some
time. Therefore it misses for example the first audio period on the
second port.
- jack: Refactoring: Lower indentation
to full fill 80 character limit of next commit.
- jack: Removing snd_pcm_jack_format_t as it is not used
- jack: Replacing jack->channels with jack->num_ports
As jack->num_ports and jack->channels hold the same values,
jack->channels is redundant and hence removed.
Sanity check is added in prepare, to check if io->Channels is
same as jack->num_ports.
- jack: Moving jack_deactivate() to snd_pcm_jack_hw_free() to speedup the XRUN Recovery
Removed snd_pcm_jack_stop() from snd_pcm_jack_prepare(),as on XRUN we do
not need to reconnect or reconfigure anything.
- jack: Move jack_activate() and jack_connect() to snd_pcm_jack_prepare()
Since the processing of jack_activate() and jack_connect() take a while
longer, snd_pcm_jack_start() was blocked.
Consider a usecase of reading the data from capture device and
writing to a playback device, since the capture device is
already started and the starting of playback device is blocked,
it leads to XRUNs for capture device.
Therefore these calls are moved to snd_pcm_jack_prepare(),
So that the capture and playback devices can be prepared in advance so
that starting of the device doesn't take too long.