Commit graph

3022 commits

Author SHA1 Message Date
David Henningsson
23bf1dce94 Fix access of freed memory in namehints
Sometimes a hook manipulates the config tree, which makes currently
running iterators point to freed memory. As a workaround, make two
copies, one for the iterators and another for the hooks.

BugLink: https://bugs.launchpad.net/bugs/1008600
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-09-19 18:44:03 +02:00
Kai Kang
f21f48a70f Update iatomic.h functions definitions for mips
Functions atomic_add(s) and atomic_sub(s) are defined with 'extern
__inline__' that may cause compile fails when cross compile for mips.
The error message looks like:

| pcm/.libs/libpcm.a(pcm_meter.o): In function `snd_pcm_meter_update_scope':
| .../alsa-lib-1.0.27.2/src/pcm/pcm_meter.c:139: undefined reference to `atomic_sub'

Replace the 'extern __inline__' with 'static __inline__' to fix this
issue.

Signed-off-by: Kai Kang <jiashuo.kang at gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-22 10:40:32 +02:00
Adrian Knoth
4b169b05b4 hdspm.h: Update LTC ioctl to use struct hdspm_ltc
Use struct hdspm_ltc to query the LTC, using a mixer struct was just
plain wrong.

Due to the wrong struct, this ioctl was never working, so we're free to
fix it without breaking userspace compatibility.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-19 20:13:55 +02:00
Arun Raghavan
36bc577040 UCM: Document some standard values
Playback/CaptureChannels has been around for a bit. Playback/CaptureRate
is new and is intended to be used to specify the sample rate at which
the Playback/CapturePCM should be opened.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-08 12:31:05 +02:00
Laurentiu Nicola
d469ebe2ef pcm: Fix a wrong value shown in the error message in rate plugin
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-08 12:29:09 +02:00
Przemek Rudy
994ab14b40 conf/cards: add Audio Advantage Micro II
With related kernel chnages add extended suport for:
- AES bits controls (via device suffix AESn= or tools like iecset)
- SPDIF switch control, turning on/off the optical transmitter (via alsamixer tool)

Signed-off-by: Przemek Rudy <prudy1@o2.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-07-31 08:05:34 +02:00
Jaroslav Kysela
b3b53a1bec local.h: use __kernel_off_t from <linux/types.h>
Also, make the empty definitions __user and __force conditional.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-07-23 14:50:41 +02:00
Jaroslav Kysela
12a2928b9d Release v1.0.27.2
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-07-08 14:31:36 +02:00
Krzysztof Hałasa
9d6736c9a2 pcm_direct: fix SEGFAULT when getgrnam_r() returns 0 and pgrp is NULL
Signed-off-by: Krzysztof Halasa <khalasa@piap.pl>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-06-14 14:13:55 +02:00
David Henningsson
c91785e002 pcm_hw: Fix buffer overflow in chmap
We can't calculate memory storage in bytes, when we're supposed
to store ints in it!

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-06-14 14:09:55 +02:00
David Henningsson
d20e24e5d1 chmap: Always succeed setting the map to what it already is
If we try to set the channel map to what it already is, this should
always succeed. E g, speaker-test can do this sometimes.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-06-05 17:56:03 +02:00
Jaroslav Kysela
ca487c9511 pcm_direct: fix the memory leak when parsing the slave definitions
Reported-by: <bolsunov@telum.ru>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-06-04 15:58:34 +02:00
David Henningsson
f2d39afe61 pcm_plugin: Fix return value of snd_pcm_rewind
In case the rewind did not rewind as much as expected, e g due to
time delay between the latest avail update and the rewind, we must
properly account for that in the plugin layer.

Otherwise, the plugin's appl ptr and the hw's appl ptr become
unsynchronised, which is very bad, especially in mmap_shadow plugins,
e g, this could cause the overlapping memcpy in the softvol plugin
as seen here:
https://bugs.freedesktop.org/show_bug.cgi?id=64299

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-05-30 14:04:15 +02:00
David Henningsson
7f877543a3 pcm_hw: Remove unused fields in struct
These fields are not used, and their name similarity to other
fields are quite confusing when trying to debug alsa-lib.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-05-30 14:04:05 +02:00
Takashi Iwai
2f43b66c06 Allow specifying the max number of cards
Add --with-max-cards option to specify the max number of cards in
configure script, when the support for more than 32 cards is
required.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-24 17:21:15 +02:00
Juho Hämäläinen
14d653d7c3 ucm: Fix segfault when device argument is missing from _sw{dev, mod}
Signed-off-by: Juho Hämäläinen <juho.hamalainen@tieto.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-24 13:03:54 +02:00
Jordi Mallach
3d7433a3c8 pcm: Fix typo in documentation: PREPARE → PREPARED.
Signed-off-by: Jordi Mallach <jordi@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-23 14:52:04 +02:00
Jaroslav Kysela
49858e7b2f Release v1.0.27.1
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-05-21 10:48:28 +02:00
Olivier Langlois
f646b7e8b3 Remove an obsolete macro in configure.in
Replaced AM_CONFIG_HEADER with AC_CONFIG_HEADERS

