Commit graph

2595 commits

Author SHA1 Message Date
Marc Kleine-Budde
abac6ff1eb configure.in: fix --without-softfloat
Using --without-softfloat or --with-softfloat=no results in using
softfloat. This patch fixes the problem.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-11-16 11:31:23 +01:00
Mads Kiilerich
f75f1da1b7 Update pcm doc strings
This is information I needed and is based on my understanding of information
from Takashi Iwai.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-14 13:49:14 +01:00
Takashi Iwai
4de76c9b06 Remove redefinition of _GNU_SOURCE and __USE_GNU
Now _GNU_SOURCE is already defined globally in configure.in.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-08 09:28:07 +01:00
Takashi Iwai
3440994f68 Fix CHECK_ENUM() in simple.c
simple.c: In function ‘snd_mixer_selem_is_enumerated’:
simple.c:881: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-08 09:26:59 +01:00
Rémi Denis-Courmont
30f59937b1 Define _GNU_SOURCE so that <fcntl.h> gives O_CLOEXEC
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-08 09:23:33 +01:00
Rémi Denis-Courmont
57ce918928 Remove old commented-out FD_CLOEXEC code
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-08 09:23:22 +01:00
Rémi Denis-Courmont
8264b2fd0a Open device nodes with close-on-exec flag
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-08 09:23:07 +01:00
Pedro Lopez-Cabanillas
ef2d3cf747 Defined symbols exposing the hrtimer to applications.
Signed-off-by: Pedro Lopez-Cabanillas <pedro.lopez.cabanillas@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-08 09:21:56 +01:00
Jaroslav Kysela
407e98b4c3 namehint: list card independent devices only once
Card-independent devices such as "null" or "pulse" should only be
added once, not once for each card.

Signed-off-by: John Lindgren <john.lindgren@tds.net>\
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-11-03 16:44:51 +01:00
Jaroslav Kysela
0fcac21756 namehint: Allow snd_device_name_hint to search for CTL devices.
Signed-off-by: John Lindgren <john.lindgren@tds.net>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-11-03 16:42:49 +01:00
Jaroslav Kysela
592bd1e98b namehint: add missing list->card initialization
list->card is wrongly assumed to be initialized, but the previous
initialization is within a conditional that is false when only
card-independent devices are found.  (This is the case when searching
for mixers on my system; the end result is that the "pulse" mixer is
listed three times.)

Signed-off-by: John Lindgren <john.lindgren@tds.net>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-11-03 16:42:44 +01:00
Jaroslav Kysela
0bff868580 Cache libasound.so access in snd_dlopen
Speed up repeated calls to snd_dlopen by caching the path to
libasound.so; this reduces the instructions executed by
snd_device_name_hint by 40 percent.

Signed-off-by: John Lindgren <john.lindgren@tds.net>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-11-03 16:41:09 +01:00
Takashi Iwai
e1c7dd2613 Fix corruption after snd_device_name_hint()
snd_device_name_hint() corrupts the config name space after its call.
This results in the error from the suceeding calls of snd_pcm_open()
after snd_device_name_hint().

The bug is in try_config() in namehint.c; it calls snd_config_delete(res)
but res can be two different objects in the function.  One is the object
obtained via snd_config_search_definition(), and another is the one from
snd_config_search_alias_hooks().  The former is the expanded objects,
thus it should be freed.  But, the latter is a reference, and must not be
freed.

This patch adds the check to free or not.

Reported-by: John Lindgren <john.lindgren@tds.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-03 09:02:39 +01:00
Jaroslav Kysela
0110d62043 hcontrol: fix compare_default function to handle also id.device and id.subdevice
In case when kcontrol differs only by device or subdevice numbers, the
find function can give wrong results.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-10-06 10:46:54 +02:00
Stefan Schmidt
0d81de0bca alisp: Comment out an unused function to avoid compiler warnings.
The function should be useful later so keep it in place and just comment it out
until it is actually used.

Signed-off-by: Stefan Schmidt <stefan@slimlogic.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-30 12:45:43 +02:00
Stefan Schmidt
19f703a774 pcm_rate_linear: Annotate unused function parameter to avoid compiler warnings.
Signed-off-by: Stefan Schmidt <stefan@slimlogic.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-30 12:45:35 +02:00
Stefan Schmidt
aa697c9d51 control: Remove unused variable.
Signed-off-by: Stefan Schmidt <stefan@slimlogic.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-30 08:21:53 +02:00
Stefan Schmidt
97145934f0 configure.in: Add m4 check for new AM_SILENT_RULES
Kbuild like output for automake (>=1.11). It's no hard dependency as it needs
the newest automake, but enable it by default if it is available. To turn it off
you can either use --disable-silent-rules at configure time or make V=0  at
compile time.

