Commit graph

3979 commits

Author SHA1 Message Date
Jaroslav Kysela
76c098bf6e ucm: merge the array items from the condition blocks
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-09 21:51:55 +02:00
Jaroslav Kysela
822f0c443b topology: use snd_config_is_array() function
... instead the own array test.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-08 12:04:41 +02:00
Jaroslav Kysela
0c99c073d3 conf: add snd_config_is_array() function
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-08 12:00:42 +02:00
Jaroslav Kysela
05a6effd8d conf: use bool type for the join member in the config structure
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-08 11:23:38 +02:00
Jaroslav Kysela
ee29d2a0b6 conf: change namehint for pcm.front
It seems that we have regressions for pcm.front (some
applications are using this device also for the default
raw input). Change the description and allow both
directions.

Fixes: https://github.com/alsa-project/alsa-lib/issues/39

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-07 16:39:57 +02:00
Takashi Iwai
bb43546c7a header: Fix build error with old kernel headers
Old development environment doesn't necessarily contain the headers
defining __kernel_long_t that is recently used for y2038 timespec
conditional.  Define it explicitly in such a case.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-05-06 22:40:16 +02:00
Frédéric Recoules
abc9f32cf4 pcm: dmix: assembly: give more freedom over the constraints
Minor changes that could help the compiler to produce a
better (smaller/faster) code.

Signed-off-by: Frédéric Recoules <frederic.recoules@orange.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-05-06 22:27:40 +02:00
Frédéric Recoules
79c6ba99c4 pcm: dmix: assembly: refactor the PIC mode
Newer versions of GCC (> 5.0) accept that ebx is declared
in the clobber list even in PIC mode. Meanwhile, even
unlikely, the compiler may use ebx as base address of
one of the memory entry, making subsequent access to
them unreliable ('size', 'dst_step', 'src_step', 'sum_step').

Adding ebx in the clobber solves the problem.
By the way, the entry 'old_ebx' is no longer required.

Signed-off-by: Frédéric Recoules <frederic.recoules@orange.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-05-06 22:27:11 +02:00
Frédéric Recoules
0fd7f0cdc5 pcm: dmix: assembly: fix the interface for safety (mmx)
- add mm0 in the clobber list if the compiler
  is aware of the mmx technology;
- otherwise, add the mmx aliased x87 floating point
  registers in the clobbers;
- the configure now checks if the compiler is aware of
  the MMX technology.

  The compiler assumes none of the mmx or x87 registers are used
  by the function. If it chooses to store some data in them, they
  will be overwritten by the chunk.
  Recall that any mmx instruction invalidate the whole set of
  x87 floating point registers.

  Note: currently does not impact the binary output.

Signed-off-by: Frédéric Recoules <frederic.recoules@orange.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-05-06 22:26:04 +02:00
Frédéric Recoules
01d8a6e03a pcm: dmix: assembly: fix the interface for safety
- move 'size' and 'old_ebx' in the output section
  since they are clobbered;
- add the "memory" clobber since input pointers
  are accessed;
- (minor) add the "cc" clobber since flags are
  clobbered.

  The compiler is missing some dataflow information
  about the execution of the assembly chunks.
  For instance, it assumes that 'size' remains unchanged
  and that no input pointer is accessed.
  The compiler optimizer may take advantage of these
  assumption and produce a wrong code.

Note: currently produces the same binary output.

Signed-off-by: Frédéric Recoules <frederic.recoules@orange.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-05-06 22:25:15 +02:00
Frédéric Recoules
b315f21bf7 pcm: dmix: assembly: change the token by symbolic names
It eases the refactoring of assembly chunk since we can now
add/remove/move entries without worrying about maintaining
the token numbering in the template.

Note: does not impact the binary output.

Signed-off-by: Frédéric Recoules <frederic.recoules@orange.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-05-06 22:24:48 +02:00
Jaroslav Kysela
21e2fc3857 test: pcm_min - add snd_pcm_drain() call and indentation fixes
Fixes: https://github.com/alsa-project/alsa-lib/issues/46
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-03 20:07:55 +02:00
sylvain.bertrand@gmail.com
29041c5220 fix infinite draining of the rate plugin in SND_PCM_NONBLOCK mode
The draining function of the rate plugin does not handle properly the
SND_PCM_NONBLOCK case. It can write data to the slave plugin each time the
function is called, but does not update its internal state in order to
reach a stopping condition. Use a last_commit_ptr workaround to reach such
condition.