lano1106@whippet2 ~/dev/alsa-lib $ ./gitcompile
aclocal: warning: autoconf input should be named 'configure.ac', not 'configure.in'
configure.in:56: error: 'AM_CONFIG_HEADER': this macro is obsolete.
    You should use the 'AC_CONFIG_HEADERS' macro instead.
/usr/share/aclocal-1.13/obsolete-err.m4:12: AM_CONFIG_HEADER is expanded from...
configure.in:56: the top level
autom4te: /usr/bin/m4 failed with exit status: 1
aclocal: error: echo failed with exit status: 1

Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-16 15:41:47 +02:00
Jordi Mallach
39a4dad148 Fix several spelling errors for “writable” and derivatives.
Signed-off-by: Jordi Mallach <jordi@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-16 10:13:49 +02:00
Steve Langasek
b906db19ef Compile in the ALSA search path instead of relying on ld.so.conf.
The Ubuntu package currently uses ld.so.conf.d fragments to add
/usr/lib/alsa-lib and /usr/lib{32,64}/alsa-lib to the dlopen search path.
These don't *belong* on the global search path, and it becomes much more
problematic to put them there with the advent of multiarch because each
architecture then needs its own distinct config file to add the separate
path... which is then also put in the global library namespace.  Instead,
let ALSA make use of the already defined ALSA_PLUGIN_DIR to look up
plugins.

Signed-off-by: Jordi Mallach <jordi@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-16 10:13:28 +02:00
Jordi Mallach
2b84ab0514 Add AM_MAINTAINER_MODE.
Add AM_MAINTAINER_MODE([enable]) to configure.in.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-16 10:09:39 +02:00
Dylan Reid
93325038db conf/ucm: DAISY-I2S: Set default filter mode for HiFi.
Default to music mode filter for the HiFi use case on the Samsung ARM
Chromebook.  This mode is better at 44.1k and 48k audio than the
"Voice" setting.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-14 21:19:28 +02:00
Takashi Iwai
c6ac8ddde9 conf/ucm: Set up for installation
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-14 18:11:01 +02:00
Marcin Juszkiewicz
52de910868 conf/ucm: tegraalc5632: add UCM config from Ubuntu
Signed-off-by: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-14 17:56:44 +02:00
Marcin Juszkiewicz
7db247be11 conf/ucm: SDP4430: add UCM config from Ubuntu
Signed-off-by: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-14 17:56:14 +02:00
Marcin Juszkiewicz
9d0f93af0b conf/ucm: PandaBoardES: add UCM config from Ubuntu
Signed-off-by: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-14 17:55:48 +02:00
Marcin Juszkiewicz
5b019ea310 conf/ucm: PandaBoard: add UCM config from Ubuntu
Signed-off-by: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-14 17:55:14 +02:00
Marcin Juszkiewicz
f07c14b082 conf/ucm: DAISY-I2S: add Samsung ARM Chromebook UCM config from ChromeOS
Signed-off-by: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-14 17:54:35 +02:00
Clemens Ladisch
e23961df50 seqmid: restore sequencer address prefix match feature
Commit 1989233449 (seq: Fix for snd_seq_parse_address()) removed the
ability to match sequencer client names by any of by their prefixes in
an attempt to avoid wrong matches when one client name is the prefix of
another.

However, the prefix match feature was documented and actually used.

Allow prefixes to match, but only if there is no exact match.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2013-05-13 21:16:36 +02:00
David Henningsson
2d5ad69e4e conf - Add Scarlett 2i2 USB to S/PDIF blacklist
The Scarlett 2i2 USB interface does not have any S/PDIF connections.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-26 07:38:28 +02:00
Takashi Iwai
a8f405b8f9 Add definition of __inline__ for non-GCC
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-25 09:55:49 +02:00
Takashi Iwai
30122df4fa Use __inline__ for exported headers
Some programs are still using C90.

Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=817077
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-25 09:52:33 +02:00
Daniel Mack
886f0cc3c2 bring pcm.h and pcm.c in sync with the kernel list
In particular, this adds definitions and descriptions for G.723 and
DSD types.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-18 11:45:11 +02:00
Daniel Mack
697f8c296c pcm.c: fix indentation
Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-18 11:45:01 +02:00
Takashi Iwai
e1e40c2553 Fix doubly call of dlclose() in dlobj caching code
When multiple dlobj_cache items point to the same dlobj, dlclose() may
be called wrongly multiple times when these items are cleared, because
we manage the dlobj_cache list as a flat list.  This results in a bad
segfault we've seen in openal-soft, for example.

