Commit graph

2877 commits

Author SHA1 Message Date
Francesco Cosoleto
a9855efcb9 pcm: fix typo in snd_pcm_recover() error message
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2011-01-23 14:29:40 +01:00
Liam Girdwood
a618cdf057 ucm: fix switch device & modifier when no transition is found
Fix some logic bugs in switch device and switch modifier when
transition sequences are not found. Also fix check for new device.

Reported-by: w0806.kim@samsung.com
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-01-11 19:05:40 +01:00
Jaroslav Kysela
e1b4bd6c89 ucm: add snd_use_case_verb_list() inline function
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2011-01-11 19:05:12 +01:00
Clemens Ladisch
45e9496a7a aliases.conf: add aliases for CMI8788-based cards
Add entries for all the aliases of the CMI8788 chip.
(Not all of them are currently used by the driver.)

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2011-01-10 16:22:15 +01:00
Liam Girdwood
7b259bc00e ucm: ctlparse - always terminate cset buffer
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-22 08:06:35 +01:00
Liam Girdwood
df760d8b31 ucm: fix handling of cset with spaces in the control name
Always terminate the cset command based on the last space found within the
cset command since the control name may contain spaces.
2010-12-22 08:06:28 +01:00
Liam Girdwood
eba5471819 ucm: only select modifier when supported device is enabled
Make sure the supported device of a modifier is enabled before
we enable the modifier.

Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-22 08:06:16 +01:00
Liam Girdwood
265cf2c3ee ucm: implement basic script exec functionality
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-22 08:06:08 +01:00
Liam Girdwood
116fabd603 ucm: check the correct return value for modifier
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-22 08:05:57 +01:00
Liam Girdwood
ebb52f6911 ucm: check for valid value list before dereference.
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-22 08:05:50 +01:00
Liam Girdwood
6cda65ba98 ucm: remove unused code.
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-22 08:05:44 +01:00
Liam Girdwood
02bc123aae ucm: make sure active modifier and device lists are initialised
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-22 08:05:36 +01:00
Liam Girdwood
8524941f2a ucm: remove parse_device() and call parse_compound() directly
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-22 08:05:27 +01:00
Liam Girdwood
868d21cf0a ucm: modifiers names must be compound parse
Modifier names must end in a .index to ensure we can support
same named modifiers. However the modifier index will be for internal
use only and the client will not use the index when setting modifier.

The modifier selection for same name modifiers will be based upon supported
device.

Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-12-22 08:05:18 +01:00
Liam Girdwood
54e9639b62 ucm: removed unused 'active' member in struct use_case_device
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-12-22 08:03:46 +01:00
Jaroslav Kysela
7d3de218ce ucm: initial implementation for cdev/cset
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-11-29 17:33:27 +01:00
Jaroslav Kysela
c0469e2a28 ucm: CTL devices are only one per card (remove DEV from comments)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-11-29 15:49:13 +01:00
Jaroslav Kysela
d8b7816196 ucm: add ValueDefaults section to the master file
- the get_value() function is recoded (tries to find the value in
  parent's list)

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-11-29 15:41:34 +01:00
Pierre-Louis Bossart
aba87e5098 pcm_plugin: fix delay
PulseAudio ALSA modules report errors after calling
snd_pcm_avail_delay(), with a delay lower than the number of samples
available.

Correct delay using Jaroslav's recommendation:
"the result should be 'delay(slave) + mmap_capture_avail(pcm)"

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-11-23 15:59:12 +01:00
Jaroslav Kysela
aaf55f1641 ucm: add cdev
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-11-23 15:58:14 +01:00
Jaroslav Kysela
a4f71b1940 pcm: add MMAP_EMUL to type names
If we try to print this then it causes a read past the end of the array
in snd_pcm_type_name().

From: Dan Carpenter <error27@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-11-23 13:40:25 +01:00
Pierre-Louis Bossart
ade3efbd86 pcm_plugin: remove unused client_frames and slave_frames routines
plug->client_frames and plug->slave_frames are not used by
any plugin, remove dead code.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-11-22 14:53:47 +01:00
Jaroslav Kysela
ba9332e919 pcm: fix snd_pcm_avail_delay() function
For capture stream, the delay must be obtained as last, but we need to
update the ring buffer pointers for the avail_update call. So, rearrange
the code a bit and add hwsync call as first.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-11-18 09:27:07 +01:00
Clemens Ladisch
7c99bd24bc support for period wakeup disabling
Add API to disable period wakeups.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2010-11-15 10:43:13 +01:00
Clemens Ladisch
70dded6aba pcm: pass hw_params flags to slave
Fix required before interrupt disabling routines patch can be applied.
Without this fix, the interrupts are only disabled when directly
accessing hw devices.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2010-11-15 10:33:35 +01:00
Jaroslav Kysela
cdc9dd50bf ucm: fix parser for sequences and fix wrong strcmp
The sequences are not parsed correctly. First cfg value is the command
and second value is the command argument.

Also, fix strcmp calls in ucm/main.c (reported by
abraham duenas <aduejazz@gmail.com>).

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-11-10 16:06:29 +01:00
Clemens Ladisch
ab6df22901 USB-Audio.conf: fix Audiophile USB card name
The device name of the M-Audio AudioPhile USB is actually "Audiophile USB (tm)".
Also keep the old string, just to be sure.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2010-11-10 10:11:51 +01:00
Jaroslav Kysela
9b6df1cf64 control: add ASCII parsers from amixer
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-11-04 19:58:44 +01:00
Jaroslav Kysela
13b5d972d2 pcm direct plugins: change timestamping in dsnoop
Do not use own timestamps, try to sync hw.ptr with real timestamp.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-10-29 17:36:41 +02:00
Jaroslav Kysela
e4083a1182 ucm: debug parser
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-10-26 14:26:46 +02:00
Simon McVittie
5cfa03d2f3 configure.in: don't rely on test -a, not all shells support it
Notably, /bin/sh in older Debian and Ubuntu is dash, which doesn't.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-10-17 11:05:13 +02:00
Simon McVittie
443c105737 Version-check libtool correctly when doing an out-of-tree build
libtool is only created at the end of ./configure, so it doesn't make
sense to grep it in ./configure (the check would always fail the first
time). However, ltmain.sh is copied into the ${srcdir} by libtoolize and
should be safe to check at any time that configure can be run.

Signed-off-by: Simon McVittie <smcv@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-10-17 11:03:57 +02:00
Clemens Ladisch
2f6206da0c tlv: fix returned dB information for min-is-mute controls
For TLV information that indicates that the minimum value is actually
muted, the returned range used the wrong minimum dB value, and
converting dB values to raw control values did not round up correctly
near the minimum.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-10-17 10:44:06 +02:00
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
c6a81e21c0 config file processing: rewrite the locking - use one recursive mutex
Avoid configuration file processing races when multiple threads call
the *open() functions together (for example using alsaloop with
multiple -T jobs can reproduce this issue).

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-10-11 10:34:12 +02:00
Jaroslav Kysela
c049d48407 namehint: Another fix to properly evaluate hw devices
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-10-01 14:08:03 +02:00
Jaroslav Kysela
0244370be6 namehint: Fix hw device evaluation (missing last device)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-10-01 13:31:45 +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
9ce25165dd Fix typo for surround PCMs in src/conf/cards/Loopback.conf
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-09-15 08:11:42 +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
Jaroslav Kysela
72c7260ce6 Add Loopback.conf to define standard PCM devices for snd-aloop driver
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-08-25 09:04:51 +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