summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Release v1.0.28baserock/v1.0.28Jaroslav Kysela2014-06-121-1/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: Fix channel map query when there are lots of mapsAnssi Hannula2014-06-081-1/+1
| | | | | | | | | | | | 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>
* pcm: route: Correctly close slave pcm when no matching chmap is foundDavid Henningsson2014-05-271-1/+3
| | | | | | | | | 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>
* pcm: Fix forward/rewind support in iec958 pluginAlexander E. Patrakov2014-04-283-3/+44
| | | | | | | | | 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>
* pcm: rate: Don't return negative frame count on success in rewindAndrew Eikum2014-04-071-1/+1
| | | | | | | | 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>
* pcm: ladspa: Delay LADSPA plugin activate callMatthias Larisch2014-04-031-2/+2
| | | | | | | | | 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>
* Revert "pcm: route: Don't handle no matching chmap as a serious error"Takashi Iwai2014-03-191-1/+3
| | | | | | | | | 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>
* route: Fix invalid pointer accessTakashi Iwai2014-03-191-2/+3
| | | | | | | | 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>
* route: Return NULL in case of zero found channels in determine_chmapDavid Henningsson2014-03-191-1/+4
| | | | | | | | 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>
* pcm: route: Don't handle no matching chmap as a serious errorTakashi Iwai2014-03-181-3/+1
| | | | | | | | | | 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>
* src/conf/cards: Add missing entry for Loopback.confTakashi Iwai2014-03-111-0/+1
| | | | Signed-off-by: Takashi Iwai <tiwai@suse.de>
* pcm: Wrap hw_ptr to boundary in pcm_ioplugMONTANARO Luciano (MM)2014-03-041-1/+1
| | | | | | | | | 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>
* conf: Allow 2.1 surround to use different number of channelsDavid Henningsson2014-02-281-4/+3
| | | | | | | | | | | | | | | 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>
* pcm: route: Select slave chmap based on ttable informationDavid Henningsson2014-02-281-43/+276
| | | | | | | | | | | | | 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>
* pcm: route: Allow chmap syntax for slave channels in ttableDavid Henningsson2014-02-281-2/+20
| | | | | | | | | | | | 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>
* pcm: Insert linear-to-float conversion when rate or channel count is incorrectMaarten Baert2014-02-261-8/+6
| | | | | | | | | 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>
* autotools: update stylePatrick Welche2014-02-2619-21/+22
| | | | | | | | | - 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>
* Portability fix: look for sys/endian.h as well as endian.hPatrick Welche2014-02-244-17/+48
| | | | | | | | - 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>
* conf: Add surround 2.1 support to all cardsDavid Henningsson2014-02-1828-1/+28
| | | | | | | | 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>
* conf: Add basic infrastructure for 2.1 surround soundDavid Henningsson2014-02-183-1/+66
| | | | | | | 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>
* alsa-lib: heavy pcm atomics cleanupRiku Voipio2014-02-113-1073/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* pcm: use CLOCK_REALTIME for non-monotonic tsOlivier Langlois2014-01-241-2/+6
| | | | | | | | | 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>
* pcm: initialize monotonic field for dshare and dsnoop, tooTakashi Iwai2014-01-232-2/+2
| | | | | | | Just like the previous fix for dmix, we need update for dshare and dsnoop plugins. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* pcm: initialize pcm_dmix monotonic fieldOlivier Langlois2014-01-232-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* control_hw: fix potential memory leakIvan Sorokin2014-01-221-1/+3
| | | | | Signed-off-by: Ivan Sorokin <vanyacpp@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* alsa-lib: minor typo in pcm docOlivier Langlois2014-01-061-1/+1
| | | | | | | Added a missing 'f' in the word 'diferent' Signed-off-by: Olivier Langlois <olivier@trillion01.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* minor malloc changesOlivier Langlois2013-12-132-3/+2
| | | | | | | | | | | 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>
* dmix: Don't use assert() and abort()Takashi Iwai2013-11-271-2/+2
| | | | | | | | 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>
* pcm_file: document new argument to snd_pcm_file_open().Andrey Mazo2013-11-181-0/+1
| | | | | | | | Document function argument, added in commit 4081be0b87ab9fa53a8906e66bc240f18a7a9a54. Signed-off-by: Andrey Mazo <mazo@telum.ru> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* pcm_file: don't touch infile on playback and output file on capture.Andrey Mazo2013-11-171-13/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* pcm_file: fixed memory leak.Andrey Mazo2013-11-171-0/+2
| | | | | | | | | | | | | | | | | | | | 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>
* pcm_file: fix SEGFAULT if file option is missing while infile is not.Andrey Mazo2013-11-171-1/+1
| | | | | | | | | | | | | 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>
* conf.c: use portable way to initialize recursive mutexTimo Teräs2013-11-081-2/+13
| | | | | | | | | | | | | | | | 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>
* include/global.h - don't define timeval and timespec structures for !glibcJaroslav Kysela2013-11-081-0/+2
| | | | | | On request from John Spencer <maillist-alsa@barfooze.de> . Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* test/chmap: Add missing usage text for -s optionTakashi Iwai2013-11-041-0/+1
| | | | Signed-off-by: Takashi Iwai <tiwai@suse.de>
* local.h: include sys/types.h to fix issues with pcm.hJohn Spencer2013-10-111-0/+1
| | | | | | | | | 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>
* remove unnecessary/obsolete compat/hsearch_r.cWaldemar Brodkorb2013-10-075-252/+3
| | | | | | | | | | | | 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>
* snd_tlv_convert_from_dB: fix decreasing gain across entriesStephen Warren2013-10-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
* HDA-Intel: present up to 8 HDMI/DP outputs via "hdmi" deviceAnssi Hannula2013-09-261-0/+92
| | | | | | | | | | | | | | | | | | | 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>
* Fix access of freed memory in namehintsDavid Henningsson2013-09-191-9/+13
| | | | | | | | | | 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>
* Update iatomic.h functions definitions for mipsKai Kang2013-08-221-4/+4
| | | | | | | | | | | | | | | 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>
* hdspm.h: Update LTC ioctl to use struct hdspm_ltcAdrian Knoth2013-08-191-1/+1
| | | | | | | | | | | 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>
* UCM: Document some standard valuesArun Raghavan2013-08-081-0/+4
| | | | | | | | 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>
* pcm: Fix a wrong value shown in the error message in rate pluginLaurentiu Nicola2013-08-081-1/+1
| | | | Signed-off-by: Takashi Iwai <tiwai@suse.de>
* conf/cards: add Audio Advantage Micro IIPrzemek Rudy2013-07-311-0/+35
| | | | | | | | | 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>
* local.h: use __kernel_off_t from <linux/types.h>Jaroslav Kysela2013-07-231-1/+5
| | | | | | Also, make the empty definitions __user and __force conditional. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* Release v1.0.27.2v1.0.27.2Jaroslav Kysela2013-07-081-1/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm_direct: fix SEGFAULT when getgrnam_r() returns 0 and pgrp is NULLKrzysztof Hałasa2013-06-141-1/+1
| | | | | Signed-off-by: Krzysztof Halasa <khalasa@piap.pl> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm_hw: Fix buffer overflow in chmapDavid Henningsson2013-06-141-1/+1
| | | | | | | | 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>
* chmap: Always succeed setting the map to what it already isDavid Henningsson2013-06-051-0/+11
| | | | | | | | 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>