Signed-off-by: Sylvain BERTRAND <sylvain.bertrand@legeek.net>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-04-30 14:25:10 +02:00
Amadeusz Sławiński
496e239e65 topology: Use bool parser to parse boolean value
It should be safe to change this as correct values with int would be 0
or 1 and bool parser handles them correctly.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-04-30 14:21:29 +02:00
Jaroslav Kysela
4327660c71 use-case.h: add USB as allowed device name
Some USB devices are really generic where the
PCM stream can be routed to different paths.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-04-28 12:59:13 +02:00
Jaroslav Kysela
a43074ba17 pcm: rate - fix the remaining size calculation in snd_pcm_rate_drain()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-04-23 13:43:32 +02:00
Ivan Mironov
c996c9f52c conf: USB-Audio: Fix S/PDIF output of ASUS Xonar AE
ASUS Xonar AE is a PCI-Express card containing USB controller:

	USB controller [0c03]: ASMedia Technology Inc. ASM1042A USB 3.0 Host Controller [1b21:1142]

and the actual USB sound card:

	ID 0b05:180f ASUSTek Computer, Inc. XONAR SOUND CARD

As other Xonar USB sound cards, it uses second device for digital
output.

Signed-off-by: Ivan Mironov <mironov.ivan@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-04-17 14:03:35 +02:00
sylvain.bertrand@gmail.com
d12df1dc9c pcm: dmix: fix sw_params handling of timestamp types in direct plugins
In pcms using direct plugins (dmix/dsnoop/dshare), the timestamp type could
be different from the terminating hw plugin, then the kernel driver.

Be sure such pcms have plugins using consistently the same timestamp type.

signed-off-by: Sylvain Bertrand <sylvain.bertrand@legeek.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-04-17 11:17:02 +02:00
Jaroslav Kysela
fb48ad9e4f ucm: fix copy-n-paste typo (RemoveDevice list)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-04-06 17:20:24 +02:00
Jaroslav Kysela
c9605484d1 ucm: fix the device remove operation
- allow to remove device only from conflicting lists
- unify the error codes when the device is not found (ENODEV)

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-04-06 13:25:46 +02:00
Jaroslav Kysela
341326c21e usecase: allow indexes also for modifier names
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-04-03 18:00:51 +02:00
Jonas Holmberg
3b46b03f09 pcm: add chmap option to route plugin
Add a config definition "chmap" to override the channel maps in the same
way as in the hw and null plugins.

Signed-off-by: Jonas Holmberg <jonashg@axis.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-03-31 22:32:41 +02:00
Jaroslav Kysela
bca39e99d0 conf: fix namehint for pcm.front and pcm.iec958
As suggested in:

Fixes: https://github.com/alsa-project/alsa-lib/issues/39

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-03-27 18:14:02 +01:00
Jaroslav Kysela
d434638a68 namehint: remember the direction from the upper levels
The current code resets the direction info for each level.
Simply remove this code.

Fixes: https://github.com/alsa-project/alsa-lib/issues/39

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-03-27 11:59:55 +01:00
Jaroslav Kysela
6137d263f3 ucm: fix uc_mgr_scan_master_configs()
Skip the lookup, if the top level filename does not exist.

Fixes: https://github.com/alsa-project/alsa-ucm-conf/issues/16

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-03-17 16:21:46 +01:00
Jaroslav Kysela
79102bf264 ucm: clarify the index syntax for the device names
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-03-17 10:21:10 +01:00
Jaroslav Kysela
caf77a93ce topology: add back asrc to widget_map in dapm.c
Fixes: aa1bac2d04 ("topology: add snd_tplg_save()")
BugLink: https://github.com/thesofproject/sof/issues/2543

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-03-13 17:07:36 +01:00
Tanu Kaskinen
9ed3c65e15 conf: USB-Audio: Add C-Media USB Headphone Set to the IEC958 blacklist
Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/317

Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-03-13 10:09:18 +01:00
Jaroslav Kysela
1654f38a29 configure: add --embed for python3-config (python 3.8)
Fixes: https://github.com/alsa-project/alsa-lib/issues/33

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-03-04 11:28:53 +01:00
be-marc
c7efaef195 Change PCM device number of Asus Xonar U5
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-03-03 13:30:39 +01:00
Jaroslav Kysela
09e78da4ca conf: namehint - add omit_noargs to the hint section
Do not list simple surround devices in the namehint function by default.

Fixes: https://github.com/alsa-project/alsa-lib/issues/27

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-03-02 09:45:55 +01:00
Jaroslav Kysela
27c7927842 conf: change the order of PCM devices in alsa.conf
Appearently, some applications use the first device for probe or so.

