alsa-lib.git
7 years agonamehint: Another fix to properly evaluate hw devices
Jaroslav Kysela [Fri, 1 Oct 2010 12:08:03 +0000 (14:08 +0200)]
namehint: Another fix to properly evaluate hw devices

Signed-off-by: Jaroslav Kysela <perex@perex.cz>

7 years agonamehint: Fix hw device evaluation (missing last device)
Jaroslav Kysela [Fri, 1 Oct 2010 11:31:45 +0000 (13:31 +0200)]
namehint: Fix hw device evaluation (missing last device)

Signed-off-by: Jaroslav Kysela <perex@perex.cz>

7 years agoFix typo for surround PCMs in src/conf/cards/Loopback.conf
Jaroslav Kysela [Wed, 15 Sep 2010 06:11:42 +0000 (08:11 +0200)]
Fix typo for surround PCMs in src/conf/cards/Loopback.conf

Signed-off-by: Jaroslav Kysela <perex@perex.cz>

7 years agoAdd Loopback.conf to define standard PCM devices for snd-aloop driver
Jaroslav Kysela [Wed, 25 Aug 2010 07:04:51 +0000 (09:04 +0200)]
Add Loopback.conf to define standard PCM devices for snd-aloop driver

Signed-off-by: Jaroslav Kysela <perex@perex.cz>

7 years agogeneral: recoded snd_dlobj_ functions
Jaroslav Kysela [Mon, 23 Aug 2010 15:05:36 +0000 (17:05 +0200)]
general: recoded snd_dlobj_ functions

- changed logic to get/put blocks
- added mutex locking of the symbol list
- added reference counting (do not free used dl handles)

Signed-off-by: Jaroslav Kysela <perex@perex.cz>

7 years agoHDA-Intel: do not lock IEC958 Playback switch
Pierre-Louis Bossart [Fri, 20 Aug 2010 01:42:30 +0000 (20:42 -0500)]
HDA-Intel: do not lock IEC958 Playback switch

As discussed with Takashi, removing the lock allows apps to mute
the output using the mixer interface.
Other AES controls remain locked.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agonamehint: Evaluate more possibilities for hw devices
Jaroslav Kysela [Fri, 20 Aug 2010 08:31:17 +0000 (10:31 +0200)]
namehint: Evaluate more possibilities for hw devices

This tries to fix the issue when logical device indexes does not match the
hardware device indexes (like hdmi -> 0:3, 1:7, 2:8, 3:9).

Signed-off-by: Jaroslav Kysela <perex@perex.cz>

8 years agoAdd missing support for 3-byte formats for 16bit put conversion
Takashi Iwai [Fri, 13 Aug 2010 14:11:36 +0000 (16:11 +0200)]
Add missing support for 3-byte formats for 16bit put conversion

In the put conversion, the support for 3-byte formats was missing.
This resulted in inaudible volume with rate plugin & co.

Typos fixed by Mark Hills <mark@pogo.org.uk>

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agopcm: Fixed typo (wrong deleted line) instroduced in the minperiodsize patch
Jaroslav Kysela [Thu, 12 Aug 2010 06:21:26 +0000 (08:21 +0200)]
pcm: Fixed typo (wrong deleted line) instroduced in the minperiodsize patch

Signed-off-by: Jaroslav Kysela <perex@perex.cz>

8 years agopcm: introduce defaults.pcm.compat to change the params choose behaviour
Jaroslav Kysela [Wed, 11 Aug 2010 18:20:40 +0000 (20:20 +0200)]
pcm: introduce defaults.pcm.compat to change the params choose behaviour

Having getenv directly in the function is not a good idea. Allow
configuration of the behaviour change in snd_pcm_param_choose() function
using alsa.conf. Use the environment variable LIBASOUND_COMPAT only
as fallback.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>

8 years agopcm: add defaults.pcm.minperiodtime parsing
Jaroslav Kysela [Wed, 11 Aug 2010 17:45:40 +0000 (19:45 +0200)]
pcm: add defaults.pcm.minperiodtime parsing

Some broken applications like Audacious don't set any timing parameters.
While the alsa-lib behaviour is to select the smallest period size and
biggest buffer size, the result is the generation of thousands
interrupts per second.