Signed-off-by: Stefan Schmidt <stefan@slimlogic.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-30 08:21:42 +02:00
Stefan Schmidt
81ac9f4d48 cvscompile: Remove in favour of gitcompile.
Alsa-lib is no longer hosted in cvs but in git and the only difference between
both helper scripts is the name of the NO_MAKE env VAR check.

Signed-off-by: Stefan Schmidt <stefan@slimlogic.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-30 08:21:29 +02:00
Takashi Iwai
da237814e7 dmix - Fix snd_pcm_info()
Call the slave snd_pcm_info() as long as possible in the direct plugins
(i.e. when the PCM device could be opened with O_APPEND mode).
This allows dmix/dsnoop as a salve for PCM hook controls.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-28 12:02:13 +02:00
Kai Vehmanen
ecf4b5af86 pcm_hw: Always use delay ioctl in snd_pcm_delay()
As the result of snd_pcm_delay() is affected not only by hw_ptr
and appl_ptr, but also by 'runtime->delay' property,
either SNDRV_PCM_IOCTL_DELAY or SNDRV_PCM_IOCTL_STATUS ioctl
must be used to get the correct result.

Previously 'runtime->delay' was ignored in case 'hw->sync_ptr'
was used.

Signed-off-by: Kai Vehmanen <kvehmanen@eca.cx>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-11 09:18:36 +02:00
Jaroslav Kysela
a4e7033f8d Release v1.0.21a
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-09-09 14:34:54 +02:00
Takashi Iwai
cd7070bf4b PCM - Change the hw_params determination order
In snd_pcm_hw_params_choose(), set the buffer size before the period
size and time as default.  This will give more useful configuration for
most of apps, i.e. larger buffer size.

For apps that require the old behavior, now the function checks the
environment variable $LIBASOUND_COMPAT.  If this variable is set to
non-empty, the hw_params is determined in the old way, first period
then buffer sizes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-09 14:16:06 +02:00
Jaroslav Kysela
1f126fd7c6 Change dmix.conf to accept user configuration from defaults.dmix.<driver_id>.xxx
An attempt to fix problem described in reverted patch "Fix driver conf
parsing in snd_config_hook_load_for_all_cards()".

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-09-09 11:40:03 +02:00
Jaroslav Kysela
133819d420 Revert "Fix driver conf parsing in snd_config_hook_load_for_all_cards()"
This reverts commit 96da0c842d.

This way of fix brokes card-specific configuration loading.
See http://bugzilla.redhat.com bug#521988 for details.

Appropriate way to handle this problem is to fix the dmix configuration file.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-09-09 11:24:11 +02:00
Takashi Iwai
ac9de424bc mixer: Add Speaker and Beep names to the weight list
Added strings "Speaker" and "Beep" to the weight list so that the entries
appear in more appropriate positions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-31 16:41:12 +02:00
Jaroslav Kysela
a64f6defd0 Release v1.0.21
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-08-31 15:09:38 +02:00
Takashi Iwai
cbf5675eef pcm/ioplug: fix error code in start callback
When snd_pcm_start() is called in the invalid state, it should return
-EBADFD.  But ioplug plugin returns -EAGAIN.  Let's fix it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-21 01:34:29 +02:00
Takashi Iwai
bd5389278c pcm: workaround for avoiding automatic start in mmap mode
In the normal mmap mode, the stream isn't started automatically even after
the data >= start_threshold has been written.   However, in the
mmap-emulation mode, the stream is started because it uses
snd_pcm_write_areas() internally.

As a workaround for this inconsistency, start_threshold value is changed
dynamically in sw_parmams and mmap_commit callbacks in mmap-emul plugin.
Meanwhile, start_threshold for slave PCM is set to boundary so that only
this plugin (or the one over it) can control the start of the stream.

This will fix problems in some apps using pulse plugin in the mmap mode.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-21 01:23:08 +02:00
Takashi Iwai
96da0c842d Fix driver conf parsing in snd_config_hook_load_for_all_cards()
Reported by Kevin Goodsell.

Summary: load_for_all_cards fails with existing configuration elements

In snd_config_hook_load_for_all_cards, the first call to
snd_config_search attempts to locate an existing configuration node with
the name of the driver.  Typically none is found, and everything is
good. However, if such a node is located, the next line assumes it is a
leaf node with type 'string' and calls snd_config_get_string to fetch
the string value. If this fails, the entire hook is abandoned.

Because of this, setting something like the following in asoundrc:

cards.<driver name>.foo 0

is sufficient to disable the entire card-specific configuration.

As a concrete example, I have a HDA-Intel sound card. dmix.conf includes
a way to set period_size, period_time, and periods by using
configuration elements of the form cards.<driver name>.pcm.dmix.<var>.
In ~/.asoundrc I add

cards.HDA-Intel.pcm.dmix.period_size 1024

