Commit graph

2890 commits

Author SHA1 Message Date
Takashi Iwai
a102028a5a PCM: Add the missing query_chmaps for route plugin
Also fix the channel count in get_chmap for route plugin.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13 08:24:58 +02:00
Takashi Iwai
e1975d20f5 PCM: Add chmap options to hw and null plugins
Add a config definition "chmap" to override (or enhance) the channel
maps.  So far, only a single channel map can be provided, and the
channel count consistency isn't strictly tested at all.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13 08:24:58 +02:00
Takashi Iwai
81135aac49 PCM: Add query_chmaps support to multi plugin
Also fix some bugs in get_chmap().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13 08:24:58 +02:00
Takashi Iwai
25f3259b48 PCM: Add snd_pcm_chmap_long_name()
Just return a more verbose name than snd_pcm_chmap_name(), but
including white spaces.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13 08:24:58 +02:00
Takashi Iwai
fe81684745 PCM: Add SND_CHMAP_API_VERSION definition
Just to make it easier for apps to support chmap conditionally via
simple ifdefs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13 08:24:58 +02:00
Takashi Iwai
b4c64e815a PCM: Add string conversion helper functions for chmap
Added a few helper functions between chmap and string.
  snd_pcm_chmap_type_name() -- a string of the given chmap type
  snd_pcm_chmap_name() -- a string of the given channel position
  snd_pcm_chmap_print() -- print channel map on the given buffer
  snd_pcm_chmap_from_string() -- get a channel position from string
  snd_pcm_parse_string() -- parse the whole channel map from string

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13 08:24:58 +02:00
Takashi Iwai
6950a1030c PCM: Fix prefix for snd_pcm_chmap_type enum members
Add _TYPE prefix to distinguish from the channel position.
Also add SND_CHMAP_TYPE_LAST entry pointing the last one like other
enums.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13 08:24:58 +02:00
Takashi Iwai
ec96740d99 Fix duplicated channel entry in test/chmap.c
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13 08:24:58 +02:00
Takashi Iwai
01dc0e6825 PCM: Implement snd_pcm_query_chmaps_from_hw()
This is a function similar like snd_pcm_query_chmaps() but performs
the query without a PCM handle.  The card, device and substream
numbers are passed as well as stream direction.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13 08:24:58 +02:00
Takashi Iwai
9c1a0ce72d PCM: Introduce snd_pcm_chmap_t and snd_pcm_chmap_query_t
Instead of passing ambiguous integer array, define snd_pcm_chmap_t and
snd_pcm_chmap_query_t so that user can understand more easily which
element is for what.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13 08:24:58 +02:00
Takashi Iwai
48c2c90f19 Add SND_CHMAP_NA and bit flag definitions
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13 08:24:58 +02:00
Takashi Iwai
0f36270dd3 Follow channel position definitions to mixer channel in mixer.h
mixer.h already contains some channel position definitions.
To be more consistent over all systems, better to follow the same
order for the new channel map, too.  But since UNKNOWN channel must be
zero but the definition in mixer.h contains -1 as UNKNOWN, simply
shift the value with 1.

If the conversion is required between SND_CHMAP and SND_MIXER_SCHN,
just increment/decrement 1.  Eventually I'll provide helper functions
for that...

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13 08:24:47 +02:00
Takashi Iwai
915b26bfe8 Define channel map position enum in pcm.h
The original definition is in sound/asound.h, but we need to export to
alsa-lib users, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-11 11:34:50 +02:00
Takashi Iwai
34f6545520 Cache the chmap operation errors
... not to retry the same error again.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-11 11:34:50 +02:00
Takashi Iwai
3fc13d6f5b Add test/chmap program
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-11 11:34:50 +02:00
Takashi Iwai
662f79d4ec Implement get_chmap/set_chmap for PCM extplug/ioplug plugins
Added the new ops for both external plugins, so the protocol numbers
are incremented.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-11 11:34:50 +02:00
Takashi Iwai
3fb013065f Implement get_chmap/set_chmap for PCM plug, route and multi plugins
Still incomplete implementations.  The query and set ops are missing
for route and multi plugins.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-11 11:34:50 +02:00
Takashi Iwai
3c4a22ea49 Implement the channel mapping API
Added new channel-mapping API functions.
Not all plugins are covered, especially the route, multi and external
plugins don't work yet.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-11 11:34:50 +02:00
Jaroslav Kysela
1ef1c5cdb4 Release v1.0.26
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2012-09-06 10:55:14 +02:00
Jaroslav Kysela
a074588889 doc: Use 'rm -rf' for the html doxygen tree (it contains search/ dir now)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2012-09-06 10:53:14 +02:00
Reilly Grant
f285572102 PCM: plug: Move fast_ops copy after slave configuration.
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
The plug plugin copies the fast_ops structure and fast_op_arg from its
slave PCM on initialization and after inserting a new plugin. This works
unless the slave PCM is also an instance of the plug plugin because plug
can change its fast_ops structure during _snd_pcm_hw_params.