The default value in alsa.conf is 5000usec.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>

8 years agoHDA-Intel: present all 4 HDMI outputs instead of just the first one
Anssi Hannula [Tue, 3 Aug 2010 17:27:49 +0000 (20:27 +0300)]
HDA-Intel: present all 4 HDMI outputs instead of just the first one

Commit 92608badc519a8c1f65d93743396517aaa582b53 in linux kernel added
the possibility of 3 additional HDMI devices on indexes 7-9.

Present all those additional devices using the "hdmi" alias as well.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agotest/latency: fix timediff calculation
Jaroslav Kysela [Wed, 4 Aug 2010 17:47:01 +0000 (19:47 +0200)]
test/latency: fix timediff calculation

Signed-off-by: Jaroslav Kysela <perex@perex.cz>

8 years agopcm_plug: fix comparison always true
Anssi Hannula [Mon, 2 Aug 2010 15:50:08 +0000 (18:50 +0300)]
pcm_plug: fix comparison always true

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agopcm - ladspa: fix small memory leak in snd_pcm_ladspa_free_instances()
Jaroslav Kysela [Thu, 22 Jul 2010 09:33:20 +0000 (11:33 +0200)]
pcm - ladspa: fix small memory leak in snd_pcm_ladspa_free_instances()

Signed-off-by: Jaroslav Kysela <perex@perex.cz>

8 years agoMemory leak in namehint.c
John Lindgren [Tue, 20 Jul 2010 22:38:37 +0000 (00:38 +0200)]
Memory leak in namehint.c

Get_card_name() can be called more than once on the same list, so it
must free the previous list->cardname before replacing it.

Signed-off-by: John Lindgren <john.lindgren@tds.net>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>

8 years agotlv: Remove tailing tab after snd_ctl_get_dB_range function
Peter Ujfalusi [Tue, 20 Jul 2010 07:34:54 +0000 (10:34 +0300)]
tlv: Remove tailing tab after snd_ctl_get_dB_range function

Cosmetic fix.
There was a tab instead of new line after snd_ctl_get_dB_range
function.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agotlv: Handle 'holes' in SND_CTL_TLVT_DB_RANGE array
Peter Ujfalusi [Tue, 20 Jul 2010 07:34:53 +0000 (10:34 +0300)]
tlv: Handle 'holes' in SND_CTL_TLVT_DB_RANGE array

When converting from dB to raw value, and DB_RANGE is
used with non overlapping map, dB value in between the
sub ranges will be not found.

For example, if the control has the following:
0: -10dB
1: -5dB
2: 0dB
3: 2dB
4: 4dB

static const unsigned int nonoverlapping_tlv[] = {
        TLV_DB_RANGE_HEAD(2),
        0, 2, TLV_DB_SCALE_ITEM(-1000, 500, 0),
        3, 4, TLV_DB_SCALE_ITEM(200, 200, 0),
};

Range 1: -10 .. 0dB
Range 2: 2 .. 4dB

If user asks for 1dB the snd_tlv_convert_from_dB will not find
the raw value, since the 1dB is not part of either range.

To fix this, we will store the previous non maching range's
maximum raw value. If the dB value is not found in the next range,
we will check, if the requested dB value is in between the current
and the previous range, and if it is than pick the apropriate raw
value based on the xdir (up or down rounding).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agotlv: Check out of range dB with SND_CTL_TLVT_DB_RANGE
Peter Ujfalusi [Tue, 20 Jul 2010 07:34:52 +0000 (10:34 +0300)]
tlv: Check out of range dB with SND_CTL_TLVT_DB_RANGE

When converting from dB value to raw value, the control's
full range was not checked in case of SND_CTL_TLVT_DB_RANGE.

Check out of range dB values, and return apropriate raw
value for the caller.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoalisp - Fix a string format ambiguity
Colin Guthrie [Sun, 28 Feb 2010 22:25:26 +0000 (22:25 +0000)]
alisp - Fix a string format ambiguity

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agocontrol: tlv: Check dB range only within the control's volume range
Peter Ujfalusi [Wed, 19 May 2010 06:19:26 +0000 (08:19 +0200)]
control: tlv: Check dB range only within the control's volume range

