summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* usecase: add CaptureMicInfoFile field to documentationHEADmasterJaroslav Kysela2023-05-161-0/+3
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* include: fix SND_DLSYM_BUILD_VERSION() for static buildJaroslav Kysela2023-05-161-6/+6
| | | | | | | Correct the dlsym_name string for nested macros. See Fixes:. Fixes: https://github.com/alsa-project/alsa-lib/issues/316 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: hw - prevent divide by zero for broken appsJaroslav Kysela2023-05-161-0/+3
| | | | | Fixes: https://github.com/alsa-project/alsa-lib/issues/318 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* Release v1.2.9v1.2.9Jaroslav Kysela2023-05-041-1/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: hw: fix the silence size setup in drainJaroslav Kysela2023-05-031-2/+2
| | | | | | | | | The silence size cannot exceed the silence threshold. Move the check from the manual condition to the common code. This may happen for small ring buffers (where the 1/10th second is too large). Suggested-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* conf/emu10k1: remove compat with two decades old driversOswald Buddenhagen2023-05-033-192/+0
| | | | | | | There really isn't much of a point to clutter the files with this. Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: remove duplicate SND_PCM_HW_PARAM_{FIRST,LAST}_* #definesOswald Buddenhagen2023-05-031-4/+0
| | | | | Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: add SND_CTL_EINTR open modeJaroslav Kysela2023-05-038-8/+13
| | | | | | | | Add possibility to return -EINTR instead waiting for the event. The applications may want to handle -EINTR condition themselves. BugLink: https://github.com/alsa-project/alsa-lib/issues/228 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: add SND_PCM_EINTR open modeJaroslav Kysela2023-05-032-1/+3
| | | | | | | | Add possibility to return -EINTR instead waiting for the event. The applications may want to handle -EINTR condition themselves. BugLink: https://github.com/alsa-project/alsa-lib/issues/228 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: improve handling for snd_pcm_wait()Jaroslav Kysela2023-05-039-10/+55
| | | | | | | | | | | | | The snd_pcm_wait() function is called also internally from the various plugins to wait for the drain with -1 and from i/o routines in pcm.c. Define two special negative timeout values to distinguish the drain and i/o wait and calculate the maximal timeout according the wait place. Fixes: https://github.com/alsa-project/alsa-lib/issues/228 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: add new symbols to Versions.inJaroslav Kysela2023-05-031-0/+8
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: hw: introduce SNDRV_PCM_HW_PARAMS_DRAIN_SILENCEJaroslav Kysela2023-05-035-1/+45
| | | | | | | | | | The application may not require to touch the playback sample stream for the drain operation at all. In this case, the application is responsible to setup a silencing mechanism for the playback or another graceful stop (like using the rewind operation). Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: hw: introduce SNDRV_PCM_INFO_PERFECT_DRAINJaroslav Kysela2023-05-035-1/+30
| | | | | | | | | Handle the driver informing us that it is not necessary to set up silencing upon playback draining. This will be the case for drivers which are guaranteed to not read any samples beyond the application pointer. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: hw: add drain_silence configuration keywordJaroslav Kysela2023-05-031-2/+24
| | | | | | | # Add silence in drain (-1 = auto /default/, 0 = off, > 0 milliseconds) [drain_silence INT] Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: hw: setup explicit silencing for snd_pcm_drain by defaultJaroslav Kysela2023-05-033-13/+71
| | | | | | | | | | | | | Some applications may not alignt transfers to the period size and also the driver developers may not follow the consequeces of the access beyond valid samples in the playback DMA buffer. To avoid clicks, fill a little silence at the end of the playback ring buffer when snd_pcm_drain() is called. Related: https://lore.kernel.org/alsa-devel/20230420113324.877164-2-oswald.buddenhagen@gmx.de/ Related: https://lore.kernel.org/alsa-devel/20230405201219.2197789-2-oswald.buddenhagen@gmx.de/ Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* compilation: fix ANDROID -> __ANDROID__ define detectionMaxython2023-05-023-3/+3
| | | | | | Fixes: https://github.com/alsa-project/alsa-lib/pull/301/ Signed-off-by: Maxython <mixython@gmail.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: avoid endless loop in snd_pcm_sw_params_default()Jaroslav Kysela2023-02-251-1/+6
| | | | | BugLink: https://lore.kernel.org/alsa-devel/167734349294.22.1388671545195719262@mailman-web.alsa-project.org/ Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* test: BSD-like fixesSASANO Takayoshi2023-02-036-13/+26
| | | | | | | | | | | | - rename devname -> pcmdev, it conflicts *BSD <stdlib.h> function - replace <values.h> -> <limits.h> and fix K&R style related warning - use config.h to determine include <malloc.h> - add OpenBSD support and fix printf() warning - fix warning Fixes: https://github.com/alsa-project/alsa-lib/pull/298 Signed-off-by: SASANO Takayoshi <uaa@uaa.org.uk> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* type_compat.h: use ESPIPE instead of EPIPE when ESTRPIPE not definedSASANO Takayoshi2023-02-032-1/+5
| | | | | | Fixes: https://github.com/alsa-project/alsa-lib/pull/298 Signed-off-by: SASANO Takayoshi <uaa@uaa.org.uk> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* configure: avoid libdl detecion on *BSDSASANO Takayoshi2023-01-291-2/+1
| | | | | | | | | | | NetBSD and OpenBSD has no libdl FreeBSD and DragonFlyBSD has libdl but dummy These OSes are no need to use -ldl to use dlopen() Fixes: https://github.com/alsa-project/alsa-lib/pull/290 Signed-off-by: SASANO Takayoshi <uaa@uaa.org.uk> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: hw - fix return code checking in snd_pcm_hw_hw_refineGunnar Dibbern2023-01-291-1/+1
| | | | | | | | | | The isse was introduced in commit 7f2d6c3 Fixes: 7f2d6c3a ("pcm: hw: change rate range syntax") Fixes: https://github.com/alsa-project/alsa-lib/issues/271 Fixes: https://github.com/alsa-project/alsa-lib/pull/293 Signed-off-by: Gunnar Dibbern <gunnar.dibbern@lht.dlh.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: Parse ignore_suspend property for dapm widgetAmadeusz Sławiński2023-01-291-0/+14
| | | | | | | | | | snd_soc_tplg_dapm_widget has ignore_suspend field, but there is no way to set value for it, because we don't parse topology field for it. Fix this by adding parsing code. Fixes: https://github.com/alsa-project/alsa-lib/pull/230 Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: Add decompilation support for ignore_suspendAmadeusz Sławiński2023-01-291-2/+4
| | | | | | | | | Previous patch added build support for ignore_suspend, however it should be also possible to decompile binary back to human readable form and not lose data. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: Parse ignore_suspend flagCezary Rojewski2023-01-291-0/+27
| | | | | | | | | | | | XXX_VOICE_WAKEUP also known as 'ignore_suspend' is already processed by kernel in soc-topology, but there is no way of setting it via topology file like it's the case for other flags. Fix this by adding it to pcm, dai and link parsing mechanism. Signed-off-by: Piotr Maziarz <piotrx.maziarz@intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* utils/alsa.m4: include <stdlib.h> for exit()Sam James2023-01-291-0/+2
| | | | | | | | | | Clang 16 makes -Wimplicit-function-declaration an error by default and it's easier to just explicitly include <stdlib.h> rather than hope the ALSA headers always have it. Fixes: https://github.com/alsa-project/alsa-lib/pull/278 Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: fix geti() macro - return zero on successJaroslav Kysela2023-01-151-0/+1
| | | | | Fixes: c083417b ("ucm: simplify and fix the previous patch (geti)") Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: simplify and fix the previous patch (geti)Jaroslav Kysela2023-01-151-70/+20
| | | | | | | | | | | Use macro to maintain only one code. The status may be 0 or 1 - handle both values correctly. Also, fix the possible memory leak in snd_use_case_geti() - string str should be freed even when the error is returned. Fixes: 436cd5b6 ("ucm: add existence checks to geti calls") Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: add existence checks to geti callsCurtis Malainey2023-01-151-16/+67
| | | | | | | | | | | | | | Right now in snd_use_case_geti you cannot tell if the item being queried exists or not when being checked. This also means the only way to check for the existence of something in the client of the library is to iterate over the list of mods/devs even if we know exactly the name we are looking for. We have functions that do exactly this internally so lets return this information in a logical fashion through geti. Also clean up some trailing white space nearby. Signed-off-by: Curtis Malainey <cujomalainey@chromium.org> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: fix possible memory leak in execute_sysw()Jaroslav Kysela2023-01-051-0/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: rate: fix last_commit_ptr boundary wrappingAlan Young2022-12-301-2/+2
| | | | | | | | | | | | Wrap last_commit_ptr using boundary. Was just wrapped to 0, which is correct only if the buffer size, and hence the boundary, is an integer multiple of the period size. Fixes: 467d69c5bc1 ("Fix CPU hog with combination of rate plugin") Fixes: 29041c52207 ("fix infinite draining of the rate plugin in SND_PCM_NONBLOCK mode") Link: https://lore.kernel.org/alsa-devel/20221230164814.901457-1-consult.awy@gmail.com/ Signed-off-by: Alan Young <consult.awy@gmail.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: route/softvol use snd_config_get_ireal vs get_real to handle also integersJaroslav Kysela2022-12-132-10/+5
| | | | | Link: https://lore.kernel.org/alsa-devel/f9a7ad6a256d4ad7a31642dcf875d436@axis.com/ Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsa-lib: conf - fix possible use-after-free in get_char_skip_commentsJaroslav Kysela2022-12-071-1/+2
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: execute_sysw - fix possible use-after-freeJaroslav Kysela2022-12-071-2/+3
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: ctl - remove the wrong (debug) codeJaroslav Kysela2022-11-291-6/+1
| | | | | | | | | | This code was commited by mistake. It was used for testing of ALSA_PCM_OLD_HW/SW_PARAMS_API. BugLink: https://github.com/thesofproject/sof/issues/6667 Related-to: 78b20e3c ("test: latency - use snd_pcm_format_physical_width()") Reported-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* test: latency - --policy option - allow using SCHED_OTHERJaroslav Kysela2022-11-241-1/+4
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* test: latency - add --policy option to allow using SCHED_FIFOJaroslav Kysela2022-11-241-5/+17
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* test: latency - usleep should not be used in the block modeJaroslav Kysela2022-11-231-2/+2
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* test: latency - add -y option (I/O usleep)Jaroslav Kysela2022-11-231-1/+12
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: handle empty string also for ${env:} substitutionJaroslav Kysela2022-11-221-1/+7
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: clarify set_defaults callsJaroslav Kysela2022-11-151-11/+25
| | | | | | - do full reset in snd_use_case_mgr_reload Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* latency: add timestamps to the POS linesJaroslav Kysela2022-11-141-11/+6
| | | | | | | - remove first capture pos line - measure the snd_pcm_start() call, too Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* test: latency - add more realtime testsJaroslav Kysela2022-11-141-12/+151
| | | | | | | | | | | | | Add '-x' and '-X' tests and '-U' - I/O update mode based on the system timing. It may be required to check the position updates for the specific hardware. Print the real time / stream time differences. Also include code to make valgrind happy (including the wrong memory llocation for the stream buffer). Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: fix the fast_ops pcm argument for fast_opsJaroslav Kysela2022-11-144-6/+7
| | | | | | | The fast_ops callback invocation must always pass the fast_op_arg as the pcm argument. Plugins expect that. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* test: latency - use snd_pcm_format_physical_width()Jaroslav Kysela2022-11-142-4/+9
| | | | | | | We need to allocate frames using the physical size not the sample bit size. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* include: alsa-symbols.h - use newer gcc symver function attributeJaroslav Kysela2022-11-091-0/+7
| | | | | | | | Use the symver function attribute for newer gccs (version 11+). The symver function attribute was introduced probably earlier (gcc-10). We can fix that on demand later. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* include: pcm_old.h - use a macro for the symbol versioningJaroslav Kysela2022-11-091-65/+68
| | | | | | Make the header file more readable and error prone. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: rate - correct the previous fix for snd_pcm_rate_may_wait_for_avail_min()Jaroslav Kysela2022-11-092-4/+8
| | | | | | | | | | The previous fix in aa4f56c3 was not correct. The root of the cause is implementation in snd_pcm_may_wait_for_avail_min() inline function where the improper pcm argument is passed to the fast_ops function. Fixes: aa4f56c3 ("pcm: rate - fix the crash in snd_pcm_rate_may_wait_for_avail_min()") Fixes: d9dbb57b ("pcm: rate - rewrite the may_wait_for_avail_min callback for the rate plugin") Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: rate - fix the crash in snd_pcm_rate_may_wait_for_avail_min()Jaroslav Kysela2022-11-091-1/+1
| | | | | | | | | | | | | | | The pcm argument passed to the conversion function in snd_pcm_plugin_may_wait_for_avail_min_conv() should be pcm->fast_op_arg. Test command: arecord -Dplughw:x -r12000 -c2 -fS16_LE -M temp.wav Fixes: d9dbb57b ("pcm: rate - rewrite the may_wait_for_avail_min callback for the rate plugin") BugLink: https://lore.kernel.org/alsa-devel/1667793912-18957-1-git-send-email-shengjiu.wang@nxp.com/ Fixes: https://github.com/alsa-project/alsa-lib/issues/282 Reported-by: Shengjiu Wang <shengjiu.wang@nxp.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: fix enhanced ID parsing in snd_use_case_parse_ctl_elem_id()Jaroslav Kysela2022-11-021-1/+1
| | | | | Reported-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* Release v1.2.8v1.2.8Jaroslav Kysela2022-10-241-1/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>