For fixing this, we need the refcounting of dlobj itself.  But, in
this case, we don't have to manage yet another list,  since dlopen()
does a proper refcounting by itself.  That is, we can just call always
dlopen() at each time a new function is assigned, and also call
dlclose() for each released dlobj_cache item at cleanup.

Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=814250

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-15 18:23:46 +02:00
Jaroslav Kysela
812e4b0c5b Release v1.0.27
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-04-11 13:43:05 +02:00
Jaroslav Kysela
201f28a008 control: enhance doc for snd_ctl_ascii_value_parse() function
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-04-11 13:38:25 +02:00
Takashi Iwai
91de1212d0 Optimize NULL check in snd_dlobj_cache_put()
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-09 15:00:23 +02:00
Takashi Iwai
e79990ac5d Clean up dlobj cache only when no user is present
Cleaning up the dlobj cache seems crashing some cases when the library
is used from another plugin like openal-soft.  A simple workaround is
to do the cleanup only when really no user is left, i.e. after all
close calls.

Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=814250

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-09 15:00:11 +02:00
Jaroslav Kysela
a6813c2d0e pcm: direct plugins: do more safe IPC semaphore handling
As reported dead-lock, do local lock counting and invoke abort() when
the lock counts do not match at close() time.

Reported-by: <mateen abdulmateen.shaikh@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-04-09 14:37:21 +02:00
Jaroslav Kysela
b6eb0f9bfd all places: doxygen cleanups
I see no errors with these changes using doxygen 1.8.1.1 .

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-04-08 16:42:24 +02:00
Jaroslav Kysela
e23fb2c4de control, pcm: implement snd_ctl_abort() and snd_pcm_abort() functions
Upon an interrupt, it is necessary to abort the wait loops with the EINTR
error code. Introduce snd_*_abort() functions to handle this case.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-04-08 13:28:03 +02:00
Daniel Svensson
730c833dd8 pcm: fix typo, should be SND_PCM_STATE_PREPARED.
Signed-off-by: Daniel Svensson <dsvensson@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-05 07:36:28 +02:00
David Henningsson
02d9f316a5 USB-audio: Add "HP Digital Stereo Headset" to SPDIF blacklist
Yet another headset without digital I/O.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-02 11:21:43 +02:00
Jaroslav Kysela
009193a345 pcm: fix and optimize snd_pcm_areas_copy function
The memcpy() function in snd_pcm_area_copy() should not be called
with the overlapped areas. Alex discovered - using own LD_PRELOAD checked
for memcpy() input - that the memcpy() is called with src == dst.

For some special plugin combos (rate+softvol+hw for example), the same
areas with same offsets can be asked to be copied (softvol). The collapse
check uses own areas created on heap, causing dst_area == src_area &&
dst_offset == src_offset check bypassed.

Two fixes are in this patch:

- use assert to check the memcpy() input for future triggers
- bypass the snd_pcm_area_copy() call for collapsed identical areas

Reported-by: Alexander Kruppa <akruppa@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-03-20 20:43:34 +01:00
Sander Jansen
28493d9d69 snd_mixer_poll_descriptors_revents should loop over pollfd
Signed-off-by: Sander Jansen <s.jansen@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-26 10:08:06 +01:00
Takashi Iwai
f5f45589f8 Add workaround for conflicting IEC958 controls for HD-audio
When both an SPDIF and an HDMI output are present on HD-audio, both
try to access IEC958 controls with index=0 although one of them must
be wrong.  For avoiding this conflict, the recent kernel code (3.9 and
3.8 stable) moves the IEC958 controls of an SPDIF with index=16 once
when the conflict happens.

In this patch, the corresponding support is added in alsa-lib side.
The new "skip_rest" boolean flag is added to the hooked element
definition which indicates that the rest of element array will be
ignored once when this element is present and evaluated.  With this
new flag, the HD-audio config takes index=16 primarily, then take
index=0 as fallback.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-21 17:52:17 +01:00
Takashi Iwai
8c6da54073 control: Simplify using snd_config_get_bool()
snd_config_get_bool() was improved to parse also ASCII strings now,
so we don't have to open-code the boolean parser in
src/control/setup.c any longer.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-21 17:48:55 +01:00
David Henningsson
3e7dc283ed Add sys/types.h to include list
This is needed by snd_pcm_format_silence* functions which
return u_int*_t. It was discovered while trying to compile ALSA
programs with eglibc 2.17.

Credits to Richard Shaw, Gary Buhrmaster, Matthieu Baerts and
 Adam Conrad for this fix.

BugLink: https://bugs.launchpad.net/bugs/1109298
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=885306
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-12 11:18:08 +01:00