OSDN Git Service
Jaroslav Kysela [Fri, 13 Jun 2014 08:46:54 +0000 (10:46 +0200)]
pcm: null plugin - fix the avail count
The automatic threshold start is not activated when the wrong avail
count is returned in the prepared state.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Alexander E. Patrakov [Thu, 12 Jun 2014 10:34:24 +0000 (16:34 +0600)]
pcm: null: add rewindable and forwardable callbacks
Dirty, but consistent with avail_update.
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Alexander E. Patrakov [Thu, 12 Jun 2014 10:34:23 +0000 (16:34 +0600)]
pcm: multi: implement rewindable and forwardable callbacks
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Alexander E. Patrakov [Thu, 12 Jun 2014 10:34:21 +0000 (16:34 +0600)]
pcm:file: add the missing htimestamp callback
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Anssi Hannula [Sun, 8 Jun 2014 09:58:56 +0000 (12:58 +0300)]
pcm: Fix channel map query when there are lots of maps
On most HDA Intel HDMI devices, the channel map list is approx. 500 ints
in size, making the 256-sized buffer used by
snd_pcm_query_chmaps_from_hw() too small and causing the query to fail
(NULL result to caller, ENOMEM).
Bump the buffer size to 2048 ints.
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
David Henningsson [Tue, 27 May 2014 07:51:21 +0000 (09:51 +0200)]
pcm: route: Correctly close slave pcm when no matching chmap is found
This patch fixes a bug where the slave pcm was not correctly closed
on some error conditions, such as not finding a matching chmap.
Reported-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Alexander E. Patrakov [Thu, 24 Apr 2014 14:40:06 +0000 (20:40 +0600)]
pcm: Fix forward/rewind support in iec958 plugin
When forwarding or rewinding, the frame counter was not updated. This
could result in corrupted channel status words or misplaced Z-type
preamble.
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Andrew Eikum [Fri, 4 Apr 2014 18:27:25 +0000 (13:27 -0500)]
pcm: rate: Don't return negative frame count on success in rewind
snd_pcm_rewind is documented to return <0 on failure and >=0 on
success.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Matthias Larisch [Thu, 27 Mar 2014 18:05:10 +0000 (19:05 +0100)]
pcm: ladspa: Delay LADSPA plugin activate call
Some LADSPA Plugins rely on connected control ports on activate call.
While this is not okay by spec, the spec also encourages the activate
call happening as late as possible.
Signed-off-by: Matthias Larisch <mail@matthias-larisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Wed, 19 Mar 2014 09:54:08 +0000 (10:54 +0100)]
Revert "pcm: route: Don't handle no matching chmap as a serious error"
This reverts commit
5b72e3d5305930bffc300aa4f2545ba95992c144.
With the previous fixes, it's no longer needed as a workaround for
regression with PulseAudio.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Wed, 19 Mar 2014 09:52:24 +0000 (10:52 +0100)]
route: Fix invalid pointer access
An uninitialized chmap pointer value is assigned in
_snd_pcm_route_open(). Add NULL initializations appropriately, and
also avoid the possible invalid access of NULL pcmp pointer.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
David Henningsson [Tue, 18 Mar 2014 22:07:19 +0000 (23:07 +0100)]
route: Return NULL in case of zero found channels in determine_chmap
This should fix the problem where the old route syntax can no longer
be opened.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Tue, 18 Mar 2014 14:23:09 +0000 (15:23 +0100)]
pcm: route: Don't handle no matching chmap as a serious error
When find_matching_chmap() returns an error for the non-matching
chmap, the caller, snd_pcm_route_open(), also returns an error
although it shouldn't be handled as the fatal error. This results in
the probe error with PulseAudio and it gives no real output in the
end.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Tue, 11 Mar 2014 09:59:21 +0000 (10:59 +0100)]
src/conf/cards: Add missing entry for Loopback.conf
Signed-off-by: Takashi Iwai <tiwai@suse.de>
MONTANARO Luciano (MM) [Tue, 4 Mar 2014 11:51:36 +0000 (12:51 +0100)]
pcm: Wrap hw_ptr to boundary in pcm_ioplug
The function snd_pcm_ioplug_hw_ptr_update() always increased the hw_ptr
by delta, without wrapping it to the boundary. This would lead to
problems when after many hours, the hw_ptr would overflow.
Signed-off-by: Luciano Montanaro <luciano.montanaro@magnetimarelli.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
David Henningsson [Fri, 28 Feb 2014 07:57:07 +0000 (08:57 +0100)]
conf: Allow 2.1 surround to use different number of channels
This way, cards that support LFE on four channels (e g laptop with
internal subwoofer) can do that, and other cards on a six channel setup
can use that as well.
Well, note that there is still a reference to "pcm.surround51" left here.
In practice, for HDA Intel sound cards this does not matter as both
surround51 and surround40 reference the same definition.
(And that's the only card I currently know of that actually does
surround2.1 over four channels.)
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
David Henningsson [Fri, 28 Feb 2014 07:57:06 +0000 (08:57 +0100)]
pcm: route: Select slave chmap based on ttable information
It means we need to initialize this order:
1) Read the ttable to figure out which channels are present
2) Open slave pcm and find a matching chmap
3) Determine size of ttable (this can now depend on the chmap)
4) Read ttable coefficients
5) At prepare time, select the matching chmap
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
David Henningsson [Fri, 28 Feb 2014 07:57:05 +0000 (08:57 +0100)]
pcm: route: Allow chmap syntax for slave channels in ttable
Instead of writing e g "0" and "1", one can now write "FL" and "FR" instead.
E g:
ttable.0.FL 1
ttable.1.FR 1
ttable.2.LFE 1
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Maarten Baert [Wed, 26 Feb 2014 13:23:45 +0000 (14:23 +0100)]
pcm: Insert linear-to-float conversion when rate or channel count is incorrect
This fixes a bug where snd_pcm_plug_insert_plugins fails when both
client and slave use format float, but the rate or channel count does
not match. I also removed some redundant code.
Signed-off-by: Maarten Baert <maarten-baert@hotmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Patrick Welche [Tue, 25 Feb 2014 12:40:21 +0000 (12:40 +0000)]
autotools: update style
- rename configure.in to configure.ac
- replace INCLUDES with AM_CPPFLAGS
- modernize AM_INIT_AUTOMAKE invocation
Signed-off-by: Patrick Welche <prlw1@cam.ac.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Patrick Welche [Sun, 23 Feb 2014 11:12:48 +0000 (11:12 +0000)]
Portability fix: look for sys/endian.h as well as endian.h
- define __BYTE_ORDER and friends.
- adjust asoundlib.h accordingly.
Signed-off-by: Patrick Welche <prlw1@cam.ac.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
David Henningsson [Tue, 18 Feb 2014 15:41:49 +0000 (16:41 +0100)]
conf: Add surround 2.1 support to all cards
All cards that support 4.1 surround now also support 2.1 surround,
because they both have surround 5.1 as slave.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
David Henningsson [Tue, 18 Feb 2014 15:41:48 +0000 (16:41 +0100)]
conf: Add basic infrastructure for 2.1 surround sound
For now, we do 2.1 over 5.1, because that's what ALSA allows per default.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Riku Voipio [Fri, 7 Feb 2014 13:38:58 +0000 (15:38 +0200)]
alsa-lib: heavy pcm atomics cleanup
The following patch comes from the realization that at least ARM code
for atomics is quite broken and nobody has cared for a decade.
A quick dive shows that only snd_atomic_{read,write}_{begin,end}
appear to be used widely. These are implemented using wmb/rmb.
Only other use of atomic functions is in pcm_meter.c.
The #SND_PCM_TYPE_METER plugin type appears rarely, if ever, used.
I presume these days anyone who wants a meter/scope will do in pulseaudio
layer instead of alsa.
It would seem better fit to have pcm_meter in alsa-plugins instead
of alsa-lib, but I guess that would be an ABI break...
So instead, I'm proposing here
1. Removal of all hand-crafted atomics from iatomic.h apart from barriers,
which are used in snd_atomic_{read,write}_{begin,end}.
2. Using __sync_synchronize as the default fallback for barriers. This
has been available since gcc 4.1, so it shouldn't be a problem.
3. Defining the few atomics used by pcm_meter.c withing pcm_meter.c
itself, using gcc atomic builtins[1].
4. Since gcc atomic builtins are available only since gcc 4.7, add a check for
that in gcc configure.in, and don't build pcm meter plugin if using
older gcc.
The last point has the impact, that if there actually is someone who 1)
uses the meter plugin 2) wants to upgrade to 2014 alsa-lib 3) but
does not want to use a 2012+ gcc - that someone will be inconvenienced.
Finally remove the unneeded configure check for cpu type. We can
trust the gcc to set right flags for us.
[1] http://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Olivier Langlois [Fri, 24 Jan 2014 00:03:00 +0000 (19:03 -0500)]
pcm: use CLOCK_REALTIME for non-monotonic ts
gettimeofday() is the same than clock_gettime(CLOCK_REALTIME)
except for the loss of precision and the double unnecessary
conversion timespec <-> timeval.
Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Thu, 23 Jan 2014 08:46:37 +0000 (09:46 +0100)]
pcm: initialize monotonic field for dshare and dsnoop, too
Just like the previous fix for dmix, we need update for dshare and
dsnoop plugins.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Olivier Langlois [Thu, 23 Jan 2014 00:04:45 +0000 (19:04 -0500)]
pcm: initialize pcm_dmix monotonic field
not doing so, leaves the pcm object in an inconsistent state since
'info' field is copied from the slave which is then used when
snd_pcm_hw_params_is_monotonic() is called.
For instance, when using dmix with aplay and an underrun is occuring, the following
info is returned:
underrun!!! (at least
1248687948.256 ms long)
Status:
state : XRUN
trigger_time:
1390347762.
628483000
tstamp :
1390347766.
184350000
delay : -635
avail : 15687
avail_max : 15675
now is computed from CLOCK_MONOTONIC while pcm status tstamps are from gettimeofday().
After the fix, underruns are still occuring on my setup but at least the displayed info
is correct:
underrun!!! (at least 7630.409 ms long)
Status:
state : XRUN
trigger_time: 7652.
739201431
tstamp : 7660.
369600636
delay : -624
avail : 15676
avail_max : 15664
Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Ivan Sorokin [Tue, 21 Jan 2014 20:12:50 +0000 (00:12 +0400)]
control_hw: fix potential memory leak
Signed-off-by: Ivan Sorokin <vanyacpp@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Olivier Langlois [Mon, 6 Jan 2014 04:12:44 +0000 (23:12 -0500)]
alsa-lib: minor typo in pcm doc
Added a missing 'f' in the word 'diferent'
Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Olivier Langlois [Fri, 13 Dec 2013 04:47:20 +0000 (23:47 -0500)]
minor malloc changes
replace malloc + memset with calloc since calloc may skip the memset if
returned memory comes directly from sbrk()
use malloc instead of malloc if first thing done with allocated memory is
to flip all bits to 1.
Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Wed, 27 Nov 2013 08:37:54 +0000 (09:37 +0100)]
dmix: Don't use assert() and abort()
We seem to still have some races at closing a dmix stream, but
aborting is the worst option. Let's make not melt down.
Reference: https://bugzilla.novell.com/show_bug.cgi?id=852446
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Andrey Mazo [Sun, 17 Nov 2013 15:45:19 +0000 (19:45 +0400)]
pcm_file: document new argument to snd_pcm_file_open().
Document function argument, added in commit
4081be0b87ab9fa53a8906e66bc240f18a7a9a54.
Signed-off-by: Andrey Mazo <mazo@telum.ru>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Andrey Mazo [Sat, 16 Nov 2013 21:11:56 +0000 (01:11 +0400)]
pcm_file: don't touch infile on playback and output file on capture.
Commit
1d80c5b901baf7e1b7998dfa518532fbd64e4283 message describes
behaviour in case of specified infile option as
'No file writes will take place in this case'.
But this is clearly not the case as output file gets truncated while
running `arecord -Dtestin >/dev/null`, where "testin" is defined as
pcm.testin {
type file
slave.pcm null
file "/tmp/qqqq.out"
infile "/tmp/qqqq.in"
format "raw"
}
Besides that, the existing behaviour is rather counterintuitive,
requiring both output and input files to exist and making access to them
regardless of playback or capture intention.
Also, it's very confusing to get output file truncated while trying to
just capture from the device.
Current changeset introduces the following behaviour:
- output file ("file" option) is only (p)open()'ed for writing
only on playback to the device
- any data is written to the output file descriptor
(provided with "file" option) only on playback to the device
- input file ("infile" option) is only open()'ed for reading only on
capture from the device
- any data is read from the input file descriptor
(provided with the "infile" option) only on capture from the device
Signed-off-by: Andrey Mazo <mazo@telum.ru>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Andrey Mazo [Sat, 16 Nov 2013 21:11:55 +0000 (01:11 +0400)]
pcm_file: fixed memory leak.
Valgrind report for this leak was:
Command: aplay -Dfile:'/tmp/qqq',raw qqq.wav
14 bytes in 1 blocks are definitely lost in loss record 1 of 2
at 0x402BF5C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
by 0x40D7557: snd_pcm_file_hw_params (in /usr/lib/libasound.so.2.0.0)
by 0x40BA093: _snd_pcm_hw_params_internal (in /usr/lib/libasound.so.2.0.0)
by 0x40AB831: snd_pcm_hw_params (in /usr/lib/libasound.so.2.0.0)
by 0x804C523: ??? (in /usr/bin/aplay)
by 0x804E5B7: ??? (in /usr/bin/aplay)
by 0x804FC8C: ??? (in /usr/bin/aplay)
by 0x80520FB: ??? (in /usr/bin/aplay)
by 0x4184942: (below main) (libc-start.c:226)
Signed-off-by: Andrey Mazo <mazo@telum.ru>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Andrey Mazo [Sat, 16 Nov 2013 21:11:54 +0000 (01:11 +0400)]
pcm_file: fix SEGFAULT if file option is missing while infile is not.
Commit
5c5f1358123af69155267463a0b6254ad9cbecc4 requires both file and
infile options to be missing to report a failure.
In fact, only file option is mandatory and should be checked there.
Otherwise, NULL file triggers segfault in
snd_pcm_file_replace_fname() called from
snd_pcm_file_open_output_file().
infile option is optional, so don't report fatal error if it's missing.
Signed-off-by: Andrey Mazo <mazo@telum.ru>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Timo Teräs [Fri, 8 Nov 2013 12:17:58 +0000 (13:17 +0100)]
conf.c: use portable way to initialize recursive mutex
PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP is not in POSIX, as _NP
(non-portable) suggests.
exposing such a symbol in musl libc would lock in the ABI for all
times and makes it impossible to do future changes to the under-
lying struct without hideous symbol versioning hacks.
use the portable way instead: pthread_once was designed for such
cases.
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Tested-by: John Spencer <maillist-alsa@barfooze.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Fri, 8 Nov 2013 11:30:04 +0000 (12:30 +0100)]
include/global.h - don't define timeval and timespec structures for !glibc
On request from John Spencer <maillist-alsa@barfooze.de> .
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Takashi Iwai [Mon, 4 Nov 2013 13:19:03 +0000 (14:19 +0100)]
test/chmap: Add missing usage text for -s option
Signed-off-by: Takashi Iwai <tiwai@suse.de>
John Spencer [Thu, 10 Oct 2013 16:56:22 +0000 (18:56 +0200)]
local.h: include sys/types.h to fix issues with pcm.h
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>
Waldemar Brodkorb [Wed, 2 Oct 2013 19:00:51 +0000 (21:00 +0200)]
remove unnecessary/obsolete compat/hsearch_r.c
The usage of hsearch functions where removed long time
ago in commit
273d115de05574251bdd661747ecb68449a5cf1d.
This patch highly increases portability for non-glibc systems.
Remove the complete compat directory as requested by
Takashi Iwai.
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Stephen Warren [Mon, 30 Sep 2013 21:25:49 +0000 (15:25 -0600)]
snd_tlv_convert_from_dB: fix decreasing gain across entries
Currently, for a TLV consisting of TLV_DB_SCALE_ITEMs, if e.g. alsamixer
calls snd_mixer_selem_set_playback_dB() with a value that is in-between
two TLV_DB_SCALE_ITEMs, and xdir is negative, the selected raw hardware
value is the minimum in the first range above that value, rather than the
maximum in the last range below that value.
The user-visible symptom is that in alsamixer, pressing the down key to
reduce the value sticks at certain points, and cannot be incrementally
reduced any further, although directly selecting a much lower value (e.g.
by pressing 0..9) works as expected. This is triggered e.g. by
sound/soc/codec/max98090.c's max98090_hp_tlv[].
Fix this by checking whether xdir is positive or not, rather than
checking whether it has a non-zero value. The code to select the previous
range's max value is already present. This matches how xdir is used in
other parts of the code.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Anssi Hannula [Sun, 22 Sep 2013 21:41:50 +0000 (00:41 +0300)]
HDA-Intel: present up to 8 HDMI/DP outputs via "hdmi" device
Some new AMD cards have HDA codecs presenting 6 connected HDMI/DP pin
nodes (plus 1 unconnected pin node) according to the ALSA card database.
Example:
http://www.alsa-project.org/db/?f=
de3ced7af41de0ed54d218650e5e2f16c511787b
Bump the maximum number of presented HDMI outputs per card via the
"hdmi" PCM from 4 to 8 (so that the last possible device is DEV=7).
Note that HDMI PCM devices DEV=4..7 use shared PCM device numbers, so
HDA cards that have over 4 audio PCM devices or multiple S/PDIF or modem
devices will have their remaining PCM devices misrepresented as HDMI
devices.
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
David Henningsson [Fri, 13 Sep 2013 17:21:44 +0000 (13:21 -0400)]
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>
Kai Kang [Thu, 15 Aug 2013 09:17:19 +0000 (17:17 +0800)]
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>
Adrian Knoth [Mon, 19 Aug 2013 15:31:37 +0000 (17:31 +0200)]
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>
Arun Raghavan [Wed, 7 Aug 2013 17:56:31 +0000 (23:26 +0530)]
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>
Laurentiu Nicola [Thu, 8 Aug 2013 10:29:09 +0000 (12:29 +0200)]
pcm: Fix a wrong value shown in the error message in rate plugin
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Przemek Rudy [Tue, 30 Jul 2013 20:31:44 +0000 (22:31 +0200)]
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>
Jaroslav Kysela [Tue, 23 Jul 2013 12:50:41 +0000 (14:50 +0200)]
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>
Jaroslav Kysela [Mon, 8 Jul 2013 12:31:36 +0000 (14:31 +0200)]
Release v1.0.27.2
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Krzysztof Hałasa [Fri, 14 Jun 2013 11:59:38 +0000 (13:59 +0200)]
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>
David Henningsson [Mon, 10 Jun 2013 14:42:47 +0000 (16:42 +0200)]
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>
David Henningsson [Wed, 5 Jun 2013 14:52:10 +0000 (16:52 +0200)]
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>
Jaroslav Kysela [Tue, 4 Jun 2013 13:58:34 +0000 (15:58 +0200)]
pcm_direct: fix the memory leak when parsing the slave definitions
Reported-by: <bolsunov@telum.ru>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
David Henningsson [Thu, 30 May 2013 10:26:34 +0000 (12:26 +0200)]
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>
David Henningsson [Thu, 30 May 2013 10:26:33 +0000 (12:26 +0200)]
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>
Takashi Iwai [Fri, 24 May 2013 15:21:15 +0000 (17:21 +0200)]
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>
Juho Hämäläinen [Fri, 24 May 2013 11:01:25 +0000 (14:01 +0300)]
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>
Jordi Mallach [Fri, 17 May 2013 16:25:51 +0000 (18:25 +0200)]
pcm: Fix typo in documentation: PREPARE → PREPARED.
Signed-off-by: Jordi Mallach <jordi@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Jaroslav Kysela [Tue, 21 May 2013 08:48:28 +0000 (10:48 +0200)]
Release v1.0.27.1
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Olivier Langlois [Thu, 16 May 2013 08:32:58 +0000 (04:32 -0400)]
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>
Jordi Mallach [Wed, 15 May 2013 17:06:00 +0000 (19:06 +0200)]
Fix several spelling errors for “writable” and derivatives.
Signed-off-by: Jordi Mallach <jordi@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Steve Langasek [Wed, 15 May 2013 17:05:59 +0000 (19:05 +0200)]
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>
Jordi Mallach [Wed, 15 May 2013 17:05:58 +0000 (19:05 +0200)]
Add AM_MAINTAINER_MODE.
Add AM_MAINTAINER_MODE([enable]) to configure.in.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Dylan Reid [Tue, 14 May 2013 16:47:58 +0000 (09:47 -0700)]
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>
Takashi Iwai [Tue, 14 May 2013 16:11:01 +0000 (18:11 +0200)]
conf/ucm: Set up for installation
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Marcin Juszkiewicz [Fri, 10 May 2013 12:51:10 +0000 (14:51 +0200)]
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>
Marcin Juszkiewicz [Fri, 10 May 2013 12:51:09 +0000 (14:51 +0200)]
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>
Marcin Juszkiewicz [Fri, 10 May 2013 12:51:08 +0000 (14:51 +0200)]
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>
Marcin Juszkiewicz [Fri, 10 May 2013 12:51:07 +0000 (14:51 +0200)]
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>
Marcin Juszkiewicz [Fri, 10 May 2013 12:51:06 +0000 (14:51 +0200)]
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>
Clemens Ladisch [Mon, 13 May 2013 19:16:36 +0000 (21:16 +0200)]
seqmid: restore sequencer address prefix match feature
Commit
19892334499e (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>
David Henningsson [Thu, 25 Apr 2013 12:44:06 +0000 (14:44 +0200)]
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>
Takashi Iwai [Thu, 25 Apr 2013 07:55:49 +0000 (09:55 +0200)]
Add definition of __inline__ for non-GCC
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Thu, 25 Apr 2013 07:52:33 +0000 (09:52 +0200)]
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>
Daniel Mack [Thu, 18 Apr 2013 08:37:50 +0000 (10:37 +0200)]
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>
Daniel Mack [Thu, 18 Apr 2013 08:37:49 +0000 (10:37 +0200)]
pcm.c: fix indentation
Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Mon, 15 Apr 2013 16:12:17 +0000 (18:12 +0200)]
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>
Jaroslav Kysela [Thu, 11 Apr 2013 11:43:05 +0000 (13:43 +0200)]
Release v1.0.27
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Thu, 11 Apr 2013 11:36:56 +0000 (13:36 +0200)]
control: enhance doc for snd_ctl_ascii_value_parse() function
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Takashi Iwai [Tue, 9 Apr 2013 12:58:52 +0000 (14:58 +0200)]
Optimize NULL check in snd_dlobj_cache_put()
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Tue, 9 Apr 2013 12:55:46 +0000 (14:55 +0200)]
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>
Jaroslav Kysela [Tue, 9 Apr 2013 12:31:20 +0000 (14:31 +0200)]
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>
Jaroslav Kysela [Mon, 8 Apr 2013 14:42:24 +0000 (16:42 +0200)]
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>
Jaroslav Kysela [Mon, 8 Apr 2013 11:28:03 +0000 (13:28 +0200)]
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>
Daniel Svensson [Thu, 4 Apr 2013 21:47:19 +0000 (23:47 +0200)]
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>
David Henningsson [Mon, 25 Mar 2013 05:41:57 +0000 (06:41 +0100)]
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>
Jaroslav Kysela [Wed, 20 Mar 2013 19:37:50 +0000 (20:37 +0100)]
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>
Sander Jansen [Mon, 25 Feb 2013 16:41:40 +0000 (10:41 -0600)]
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>
Takashi Iwai [Mon, 11 Feb 2013 11:28:45 +0000 (12:28 +0100)]
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>
Takashi Iwai [Fri, 12 Oct 2012 10:22:53 +0000 (12:22 +0200)]
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>
David Henningsson [Tue, 12 Feb 2013 09:06:11 +0000 (10:06 +0100)]
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>
Allan Wirth [Thu, 31 Jan 2013 18:55:33 +0000 (13:55 -0500)]
conf: Fix a memory access violation resulting from improper error propogation
Fixes an issue where a variable is used undeclared, which can cause seg
faults on some systems if the configuration file is not formatted
properly.
Signed-off-by: Allan Wirth <allan@allanwirth.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Jerome Forissier [Thu, 31 Jan 2013 14:47:25 +0000 (15:47 +0100)]
snd_device_name_hint(): do not use global snd_config.
This commit and its parent make the function reentrant.
Signed-off-by: Jerome Forissier <jerome@taodyne.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Jerome Forissier [Thu, 31 Jan 2013 14:47:24 +0000 (15:47 +0100)]
snd_device_name_hint(): do not change the global error handler.
This is the first step towards making this function reentrant.
Signed-off-by: Jerome Forissier <jerome@taodyne.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Jerome Forissier [Thu, 31 Jan 2013 14:47:23 +0000 (15:47 +0100)]
Add snd_lib_error_set_local() to install a thread-local error handler.
This is required so we can make other functions reentrant (such as
snd_device_name_hint()).
The default error handling function snd_lib_error_default() now checks
if a local handler exists, and if so, calls it. Otherwise, the previous
behavior is unchanged.
Signed-off-by: Jerome Forissier <jerome@taodyne.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Jerome Forissier [Wed, 30 Jan 2013 15:22:17 +0000 (16:22 +0100)]
snd_pcm_direct_parse_open_conf(): use thread-safe getgrnam_r()
Fixes a thread safety issue with snd_pcm_open().
Signed-off-by: Jerome Forissier <jerome@taodyne.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Tanu Kaskinen [Sat, 26 Jan 2013 12:20:20 +0000 (14:20 +0200)]
ucm: Set uc_mgr->ctl to NULL after closing it.
Fixes a double-free bug.
Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Olivier Blin [Sat, 15 Dec 2012 00:58:59 +0000 (01:58 +0100)]
configure: do not detect incorrect cross-compiler
On Ubuntu 11.04, configuring with --build=x86_64-unknown-linux-gnu
--host=x86_64-linux-gnu finds a wrong cross-compiler:
checking for cross-compiler... x86_64-x86_64-pc-linux-gnu-gcc
This happens because of a dash vs underscore inconsistency in configure.in:
host=x86_64-pc-linux-gnu
host_cpu=x86_64
host_os=linux-gnu
which ${host_cpu}-${host_os}-gcc >/dev/null 2>&1 && echo ${host_cpu}-${host-os}-gcc
This bug has been introduced in the initial --with-host support from
2002, commit
eb267ade29c9a49c07b1c33dc9bf7a6790217400
This configure command is about "cross-compiling for i586", where the
system compiler is used, which just -m32 additional options.
The --build value comes from config.guess.
Takashi Iwai [Thu, 13 Dec 2012 08:55:44 +0000 (09:55 +0100)]
Fix endian check in local.h
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>