Fixes: https://github.com/alsa-project/alsa-lib/issues/27

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-02-29 10:31:03 +01:00
Jaroslav Kysela
717a8425ff Release v1.2.2
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-02-19 10:35:39 +01:00
Jaroslav Kysela
e006811e94 github build.yml: cosmetic changes
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-02-18 19:46:42 +01:00
Jaroslav Kysela
78fea15390 alsa.m4: another fix to not link all binaries with -latopology
Preserve LIBS when the -latopology is tested. It's added later.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-02-18 19:45:19 +01:00
Jaroslav Kysela
f47f1e6ff7 README.md: add build status badge
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-02-18 15:04:52 +01:00
Jaroslav Kysela
6d5a7b4eb0 github: create test workflow for fedora and ubuntu
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-02-18 14:55:41 +01:00
Rolf Eike Beer
b367274b4d do not set close-on-exec flag on descriptor if it was already set
There is no need to set this again if O_CLOEXEC is supported.

Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-02-11 12:13:08 +01:00
Jaroslav Kysela
5bc3d4c4c1 ucm: parser - add error message to verb_dev_list_add()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-02-11 10:38:51 +01:00
Takashi Iwai
5bbe8b2fb9 uapi: Sync with 5.6 kernel ABI
This is a sync with 5.6-rc1 kernel headers.  The copy is performed
from the sanitized headers installed via make headers_install.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-02-10 12:50:50 +01:00
Takashi Iwai
beb6b178e6 topology: Drop SNDRV_CTL_ELEM_ACCESS_TIMESTAMP access
SNDRV_CTL_ELEM_ACCESS_TIMESTAMP is removed from 5.6 kernel ABI as the
ctl timestamp field has been never used and deprecated.
Drop the corresponding access from the topology code, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-02-10 12:49:25 +01:00
Takashi Iwai
43e137c064 control: Remove access to the deprecated dimen fields
The dimen fields of control element has been deprecated, and it's
finally dropped in kernel 5.6 ABI definition.  Remove the
corresponding accesses in alsa-lib code.

As of this patch, it's disabled via ifdef, just to be sure.  The
disabled code should be removed in a later stage as a cleanup.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-02-10 12:47:19 +01:00
Jaroslav Kysela
fdf96312fa ucm: fill missing device entries (conflicting / supported)
It is not necessary to maintain this information in sync in the configuration
files. Fill the missing entries to the complementary devices.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-02-07 16:20:56 +01:00
Jaroslav Kysela
251bc204a1 ucm: implement RenameDevice and RemoveDevice verb management
With the conditionals, it may be useful to define the devices
in the included configuration files. To satisfy the specification
requirements (device naming) those device names might require
to be renamed or deleted wrong references from the conflicting
or supported lists.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-02-07 16:20:49 +01:00
Jaroslav Kysela
71a1367bca ucm: the ucm2/ subdirectory is driver name based
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-02-03 15:24:19 +01:00
Jaroslav Kysela
c5a09b0fea ucm: parser - use correct filename in parser_master_file()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-02-03 14:44:13 +01:00
Tanu Kaskinen
b2fe99277a configure.ac: remove an unnecessary libtool fix
This code was added in commit 75d393a563
without explaining why. I assume it was a mistake, since it looks like
the libtool problem should have gone away a long time ago. The referenced
wiki page https://wiki.debian.org/RpathIssue says:

    Since libtool 1.5.2 (released 2004-01-25), on Linux libtool no
    longer sets RPATH for any directories in the dynamic linker search
    path, so this should no longer be an issue unless upstream used a
    really old version of libtool when creating their distribution
    tarball.

This code caused problems in OpenEmbedded, where the libtool script is
named "x86_64-oe-linux-libtool" or similar rather than just "libtool",
so the sed command failed with a file not found error. Rather than
adapting the code to OpenEmbedded's peculiarities, it seems best to just
remove the unnecessary code altogether.

Note: The rpath is set (hardcoded) for 'make' but it is corrected
for 'make install' by libtool.

Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-24 09:55:51 +01:00
Jaroslav Kysela
7d3fec6ac6 ucm: parser - cosmetic fixes in the comments
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-17 18:23:44 +01:00
Jaroslav Kysela
fbe1ac4a09 topology: remove MAX_FILE definition and use correct PATH_MAX
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-15 10:41:35 +01:00
Jaroslav Kysela
ebf5213cd6 ucm: remove MAX_FILE definition and use correct PATH_MAX
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-15 10:40:39 +01:00