summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Release v1.2.4v1.2.4Jaroslav Kysela2020-10-191-1/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: straight printf and error path fixesJaroslav Kysela2020-10-193-13/+15
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: save_config - fix the error path handlingJaroslav Kysela2020-10-191-2/+2
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: handle correctly Linked configurationJaroslav Kysela2020-10-191-0/+17
| | | | | BugLink: https://github.com/alsa-project/alsa-ucm-conf/issues/54 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* tplg: fix the unaligned_get32/put32 helpers for big endianJaroslav Kysela2020-10-151-1/+8
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: file plugin - implement safe_writeJaroslav Kysela2020-10-151-7/+21
| | | | | | | | The syscalls may return EINTR when a signal is handled. Implement safe_write() function which does simple write retry. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: fix the pcm_frames_diff -> pcm_frame_diff typoJaroslav Kysela2020-10-143-7/+7
| | | | | BugLink: https://github.com/alsa-project/alsa-lib/issues/85 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: dshare - apply the boundary wrap in snd_pcm_dshare_sync_area()Jaroslav Kysela2020-10-131-1/+1
| | | | | BugLink: https://github.com/alsa-project/alsa-lib/issues/84 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: introduce pcm_frame_diff and pcm_frame_diff2 helpersJaroslav Kysela2020-10-134-40/+30
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: meter / s16 - add protection for the maximum copied framesJaroslav Kysela2020-10-131-0/+4
| | | | | | | | | | | The rewind or forward may cause the stream pointer change. Although this patch does not fix the real meter update issue, it breaks the possible big loops when the stream pointers are desynced with the meters. It does not make sense to copy more samples than the pcm buffer contains. Link: https://lore.kernel.org/alsa-devel/f56d6a67-014a-e562-c253-830c0ec03717@ivitera.com/ Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* dlsym: use the only alsa plugins directory for the internal modulesJaroslav Kysela2020-10-131-17/+6
| | | | | | | | | | | | The commit b2a4272ecb40d84556d8e043d0b6e89439acbc33 introduced a slightly different behaviour for ALSA_PLUGIN_DIR. The fallback causes that the alsa libraries are searched in all library directories. It was never intended to do the system wide library lookups for internal modules. Fixes: b2a4272ecb40 ("snd_dlopen: do not use absolute plugin path for snd_dlopen() calls") Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* dlmisc, pcm: export the old symbols (for -flto)Jaroslav Kysela2020-10-132-8/+8
| | | | | | | All old symbols must be visible (exported) for -flto. BugLink: https://github.com/alsa-project/alsa-lib/issues/56 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* dlsym: add support for ALSA_PLUGIN_DIR environment variableJaroslav Kysela2020-10-131-25/+30
| | | | | | | | In some cases, it may be useful to specify the plugin directory using the environment variable. BugLink: https://github.com/alsa-project/alsa-lib/issues/82 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: fix the snd_pcm_plugin_status() avail and delay fieldsJaroslav Kysela2020-10-091-2/+6
| | | | | | | | | | | | | The avail and delay fields in the returned status structure does not reflect the actual hw_ptr/appl_ptr. This change correct this. TODO: Unfortunately, the delay might contain also information about extra hardware / buffering delay which is hidden with this change. Link: https://lore.kernel.org/alsa-devel/d9c1f37e-5c8d-f289-270e-c6cda7a56ce3@axis.com/ Reported-by: Jonas Holmberg <jonashg@axis.com> Tested-by: Jonas Holmberg <jonashg@axis.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: rename once_list to boot_listJaroslav Kysela2020-10-064-9/+9
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: substitute the comment string also in the main configuration fileJaroslav Kysela2020-10-061-1/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: add a check for the empty configurationJaroslav Kysela2020-10-061-3/+23
| | | | | | | Return an error if the UCM configuration is empty (no verbs or no boot sequence). Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: Handle 'Error' keyword in the master fileJaroslav Kysela2020-10-061-0/+22
| | | | | | | | With the conditional blocks, it may be useful to terminate the hardware detection from the configuration. Introduce 'Error' keyword for the master UCM configuration file. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* control: Add documentation for snd_ctl_elem_value_*.Tanjeff-N. Moos2020-09-032-158/+357
| | | | | Signed-off-by: Tanjeff-N. Moos <tanjeff@cccmz.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* control: Improve general control interface documentation.Tanjeff-N. Moos2020-09-031-9/+63
| | | | | Signed-off-by: Tanjeff-N. Moos <tanjeff@cccmz.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* topology: improve the printf buffer managementJaroslav Kysela2020-08-319-97/+130
| | | | | | | | | | | | | | | | | | | | The commit d04e72c9a593015952e4858b92ab3f9d821560d9 introduced the dynamic printf buffer allocation for each tplg_save_printf() call. Introduce 'struct tplg_buf' which carries extra information about the temporary printf buffer and the destination buffer to save allocation requests. The printf buffer is also allocated using 1024 bytes chunks. A comparison between 'alloc everyting' and 'cache+chunk alloc' for the random picked topology file: 1: 18,620 allocs, 18,620 frees, 7,239,688 bytes allocated 2: 12,490 allocs, 12,490 frees, 962,568 bytes allocated Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: fix the unaligned accessJaroslav Kysela2020-08-313-16/+29
| | | | | | | | | | Introduce unaligned_get32/put32 helpers to deal with the packed structures. Use the gcc __BYTE_ORDER__ defines for the endian checks. It may be improved to support other compilation environment. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: fix sort_config()Jaroslav Kysela2020-08-311-8/+6
| | | | | | The temporary config array must be initialized for all compound types. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: fix some gcc10 warnings (labs, signess)Jaroslav Kysela2020-08-312-2/+2
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: return correct value in tplg_save_printf()Jaroslav Kysela2020-08-311-1/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: Make buffer for saving dynamic sizePiotr Maziarz2020-08-311-5/+29
| | | | | | | | | | | Some fields can exceed size limit, e.g. private data has no size restriction. Therefore it needs to be dynamically increased. Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: decode: Add DAI name printingPiotr Maziarz2020-08-311-1/+3
| | | | | | | | | | | DAI name is a part of topology binary. Not printing makes data loss while converting from binary to standard ALSA configuration file. Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: decode: Print sig_bits field in PCM capabilities sectionPiotr Maziarz2020-08-311-0/+3
| | | | | | | | | | | Not printing this field makes data loss while converting from binary to standard ALSA configuration file. Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: decode: Fix decoding PCM formats and ratesPiotr Maziarz2020-08-311-2/+2
| | | | | | | | | | | | Not checking _LAST format and rate, which are valid indexes in arrays, makes data loss while converting binary to standard ALSA configuration file. Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: decode: Change declaration of enum decoding functionPiotr Maziarz2020-08-313-17/+7
| | | | | | | | | | | | | Size constraints are always checked before invoking tplg_decode_control_enum1. There is no need to validate it twice. Alos moved debug print about size to invoking function, since now it's it responsibility to check size. Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: decode: Fix printing texts sectionPiotr Maziarz2020-08-311-1/+1
| | | | | | | | Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: decode: Add enum control texts as separate elementPiotr Maziarz2020-08-311-3/+11
| | | | | | | | | | Texts are separate sections that should referenced by enum control. Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: decode: Remove decoding values for enum controlPiotr Maziarz2020-08-311-4/+1
| | | | | | | | | | | | Values have no representation in standard ALSA configuration files, therefore there is no need to populate them. Also memory for values wasn't allocated which was causing undefined behaviour. Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: decode: Fix infinite loop in decoding enum controlPiotr Maziarz2020-08-311-1/+1
| | | | | | | | | | Accessing memory outside of allocated boundaries caused segmentation fault. Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: decode: Fix channel map memory allocationPiotr Maziarz2020-08-311-6/+7
| | | | | | | | | | | Memory allocated on the stack was referenced outside of the function scope caused undefined behaviour. Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* conf: quote also strings with '*' and '#' characters in string_print()Jaroslav Kysela2020-08-181-0/+2
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* control: Add documentation for snd_ctl_elem_list_*.Tanjeff-N. Moos2020-08-182-13/+148
| | | | | Signed-off-by: Tanjeff-N. Moos <tanjeff@cccmz.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* README: add patch submission instructionsTanu Kaskinen2020-08-161-0/+11
| | | | | Signed-off-by: Tanu Kaskinen <tanuk@iki.fi> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* pcm: dmix: fix access to sum-buffer in non-interleaved mixing modeVijay Palaniswamy2020-08-131-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When dmix uses non-interleaved mixing mode the offset and step width to sum_buffer was calculated by using the dmix channels instead of the slave channels. This leads to audio distortions due to frame corruption. example: - With below configuratio, Do aplay on both device in parallel for audio distortion pcm.dmix_2_channels { type dmix ipc_key 5678293 ipc_perm 0660 ipc_gid audio bindings [0 1] slave { pcm "hardware" channels 2 periods 4 period_time 40000 } } pcm.dmix_1_channels { type dmix ipc_key 5678293 ipc_perm 0660 ipc_gid audio bindings [0] slave { pcm "hardware" channels 1 periods 4 period_time 40000 } } pcm.hardware { type hw card 0 channels 2 rate 48000 format S16_LE } Signed-off-by: Vijay Palaniswamy <vijay.palaniswamy@in.bosch.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* conf: USB-Audio: Disable IEC958 on Lenovo ThinkStation P620Kai-Heng Feng2020-08-111-0/+2
| | | | | | | | Both USB audio cards on Lenovo ThinkStation P620 don't support IEC958, so disable IEC958 accordingly. Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* control: ctlparse - fix enum values in '' or ""Jaroslav Kysela2020-07-271-11/+15
| | | | | | | | This comit fixes the enum value string parser (fixes aaf3a081bff1cc85635f7a3c3d4287c4addbbd84). BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/40 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* conf: pcm - USB - Added S/PDIF fix for Asus Xonar SEomar2020-07-271-0/+1
| | | | | | Resolves #70 From: omar <odzinic@gmail.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: iec958: set channel status bits according to rate and formatMatthias Reichl2020-07-141-4/+76
| | | | | | | | | | | | | | | This mimics snd_pcm_create_iec958_consumer in the kernel. The rate and wordlength bits will only be modified if they are set to "not indicated", which is now the default if no status option is used. This allows applications to override parameters determined from the stream or implement channel status bits extensions without needing to change pcm_iec958 code. Signed-off-by: Matthias Reichl <hias@horus.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* pcm: iec958: implement HDMI HBR audio formattingMatthias Reichl2020-07-141-4/+33
| | | | | | | | | | | | | | | | | | | High bitrate compressed audio data like DTS HD or MAT is usually packed into 8-channel data. The HDMI specs state this has to be formatted as a single IEC958 stream, compared to normal multi- channel PCM data which has to be formatted as parallel IEC958 streams. As this single-stream formatting mode may break existing setups that expect non-PCM multichannel data to be formatted as parallel IEC958 streams it needs to be explicitly selected by setting the hdmi_mode option to true. The single-stream formatting implementation is prepared to cope with arbitrary channel counts but only limited testing was done for channel counts other than 8. Signed-off-by: Matthias Reichl <hias@horus.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* pcm: dmix: Fix semaphore usage with lockless operationTakashi Iwai2020-07-075-8/+15
| | | | | | | | | | | | | | | | As Maarten Baert recently reported, the current dmix code applies the semaphore unnecessarily around mixing streams even when the lockless mix operation is used on x86. This was rather introduced mistakenly at the commit 267d7c728196 ("Add support of little-endian on i386/x86_64 dmix") where the generic dmix code was included on x86, too. For achieving the original performance back, this patch changes the semaphore handling to be checked at run time instead of statically at compile time. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* pcm: dmix: make lockless operation optionalTakashi Iwai2020-07-072-3/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recently reported (but a long-standing) bug about the unconditional semaphore usage in the dmix implies that basically we've had no problem with the locking in the practical usages over years. Although the lockless operation has a clear merit, it's a much higher CPU usage (especially on some uncached pages), and it might lead to a potential deadlock in theory (which is hard to reproduce at will, though). This patch introduces a new configure option "--enable-lockless-dmix" or "--disable-lockless-dmix" to let user choose the default dmix operation mode. The usage of the lockless mixing has been already conditionally enabled via asoundrc and card config "direct_memory_access", so we just need to set the default value based on it. In this patch, the default is set off to the lockless mixing, i.e. the generic mixing is chosen. It makes more sense from the performance POV. For any users who still require the lockless operation, it can be enabled either via configure option or the asoundrc. The magic number used in the shmem is also changed depending on the operation mode. It's just for safety, not to conflict both operation modes with each other. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ctl: improve documentation for identifier of control elementTakashi Sakamoto2020-07-061-2/+2
| | | | | | | | | | | In documentation, there're two ways relevant to the identifier of control element. However, the case of combination has the lack of parameters. This commit improves documentation in this point. Fixes: f3c24de8c0df ("ctl: add an overview for design of ALSA control interface") Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: substitute the merged tree completelyJaroslav Kysela2020-07-064-4/+66
| | | | | | | | | | We need to define the common shared configuration like for multiple HDMI devices or so. Substitute the whole merged configuration tree including identifiers. Fixes: https://github.com/alsa-project/alsa-lib/issues/67 Fixes: https://github.com/alsa-project/alsa-ucm-conf/commit/dcef48f13d4f5db79b006755074940b94730a883 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: fix parse_get_safe_name() - safe name must be checked after substitutionJaroslav Kysela2020-07-031-2/+7
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: substitution - remove duplicate allow_empty assignmentJaroslav Kysela2020-06-301-2/+2
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>