summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* ucm: fix switch device & modifier when no transition is founducmLiam Girdwood2011-01-111-3/+3
| | | | | | | | 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>
* ucm: add snd_use_case_verb_list() inline functionJaroslav Kysela2011-01-111-1/+12
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: ctlparse - always terminate cset bufferLiam Girdwood2010-12-221-1/+1
| | | | Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* ucm: fix handling of cset with spaces in the control nameLiam Girdwood2010-12-221-1/+1
| | | | | Always terminate the cset command based on the last space found within the cset command since the control name may contain spaces.
* ucm: only select modifier when supported device is enabledLiam Girdwood2010-12-221-10/+44
| | | | | | | Make sure the supported device of a modifier is enabled before we enable the modifier. Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* ucm: implement basic script exec functionalityLiam Girdwood2010-12-221-1/+3
| | | | Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* ucm: check the correct return value for modifierLiam Girdwood2010-12-221-1/+1
| | | | Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* ucm: check for valid value list before dereference.Liam Girdwood2010-12-221-0/+3
| | | | Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* ucm: remove unused code.Liam Girdwood2010-12-221-2/+0
| | | | Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* ucm: make sure active modifier and device lists are initialisedLiam Girdwood2010-12-221-0/+2
| | | | Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* ucm: remove parse_device() and call parse_compound() directlyLiam Girdwood2010-12-221-8/+2
| | | | Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* ucm: modifiers names must be compound parseLiam Girdwood2010-12-221-4/+23
| | | | | | | | | | | | 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>
* ucm: removed unused 'active' member in struct use_case_deviceLiam Girdwood2010-12-221-2/+0
| | | | | Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: initial implementation for cdev/csetJaroslav Kysela2010-11-293-13/+193
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: CTL devices are only one per card (remove DEV from comments)Jaroslav Kysela2010-11-291-3/+3
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: add ValueDefaults section to the master fileJaroslav Kysela2010-11-294-25/+60
| | | | | | | - the get_value() function is recoded (tries to find the value in parent's list) Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: add cdevJaroslav Kysela2010-11-233-3/+19
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: fix parser for sequences and fix wrong strcmpJaroslav Kysela2010-11-103-6/+17
| | | | | | | | | | 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>
* control: add ASCII parsers from amixerJaroslav Kysela2010-11-043-1/+360
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: debug parserJaroslav Kysela2010-10-265-154/+268
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: implemented card list featureJaroslav Kysela2010-10-136-27/+134
| | | | | | - also added some test files to test/ucm tree Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: unify snd_use_case_geti(), add snd_use_case_card_list() templateJaroslav Kysela2010-10-122-8/+34
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: cosmetic fixJaroslav Kysela2010-10-011-1/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: added implementation for other ucm parts, only card name list is missingJaroslav Kysela2010-09-222-12/+220
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: Introduce "Value {}" section, more implementation workJaroslav Kysela2010-09-225-1303/+823
| | | | | | | | | - 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>
* ucm: Moved ucm to src/ucm subdirectoryJaroslav Kysela2010-09-1511-3526/+2888
| | | | | | | | - separate code to more files - use standard lists to represent structures - use alsa-lib configuration parser Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ucm: Recode header to be more universalJaroslav Kysela2010-08-251-200/+93
| | | | | | | | | - 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>
* ucm: build - add build support for Use Case ManagerLiam Girdwood2010-08-233-2/+3
| | | | | | | | | 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>
* ucm: core - Add initial Use Case Manager support.Liam Girdwood2010-08-231-0/+3515
| | | | | | | | | | | | | | | | | | | | 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>
* ucm: header - ALSA Use Case ManagerLiam Girdwood2010-08-231-0/+427
| | | | | | | | | | | | | | | | 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>
* general: recoded snd_dlobj_ functionsJaroslav Kysela2010-08-237-121/+151
| | | | | | | | - 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>
* HDA-Intel: do not lock IEC958 Playback switchPierre-Louis Bossart2010-08-231-4/+0
| | | | | | | | | 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>
* namehint: Evaluate more possibilities for hw devicesJaroslav Kysela2010-08-201-5/+13
| | | | | | | 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>
* Add missing support for 3-byte formats for 16bit put conversionTakashi Iwai2010-08-132-4/+44
| | | | | | | | | 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>
* pcm: Fixed typo (wrong deleted line) instroduced in the minperiodsize patchJaroslav Kysela2010-08-121-0/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm: introduce defaults.pcm.compat to change the params choose behaviourJaroslav Kysela2010-08-114-3/+16
| | | | | | | | | 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>
* pcm: add defaults.pcm.minperiodtime parsingJaroslav Kysela2010-08-114-2/+21
| | | | | | | | | | | 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>
* HDA-Intel: present all 4 HDMI outputs instead of just the first oneAnssi Hannula2010-08-091-4/+104
| | | | | | | | | | 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>
* test/latency: fix timediff calculationJaroslav Kysela2010-08-041-1/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* pcm_plug: fix comparison always trueAnssi Hannula2010-08-021-1/+1
| | | | | Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* pcm - ladspa: fix small memory leak in snd_pcm_ladspa_free_instances()Jaroslav Kysela2010-07-221-0/+2
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* Memory leak in namehint.cJohn Lindgren2010-07-211-0/+2
| | | | | | | | 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>
* tlv: Remove tailing tab after snd_ctl_get_dB_range functionPeter Ujfalusi2010-07-201-1/+1
| | | | | | | | | 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>
* tlv: Handle 'holes' in SND_CTL_TLVT_DB_RANGE arrayPeter Ujfalusi2010-07-201-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* tlv: Check out of range dB with SND_CTL_TLVT_DB_RANGEPeter Ujfalusi2010-07-201-1/+11
| | | | | | | | | | | 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>
* alisp - Fix a string format ambiguityColin Guthrie2010-05-271-1/+1
| | | | Signed-off-by: Takashi Iwai <tiwai@suse.de>
* control: tlv: Check dB range only within the control's volume rangePeter Ujfalusi2010-05-191-3/+8
| | | | | | | | | | | | | 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>
* seq: Fix for snd_seq_parse_address()Pedro Lopez-Cabanillas2010-04-221-1/+2
| | | | | | | | | | | | 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>
* Use thread-safe locale functions if availableRémi Denis-Courmont2010-04-211-0/+16
| | | | | | | | | | | 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>
* Check for thread-specific locale supportRémi Denis-Courmont2010-04-211-0/+1
| | | | | Signed-off-by: Rémi Denis-Courmont <remi@remlab.net> Signed-off-by: Jaroslav Kysela <perex@perex.cz>