The DB_RANGE need to be used on some HW, since the gain on
volume control is not continuous, and has to be divided into
several sub DB_SCALE ranges.
ASoC has a feature to override the HW default volume range,
and in this case when the volume range is less than the
HW maximum we do not need to go through the whole DB_RANGE,
but we need to stop where the kcontrol's maximum tell us.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>

8 years agoseq: Fix for snd_seq_parse_address()
Pedro Lopez-Cabanillas [Thu, 22 Apr 2010 13:42:20 +0000 (15:42 +0200)]
seq: Fix for snd_seq_parse_address()

snd_seq_parse_address() uses strncmp() to compare the client name
in the string argument with the existing clients, until it finds one
name matching the same leading characters. This may produce wrong
results when there are two sequencer clients with similar names.

Example: "KMidimon" : "Kmid"

Signed-off-by: Pedro Lopez-Cabanillas <pedro.lopez.cabanillas@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>

8 years agoUse thread-safe locale functions if available
Rémi Denis-Courmont [Wed, 21 Apr 2010 16:37:48 +0000 (18:37 +0200)]
Use thread-safe locale functions if available

setlocale() is not thread-safe. It can actually trigger a crash if
another thread uses locale informations at the same time in the process.
Library code should use POSIX newlocale/duplocale/uselocale/freelocale
instead. Those functions only change the locale data for the calling
thread.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>

8 years agoCheck for thread-specific locale support
Rémi Denis-Courmont [Wed, 21 Apr 2010 16:37:47 +0000 (18:37 +0200)]
Check for thread-specific locale support

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>

8 years agoRelease v1.0.23 v1.0.23
Jaroslav Kysela [Fri, 16 Apr 2010 11:11:05 +0000 (13:11 +0200)]
Release v1.0.23

Signed-off-by: Jaroslav Kysela <perex@perex.cz>

8 years agopcm_share plugin: fix pcm->monotonic setup in open() function
Jaroslav Kysela [Tue, 13 Apr 2010 08:08:56 +0000 (10:08 +0200)]
pcm_share plugin: fix pcm->monotonic setup in open() function

Signed-off-by: Jaroslav Kysela <perex@perex.cz>

8 years agopcm_hw - show errno codes
Jaroslav Kysela [Wed, 10 Mar 2010 08:40:02 +0000 (09:40 +0100)]
pcm_hw - show errno codes

Signed-off-by: Jaroslav Kysela <perex@perex.cz>

8 years agopcm direct plugins: drain() call might be blocked when threads are used
Jaroslav Kysela [Wed, 3 Mar 2010 09:58:53 +0000 (10:58 +0100)]
pcm direct plugins: drain() call might be blocked when threads are used

Add SETUP state checks and do modifications according latest ALSA driver
(passing wrong event identification).

ALSA bug#4914

Signed-off-by: Jaroslav Kysela <perex@perex.cz>

8 years agopcm_dmix: add support for S24_LE format
Jaroslav Kysela [Tue, 2 Mar 2010 13:01:32 +0000 (14:01 +0100)]
pcm_dmix: add support for S24_LE format

From: Bart De Vos <bart_dv@eia.be>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>

8 years agoFix snd_pcm_sw_params_set_period_event() implementation
Jaroslav Kysela [Tue, 23 Feb 2010 09:58:00 +0000 (10:58 +0100)]
Fix snd_pcm_sw_params_set_period_event() implementation

Fix the PCM timer open subdevice number in the pcm_hw plugin.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>

8 years agopcm: fix read_areas and write_areas
Jaroslav Kysela [Sun, 31 Jan 2010 08:40:08 +0000 (09:40 +0100)]
pcm: fix read_areas and write_areas

The stream state was wrongly updated and handled.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>

8 years agomodem.conf Off-hook improve behavior
David Fries [Fri, 25 Dec 2009 20:22:38 +0000 (14:22 -0600)]
modem.conf Off-hook improve behavior

