Detailed changes v1.1.0 v1.1.1

From AlsaProject
Revision as of 17:05, 31 March 2016 by Perex (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Detailed changelog between 1.1.0 and 1.1.1 releases

Changelog between 1.1.0 and 1.1.1 releases

alsa-lib

Core

- Release v1.1.1
- Define some types if missing
Include Linux headers on Linux only.
For portability with non-Linux.
- Define EBADFD in terms of EBADF if it doesn't exist.
For portability on FreeBSD, NetBSD and probably others.

Control API

- control: keep consistent usage of assertion
In most codes for control APIs, assertions are used to check given
arguments from applications. If the arguments are not expected, the
application is forced to abort. When NDEBUG is defined in the beginning
of the codes, no checks are performed.
Although, in snd_ctl_elem_set_bytes(), assertion is used with condition
statement. There's an intention to check the arguments regardless of
NDEBUG. However, this is not the same fashion in the codes.
This commit applies the same fashion to the function, to keep consistent
usage of assertion.
- control: initialize element channel values according to identification number at adding a new element
In ALSA control core, there're two ways to identify elements. One is by
numid. Another is by name/index. The former way is lighter than the latter
way.
In control API, after adding elements by snd_ctl_elem_add_integer() and
snd_ctl_elem_add_integer64(), these functions initialize value of each
channel. When executing this operation, used ID information is still given
by applications. Although, in this time, the element can be identified
according to numid.
This commit uses the numid instead of name/index pair.
- control: fulfill a description about element type with integer64
In UAPI of asound.h, there're 6 types of control element; boolean, integer,
enumerated, bytes, iec958 and integer64 (The none type seems to be added to
start the value at non-zero). Although, current description in alsa-lib
has a lack of integer64 type.
This commit fulfil the type.
- coverity fixes
- control: add missing asserts to ctl_elem_set functions

PCM API

- pcm: fix 'unable to create IPC shm instance' caused by fork from a thread
As stated in manpage SHMCTL(2), shm_nattch is "No. of current attaches"
(i.e., number of processes attached to the shared memeory). If an
application uses alsa-lib and invokes fork() from a thread of the
application, there may be the following execution sequence:
1. execute the following statement:
pcm_direct.c:110: dmix->shmptr = shmat(dmix->shmid, 0, 0)
(shm_nattch becomes 1)
2. invoke fork() in some thread.
(shm_nattch becomes 2)
3. execute the following statement:
pcm_direct.c:122: if (buf.shm_nattch == 1)
4. execute the following statement:
pcm_direct.c:131: if (dmix->shmptr->magic != SND_PCM_DIRECT_MAGIC)
(As stated in manpage SHMGET(2), "When a new shared memory segment
is created, its contents are initialized to zero values", so
dmix->shmptr->magic is 0)
5. execute the following statements:
pcm_direct.c:132: snd_pcm_direct_shm_discard(dmix)
pcm_direct.c:133: return -EINVAL
The above execution sequence will cause the following error:
unable to create IPC shm instance
This error causes multimedia application has no sound. This error rarely
occurs, probability is about 1%.
More notes about this patch:
this patch tries to address the race above by changing the condition
to identify "the first user". Until now, the first user was
identified by checking shm_nattch. But this is racy, as stated in the
above.
In this version, we try to assign a shm at first without IPC_CREAT.
If this succeeds, we are not alone, so we must not be the first user.
Only when this fails, try to get a shmem with IPC_CREAT and IPC_EXCL.
If this succeeds, we are the first user. And, one more notable point
is that the race of this function call itself is protected by
semaphore in the caller side. The only point to avoid is the race
after shmget() and the first initialization, and this method should
work around that.
- Introduce bswap.h for portable definitions of byte swap macros.
- coverity fixes
- pcm_hw: fix possible memory leak (coverity)
- pcm: simple: Fix asserts
Do not error out on the boundaries.

Sequencer API

- seq: Provide sequencer sound card number / PID via alsa-lib
rawmidi devices expose the card number via IOCTLs, which allows to
find the corresponding device in sysfs.
The sequencer provides no identifing data. Chromium works around this
issue by scanning rawmidi as well as sequencer devices and matching
them by using assumtions, how the kernel register sequencer devices.
This changes adds support for exposing the card number for kernel clients
as well as the PID for user client.
It supports kernels with and without the required support.

Timer API

- Only use F_SETSIG fcntl where it exists.

Topology API

- topology: Add support for widget byte controls
Add support for DAPM widgets to include bytes controls.
- topology: add support for CTL access flags to config file
Allow the config files to define CTL access flags.
- topology: add support for pasring external ops in conf files
Parsing external ops was missing from the conf files but was in the
C API. Fix this now by making sure we also check for external ops.
- topology: Add ops to bytes control.
Byte controls can also support ops. Add them to the parser.
- topology: Remove unnecessary includes
Headers are already included in local.h.
- topology: fix debug output to print correct "max" value.
Debug log is printing num_regs instead of max in the max section.
- topology: Quit and show error message on big-endian machines
This tool can only support little-endian machines atm.
Many codes directly refer to __le32/__le64 variables of ABI objects,
so will be broken on big-endian machines.
- topology: Not compare a for loop iterator with ABI __le32 variables
The iterator 'i' in a loop is a usually a integer. But ABI variables use
type _le32, which is converted to host unsigned integer. Comparing them
can cause gcc warning: comparison between signed and unsigned integer
expressions[-Wsign-compare].
- topology: Fix comparison of unsigned expression < 0
Fix gcc warning: comparison of unsigned expression < 0 is always false
[-Wtype-limits]
The ABI object channel->id is _le32 and is converted to host unsigned
integer. It cannot be < 0.
- topology: Remove unused variables
Fix gcc warning when -Wunused-variable is set.
- topology: Remove unused function write_data_block()
Fix gcc warning: 'write_data_block' defined but not used
[-Wunused-function].
- topology: open topology files with O_TRUNC
The topology file if exists needs to rewritten, so we need to open these
files with O_TRUNC flag as well
- topology: Add missing include sys/stat.h
Necessary for proper definitions of S_IRUSR & co. Otherwise it
results in compile errors with old glibc:
parser.c: In function 'snd_tplg_build_file':
parser.c:262: error: 'S_IRUSR' undeclared (first use in this function)
parser.c:262: error: (Each undeclared identifier is reported only once
parser.c:262: error: for each function it appears in.)

Use Case Manager API

- Use alphasort where versionsort is not available.

/include/Makefile.am

- Introduce bswap.h for portable definitions of byte swap macros.
- Define some types if missing
Include Linux headers on Linux only.
For portability with non-Linux.

ALSA Server

- coverity fixes

Compatibility routines

- Add more compatibility defines.
- Introduce bswap.h for portable definitions of byte swap macros.
- Define some types if missing
Include Linux headers on Linux only.
For portability with non-Linux.

Configuration

- Use alphasort where versionsort is not available.
- config files - do not include ucm/topology configuration when not requested

Kernel Headers

- seq: Provide sequencer sound card number / PID via alsa-lib
rawmidi devices expose the card number via IOCTLs, which allows to
find the corresponding device in sysfs.
The sequencer provides no identifing data. Chromium works around this
issue by scanning rawmidi as well as sequencer devices and matching
them by using assumtions, how the kernel register sequencer devices.
This changes adds support for exposing the card number for kernel clients
as well as the PID for user client.
It supports kernels with and without the required support.
- Update include/sound/asequencer.h from 4.6-pre kernel uapi
A few unimplemented ioctl definitions have been removed. Also
<sound/asound.h> is included locally, too.
- Update include/sound/asound.h from 4.6-pre kernel uapi
The inclusion of <linux/*.h> is done conditionally for Linux in order
to improve portability.

alsa-utils

Core

- Release v1.1.1
- alsabat: add tinyalsa support
Use "configure --enable-alsabat-backend-tiny" for alsabat to use
tinyalsa as backend lib. On a system that has both ALSA and tinyalsa
installed, alsabat will use ALSA library by default.
The intention is for alsabat to run on tinyalsa platforms such as
Android or some Internet of Things(IoT) devices.
- alsabat: add standalone mode
Add support for standalone mode where alsabat will run on a
different machine to the one being tested.
In standalone mode, the alsabat just generates, playback and
capture sound data like in normal mode, but does not analyze.
The alsabat being built without libfftw3 support is always work
in standalone mode.
The alsabat in normal mode can also bypass data analysis using
option "--standalone".
- aconnect: Show sequencer sound card numer/PID via aconnect
rawmidi devices expose the card number via IOCTLs, which allows to
find the corresponding device in sysfs.
The sequencer provides no identifing data. Chromium works around this
issue by scanning rawmidi as well as sequencer devices and matching
them by using assumtions, how the kernel register sequencer devices.
This patch adds support for displaying the sound card number/PID to
aconnect.

ALSA Control (alsactl)

- alsactl: init/ca0106, init/hda - use CTL{values} instead CTL{value}
- alsactl: remove debug line in set_ctl_values()

aconnect

- aconnect: Show sequencer sound card numer/PID via aconnect
rawmidi devices expose the card number via IOCTLs, which allows to
find the corresponding device in sysfs.
The sequencer provides no identifing data. Chromium works around this
issue by scanning rawmidi as well as sequencer devices and matching
them by using assumtions, how the kernel register sequencer devices.
This patch adds support for displaying the sound card number/PID to
aconnect.

alsa-info.sh

- alsa-info: add alsa-info.sh.1 to EXTRA_DIST
- alsa-info.sh: add man page

amixer

- amixer: skip showing asoc tlv byte controls
ASoC TLV Byte controls are very large size controls so we should add new
options for these. So skip dumping contents for these.
$amixer -c0 cget numid=16
numid=16,iface=MIXER,name='mdl params'
 ; type=BYTES,access=-----RW-,values=30336
 ; ASoC TLV Byte control, skipping bytes dump

aplay/arecord

- aplay/arecord: handle parsing errors of parameter values
when a user enters a command, he expects his command to be executed
as specified or aborted if it is impossible to fulfill his request
right now a command like "arecord -d hw:1,0 --max-file-time 1h recording.wav"
will happily record something and exit without error status while the resulting
recording contains definitely not what the user requested
to fix this, the patch handles the number parsing function's error channel
and checks whether the parsed number has any trailing characters

bat (basic audio tester)

- alsabat: add tinyalsa support
Use "configure --enable-alsabat-backend-tiny" for alsabat to use
tinyalsa as backend lib. On a system that has both ALSA and tinyalsa
installed, alsabat will use ALSA library by default.
The intention is for alsabat to run on tinyalsa platforms such as
Android or some Internet of Things(IoT) devices.
- alsabat: move alsa process to a single block
Move all alsa callings to a single block (alsa.c), so other blocks
such as the main structure, the signal process and the data analysis
modules will be independent to alsa, and new modules such as a
tinyalsa interface can be easily embedded into alsabat.
- alsabat: use general data generator function
Use general data generator to replace local function, so other
modules can reuse the data generator rather than re-implement it.
- alsabat: clean return value for playback and capture threads
Remove unnecessary prints in playback and capture threads, and replace
the return value "0" with error code for convenience of maintaining.
- alsabat: use general function for wav header update
In playback thread, use general function update_wav_header()
to replace a bunch of code, so the structure is cleaner and
no need to define variable "wav".
- alsabat: refactoring alsa capture thread
Refactoring ALSA capture thread:
1. Move file open/seek operations to sub function, so all file
processes are now on a single function (read_from_pcm_loop()), so
the structure is more reasonable, the function API is simplified
and no need file cleanup in thread loop.
2. Replace the wav header processing lines with a general function
(update_wav_header()), which can be reused in other sections.
3. Add pthread_exit() for thread to exit safely in single line mode,
and correct comment.
- alsabat: use variable for thread return value
Use variable instead of 0/1 to indicate the return value of
playback and capture threads.
- alsabat: fix fopen and messages
All files should be opened in either "rb" or "wb" in current
usage.
Remove incorrect and unneccesary prints.
- alsabat: fix misusing of errno
Preserve errno value before use, since the value might be
changed by another library call.
Add "#include <errno.h>" and remove redundant include.
- alsabat: add bash test script
Add bash script for alsabat feature test. It covers basic alsabat
features, including waveform and wav file generate, playback,
capture and analysis with configurable parameters under different
work modes. (loopback, single line, standalone and local mode)
Usage examples:
alsabat-test.sh
alsabat-test.sh plughw:1,0
alsabat-test.sh plughw:1,0 plughw:1,0
- alsabat: add standalone mode
Add support for standalone mode where alsabat will run on a
different machine to the one being tested.
In standalone mode, the alsabat just generates, playback and
capture sound data like in normal mode, but does not analyze.
The alsabat being built without libfftw3 support is always work
in standalone mode.
The alsabat in normal mode can also bypass data analysis using
option "--standalone".
- alsabat: add default device name for playback and capture
Add default name for the playback and capture devices, in case
they were not set by user through '-D', '-P' or '-C' options.
Previously, if no device be specified, the alsabat will start
a playback thread and a capture thread, and then exit the
threads with error log.
If only one of playback and capture is specified, the alsabat
will work on single line mode as before, where only one thread
(playback or capture) will be started.
The patch was tested on Ubuntu and Chrome OS.
- alsabat: truncate sample frames for faster FFT analysis
Truncate the sample frames to powers of 2, since the FFTW algorithm
runs especially fast in this case, and other sizes may be computed
by means of a slow, general-purpose algorithm.
In my test environment applying the patch, a sound clip of 33072
frames is cut off to 32768 frames before analysis, and the time
cost is reduced from 6.128s to 0.224s.
- alsabat: rename to avoid naming conflict
alsa-utils as well as bareos-bat (as well a some Bacula packages)
all contain a program called /usr/bin/bat, which causes conflicts on
various distributions ("basic audio tester" vs "bareos administration
tool"("bacula administration tool")).
Rename to avoid conflict.
- bat: Don't pass incompatible function pointers to pthread_cleanup_push()
pthread_cleanup_push() takes a function pointer for void (void *).
Although it may work in most cases, we shouldn't pass an incompatible
function pointer there, as some old gcc complains:
alsa.c:560: warning: initialization from incompatible pointer type
alsa.c:562: warning: initialization from incompatible pointer type
- bat: Avoid local signal.h file
The local header file named as "signal.h" causes mysterious compile
error when built with an old glibc.
signal.h:27: error: conflicting types for 'sin_generator_init'
./signal.h:27: error: previous declaration of 'sin_generator_init' was here
signal.h:28: error: conflicting types for 'sin_generator_next_sample'
./signal.h:28: error: previous declaration of 'sin_generator_next_sample' was here
....
This turned out to be the conflict of signal.h; namely, pthread.h that
is included before our local signal.h also includes "pthread.h".
Since our local "signal.h" has a higher priority, it gets loaded
instead of the expected pthread's one. Then we load it again, and it
screws up.
Although it's basically a bug of pthread, it's anyway not good to have
a header file conflicting with the standard header file. So, let's
name it more explicitly as specific to BAT, bat-signal.h, for avoiding
such a conflict.

alsa-plugins

Core

- Release v1.1.1

A52 Output plugin

- a52: Fix usage of obsoleted avcodec_*_frame() functions
pcm_a52.c uses avcodec_alloc_frame and avcodec_free_frame that have
been replaced by av_frame_alloc and av_frame_free in recent versions
of libavcodec. The following patch should fix this while remaining
backwards compatible.
- a52: Make compatible with ffmpeg 3.0
audioconvert.h has been deprecated a while ago and got removed in
ffmpeg 3.0 (commit 2d40968dd3ff17b12f7).
- a52: fix reported input channel order
a52 plugin expects the input to be in ALSA order and remaps it to general order when encoding. However it reports that the input it takes should be in general order.
This fix should make programs (e.g. mpv) that is aware of channel layout reported by ALSA remap sources appropriately before sending when necessary.
It should not cause any regression to programs (e.g. mplayer) that does not check the reported channel layout (hence not affected by the issue) and remaps sources anyway.

Public Parrot Hack rate converter

- pph: include config.h from rate_speexrate.c
Fixes compilation against libspeexdsp 1.2rc3.
rate_speexrate.c includes speex_resampler.h, which depends on config.h
by referencing the HAVE_SPEEX_SPEEXDSP_TYPES_H macro. AFAIK it's not
a good idea to include config.h from headers (I don't know/remember
why, though), which is why I include config.h from rate_speexrate.c
instead of speex_resampler.h.

Speex PCM plugin

- speex: Add missing include config.h

tinycompress

Core

- Release v1.1.1
- tinycompress: INSTALL: Update the instructions
Reported-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>

Header files

- tinycompress: cplay: make functions static
Sparse rightly complains some functions should be static so make them static
cplay.c:100:5: warning: symbol 'parse_mp3_header' was not declared. Should it be static?
cplay.c:129:5: warning: symbol 'check_codec_format_supported' was not declared. Should it be static?
../../include/tinycompress/tinymp3.h:66:11: warning: symbol 'mp3_sample_rates' was not declared. Should it be static?
../../include/tinycompress/tinymp3.h:72:11: warning: symbol 'mp3_bit_rates' was not declared. Should it be static?

Utilities

- tinycompress: crec: make functions static
Sparse rightly complains some functions should be static so make them static
crec.c:113:26: warning: symbol 'blank_wave_header' was not declared. Should it be static?
crec.c:239:6: warning: symbol 'capture_samples' was not declared. Should it be static?
- tinycompress: crec: fix function declaration
finish_record was not following ANSI standard for declaration as warned by
sparse
crec.c:193:26: warning: non-ANSI function declaration of function 'finish_record'
- tinycompress: cplay: make functions static
Sparse rightly complains some functions should be static so make them static
cplay.c:100:5: warning: symbol 'parse_mp3_header' was not declared. Should it be static?
cplay.c:129:5: warning: symbol 'check_codec_format_supported' was not declared. Should it be static?
../../include/tinycompress/tinymp3.h:66:11: warning: symbol 'mp3_sample_rates' was not declared. Should it be static?
../../include/tinycompress/tinymp3.h:72:11: warning: symbol 'mp3_bit_rates' was not declared. Should it be static?
- crec: Always read whole number of fragments when length limit specified
This patch removes the lines that adjusted the read size to exactly
read to the end of the calculated length in bytes. Doing this could
lead to invalid fragment sizes being requested which may then cause
a read error on some codecs.
Instead we keep reading whole fragments until we have >= length bytes
of data captured.
Custom Search
Personal tools
Namespaces

Variants
Actions
Navigation
wiki
Toolbox