This patch defines the structs / unions that can be used for encoding
and decoding UMP packets, as well as inline helper functions.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
On 32-bit platforms when not using the large-file-support ABI,
struct stat64 contains ino64_t which is 64-bit, while ino_t is only
32-bit.
snd_config_update_r() checks whether a file has been replaced by saving
the ino member of a struct stat64 and comparing it with a previously-saved
inode number. On 32-bit platforms, assigning the 64-bit member of struct
stat64 to a 32-bit member of struct finfo will truncate it modulo 1<<32,
which could conceivably result in libasound not reloading configuration
when it should (although the inode number space is large enough to make
this failure mode highly unlikely).
Fixes: https://github.com/alsa-project/alsa-lib/pull/231
Signed-off-by: Simon McVittie <smcv@collabora.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
We are forcibly use the LFS (64-bit) calls in the source now. Add a new
check to the configure script and use compatibility defines when those
calls are not available for a reason.
Fixes: https://github.com/alsa-project/alsa-lib/pull/223
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Only one library should define the safe_strto function. Export it
correctly and add _snd_ prefix to avoid possible clashes with the other
application code.
Fixes: 47252054 ("src/topology/parser.c: drop duplicate safe_strtol_base")
Fixes: https://github.com/alsa-project/alsa-lib/pull/208
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit allows to define private alsa-lib's configuration. When
the configuration is present, the device values ("PlaybackCTL",
"CaptureCTL", "PlaybackMixer", "CaptureMixer", "CapturePCM")
are prefixed with '_ucmHEXA.' string where HEXA is replaced by the
unique hexadecimal number identifying the opened ucm manager handle.
Syntax 4
LibraryConfig.a_label.SubstiConfig {
# substituted library configuration like:
usr_share_dir "${ConfLibDir}"
}
LibraryConfig.b_label.Config {
# non-substituted library configuration like:
usr_share_dir "/usr/share/alsa"
}
The File counterparts:
LibraryConfig.c_label.SubstiFile "/some/path"
LibraryConfig.d_label.File "/some/path"
Note that for files the contents is substituted on the request,
but the file name is always substituted (useful for ${ConfDir} etc.).
The private configuration is not saved or preserved. It's life time
belongs to the opened ucm manager handle.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
There is no need to set this again if O_CLOEXEC is supported.
Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
- various cleanups (more straight code and allocations)
- do not add the base config path /usr/share/alsa to the
explicit include list of directories
(it's not wanted for ucm configs)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
They are equivalent, but __func__ is in C99. __FUNCTION__ exists only
for backwards compatibility with old gcc versions.
Signed-off-by: Michael Forney <mforney@mforney.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Many UCM profiles include the UCM profile components under ucm/*
subdirectories and thusly put <searchdir:ucm> at each place. This is
rather cumbersome.
This patch makes the UCM parser to set the default include path, so
that each profile no longer needs to set searchdir. All the
<searchdir:ucm> lines currently found in the profiles are removed
gracefully, too.
For the needed implementation, a new helper,
_snd_config_load_with_include() is introduced. It's not exported,
only for the use inside alsa-lib.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
snd_dlopen() was recently rewritten to be versioned symbols, and we
have to call it with INTERNAL() wrapper from the library itself.
Add the proper declaration in the local header and fix the callers
appropriately.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
According POSIX[1] and linux manpage[2] the include is poll.h, not
sys/poll.h.
This fixes the he following compiler warning when build with musl libc:
/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp]
#warning redirecting incorrect #include <sys/poll.h> to <poll.h>
^~~~~~~
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Include Linux headers on Linux only.
For portability with non-Linux.
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Move ARRAY_SIZE() from tplg_local.h to local.h and add container_of()
macro to local.h. Both macros are generic but are initially used by
topology.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Like pcm and rawmidi, each object parser needs to accept the hint
component. Now a new local function _snd_conf_generic_id() was
introduced to replace each call of "comment" and "type" field checks.
Also, the two existing identical functions for pcm and rawmidi are
removed and the new function is used commonly.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sys/types.h is required for the u_int_XX types used by pcm.h.
since a change in pcm.h is not desired, we add the inclusion
to the header that includes pcm.h during build.
Signed-off-by: John Spencer <maillist-alsa@barfooze.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
SNDRV_LITTLE_ENDIAN and SNDRV_BIG_ENDIAN checks have been removed from
sound/asound.h during UAPI header move, and this resulted in a wrong
detected endian.
Move together with the similar check for SND_*_ENDIAN at the earlier
place in local.h.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Instead of keeping modified asound.h and asequencer.h, copy the files
in the kernel include/uapi/sound as is, and give some renames for
avoiding conflicts with alsa-lib's definitions.
Some structs, unions and typedefs in asound.h and asequencer.h are
once renamed in local.h before inclusion, then renamed back again.
A bonus by this action is that some local codes don't have to refer to
sndrv_xxx any longer. However, some codes like src/seq/seq.c need
explicit cast because of unavoidable conflicts of struct types.
Another significant change is that now snd_pcm_sw_params.period_event
field is removed. Instead, try to access the last reserved field
internally.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
- changed logic to get/put blocks
- added mutex locking of the symbol list
- added reference counting (do not free used dl handles)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Rename the local functions to snd1_* so that they won't be exported
out of alsa-lib.
Some functions are still kept because aserver requires them. Sigh.
Remove obsoleted sequencer instrument layer from alsa-lib.
The old symbols are compiled in as default as dummy functions
(unless --disable-old-symbols is given to configure) so that
the old binaries can still work more or less.
- add snd_device_name_hint() and snd_device_name_free_hint() functions
- add snd_ctl_iface_conf_name() functions
- do not accept parameters for the plugin definition without @args section
- add defaults.pcm.dmix.card/device and dsnoop.card/device definitions
- add hints for HDA-Intel.conf, pcm/dmix.conf, pcm/dsnoop.conf and alsa.conf
- add test/namehint test utility
- doxygen related cleanups
From: Mike Frysinger <vapier@gentoo.org>
some architectures, like Blackfin, have a prefix added to all symbols (in our
case it's historical baggage)
while normally packages shouldnt care, when code starts mixing assembler with
C (like symbol versioning), you need to dip down into the inner details.
find attached a patch which queries gcc for the prefix (all gcc toolchains
have a builtin define of __USER_LABEL_PREFIX__) and then automatically has
asm() constructs utilize this
since most targets define __USER_LABEL_PREFIX__ to nothing, hopefully this
shouldnt cause any problems :)
Change the handling of non-fatal errors. Now the non-fatal error
messages are not shown in stderr and no assert() as default. The
behavior can be changed with LIBASOUND_DEBUG environment variable.