Only restore the old value if it differs from the requested
value, because if it has changed restoring the old value
overrides the change.  Take for example, a voice modem with
a .conf that sets preserve off-hook.  Start playback (on-hook
to off-hook), start record (off-hook to off-hook), stop
playback (off-hook to restore on-hook), stop record (on-hook
to restore off-hook), Clearly you don't want to leave the
modem "on the phone" now that there isn't any playback or
recording active.

Signed-off-by: David Fries <david@fries.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoadd atomic operations for Blackfin parts
Mike Frysinger [Sun, 17 Jan 2010 21:55:03 +0000 (16:55 -0500)]
add atomic operations for Blackfin parts

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agopcm: Fix the sound distortions for S24_3LE stream in pcm_softvol plugin
Zerg Cannibal [Mon, 21 Dec 2009 21:19:14 +0000 (22:19 +0100)]
pcm: Fix the sound distortions for S24_3LE stream in pcm_softvol plugin

This patch fixes sound distortions in alsa-lib "softvol"
for S24_3LE sound stream, when softvol slider is not at 0.0dB
position.

Signed-off-by: CannibalZerg <cnb_zerg@yahoo.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>

8 years agopcm: Close event timer in pcm_hw plugin
Jaroslav Kysela [Mon, 21 Dec 2009 08:09:42 +0000 (09:09 +0100)]
pcm: Close event timer in pcm_hw plugin

Dan McCombs discovered that snd_pcm_close() invocations are not leading
to associated timers being closed, which results in successively more
timers being created but not freed.

Original patch from Daniel T Chen <crimsun@ubuntu.com>.

BugLink: https://bugs.launchpad.net/bugs/451893

Signed-off-by: Jaroslav Kysela <perex@perex.cz>

8 years agoRelease v1.0.22 v1.0.22
Jaroslav Kysela [Wed, 16 Dec 2009 15:18:51 +0000 (16:18 +0100)]
Release v1.0.22

Signed-off-by: Jaroslav Kysela <perex@perex.cz>

8 years agomixer: fix enum check
Clemens Ladisch [Mon, 23 Nov 2009 09:56:46 +0000 (10:56 +0100)]
mixer: fix enum check

The recent CHECK_ENUM fix uncovered a bug in snd_mixer_selem_is_enumerated()
which would now return -EINVAL for any non-enum control, which would be
interpreted as 'true' by callers like amixer or alsamixer.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>

8 years agosimple_none.c uses HAVE_SOFT_FLOAT it has to include config.h
Michael Olbrich [Mon, 16 Nov 2009 10:31:49 +0000 (11:31 +0100)]
simple_none.c uses HAVE_SOFT_FLOAT it has to include config.h
for this to work properly.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>

8 years agoconfigure.in: fix --without-softfloat
Marc Kleine-Budde [Mon, 16 Nov 2009 10:14:54 +0000 (11:14 +0100)]
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>

8 years agoUpdate pcm doc strings
Mads Kiilerich [Sat, 14 Nov 2009 12:48:25 +0000 (13:48 +0100)]
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>

8 years agoRemove redefinition of _GNU_SOURCE and __USE_GNU
Takashi Iwai [Sun, 8 Nov 2009 08:28:07 +0000 (09:28 +0100)]
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>

8 years agoFix CHECK_ENUM() in simple.c
Takashi Iwai [Sun, 8 Nov 2009 08:26:23 +0000 (09:26 +0100)]
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>

8 years agoDefine _GNU_SOURCE so that <fcntl.h> gives O_CLOEXEC
Rémi Denis-Courmont [Thu, 5 Nov 2009 19:17:42 +0000 (21:17 +0200)]
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>

8 years agoRemove old commented-out FD_CLOEXEC code
Rémi Denis-Courmont [Thu, 5 Nov 2009 19:17:41 +0000 (21:17 +0200)]
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>

8 years agoOpen device nodes with close-on-exec flag
Rémi Denis-Courmont [Sat, 7 Nov 2009 19:29:23 +0000 (21:29 +0200)]
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>

8 years agoDefined symbols exposing the hrtimer to applications.
Pedro Lopez-Cabanillas [Sat, 7 Nov 2009 23:01:06 +0000 (00:01 +0100)]
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>

