| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
- 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>
|
|
|
|
|
|
|
|
| |
- 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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Just like the previous fix for dmix, we need update for dshare and
dsnoop plugins.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
Signed-off-by: Ivan Sorokin <vanyacpp@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
| |
Added a missing 'f' in the word 'diferent'
Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
Document function argument, added in commit
4081be0b87ab9fa53a8906e66bc240f18a7a9a54.
Signed-off-by: Andrey Mazo <mazo@telum.ru>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
On request from John Spencer <maillist-alsa@barfooze.de> .
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
|
|
|
| |
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
|
| |
sys/types.h is required for the u_int_XX types used by pcm.h.
since a change in pcm.h is not desired, we add the inclusion
to the header that includes pcm.h during build.
Signed-off-by: John Spencer <maillist-alsa@barfooze.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Also, make the empty definitions __user and __force conditional.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
|
|
|
| |
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
|
|
|
|
| |
Signed-off-by: Krzysztof Halasa <khalasa@piap.pl>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|