Commit graph

2639 commits

Author SHA1 Message Date
Jaroslav Kysela
e820866637 ucm: implemented card list feature
- also added some test files to test/ucm tree

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-10-13 11:48:52 +02:00
Jaroslav Kysela
3a34394508 ucm: unify snd_use_case_geti(), add snd_use_case_card_list() template
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-10-12 13:29:05 +02:00
Jaroslav Kysela
0ae6c43b86 ucm: cosmetic fix
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-10-01 13:30:59 +02:00
Jaroslav Kysela
6c6dc230bc ucm: added implementation for other ucm parts, only card name list is missing
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-09-22 15:35:11 +02:00
Jaroslav Kysela
404cd090b2 ucm: Introduce "Value {}" section, more implementation work
- new "Value {}" section is introduced for read-only values
  describing the PCM and control/mixer IDs (or any other
  things)
- more complete implementation for API functions

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-09-22 14:31:15 +02:00
Jaroslav Kysela
1c79fad969 ucm: Moved ucm to src/ucm subdirectory
- separate code to more files
- use standard lists to represent structures
- use alsa-lib configuration parser

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-09-15 08:09:31 +02:00
Jaroslav Kysela
fcc9adb260 ucm: Recode header to be more universal
- merge all similar functions to one - make everything
  string based
- add possibility to create virtual cards
- add comment pairs for the end user interface

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-08-25 09:42:58 +02:00
Liam Girdwood
1c5afdb0c1 ucm: build - add build support for Use Case Manager
Add doxygen and make support for UCM.

CC: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Justin Xu <justinx@slimlogic.co.uk>
Signed-off-by: Stefan Schmidt <stefan@slimlogic.co.uk>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-23 20:05:45 +02:00
Liam Girdwood
7699c92bd4 ucm: core - Add initial Use Case Manager support.
This patch adds audio Use Case management support to alsa-lib.

UCM is designed to abstract the audio device hardware mixer controls into
high level abstract use cases.

The use case manager works by configuring the sound card ALSA kcontrols to
change the hardware digital and analog audio routing to match the requested
device use case. The use case manager kcontrol configurations are stored in
easy to modify text files.

UCM development has been kindly sponsored by Texas Instruments Inc,
Wolfson Microelectronics PLC and Slimlogic Ltd.

CC: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Stefan Schmidt <stefan@slimlogic.co.uk>
Signed-off-by: Justin Xu <justinx@slimlogic.co.uk>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-23 20:05:35 +02:00
Liam Girdwood
4adb3c325b ucm: header - ALSA Use Case Manager
This patch adds the API header for alsa-lib Use Case Management support.

This file defines the public interface exported by UCM to client
applications.

UCM development has been kindly sponsored by Texas Instruments Inc,
Wolfson Microelectronics PLC and Slimlogic Ltd.

CC: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Stefan Schmidt <stefan@slimlogic.co.uk>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Justin Xu <justinx@slimlogic.co.uk>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-23 20:05:23 +02:00
Jaroslav Kysela
91c9c8f1b8 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>
2010-08-23 17:10:16 +02:00
Pierre-Louis Bossart
be06ab3ee7 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>
2010-08-23 12:24:33 +02:00
Jaroslav Kysela
97d25c0766 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>
2010-08-20 10:33:32 +02:00
Takashi Iwai
18b377dec2 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>
2010-08-13 16:11:36 +02:00
Jaroslav Kysela
0633a96636 pcm: Fixed typo (wrong deleted line) instroduced in the minperiodsize patch
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-08-12 08:21:26 +02:00
Jaroslav Kysela
de606e9c25 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>
2010-08-11 20:20:40 +02:00
Jaroslav Kysela
09879a4bb5 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>
2010-08-11 19:55:15 +02:00
Anssi Hannula
e6d5dcf1f6 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>
2010-08-09 09:40:40 +02:00
Jaroslav Kysela
eb3768563a test/latency: fix timediff calculation
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-08-04 19:48:00 +02:00
Anssi Hannula
db7545a077 pcm_plug: fix comparison always true
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-08-02 18:21:05 +02:00
Jaroslav Kysela
3f589c9369 pcm - ladspa: fix small memory leak in snd_pcm_ladspa_free_instances()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-07-22 11:33:20 +02:00
John Lindgren
8dde984237 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>
2010-07-21 09:28:18 +02:00
Peter Ujfalusi
2a94d80407 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>
2010-07-20 12:56:03 +02:00
Peter Ujfalusi
d81ce4ea7a 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>
2010-07-20 12:55:51 +02:00
Peter Ujfalusi
16a2cad39b 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>
2010-07-20 12:55:41 +02:00
Colin Guthrie
191c57805a alisp - Fix a string format ambiguity
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-27 10:17:04 +02:00
Peter Ujfalusi
30ad5ed040 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>
2010-05-19 12:39:10 +02:00
Pedro Lopez-Cabanillas
1989233449 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>
2010-04-22 16:08:14 +02:00
Rémi Denis-Courmont
8d80d5f344 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>
2010-04-21 19:20:39 +02:00
Rémi Denis-Courmont
51ef640cee Check for thread-specific locale support
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-04-21 19:20:00 +02:00
Jaroslav Kysela
aadcbabdb6 Release v1.0.23
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-04-16 13:11:05 +02:00
Jaroslav Kysela
7a2cdb33c4 pcm_share plugin: fix pcm->monotonic setup in open() function
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-04-13 10:08:56 +02:00
Jaroslav Kysela
a55e1ded99 pcm_hw - show errno codes
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-03-10 09:40:02 +01:00
Jaroslav Kysela
b9dbee694a 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>
2010-03-03 10:58:53 +01:00
Jaroslav Kysela
7fd0d9f423 pcm_dmix: add support for S24_LE format
From: Bart De Vos <bart_dv@eia.be>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-03-02 14:01:32 +01:00
Jaroslav Kysela
f171347508 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>
2010-02-23 10:58:00 +01:00
Jaroslav Kysela
2e48439ad9 pcm: fix read_areas and write_areas
The stream state was wrongly updated and handled.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-01-31 09:43:45 +01:00
David Fries
63acb87329 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>
2010-01-22 11:45:35 +01:00
Mike Frysinger
d3c6e2b097 add atomic operations for Blackfin parts
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-01-18 08:35:57 +01:00
Zerg Cannibal
bdf80e58af 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>
2009-12-21 22:20:46 +01:00
Jaroslav Kysela
a256766c10 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>
2009-12-21 09:09:42 +01:00
Jaroslav Kysela
8a4127b549 Release v1.0.22
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-12-16 16:18:51 +01:00
Clemens Ladisch
762fe145e9 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>
2009-11-23 10:56:46 +01:00
Michael Olbrich
13af48843d 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>
2009-11-16 11:31:53 +01:00
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