8 years agonamehint: list card independent devices only once
Jaroslav Kysela [Tue, 3 Nov 2009 15:44:51 +0000 (16:44 +0100)]
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>

8 years agonamehint: Allow snd_device_name_hint to search for CTL devices.
Jaroslav Kysela [Tue, 3 Nov 2009 15:38:30 +0000 (16:38 +0100)]
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>

8 years agonamehint: add missing list->card initialization
Jaroslav Kysela [Tue, 3 Nov 2009 15:36:55 +0000 (16:36 +0100)]
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>

8 years agoCache libasound.so access in snd_dlopen
Jaroslav Kysela [Tue, 3 Nov 2009 15:34:34 +0000 (16:34 +0100)]
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>

8 years agoFix corruption after snd_device_name_hint()
Takashi Iwai [Tue, 3 Nov 2009 07:57:10 +0000 (08:57 +0100)]
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>

8 years agohcontrol: fix compare_default function to handle also id.device and id.subdevice
Jaroslav Kysela [Tue, 6 Oct 2009 08:46:54 +0000 (10:46 +0200)]
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>

8 years agoalisp: Comment out an unused function to avoid compiler warnings.
Stefan Schmidt [Wed, 30 Sep 2009 10:36:14 +0000 (12:36 +0200)]
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>

8 years agopcm_rate_linear: Annotate unused function parameter to avoid compiler warnings.
Stefan Schmidt [Wed, 30 Sep 2009 10:36:13 +0000 (12:36 +0200)]
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>

8 years agocontrol: Remove unused variable.
Stefan Schmidt [Tue, 29 Sep 2009 21:48:21 +0000 (23:48 +0200)]
control: Remove unused variable.

Signed-off-by: Stefan Schmidt <stefan@slimlogic.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoconfigure.in: Add m4 check for new AM_SILENT_RULES
Stefan Schmidt [Tue, 29 Sep 2009 21:48:20 +0000 (23:48 +0200)]
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>

8 years agocvscompile: Remove in favour of gitcompile.
Stefan Schmidt [Tue, 29 Sep 2009 21:48:19 +0000 (23:48 +0200)]
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>

8 years agodmix - Fix snd_pcm_info()
Takashi Iwai [Mon, 28 Sep 2009 09:59:50 +0000 (11:59 +0200)]
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>

8 years agopcm_hw: Always use delay ioctl in snd_pcm_delay()
Kai Vehmanen [Thu, 10 Sep 2009 22:07:21 +0000 (01:07 +0300)]
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>

8 years agoRelease v1.0.21a v1.0.21a
Jaroslav Kysela [Wed, 9 Sep 2009 12:34:54 +0000 (14:34 +0200)]
Release v1.0.21a

Signed-off-by: Jaroslav Kysela <perex@perex.cz>

8 years agoPCM - Change the hw_params determination order
Takashi Iwai [Wed, 9 Sep 2009 12:16:06 +0000 (14:16 +0200)]
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>

8 years agoChange dmix.conf to accept user configuration from defaults.dmix.<driver_id>.xxx
Jaroslav Kysela [Wed, 9 Sep 2009 09:38:11 +0000 (11:38 +0200)]
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>

8 years agoRevert "Fix driver conf parsing in snd_config_hook_load_for_all_cards()"
Jaroslav Kysela [Wed, 9 Sep 2009 09:24:11 +0000 (11:24 +0200)]
Revert "Fix driver conf parsing in snd_config_hook_load_for_all_cards()"

This reverts commit 96da0c842d14b40ce8e37726b259229634b3aa21.

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>

8 years agomixer: Add Speaker and Beep names to the weight list
Takashi Iwai [Mon, 31 Aug 2009 14:41:12 +0000 (16:41 +0200)]
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>

8 years agoRelease v1.0.21 v1.0.21
Jaroslav Kysela [Mon, 31 Aug 2009 13:09:38 +0000 (15:09 +0200)]
Release v1.0.21

Signed-off-by: Jaroslav Kysela <perex@perex.cz>

