control_external: Add ability to specify TLV data.
Allow external control plugins to provide TLV data. This allows
user-space pcms to specify dB ranges for controls.
This follows the same model as the ALSA drivers for accessing the
data. The code is based on that implementation. The control can
provide static data or a callback. The data is accessed or modified
in the new snd_ctl_ext_elem_tlv callback.
Rev bump the protocol version to enable checking if an external
control supports TLV.
Luke Yelavich [Wed, 8 Feb 2012 04:09:55 +0000 (15:09 +1100)]
conf/pcm: Add support for Echo3G devices. Thanks to unimatrix.
BugLink: https://bugs.launchpad.net/bugs/433573 Signed-off-by: Luke Yelavich <luke.yelavich@canonical.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Takashi Iwai [Mon, 14 Nov 2011 16:02:40 +0000 (17:02 +0100)]
pcm:mmap_emul: Fix sw_params and others in bypass mode
When the slave doesn't need any mmap-emulation, the plugin shouldn't do
anything special in sw_params and other callbacks but just pass to the
generic helpers and update hwptr and applptr.
Clemens Ladisch [Fri, 7 Oct 2011 20:46:51 +0000 (22:46 +0200)]
control: add snd_ctl_elem_add_enumerated()
Handling of user control elements was implemented for all types except
BYTES and ENUMERATED. Enumerated user controls will be needed for the
device-specific mixers of upcoming FireWire drivers.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Clemens Ladisch [Wed, 21 Sep 2011 06:30:20 +0000 (08:30 +0200)]
pcm: recalculate all rules after changing hw_params flags
The rules engine avoids recalculating rules that do not depend on
any changed parameter, but there is no mechanism to record changed
flags. So when we change a flag, we have to ensure that all rules
depending on that flag are recalculated; the only method to do this
is to force recalculation of all rules.
So far, there have been no kernel drivers with rules depending
on flags, but rules to disable hardware SRCs by setting
SND_PCM_HW_PARAMS_NORESAMPLE are being introduced now.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Colin Guthrie [Fri, 16 Sep 2011 09:04:26 +0000 (10:04 +0100)]
conf: Allow for a directory to be given as a config file.
When this is done, *.conf files can be placed in that directory and they
will be processed by as if they were included directly.
A directory (typically /usr/share/alsa/alsa.conf.d/) has been
added into the distribution.
v2: Used existing conf syntax rather than processing via autotools
v3: Split file loading into separate function and made error handling
more consistent.
Signed-off-by: Colin Guthrie <colin@mageia.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This patch adds new API functions, snd_ctl_open_fallback() and
snd_pcm_open_fallback(). These are just like snd_*_open_lconf() but
used to open a fallback PCM/control. The difference is that it replaces
the name string with the given original name, so that hctl and other
upper-layers will recognize it as an alias.
When "default" PCM and control definitions are overwritten by others
like PulseAudio setup, the original system-default defition is lost.
This is a problem when PA is temporarily (or intentionally) disabled
and user wants to use the default dmix.
This patch adds a new standard definition for the system-default,
"sysdefault". This can be used for fallbacks.
Stephen Warren [Mon, 6 Jun 2011 20:16:57 +0000 (14:16 -0600)]
UCM: get: Implement 'exact' value retrieval
[=]<NAME>[/[<modifier>|</device>][/<verb>]]
- value identifier <NAME>
- Search starts at given modifier or device if any,
else at a verb
- Search starts at given verb if any,
else current verb
- Searches modifier/device, then verb, then defaults
- Specify a leading "=" to search only the exact
device/modifier/verb specified, and not search
through each object in turn.
- Examples:
"PlaybackPCM/Play Music"
"CapturePCM/SPDIF"
From ValueDefaults only:
"=Variable"
From current active verb:
"=Variable//"
From verb "Verb":
"=Variable//Verb"
From "Modifier" in current active verb:
"=Variable/Modifier/"
From "Modifier" in "Verb":
"=Variable/Modifier/Verb"
Stephen Warren [Fri, 3 Jun 2011 20:56:32 +0000 (14:56 -0600)]
UCM: Disallow gets of undefined system properties
In UCM, there are various system-defined properties whose names start
with "_". Explicitly prevent any gets from falling back to properties
defined in a config file if the property name starts with "_", in order
to reserve the entire "_" namespace for system-defined properties.
Stephen Warren [Fri, 3 Jun 2011 20:56:31 +0000 (14:56 -0600)]
UCM: Implement ConflictingDevices, add device list to devices
Wherever SupportedDevice can appear, also allow ConflictingDevice. Only
one or the other (or neither) may be specified. When neither is
specified, allow anything. Sometimes, listing ConflictingDevices may
result in a shorter list than explicitly listing all SupportedDevices.
Add support for SupportedDevice and ConflictingDevice to SectionDevice.
This allows representing devices which are mutually exclusive, e.g. due
to a mux that switches between capturing from two different microphones,
without the possibility of mixing.
Enhance is_modifier_supported to allow ignoring SupportedDevice and
ConflictingDevice. This is useful when querying values from a
SectionModifier; there's no reason we shouldn't be able to query values
just because the current configuration would prevent enabling that
device. The new is_device_supported is implemented similarly.
Enhance switch_device to remove the old device from the current device
list before querying for the new device, and add it back immediately
afterwards. This allows the query for the new device to ignore any
conflicts caused solely by the old device.
... but also allows the old syntax, iff the index is exactly "0". If an
index is present, but not exactly "0", parsing will appear to succeed,
but produce an empty device or modifier.
When naming devices and modifiers, even if the legacy format is used,
any index is not included in the name; i.e. both sets of syntax above
name the device just "Speaker".
The SupportedDevice list syntax still also accepts either "x" or "x.0",
but internally strips ".0" from the tail of any device name. Any other
name including "." is disallowed.
Finally, when comparing device or modifier names, a simple exact string
compare is now used, since no index data is ever present in device or
modifier names.
The one functional change introduced here is that a SupportedDevice
entry of just "x" will now only ever match a single device. It previously
acted as a wildcard for any device named "x.foo".
Stephen Warren [Thu, 2 Jun 2011 22:44:39 +0000 (16:44 -0600)]
UCM: Fix deadlock following failed get _verb
When querying the current verb without a verb set, snd_use_case_get bails
out early without unlocking uc_mgr->mutex. This causes subsequent API calls
to hang. Instead, s/return/goto __end/.
Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Raymond Yau [Fri, 13 May 2011 02:40:28 +0000 (10:40 +0800)]
emu10k1.conf - Fix no sound problem when using SB Live! Platinum
Add asym to front, rear and center_lfe to prevent route change after
removed the lock.
After removed the lock, when application using "hw", "front", "rear",
"surround40" and "surround51", the route of the front channel is
changed (lost right channel or both channels) when other application
using "front", "rear" or "center_lfe" to record
Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Wed, 4 May 2011 07:14:29 +0000 (09:14 +0200)]
Fix compile warnings
strstr() returns a char pointer
simple_none.c: In function ‘base_len’:
simple_none.c:940:33: warning: ordered comparison of pointer with integer zero
simple_none.c:941:29: warning: ordered comparison of pointer with integer zero
alsa-lib: fixed coverity reported issues under "FORWARD_NULL" checker.
Coverity Static Analysis helps developers find hard-to-spot,
yet potentially crash-causing defects early in the development phase,
reducing the cost,time, and risk of software errors.
This patch has fix for situations where variable can be NULL
but not been checked beforehand
Locking the controls in hooks causes a BUSY error when multiple
streams are opened, typically in PulseAudio. Better not to touch
the locking in hooks in such a case.
The ICE1712 kernel driver accepts 10 playback channels and
12 recording channels only. Therefore fix this channel count
in alsa-lib.
BugLink: http://bugs.launchpad.net/bugs/178442 Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Liam Girdwood [Tue, 21 Dec 2010 22:11:51 +0000 (23:11 +0100)]
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>
Jaroslav Kysela [Thu, 18 Nov 2010 08:27:07 +0000 (09:27 +0100)]
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.
Clemens Ladisch [Mon, 15 Nov 2010 09:33:35 +0000 (10:33 +0100)]
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>