Instead of copying fast_ops in snd_pcm_plug_insert_plugins wait until
the end of snd_pcm_plug_hw_params when the slave has been fully
initialized.

This fixes a crash when two instances of plug are instantiated back to
back and the format conversion plugin inserted by the second is skipped
by the first because the fast_ops pointer is not properly updated.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-31 18:34:02 +02:00
Takashi Iwai
59de61e5b5 PCM: Allow to run older version of extplug plugin
Also show the incompatible plugin version number in error messages.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-15 17:05:37 +02:00
Takashi Iwai
d0ca075621 Ignore .* files in general
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-10 14:24:59 +02:00
Takashi Iwai
7c5c3ff3de ucm: Add const to execute_cset() argument
Now with the previous rewrite of execute_cset(), the cset string is no
longer modified, thus we can pass const safely.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-10 14:19:17 +02:00
Takashi Iwai
58d10c09e1 ucm: Improve cset command parsing
The cset command parsing in ucm/main.c assumes implicitly that the
argument contains no space, thus an example below wouldn't work:
    cset "name='Input Select' Digital Mic"

This patch introduces a new internal API function
__snd_ctl_ascii_elem_id_parse() to improve the cset parser.

Reported-by: Tanu Kaskinen <tanu.kaskinen@digia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-10 14:14:28 +02:00
Mario Domenech Goulart
c34f74c818 test/latency.c: Fix string argument to getopt_long, so now it handles -E and -B
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-08 16:29:03 +02:00
Tanu Kaskinen
e16a9a04b1 ucm: Return NULL from get_list0() and get_list20() in case of empty lists.
alloc_str_list() sets the result to NULL too, so this patch
makes the behavior more consistent. This also fixes a crash
in PulseAudio, because PulseAudio assumes that
snd_use_case_get_list() always initializes the result, and
since snd_use_case_get_list() uses get_list20(), this
assumption didn't hold.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-01 15:47:27 +02:00
Arun Raghavan
480d3204fe build: Disable another compile chack with --disable-alsatest
Signed-off-by: Arun Raghavan <arun.raghavan@collabora.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-17 14:57:10 +02:00
Arun Raghavan
9e795252c6 ucm: Add missing pthread.h include
Needed for the use of pthread_mutex_t

Signed-off-by: Arun Raghavan <arun.raghavan@collabora.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-17 14:57:10 +02:00
Arun Raghavan
55abbc9fde build: Fallback to alphasort() if versionsort() isn't available
versionsort() is a GNU-ism and can't be relied on for non-GNU systems.

[modified to define SORTFUNC instead of copying lines by tiwai]

Signed-off-by: Arun Raghavan <arun.raghavan@collabora.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-17 14:56:14 +02:00
Arun Raghavan
df924cd9c5 control: Use strcpy() instead of stpcpy()
This allows us to build in environments that don't provide stpcpy().
This makes it necessary to traverse the string twice, but should not be
noticeable in clients since this function is very unlikely to be part of
a performance-critical path.

[coding style fixed by tiwai]

Signed-off-by: Arun Raghavan <arun.raghavan@collabora.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-17 14:55:55 +02:00
Martin Sandsmark
86e27cdbf1 hctl: Remove a useless assert
The case where the element is unavailable (for example gone away since
the event was created) is handled beneath.

See also bug 5471.
	https://bugtrack.alsa-project.org/alsa-bug/view.php?id=5471

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-05 10:09:06 +02:00
Takashi Iwai
52160de21e Fix the binary compatibility of ext-ctl plugin with protocol 1.0.0
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-25 23:16:14 +02:00
Arun Raghavan
e8923f2e75 ucm: Handle repeat device and modifier enables/disables
Currently, enabling a device twice can cause it to be added to
snd_use_case_mgr_t->active_devices twice, causing the list to become a
loop and subsequent uses to result in an infinite loop.

This patch makes sure we don't enable/disable a device twice, and avoid
doing the same for modifiers.