8 years agopcm/ioplug: fix error code in start callback
Takashi Iwai [Thu, 20 Aug 2009 23:34:29 +0000 (01:34 +0200)]
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>

8 years agopcm: workaround for avoiding automatic start in mmap mode
Takashi Iwai [Thu, 20 Aug 2009 23:18:00 +0000 (01:18 +0200)]
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>

9 years agoFix driver conf parsing in snd_config_hook_load_for_all_cards()
Takashi Iwai [Mon, 10 Aug 2009 12:11:57 +0000 (14:11 +0200)]
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>

9 years agocontrol.c: snd_ctl_wait: fix revents handling
Clemens Ladisch [Mon, 10 Aug 2009 08:11:15 +0000 (10:11 +0200)]
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>

9 years agotimer_query: make ops structure constant
Clemens Ladisch [Mon, 10 Aug 2009 08:09:02 +0000 (10:09 +0200)]
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>

9 years agosnd_pcm_scope_set_ops: make ops parameter const
Clemens Ladisch [Mon, 10 Aug 2009 08:08:25 +0000 (10:08 +0200)]
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>

9 years agoFix zero-division in pcm_rate.c
Takashi Iwai [Mon, 10 Aug 2009 07:53:18 +0000 (09:53 +0200)]
Fix zero-division in pcm_rate.c

Patch from Debian bug#539454

Signed-off-by: Takashi Iwai <tiwai@suse.de>

9 years agofix doc errors
Clemens Ladisch [Tue, 4 Aug 2009 07:17:20 +0000 (09:17 +0200)]
fix doc errors

Fix various errors in the documentation that make doxygen complain.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>

9 years agodoc: hide structs with typedefs
Clemens Ladisch [Tue, 4 Aug 2009 07:15:40 +0000 (09:15 +0200)]
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>

9 years agodoc: fix handling of @top_srcdir@
Clemens Ladisch [Tue, 4 Aug 2009 07:12:39 +0000 (09:12 +0200)]
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>

9 years agoremove unimplemented functions from headers
Clemens Ladisch [Tue, 4 Aug 2009 07:11:47 +0000 (09:11 +0200)]
remove unimplemented functions from headers

Remove some function declarations that are not (no longer) implemented.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>

9 years agoadd config tests
Clemens Ladisch [Mon, 3 Aug 2009 11:35:01 +0000 (13:35 +0200)]
add config tests

Add some test for the snd_config_* functions.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>

9 years agoconf.c: more documentation
Clemens Ladisch [Mon, 27 Jul 2009 08:09:03 +0000 (10:09 +0200)]
conf.c: more documentation

Expand the documentation for the snd_config_* functions.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>

9 years agoconf.c: rename 'node' to 'config'
Clemens Ladisch [Fri, 17 Jul 2009 10:41:43 +0000 (12:41 +0200)]
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>

9 years agoconf.c: rename 'leaf' to 'child'
Clemens Ladisch [Fri, 17 Jul 2009 10:41:17 +0000 (12:41 +0200)]
conf.c: rename 'leaf' to 'child'

Nodes that (might) have children are not leaves.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>

9 years agoconf.c: rename 'father' to 'parent'
Clemens Ladisch [Fri, 17 Jul 2009 10:40:00 +0000 (12:40 +0200)]
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>

9 years agoconf.c: snd_config_add: prevent adopting a non-orphan
Clemens Ladisch [Wed, 15 Jul 2009 09:20:29 +0000 (11:20 +0200)]
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>

9 years agosound: rawmidi: disable active-sensing-on-close by default
Clemens Ladisch [Mon, 13 Jul 2009 11:53:16 +0000 (13:53 +0200)]
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>

9 years agoUSB-Audio.conf: fix definition for M-Audio AudioPhile spdif device
Clemens Ladisch [Mon, 13 Jul 2009 11:28:21 +0000 (13:28 +0200)]
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>

9 years agoconf.c: fix handling of NULL string values
Clemens Ladisch [Fri, 10 Jul 2009 05:26:29 +0000 (07:26 +0200)]
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>

9 years agoconf.c: snd_config_set_id: prevent duplicate ids
Clemens Ladisch [Fri, 10 Jul 2009 05:25:50 +0000 (07:25 +0200)]
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>

