OSDN Git Service
Takashi Iwai [Tue, 22 Jul 2014 09:55:40 +0000 (11:55 +0200)]
pcm: route: Use get32 for multi-source route calculation
The PCM route plugin can assign the destination value from average of
multiple sources with attenuation. This requires the read of each
channel value, sums and writes the resultant value in the requested
format.
Currently, get_labels is used for reading source values while
put32_labels is used for writing the dest value. This is, however,
a buggy implementation; get_labels gives the value as is only with
endianness and signedness conversions, but put32_labels assumes that
the value is normalized to 32bit int and it shifts down to the dest
format. In addition, the current code lacks get_labels entries for
the 24bit formats, as Shengjiu Wang spotted out.
For fixing these bugs, this patch replaces the read with
get32_labels and use always 64bit int for sum. This simplifies the
code a lot and drops many lines.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Wed, 16 Jul 2014 15:48:34 +0000 (17:48 +0200)]
pcm: Fill sw_params proto field
Fill the new proto field introduced to sw_params with the current PCM
protocol version. This makes tstamp_type evaluated properly in the
kernel.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Mon, 21 Jul 2014 14:30:54 +0000 (16:30 +0200)]
pcm: route: Use get/put labels for all 3 byte formats
So far, use_getput flag is set only when the src or dest format is
24bit physical width. But, also 18 and 20 bit physical width formats
should set the flag, too. This patch makes the check broader to cover
all 3 bytes formats.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Mon, 14 Jul 2014 16:12:49 +0000 (18:12 +0200)]
test/audio_time: Set timestamp type explicitly
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Thu, 10 Jul 2014 12:37:49 +0000 (14:37 +0200)]
pcm: Implement timestamp type handling in all plugins
Now all PCM plugins do support the proper timestamp type or pass it
over slaves. The internal monotonic flag is dropped and replaced with
tstamp_type in all places.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Thu, 10 Jul 2014 12:32:50 +0000 (14:32 +0200)]
pcm: Implement timestamp type setup in hw plugin
This patch implements the support for sw_params timestamp type in PCM
hw layer. As gettimestamp() is still unchanged, the resultant
timstamps may be still with CLOCK_MONOTONIC even if you pass monotonic
raw type. More fixes will follow.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Thu, 10 Jul 2014 12:26:37 +0000 (14:26 +0200)]
pcm: Add sw_params API functions to get/set timestamp type
For obtaining / changing the timestamp type, add the corresponding
sw_params accessor API functions together with the public definitions
of timestamp types.
This patch only adds the functions and defines but doesn't bring the
functional changes yet.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Thu, 10 Jul 2014 12:22:33 +0000 (14:22 +0200)]
Add timestamp type to sw_params (internal only)
This patch is just the udpate of sound/asound.h taken from the kernel
commit. The API changes and PCM structure changes will follow after
this.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Mark Brown [Tue, 8 Jul 2014 14:52:32 +0000 (16:52 +0200)]
pcm: Provide a CLOCK_MONOTONIC_RAW timestamp type
For applications which need to synchronise with external timebases such
as broadcast TV applications the kernel monotonic time is not optimal as
it includes adjustments from NTP and so may still include discontinuities
due to that. A raw monotonic time which does not include any adjustments
is available in the kernel from getrawmonotonic() so provide userspace with
a new timestamp type SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW which provides
timestamps based on this as an option.
Reported-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Shengjiu Wang [Mon, 14 Jul 2014 08:55:48 +0000 (16:55 +0800)]
pcm: rate: fix hw_ptr exceed the boundary
For long time test case, the hw_ptr will exceed the boundary, then cause
the avail size wrong.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Anssi Hannula [Tue, 8 Jul 2014 08:19:20 +0000 (11:19 +0300)]
USB-Audio: Add second S/PDIF device on Phiree U2
Phiree U2 has an unusual configuration. It only has S/PDIF output, but
there are still two devices presented:
- device 0: PCM audio, subject to volume control
- device 1: non-PCM data (passthrough), not subject to volume control
It looks like the AES bits are set according to the selected device,
since outputting PCM data via device 1 will not work (silence).
Currently only the device 0 is shown via the "iec958" alias, and the
second device is not accessible via hinted aliases.
Simply provide access to both of these devices via the "iec958" alias.
Reported-by: touc @ XBMC forum
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Alexander E. Patrakov [Mon, 30 Jun 2014 18:40:48 +0000 (00:40 +0600)]
ICE1712: add surround71 pcm definition
The M-Audio Delta 1010 card has 7.1 analog output, but no ready-made pcm
definition to use it.
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Reported-and-tested-by: Matt Zagrabelny <mzagrabe@d.umn.edu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Tanu Kaskinen [Thu, 26 Jun 2014 10:30:25 +0000 (13:30 +0300)]
ucm: Document PlaybackPCMIsDummy and CapturePCMIsDummy values
At least PulseAudio needs special handling for dummy devices. To allow
that to happen automatically, the UCM configuration should contain the
information about which PCMs are dummy.
Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Jaroslav Kysela [Tue, 17 Jun 2014 12:34:19 +0000 (14:34 +0200)]
Release v1.0.28
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Sergey [Mon, 16 Jun 2014 15:52:51 +0000 (19:52 +0400)]
alsa-lib: pcm_plug: fix float conversion for user specified ttable
Move custom ttable with equal channels case from a separate ttable_last
exception into a common plugins insertion loop.
Fixes plug with ttable for float pcms (jack, ladspa).
Example: aplay -fFLOAT_LE /dev/zero
pcm.!default {
type plug
slave.pcm { type null }
ttable.0.0 1
}
Signed-off-by: Sergey <sergemp@mail.ru>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Fri, 13 Jun 2014 17:18:43 +0000 (19:18 +0200)]
Loopback.conf: fix the comment
Jordi Mallach [Fri, 28 Jun 2013 13:01:40 +0000 (15:01 +0200)]
Add -lm to test programs to fix build failure.
Add -lm to test programs that use sin(), to fix a build failure with recent
binutils.
Signed-off-by: Jordi Mallach <jordi@debian.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Fri, 13 Jun 2014 09:15:07 +0000 (11:15 +0200)]
pcm: rate plugin - remove the rewind/forward implementation
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Alexander E. Patrakov [Thu, 12 Jun 2014 10:34:22 +0000 (16:34 +0600)]
pcm: rate: add rewindable and forwardable callbacks
This commit does not fix nonsense values returned by the rewind and
forward callbacks. E.g., with period_size = 1024 and buffer_size = 4096,
an attempt to rewind 1024 samples from the nearly-full buffer returns
4090.
Due to these nonsense values, the current rate plugin should be treated
as non-rewindable. That's why the new callbacks return 0.
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
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>