Commit graph

54 commits

Author SHA1 Message Date
Jaroslav Kysela
0ba999591b use-case.h: add Channels/ChannelPos values to the documentation
We have use cases, where the channel split is required. We
can use alsa-lib plugins for this job, but some sound servers
or applications may want to do the split themselves.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2022-05-24 14:42:44 +02:00
Jaroslav Kysela
46e991c9ce use-case.h: add SND_USE_CASE_DEV_DIRECT define
It may be useful to define the devices without channel remapping
(e.g. ProAudio devices).

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2022-05-14 16:20:33 +02:00
Jaroslav Kysela
0e4ba2ea8c ucm: add _alibpref to get the private device prefix
It may be useful to get the device prefix for the local configuration.

Link: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1251
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-06-02 11:09:46 +02:00
Jaroslav Kysela
8f5779eb3f ucm: add LibraryConfig support
This commit allows to define private alsa-lib's configuration. When
the configuration is present, the device values ("PlaybackCTL",
"CaptureCTL", "PlaybackMixer", "CaptureMixer", "CapturePCM")
are prefixed with '_ucmHEXA.' string where HEXA is replaced by the
unique hexadecimal number identifying the opened ucm manager handle.

    Syntax 4

    LibraryConfig.a_label.SubstiConfig {
            # substituted library configuration like:
            usr_share_dir "${ConfLibDir}"
    }

    LibraryConfig.b_label.Config {
            # non-substituted library configuration like:
            usr_share_dir "/usr/share/alsa"
    }

    The File counterparts:

    LibraryConfig.c_label.SubstiFile "/some/path"
    LibraryConfig.d_label.File "/some/path"

Note that for files the contents is substituted on the request,
but the file name is always substituted (useful for ${ConfDir} etc.).

The private configuration is not saved or preserved. It's life time
belongs to the opened ucm manager handle.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-04-13 17:14:28 +02:00
Jaroslav Kysela
9c194a0ba7 ucm: add _fboot / FixedBootSequence
Actually, the BootSequence is executed only when the driver controls
(identifiers or value types) are changed. It may be handy to have
also a sequence which is executed at _each_ boot without any condition.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-03-11 09:25:52 +01:00
Jaroslav Kysela
d9c835d804 use-case.h: define Linked variable
We have a requirement to "hide" some hardware drivers, because
other (main) UCM configuration will refer them.

BugLink: https://github.com/alsa-project/alsa-ucm-conf/issues/30
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-07 17:41:04 +02:00
Jaroslav Kysela
14636be4a8 ucm: rename _once command to _boot command
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-25 19:20:18 +02:00
Jaroslav Kysela
0c3776a354 ucm: handle 'set _defaults' command
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-14 18:32:05 +02:00
Jaroslav Kysela
a570634a22 ucm: handle 'set _once' command
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-14 18:25:58 +02:00
Jaroslav Kysela
4327660c71 use-case.h: add USB as allowed device name
Some USB devices are really generic where the
PCM stream can be routed to different paths.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-04-28 12:59:13 +02:00
Jaroslav Kysela
341326c21e usecase: allow indexes also for modifier names
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-04-03 18:00:51 +02:00
Jaroslav Kysela
79102bf264 ucm: clarify the index syntax for the device names
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-03-17 10:21:10 +01:00
Jaroslav Kysela
f828dfe549 ucm: docs - remove MixerCopy values, add Priority for verb, improve priority docs
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-10 11:48:06 +01:00
Jaroslav Kysela
ca67e82383 ucm: docs - add note about the sequences and device split
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-06 11:11:54 +01:00
Jaroslav Kysela
5473c5d677 ucm: docs - change the Mic description to simple Microphone Device
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-05 17:19:06 +01:00
Jaroslav Kysela
1ad660ddee ucm: docs - remove DigitalMic, it does not have sense
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-05 17:01:31 +01:00
Jaroslav Kysela
555a5dbdab ucm: docs - add Mic/DigitalMic and multiple devices comments
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-05 16:59:05 +01:00
Jaroslav Kysela
a0fc4447bb ucm: docs - add JackCTL, rearrange JackControl and JackDev
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-03 15:01:04 +01:00
Jaroslav Kysela
2a286ca9a8 use-case: docs - add PlaybackMixerCopy and CaptureMixerCopy
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-02 11:58:05 +01:00
Jaroslav Kysela
4dddcf733d ucm: docs - allow spaces in device names for JackHWMute
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-02 11:56:30 +01:00
Jaroslav Kysela
ebdd2b6cdb ucm: add _identifiers list
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-11-30 20:31:55 +01:00
Jaroslav Kysela
2cb44791c3 use-case: add priority values from pulseaudio
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-11-28 18:10:43 +01:00
Jaroslav Kysela
659ecf6ff0 use-case: improve comment for mixer elements
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-11-28 14:58:36 +01:00
Jaroslav Kysela
eee55a5267 ucm: rename mixer element identifiers
To my knowledge, no software is using the mixer element identifiers.
Rename them to be more consistent with the mixer API and add
Master element identifier and type.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-11-27 15:03:06 +01:00
Jaroslav Kysela
1a4b362115 ucm: use-case.h - add <alsa/asoundlib.h> include
It is required for snd_ctl_elem_id_t and snd_mixer_selem_id_t.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-11-23 15:39:49 +01:00
Curtis Malainey
35e737f2ec ucm: docs: Add MinBufferLevel value
Allows ucm to override minimum buffer level for platforms that
incorrectly report their buffer level.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-11-14 15:00:40 +01:00
Curtis Malainey
eab3835c36 ucm: docs: Add EDID File value
Add a sys path to the EDID file for the corresponding HDMI device so
userspace can use if needed

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-11-14 15:00:40 +01:00
Jaroslav Kysela
e6fbc84c16 use-case header file: add more references to correct ASCII ID parsers for CTL/mixer IDs
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-11-14 15:00:40 +01:00
Jaroslav Kysela
5c88b18371 ucm: add snd_use_case_parse_selem_id()
and add strict ucm_id checks to snd_use_case_parse_ctl_elem_id()

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-11-14 15:00:40 +01:00
Jaroslav Kysela
cd4b07ffbd ucm: add snd_use_case_parse_ctl_elem_id()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-11-14 15:00:40 +01:00
Jaroslav Kysela
be6deb927f ucm: extend snd_use_case_mgr_open() to address the sound card directly
Some clients like pulseaudio wants to access the multiple instances
of sound cards. This patch adds prefixes like "hw:" to the card_name
argument to handle this. The card index (value) or card identification
(string) can be used for this prefix.