9 years agoconf.c: fix handling of NULL ids
Clemens Ladisch [Thu, 9 Jul 2009 05:38:26 +0000 (07:38 +0200)]
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>

9 years agotest/lsb/midi_event.c: check for buffer size check
Clemens Ladisch [Wed, 8 Jul 2009 06:50:54 +0000 (08:50 +0200)]
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>

9 years agotest/lsb/midi_event.c: abort on fatal errors
Clemens Ladisch [Wed, 8 Jul 2009 06:50:19 +0000 (08:50 +0200)]
test/lsb/midi_event.c: abort on fatal errors

If snd_midi_event_fails(), we cannot use the object and must abort the
current test.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>

9 years agoMerge branch 'master' of git@git.alsa-project.org:alsa-lib
Takashi Iwai [Mon, 6 Jul 2009 10:31:53 +0000 (12:31 +0200)]
Merge branch 'master' of git@git.alsa-project.org:alsa-lib

9 years agotest/pcm.c: float format support
Takashi Iwai [Mon, 6 Jul 2009 06:56:53 +0000 (08:56 +0200)]
test/pcm.c: float format support

Signed-off-by: Takashi Iwai <tiwai@suse.de>

9 years agoadd midi event tests
Clemens Ladisch [Mon, 6 Jul 2009 10:00:04 +0000 (12:00 +0200)]
add midi event tests

Add some tests for the snd_midi_event_* functions.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>

9 years agomore midi_event documentation
Clemens Ladisch [Mon, 6 Jul 2009 09:55:31 +0000 (11:55 +0200)]
more midi_event documentation

Expand the documentation for the snd_midi_event_* functions.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>

9 years agotest/pcm.c: Generic linear PCM support
Takashi Iwai [Mon, 6 Jul 2009 06:42:18 +0000 (08:42 +0200)]
test/pcm.c: Generic linear PCM support

- Fix the support of non-native endianness
- Conversion for unsigned formats
- Only allow linear formats

Signed-off-by: Takashi Iwai <tiwai@suse.de>

9 years agotest/pcm.c: Fix S24 format
Takashi Iwai [Mon, 6 Jul 2009 06:41:00 +0000 (08:41 +0200)]
test/pcm.c: Fix S24 format

S24 format has different bit width and physical width.
For calculating the byte offset for big-endian packing, the latter value
has to be used.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

9 years agotest/pcm.c: Sample generation on big endian platforms was broken.
Kenneth Johansson [Fri, 3 Jul 2009 20:31:38 +0000 (22:31 +0200)]
test/pcm.c: Sample generation on big endian platforms was broken.

Has not worked since commit 3d1fa924906996463ac33cba5b5143f762d913cf

Signed-off-by: Kenneth Johansson <kenneth@southpole.se>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

9 years agopcm_hooks: cosmetic removal of unused variables
Paul Fertser [Tue, 30 Jun 2009 11:18:36 +0000 (15:18 +0400)]
pcm_hooks: cosmetic removal of unused variables

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

9 years agoManage dlobj lifetime in pcm_hooks.c
Takashi Iwai [Tue, 30 Jun 2009 09:11:34 +0000 (11:11 +0200)]
Manage dlobj lifetime in pcm_hooks.c

The shared object may be still needed depending on the implementation
of hook-installation functions.  When any hooks are registered in the
installation function, the dlobj has to be kept opened until closing
the PCM instance.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

9 years agoMerge branch 'master' of git@git.alsa-project.org:alsa-lib
Takashi Iwai [Wed, 24 Jun 2009 10:25:47 +0000 (12:25 +0200)]
Merge branch 'master' of git@git.alsa-project.org:alsa-lib

9 years agoseq_midi_event: fix decoding of (N)RPN events
Clemens Ladisch [Mon, 22 Jun 2009 08:00:46 +0000 (10:00 +0200)]
seq_midi_event: fix decoding of (N)RPN events

When decoding (N)RPN sequencer events into raw MIDI commands, the
extra_decode_xrpn() function had accidentally swapped the MSB and LSB
controller values of both the parameter number and the data value.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>