Signed-off-by: Arun Raghavan <arun.raghavan@collabora.co.uk>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-05-29 11:59:26 +02:00
David Henningsson
e4d9c34830 conf: Add more USB devices to S/PDIF blacklist
These devices don't have digital in/out, so prevent them from being
opened.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-05-23 11:03:24 +02:00
Benoît Thébaudeau
70b958f460 tlv: improve robustness of raw value ranges
snd_tlv_convert_from_dB() relies on rangemin/max blindly.
Since this function is exported, it is better for robustness and
consistency to parse the range properly, which this patch does.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-05-23 01:53:28 +02:00
Antonio Borneo
afaffe80d9 pcm_dsnoop: comment fall-through in next "case"
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-05-14 17:58:28 +02:00
Antonio Borneo
b7334b1a81 pcm: add missing "break" in "switch"
A missing "break" in procedure snd_pcm_write_mmap() causes
execution of "case SND_PCM_ACCESS_MMAP_NONINTERLEAVED" to
fall through next "default" case of the "switch" statement.
Since "default" handles error cases, the procedure returns
error.

The error fixed by this patch blocks transfer of capture
data from kernel to application. Execution get stuck in
alsa-lib, that discards all received data.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-05-14 16:55:39 +02:00
John Spencer
1d3f7975f9 Fix invalid long long format specifier
Per POSIX:

       L      Specifies that a following a, A, e, E, f, F, g, or G  conversion
              specifier applies to a long double argument.

L is only intended to be used with long doubles, not long long ints.

the proper way is to use "ll" instead.

Signed-off-by: John Spencer <maillist-alsa@barfooze.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-04-24 15:38:45 +02:00
David Henningsson
bb5c49fa41 alsa-lib conf: Add two more USB devices to iec958 blacklist
Add "Logitech Wireless Headset" and "Logitech Speaker Lapdesk N700" to
the iec958 blacklist.
Also reorder the list in alphabetic order.

BugLink: https://bugs.launchpad.net/bugs/987163
Reported-by: Jean-Baptiste Lallement <jean-baptiste@ubuntu.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-04-23 10:53:40 +02:00
Dylan Reid
a6c50d64d9 control_external: Add ability to specify TLV data.
Allow external control plugins to provide TLV data.  This allows
user-space pcms to specify dB ranges for controls.

This follows the same model as the ALSA drivers for accessing the
data.  The code is based on that implementation.  The control can
provide static data or a callback.  The data is accessed or modified
in the new snd_ctl_ext_elem_tlv callback.

Rev bump the protocol version to enable checking if an external
control supports TLV.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-04-16 10:16:17 +02:00
David Henningsson
ed0e48583f alsa-lib conf: block S/PDIF access for Sennheiser USB headset
The Sennheiser USB headset has no S/PDIF input or output, so make
sure we can't open it that way.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-04-14 21:20:18 +02:00
Adrian Knoth
e5c4c248a1 doc: Fix typo in PCM formats
Of course, 24bit samples are not stored in three bits, but bytes.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-03-28 17:41:36 +02:00
Henning Thielemann
1937247439 seqmid - more descriptions on snd_seq_parse_address() behavior
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-03-14 18:45:02 +01:00
Takashi Iwai
2ab86d96c9 mixer: Remove redundant CHECK_ENUM() from snd_mixer_selem_is_enum*()
The functions to check whether the element is an enum don't need the
extra check of the type.  It should return simply 0 or 1 without error.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-03-13 14:30:22 +01:00
David Henningsson
947d208076 USB-Audio: Fixup card name for Logitech web camera
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>
2012-03-09 14:12:25 +01:00
David Henningsson
1a9627dfe7 USB-Audio: Blacklist iec958 for some USB devices
Some common USB devices are analog only, so prevent the digital
devices from being opened. This simplifies probing the device
in PulseAudio.

I have a "Logitech USB Headset" myself, the "Logitech Web Camera"
was reported by Raymond Yau, and the "Blue Snowball" was reported by
Andy Whitcroft.

Cc: Andy Whitcroft <andy.whitcroft@canonical.com>
Cc: Raymond Yau <superquad.vortex2@gmail.com>
BugLink: https://bugs.launchpad.net/bugs/940145
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-03-09 12:36:44 +01:00
Luke Yelavich
65298d98f3 conf/pcm: Add support for Echo3G devices. Thanks to unimatrix.
BugLink: https://bugs.launchpad.net/bugs/433573

Signed-off-by: Luke Yelavich <luke.yelavich@canonical.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2012-02-08 09:01:39 +01:00
Jaroslav Kysela
c3ed2c9850 Release v1.0.25
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2012-01-25 08:56:56 +01:00
Jaroslav Kysela
98d4ed8810 Introduce --with-pkgconfdir, add 64-bit defaults to gitcompile
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2012-01-20 16:14:44 +01:00