Also the prefix "strict:" was added to avoid the driver name and
driver long name matching. It might be useable for use case
configurations which are not bound to the one sound card.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-11-10 13:10:43 +01:00
Jaroslav Kysela
5b9041bced Change FSF address (Franklin Street)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2017-11-14 14:29:26 +01:00
Mengdong Lin
e93d93a8cd ucm: Add command 'get _file' to get the config file name of the opened card
After opening a card, this command can show the name of the actually
loaded configuration file, either matches the card name or card long name.
So developers can check if there is a device-sepcific configuration file
available for a given card.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-18 11:55:25 +01:00
Antonio Ospite
64481b3c72 ucm: docs: typeset lists of identifiers explicitly
Doxygen doesn't preserve formatting that relies only on indentation,
typeset lists of identifiers explicitly.

This makes the HTML docs a lot more readable.

This change comes along the lines of commit 72aa0f8332 ("ucm: reformat
snd_use_case_get() doc").

Some TABs has been added too in order to preserve the aligned look when
reading the source code.

Signed-off-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-09-29 09:56:02 +02:00
Liam Girdwood
bb92545e06 ucm: docs: Fix doxygen formatting for UCM main page.
Make sure group is defined and lists dipplayed correctly.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-06-29 17:44:00 +02:00
Tanu Kaskinen
b4222f3fdc ucm: allow multiple devices in JackHWMute
One jack may mute multiple devices, so let's make JackHWMute a list of
device names instead of just a single device name.

Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-05-18 10:44:24 +02:00
Tanu Kaskinen
ecb38d2bec ucm: improve jack configuration documentation
Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-03-05 14:24:10 +01:00
Tanu Kaskinen
72aa0f8332 ucm: reformat snd_use_case_get() doc
Doxygen doesn't preserve formatting that relies only on indentation.
This fixes it by using lists more liberally.

There are probably more places to fix than just
snd_use_case_get_list(), but I only have motivation for fixing this
function's documentation formatting (the next patch will add some more
content to the function's documentation).

Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-03-05 14:24:04 +01:00
Lu, Han
c56064e135 ucm: document some standard values
add standard value JackDev, JackControl and JackHWMute for speaker
mute control on jack insertion. These values will be applied on
pulseaudio.

Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-03-05 10:58:46 +01:00
Tanu Kaskinen
567c831e69 ucm: fix some variable constness issues
I submitted earlier a patch that made the value parameter of
snd_use_case_get() non-const, but as that changed the public API, the
patch couldn't be accepted. This is the same patch, modifying the
internal code so that there are fewer issues with constness, but the
public API is left alone (a comment was added to the function
documentation, though, so that hopefully nobody else will try to fix
the same unfixable problem).

Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-02-17 22:16:00 +01:00
Tanu Kaskinen
7a748af4db ucm: Document PlaybackPCMIsDummy and CapturePCMIsDummy values
At least PulseAudio needs special handling for dummy devices. To allow
that to happen automatically, the UCM configuration should contain the
information about which PCMs are dummy.

Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-06-27 14:22:28 +02:00
Arun Raghavan
36bc577040 UCM: Document some standard values
Playback/CaptureChannels has been around for a bit. Playback/CaptureRate
is new and is intended to be used to specify the sample rate at which
the Playback/CapturePCM should be opened.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-08 12:31:05 +02:00
Takashi Iwai
30122df4fa Use __inline__ for exported headers
Some programs are still using C90.

Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=817077
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-25 09:52:33 +02:00
Jaroslav Kysela
b6eb0f9bfd all places: doxygen cleanups
I see no errors with these changes using doxygen 1.8.1.1 .

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-04-08 16:42:24 +02:00
Stephen Warren
e2c2262403 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"

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-08 18:22:15 +02:00
Stephen Warren
32d24f4071 UCM: Allow querying of {Supported,Conflicting}Devices
At any time, one can query:

_supporteddevs/<modifier>|<device>/<verb>
_conflictingdevs/<modifier>|<device>/<verb>

If a verb is current, one can query:

_supporteddevs/<modifier>|<device>
_conflictingdevs/<modifier>|<device>

Note that at most one of the supported/conflicting devs lists has
any entries, and when neither is present, all devices are supported.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-08 18:21:21 +02:00
Jaroslav Kysela
60397387ef UCM: comment fixes and fix myvalue initialization fix in add_values()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2011-03-19 00:54:43 +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
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