Commit graph

3977 commits

Author SHA1 Message Date
Takashi Iwai
6d3311fefb Makefile: Add README.md to EXTRA_DIST
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-10 10:37:13 +01:00
Jonas Holmberg
7d36895225 pcm: set the snd_pcm_ioplug_status() tstamp field
Set the status tstamp field so that it can be accessed with
snd_pcm_status_get_htstamp().

Signed-off-by: Jonas Holmberg <jonashg@axis.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-02 15:29:26 +01:00
Pierre-Louis Bossart
e5c350d7bc topology: use inclusive language in documentation
Use codec_provider and codec_consumer for bclk and fsync

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-11-17 14:01:30 +01:00
Pierre-Louis Bossart
706192341d topology: use inclusive language for fsync
use fsync_provider for structure fields, 'codec_provider' and
'codec_consumer' for options and modify #defines to use CP and CC
suffixes.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-11-17 14:01:20 +01:00
Pierre-Louis Bossart
39bd0e1a5b topology: use inclusive language for bclk
use bclk_provider for structure fields, 'codec_provider' and
'codec_consumer' for options and modify #defines to use CP and CC
suffixes.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-11-17 13:59:18 +01:00
Jaroslav Kysela
2757191e3b pcm: snd_pcm_mmap_readi - fix typo in comment
\param size frames to be *read*

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-10-29 20:34:25 +01:00
Jaroslav Kysela
1d993b37ab dlmisc: fix snd_plugin_dir locking for not DL_ORIGIN_AVAILABLE
Fixes: 8580c081c2 ("dlsym: add support for ALSA_PLUGIN_DIR environment variable")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-10-29 20:32:10 +01:00
Jaroslav Kysela
ad8c8e5503 dlmisc: the snd_plugin_dir_set / snd_plugin_dir must be declared even for \!DL_ORIGIN_AVAILABLE
Fixes: 8580c081c2 ("dlsym: add support for ALSA_PLUGIN_DIR environment variable")
BugLink: https://github.com/alsa-project/alsa-lib/issues/91
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-10-22 20:58:19 +02:00
Jaroslav Kysela
49bd4b198e Release v1.2.4
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-10-19 11:45:13 +02:00
Jaroslav Kysela
e91b1c0670 topology: straight printf and error path fixes
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-10-19 11:17:21 +02:00
Jaroslav Kysela
5c1cb568ec topology: save_config - fix the error path handling
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-10-19 11:02:29 +02:00
Jaroslav Kysela
d77fb47318 ucm: handle correctly Linked configuration
BugLink: https://github.com/alsa-project/alsa-ucm-conf/issues/54
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-10-19 10:52:13 +02:00
Jaroslav Kysela
cebe0fe0f9 tplg: fix the unaligned_get32/put32 helpers for big endian
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-10-15 19:13:18 +02:00
Jaroslav Kysela
e191b231c5 pcm: file plugin - implement safe_write
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>
2020-10-15 12:54:29 +02:00
Jaroslav Kysela
0128af6f54 pcm: fix the pcm_frames_diff -> pcm_frame_diff typo
BugLink: https://github.com/alsa-project/alsa-lib/issues/85
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-10-14 17:55:20 +02:00
Jaroslav Kysela
ebe2f8b851 pcm: dshare - apply the boundary wrap in snd_pcm_dshare_sync_area()
BugLink: https://github.com/alsa-project/alsa-lib/issues/84
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-10-13 20:15:09 +02:00
Jaroslav Kysela
6d06fcc285 pcm: introduce pcm_frame_diff and pcm_frame_diff2 helpers
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-10-13 20:10:49 +02:00
Jaroslav Kysela
a6c8ac0c85 pcm: meter / s16 - add protection for the maximum copied frames
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>
2020-10-13 19:31:49 +02:00
Jaroslav Kysela
aa89ad9362 dlsym: use the only alsa plugins directory for the internal modules
The commit b2a4272ecb 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: b2a4272ecb ("snd_dlopen: do not use absolute plugin path for snd_dlopen() calls")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-10-13 17:00:29 +02:00
Jaroslav Kysela
2a204a5412 dlmisc, pcm: export the old symbols (for -flto)
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>
2020-10-13 11:33:29 +02:00
Jaroslav Kysela
8580c081c2 dlsym: add support for ALSA_PLUGIN_DIR environment variable
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>
2020-10-13 10:43:46 +02:00
Jaroslav Kysela
4f90392f07 pcm: fix the snd_pcm_plugin_status() avail and delay fields
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>
2020-10-09 20:02:22 +02:00
Jaroslav Kysela
2b217b7010 ucm: rename once_list to boot_list
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-10-06 10:47:11 +02:00
Jaroslav Kysela
61749cf400 ucm: substitute the comment string also in the main configuration file
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-10-06 10:43:38 +02:00
Jaroslav Kysela
22d5ca8b6b ucm: add a check for the empty configuration
Return an error if the UCM configuration is empty (no verbs
or no boot sequence).

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-10-06 10:43:13 +02:00
Jaroslav Kysela
e80f35611d ucm: Handle 'Error' keyword in the master file
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>
2020-10-06 10:23:25 +02:00
Tanjeff-N. Moos
c1e72460de control: Add documentation for snd_ctl_elem_value_*.
Signed-off-by: Tanjeff-N. Moos <tanjeff@cccmz.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-09-03 09:12:41 +02:00
Tanjeff-N. Moos
84185b5c94 control: Improve general control interface documentation.
Signed-off-by: Tanjeff-N. Moos <tanjeff@cccmz.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-09-03 09:11:27 +02:00
Jaroslav Kysela
472ab5db67 topology: improve the printf buffer management
The commit d04e72c9a5 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>
2020-08-31 19:51:49 +02:00
Jaroslav Kysela
ab73253924 topology: fix the unaligned access
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>
2020-08-31 14:27:30 +02:00
Jaroslav Kysela
84c6aeef5c topology: fix sort_config()
The temporary config array must be initialized for all compound types.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-08-31 14:26:02 +02:00
Jaroslav Kysela
6ca1ddfbcd topology: fix some gcc10 warnings (labs, signess)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-08-31 13:25:07 +02:00
Jaroslav Kysela
dc778bade6 topology: return correct value in tplg_save_printf()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-08-31 13:21:26 +02:00
Piotr Maziarz
d04e72c9a5 topology: Make buffer for saving dynamic size
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>
2020-08-31 13:03:01 +02:00
Piotr Maziarz
6b0fb2bc7e topology: decode: Add DAI name printing
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>
2020-08-31 13:03:01 +02:00
Piotr Maziarz
d93b346299 topology: decode: Print sig_bits field in PCM capabilities section
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>
2020-08-31 13:03:01 +02:00
Piotr Maziarz
acbb0e3b17 topology: decode: Fix decoding PCM formats and rates
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>
2020-08-31 13:03:01 +02:00
Piotr Maziarz
c32498603a topology: decode: Change declaration of enum decoding function
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>
2020-08-31 13:03:01 +02:00
Piotr Maziarz
56a096ca2c topology: decode: Fix printing texts section
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>
2020-08-31 13:03:01 +02:00
Piotr Maziarz
f1435207a2 topology: decode: Add enum control texts as separate element
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>
2020-08-31 13:03:01 +02:00
Piotr Maziarz
11d4a5aa72 topology: decode: Remove decoding values for enum control
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>
2020-08-31 13:03:01 +02:00
Piotr Maziarz
346a5efa87 topology: decode: Fix infinite loop in decoding enum control
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>
2020-08-31 13:03:01 +02:00
Piotr Maziarz
1ac965184e topology: decode: Fix channel map memory allocation
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>
2020-08-31 13:03:01 +02:00
Jaroslav Kysela
ed75249852 conf: quote also strings with '*' and '#' characters in string_print()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-08-18 16:53:35 +02:00
Tanjeff-N. Moos
e097dd491a control: Add documentation for snd_ctl_elem_list_*.
Signed-off-by: Tanjeff-N. Moos <tanjeff@cccmz.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-08-18 12:18:30 +02:00
Tanu Kaskinen
fece807386 README: add patch submission instructions
Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-08-16 09:36:01 +02:00
Vijay Palaniswamy
82cb27c165 pcm: dmix: fix access to sum-buffer in non-interleaved mixing mode
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>
2020-08-13 16:19:30 +02:00
Kai-Heng Feng
464c2f8b61 conf: USB-Audio: Disable IEC958 on Lenovo ThinkStation P620
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>
2020-08-11 13:17:15 +02:00
Jaroslav Kysela
a3ca4803cb control: ctlparse - fix enum values in '' or ""
This comit fixes the enum value string parser
(fixes aaf3a081bf).

BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/40
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-07-27 18:29:09 +02:00
omar
a80606d1ab conf: pcm - USB - Added S/PDIF fix for Asus Xonar SE
Resolves #70
From: omar <odzinic@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-07-27 11:46:53 +02:00