This will cause HDA-Intel.conf to fail to load, and the pcm defined in
default.conf will fail to find the device-specific pcm
cards.HDA-Intel.pcm.default, and fall back on the default pcm using
plughw.  By attempting to configure dmix, I have disabled it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-10 14:14:10 +02:00
Clemens Ladisch
34d63b449f control.c: snd_ctl_wait: fix revents handling
The revents parameter of snd_ctl_poll_descriptors_revents() is a single
value, not an array.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2009-08-10 10:11:15 +02:00
Clemens Ladisch
f3dc8e2aa4 timer_query: make ops structure constant
The contents of the snd_timer_query_ops structure are not going to be
changed, so we might as well declare is as constant.  This change avoids
a warning if some ops structure is actually defined as const.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2009-08-10 10:09:02 +02:00
Clemens Ladisch
2905af225f snd_pcm_scope_set_ops: make ops parameter const
The contents of the snd_pcm_scope_ops structure are not going to be
changed, so we might as well declare is as constant.  This change is
backwards compatible, and avoids warnings if some ops structure is
actually defined as const.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2009-08-10 10:08:25 +02:00
Takashi Iwai
79345b523e Fix zero-division in pcm_rate.c
Patch from Debian bug#539454

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-10 09:53:18 +02:00
Clemens Ladisch
5332d74a67 fix doc errors
Fix various errors in the documentation that make doxygen complain.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2009-08-04 09:17:20 +02:00
Clemens Ladisch
0ed67883af doc: hide structs with typedefs
In the documentation, hide structure types that have a corresponding
typedef.  Since doxygen 1.5.4, this is no longer the default when
OPTIMIZE_OUTPUT_FOR_C is set.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2009-08-04 09:15:40 +02:00
Clemens Ladisch
1b4dedc62e doc: fix handling of @top_srcdir@
The value of top_srcdir should be replaced in the config file, not in
the makefile, so we have to escape it in the makefile.

In the default case, the value of top_srcdir is ".." which, when used as
a regular expression, is a little bit too inclusive.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2009-08-04 09:12:39 +02:00
Clemens Ladisch
fa30246096 remove unimplemented functions from headers
Remove some function declarations that are not (no longer) implemented.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2009-08-04 09:11:47 +02:00
Clemens Ladisch
da19588063 add config tests
Add some test for the snd_config_* functions.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2009-08-03 13:35:01 +02:00
Clemens Ladisch
5fe83677b5 conf.c: more documentation
Expand the documentation for the snd_config_* functions.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2009-07-27 10:09:03 +02:00
Clemens Ladisch
930335668a conf.c: rename 'node' to 'config'
Just for consistency with the parameter names of all the other
functions.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2009-07-17 12:41:43 +02:00
Clemens Ladisch
9258e8c851 conf.c: rename 'leaf' to 'child'
Nodes that (might) have children are not leaves.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2009-07-17 12:41:17 +02:00
Clemens Ladisch
9bf79f43c5 conf.c: rename 'father' to 'parent'
I haven't found anything that would make compound nodes specifically
male ...

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2009-07-17 12:40:00 +02:00
Clemens Ladisch
5d56a11a8e conf.c: snd_config_add: prevent adopting a non-orphan
When adding a configuration node to another, check that the child node
does not already have a parent.  Otherwise, the old parent's children
list would become corrupted.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2009-07-15 11:20:29 +02:00
Clemens Ladisch
76c60af00a sound: rawmidi: disable active-sensing-on-close by default
Sending an Active Sensing message when closing a port can interfere with
the following data if the port is reopened and a note-on is sent before
the device's timeout has elapsed.  Therefore, it is better to disable
this setting by default.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2009-07-13 13:53:16 +02:00
Clemens Ladisch
a9b1299556 USB-Audio.conf: fix definition for M-Audio AudioPhile spdif device
Add custom definitions for the AudioPhile "default" and "iec958" devices
so that output and input are routed to the correct PCM device.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2009-07-13 13:28:21 +02:00
Clemens Ladisch
efda3e2bc7 conf.c: fix handling of NULL string values
Make sure that we do not crash when encountering configuration nodes
with a NULL string value, or that at least we run into an assert().

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2009-07-10 07:26:29 +02:00
Clemens Ladisch
e2317969e1 conf.c: snd_config_set_id: prevent duplicate ids
snd_config_add() checks for duplicate ids, but it was possible to create
duplicates by adding a note and changing the id afterwards with
snd_config_set_id(); so we have to add a check there, too.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2009-07-10 07:25:50 +02:00
Clemens Ladisch
2c4b3c7d09 conf.c: fix handling of NULL ids
Make sure that we do not crash when encountering configuration nodes
with a NULL id.  Furthermore, since we cannot avoid having NULL ids
anyway, allow the id of a top-level node to be reset to NULL.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2009-07-09 07:38:26 +02:00
Clemens Ladisch
a7f744888e test/lsb/midi_event.c: check for buffer size check
Add a test to check that snd_midi_event_decode() checks its output
buffer size.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2009-07-08 08:50:54 +02:00