OSDN Git Service
Jaroslav Kysela [Wed, 2 Jun 2021 17:50:17 +0000 (19:50 +0200)]
timer: remove dead code in _snd_timer_hw_open()
Jaroslav Kysela [Wed, 2 Jun 2021 17:49:29 +0000 (19:49 +0200)]
pcm: softvol - fix early exit in add_tlv_info()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Wed, 2 Jun 2021 17:46:46 +0000 (19:46 +0200)]
pcm: remove extra NULL checks in snd_pcm_dshare_open()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Wed, 2 Jun 2021 17:39:32 +0000 (19:39 +0200)]
pcm: remove extra NULL checks in snd_pcm_dsnoop_open()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Wed, 2 Jun 2021 17:37:53 +0000 (19:37 +0200)]
pcm: remove extra NULL checks in snd_pcm_dmix_open()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Wed, 2 Jun 2021 17:35:44 +0000 (19:35 +0200)]
pcm: direct - fix pcmp error path in _snd_pcm_direct_new()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Wed, 2 Jun 2021 17:28:32 +0000 (19:28 +0200)]
control: remap - fix uninitialized value in parse_map_vindex()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Wed, 2 Jun 2021 17:26:47 +0000 (19:26 +0200)]
conf: remove dead code in snd_config_get_card()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Wed, 2 Jun 2021 09:21:54 +0000 (11:21 +0200)]
ucm: fix _alibpref string (add '.' delimiter to the end)
Fixes:
0e4ba2ea ("ucm: add _alibpref to get the private device prefix")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Wed, 2 Jun 2021 09:09:43 +0000 (11:09 +0200)]
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>
Jaroslav Kysela [Wed, 2 Jun 2021 06:49:32 +0000 (08:49 +0200)]
conf: fix load_for_all_cards()
The
63f7745b commit is loading the driver specific configuration
multiple times which ends with the array merges (see the bug).
Introduce the loaded compound which traces the already loaded
driver configurations and skip the multiple load requests.
Fixes: https://github.com/alsa-project/alsa-lib/issues/143
Fixes:
63f7745b ("conf: extend load_for_all_cards hook (id/value table)")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Thu, 27 May 2021 21:30:16 +0000 (23:30 +0200)]
Release v1.2.5
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Thu, 27 May 2021 21:26:02 +0000 (23:26 +0200)]
pcm: hw - correct the comment in snd_pcm_hw_state()
Fixes:
c7a939ee ("pcm: hw - fix again snd_pcm_hw_state() when the driver was disconnected")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Thu, 27 May 2021 20:01:25 +0000 (22:01 +0200)]
pcm: hw - fix again snd_pcm_hw_state() when the driver was disconnected
Fixes:
2c8e31f5 ("pcm: hw - fix snd_pcm_hw_state()")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Wed, 26 May 2021 15:28:53 +0000 (17:28 +0200)]
seq: fix snd_seq_parse_address()
Use safe_strtol() for the integer conversion. Also accept
client name in "" or '' notation.
BugLink: https://github.com/alsa-project/alsa-utils/issues/90
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Chao Song [Wed, 26 May 2021 06:00:21 +0000 (14:00 +0800)]
topology/pcm.c: remove duplicated AC97 hw format
Remove the second occurrence of AC97 hardware format
from audio hardware format array.
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 25 May 2021 15:12:47 +0000 (17:12 +0200)]
include: try to fix the out-of-source-tree build
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 25 May 2021 14:35:23 +0000 (16:35 +0200)]
include: fix out-of-source-tree build
Fixes:
cd alsa-lib
if test -r Makefile; then
make distclean
fi
mkdir build
cd build
../configure
make
Note:
The srcdir is used for the symlinks to generated include files :-(
I've not found a better (easy) way to fix this.
Fixes: https://github.com/alsa-project/alsa-lib/issues/136
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 25 May 2021 13:29:22 +0000 (15:29 +0200)]
pcm: hw - fix snd_pcm_hw_state()
The pcm status function should not return an error code.
Return always only the mmaped status.
Fixes: https://github.com/alsa-project/alsa-lib/issues/137
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Mon, 24 May 2021 07:51:37 +0000 (09:51 +0200)]
ucm: compound_merge - use snd_config_merge()
It's useful to do the full tree merge (append).
Fixes: https://github.com/alsa-project/alsa-ucm-conf/pull/92
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Mon, 24 May 2021 08:00:08 +0000 (10:00 +0200)]
conf: snd_config_merge() - substitute non-compound config handles
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Mon, 24 May 2021 07:37:13 +0000 (09:37 +0200)]
conf: snd_config_merge() - merge (concat) correctly arrays
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Mon, 24 May 2021 07:27:17 +0000 (09:27 +0200)]
conf: return count of items in snd_config_is_array()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 18 May 2021 14:36:49 +0000 (16:36 +0200)]
ucm: recognize first '-' character as ignore error for exec/shell
It may be useful to ignore the returned errors (like modprobe etc).
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 18 May 2021 11:02:56 +0000 (13:02 +0200)]
conf: print quoted string more wisely
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 18 May 2021 10:22:46 +0000 (12:22 +0200)]
ucm: cfg-save - allow to save the sub-tree including root keys
The leading '+' in the keys specification add the key prefix
(sub-tree root identification) to the saved configuration.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 18 May 2021 09:20:56 +0000 (11:20 +0200)]
ucm: libconfig - merge not override items
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 18 May 2021 09:20:18 +0000 (11:20 +0200)]
ucm: libconfig parser - fix memory leaks
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 18 May 2021 08:57:17 +0000 (10:57 +0200)]
conf: fix snd_config_merge() - merge schema
All child compounds must be traversed and merged.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Mon, 17 May 2021 15:03:37 +0000 (17:03 +0200)]
control: remap - add no-op when the remapping is not active
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Fri, 14 May 2021 10:20:18 +0000 (12:20 +0200)]
ucm: add cfg-save command
Allow to save whole (or partial) local UCM alsa library configuration
to a file.
Syntax (saves key1.key2 sub-tree):
Sequence [
cfg-save "/tmp/my-file.conf:key1.key2"
]
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Fri, 14 May 2021 10:49:03 +0000 (12:49 +0200)]
ucm: fix memory leak in execute_cset()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Thu, 13 May 2021 16:28:20 +0000 (18:28 +0200)]
ucm: parse LibraryConfig also in the toplevel file
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Thu, 13 May 2021 09:04:14 +0000 (11:04 +0200)]
conf: load the card specific configurations to the config sub-tree
The /var/lib/alsa/card<CARDNO>.conf.d configurations are loaded
to the cards.<CARDNO> tree only (overwrite mode).
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Thu, 13 May 2021 09:02:41 +0000 (11:02 +0200)]
conf: add snd_config_make_path() function
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Thu, 13 May 2021 08:59:43 +0000 (10:59 +0200)]
conf: add snd_config_is_empty() function
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Thu, 13 May 2021 08:18:27 +0000 (10:18 +0200)]
pcm: fix open in direct plugins - wrong pointer assignment
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Wed, 12 May 2021 10:12:57 +0000 (12:12 +0200)]
conf: _snd_config_evaluate - remove 'delete compound members' call
With the recent snd_config_substitute() fix, remove the duplicate
code.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Wed, 12 May 2021 09:39:05 +0000 (11:39 +0200)]
conf: fix snd_config_substitute() - memory leak
There's an issue with the current code: It says append for compounds,
but it does overwrite without the proper members delete from
the overwritten (destination) compound node.
Don't change the behaviour, just fix the comment and memory leak.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Wed, 12 May 2021 08:07:12 +0000 (10:07 +0200)]
conf: fix snd_config_merge() - double free in overwrite mode
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Wed, 12 May 2021 07:53:18 +0000 (09:53 +0200)]
ucm: fix regexec() REG_NOMATCH state handling for define regex
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 11 May 2021 12:48:16 +0000 (14:48 +0200)]
ucm: add exec sequence command
This change renames the original exec command to shell which
is more appropriate. Implement a light version of the exec
command which calls directly the specified executable without
the shell interaction (man 3 system).
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 4 May 2021 18:48:52 +0000 (20:48 +0200)]
alsa: conf - use card number roots for device redirects
The change device definitions (pcm.front etc.) from the driver
roots (cards.<DRIVER_NAME>) to the card number roots (cards.<CARDNO>).
This will allow us to do custom overrides (like UCM) in
/var/lib/alsa/card<CARDNO>.conf.d.
For dmix and dsnoop default values, use the card ID instead
the card driver name. It's more flexible.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 4 May 2021 18:27:45 +0000 (20:27 +0200)]
conf: extend load_for_all_cards hook (id/value table)
For the per-card configuration, add possibility to define
card number -> card driver link table.
Example:
cards.0 'cards.USB-Audio'
cards.1 'cards.USB-Audio'
cards.2 'cards.HDA-Intel'
cards.3 'cards.USB-Audio'
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Hans de Goede [Tue, 4 May 2021 15:58:30 +0000 (17:58 +0200)]
mixer: simple - Fix "Capture Volume" and "Capture Switch" being seen as global controls
Fix the "Capture Volume" and "Capture Switch" exceptions no longer
working after commit
86b9c67774bc ("mixer: simple - Unify simple_none:
base_len() exception handling") because they were moved to after the
suffix checking, so they would be treated as CTL_GLOBAL_VOLUME resp.
CTL_GLOBAL_SWITCH based on their suffix before the exception check
has a chance to check for a match.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Hans de Goede [Mon, 3 May 2021 20:52:44 +0000 (22:52 +0200)]
ucm: Fix sysw sequence command not working when requesting to ignore errors
When the user requests to ignore sysfs write errors by prefixing
the path with a '-' then we need to skip the '-' when building the
actual path otherwise the write will never work.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Fri, 23 Apr 2021 15:24:36 +0000 (17:24 +0200)]
ucm: fix the local ucm control device name caching
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Fri, 23 Apr 2021 14:35:26 +0000 (16:35 +0200)]
control: remap - don't allow I/O on renamed IDs
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Fri, 23 Apr 2021 10:28:33 +0000 (12:28 +0200)]
control: add missing src/conf/ctl/Makefile.am
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Thu, 22 Apr 2021 09:47:48 +0000 (11:47 +0200)]
ucm: limit the master config scan to conf.virt.d
The composition of the list of valid UCM cards is a bit
tricky. Scan only ucm2/conf.virt.d tree.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Fri, 16 Apr 2021 12:48:08 +0000 (14:48 +0200)]
ucm: fixed find-device substitution (non-continuous PCM devices)
The PCM device numbers may be non-continous. Skip them when -ENOENT error
is returned.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Fri, 16 Apr 2021 10:34:29 +0000 (12:34 +0200)]
ucm: allow to escape the trailing variable substitution character
Example:
${find-device:ctl='hw:0',type=pcm,field=id,regex='USB A{1\\}'}
Unescaped find-device arguments:
ctl='hw:0',type=pcm,field=id,regex='USB A{1}'
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Fri, 16 Apr 2021 08:48:35 +0000 (10:48 +0200)]
ucm: find-device / pcm - the ctl_list may be empty
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Thu, 15 Apr 2021 14:58:24 +0000 (16:58 +0200)]
ucm: add missing uc_mgr_card_close() call to snd_use_case_mgr_open()
Handle the error path correctly.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Thu, 15 Apr 2021 14:45:12 +0000 (16:45 +0200)]
ucm: cosmetic code reshuffle in rval_lookup_main()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Thu, 15 Apr 2021 09:49:32 +0000 (11:49 +0200)]
ucm: fix uc_mgr_has_local_config()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Thu, 15 Apr 2021 09:38:39 +0000 (11:38 +0200)]
ucm: rewrite device value only when the local config exists
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
asavah [Tue, 13 Apr 2021 19:16:26 +0000 (22:16 +0300)]
utils/alsa.m4: another quick fix for the brackets
BugLink: https://github.com/alsa-project/alsa-lib/pull/133
From: asavah <asavah@avh.od.ua>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 13 Apr 2021 18:30:07 +0000 (20:30 +0200)]
utils/alsa.m4: a quick fix for missing end brackets
Fixes:
c6e0f24e ("utils/alsa.m4: update for newer autoconf.")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 13 Apr 2021 17:58:01 +0000 (19:58 +0200)]
conf: usb - correct 'SB Omni Surround 5.1' iec958 device
BugLink: https://github.com/alsa-project/alsa-lib/issues/101
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 13 Apr 2021 17:49:44 +0000 (19:49 +0200)]
test: audio_time - fix timestamp2ns() and usage()
BugLink: https://github.com/alsa-project/alsa-lib/issues/132
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Ozkan Sezer [Thu, 17 Dec 2020 11:11:28 +0000 (14:11 +0300)]
utils/alsa.m4: update for newer autoconf.
fixes autoconf-2.70 warnings. should be compatible down to autoconf-2.59.
BugLink: https://github.com/alsa-project/alsa-lib/pull/106
Signed-off-by: Ozkan Sezer <sezeroz@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 13 Apr 2021 17:13:20 +0000 (19:13 +0200)]
ucm: return error if fixedboot_list is empty
The application should know, that there is no special
initialization sequence. It's counterpart for
"ucm: return error if boot_list is empty".
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Hui Wang [Thu, 29 Oct 2020 06:51:30 +0000 (14:51 +0800)]
ucm: return error if boot_list is empty
If bootlist is empty, that means there is no BootSequence defined
in the ucm for this sound card, let set_boot_user() return error,
then alsactl could have chance to use non-ucm ways to initialize the
sound card.
BugLink: https://github.com/alsa-project/alsa-lib/pull/94
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Hui Wang [Mon, 1 Mar 2021 05:51:54 +0000 (13:51 +0800)]
conf: USB - add "Cmedia Audio" to USB-Audio.pcm.iec958_device
Otherwise, there will be a "Digital Output(S/PDIF)-Cmedia Audio" from
Gnome UI, but there is no this physical interface on the card.
BugLink: https://github.com/alsa-project/alsa-lib/pull/122
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
James [Wed, 3 Mar 2021 21:03:37 +0000 (21:03 +0000)]
Remove non-existent SPDIF output on Dell AE515
The Dell Professional Sound Bar AE515 shows up in GNOME Settings with
a digital output that doesn't physically exist. Add it to the list
to suppress this.
BugLink: https://github.com/alsa-project/alsa-lib/pull/124
From: drjhe
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
James [Tue, 16 Mar 2021 17:41:48 +0000 (17:41 +0000)]
conf: No SPDIF on Plantronics 3220 headset
The Plantronics Blackwire 3220 Series headset (USB ID 047f:c056) shows up
in GNOME Settings with a non-existent digital output. Add it to the list
to suppress this.
BugLink: https://github.com/alsa-project/alsa-lib/pull/126
From: drjhe
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 13 Apr 2021 16:55:37 +0000 (18:55 +0200)]
pcm: direct - move the direct struct init to _snd_pcm_direct_new()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Vanitha Channaiah [Sun, 21 Mar 2021 11:00:48 +0000 (16:30 +0530)]
pcm: dshare - fix shared memory pointer check
Currently shared memory pointer is initialized to 0 and set to -1
in some, but not in all error paths.
In cleanup path of open the shm pointer is only compared to be non-NULL
before dereferencing it which leads to SEGFAULT in case it was set to -1.
This patch initializes pointer to -1 to have a unique identification
for invalid pointer and also checks for pointer being not -1 on
access in cleanup path.
Signed-off-by: Vanitha Channaiah <vanitha.channaiah@in.bosch.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 13 Apr 2021 16:01:09 +0000 (18:01 +0200)]
include: fix SND_LIB_VER() macro
Fixes:
c132509a ("include: add SND_LIB_VER() macro")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 13 Apr 2021 15:19:54 +0000 (17:19 +0200)]
ucm: ucm_filename() - avoid double //
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 13 Apr 2021 07:52:35 +0000 (09:52 +0200)]
ucm: handle better the system() call
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Mon, 12 Apr 2021 16:09:21 +0000 (18:09 +0200)]
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>
Jaroslav Kysela [Mon, 12 Apr 2021 14:47:58 +0000 (16:47 +0200)]
output: Add snd_output_buffer_steal() function
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Fri, 9 Apr 2021 16:11:57 +0000 (18:11 +0200)]
conf: add snd_config_merge() function
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Thu, 8 Apr 2021 10:48:38 +0000 (12:48 +0200)]
ucm: add ${ConfLibDir} substitution
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Thu, 8 Apr 2021 10:31:47 +0000 (12:31 +0200)]
conf: add /var/lib/alsa/conf.d directory lookup
It may be handy to put the configurations or symlinks
to the global runtime directory.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 6 Apr 2021 19:05:31 +0000 (21:05 +0200)]
conf: add /var/lib/alsa/card<NUMBER>.conf.d directory lookups
It may be handy to put extra configurations or symlinks to
the global runtime directory. The configurations may be
created at boot / hotplug event by udev or other scripts.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 6 Apr 2021 18:00:36 +0000 (20:00 +0200)]
conf: extend hook load_for_all_cards
Pass also card integer number.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 6 Apr 2021 16:32:57 +0000 (18:32 +0200)]
include: add SND_LIB_VER() macro
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 6 Apr 2021 16:19:48 +0000 (18:19 +0200)]
conf: make ctl.default and sysdefault devices more universal
It may be handy to add hw specific configs.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 6 Apr 2021 18:34:18 +0000 (20:34 +0200)]
control: add empty plugin
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 6 Apr 2021 10:57:54 +0000 (12:57 +0200)]
control: remap plugin - add docs
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 6 Apr 2021 10:18:23 +0000 (12:18 +0200)]
control: doc - create controls plugin page
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Mon, 29 Mar 2021 10:36:21 +0000 (12:36 +0200)]
control: remap plugin - initial version
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Mon, 29 Mar 2021 10:19:21 +0000 (12:19 +0200)]
control: add _snd_ctl_open_child()
To support internal plugins, add internal _snd_ctl_open_child()
function like _snd_pcm_open_slave().
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 6 Apr 2021 18:03:40 +0000 (20:03 +0200)]
pcm: empty plugin - fix the docs
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Mon, 29 Mar 2021 09:41:26 +0000 (11:41 +0200)]
control: shm - add missing continue to _snd_ctl_shm_open()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Mon, 29 Mar 2021 09:12:28 +0000 (11:12 +0200)]
ucm: add ctl-remove sequence command to delete controls from UCM
Syntax:
ctl-remove "name='ABCD'"
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Thu, 25 Mar 2021 19:36:54 +0000 (20:36 +0100)]
ucm: add cset-new sequence command to create new controls from UCM
This command create a new control using ID, description and value.
Syntax:
cset-new "name='ABCD',index=2 type=boolean,count=2 on,on"
cset-new "name='Enum' type=enum,labels='L1;L2;L3' 'L2'"
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Thu, 25 Mar 2021 19:40:22 +0000 (20:40 +0100)]
ucm: move __snd_ctl_ascii_elem_id_parse prototype to control_local.h
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Thu, 25 Mar 2021 19:27:44 +0000 (20:27 +0100)]
control: add __snd_ctl_add_elem_set() helper
It simplifies the add_elem_set functions and we need it for UCM.
It's an internal function.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 23 Mar 2021 16:43:30 +0000 (17:43 +0100)]
control: add snd_ctl_elem_id_compare_numid() function
Idea for the function prototype by Takashi Sakamoto.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 23 Mar 2021 16:30:25 +0000 (17:30 +0100)]
control: rename snd_ctl_elem_id_compare() to snd_ctl_elem_id_compare_set()
- add asserts to check if the unsigned integers are in the valid range
- replace tuple with set in the id description
- add const prefix for id1
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 23 Mar 2021 15:53:03 +0000 (16:53 +0100)]
ucm: add Path condition type
Check for a file presence and mode.
Modes: exists, read, write, exec
Example:
If.0 {
Condition {
Type Path
Mode read
Path "/etc/alsa/something"
True {
...
}
}
}
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 23 Mar 2021 10:40:30 +0000 (11:40 +0100)]
ucm: rename sysset to sysw
Fixes:
1c6fb202 ("ucm: implement sysset sequence command")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Takashi Iwai [Thu, 18 Mar 2021 16:43:58 +0000 (17:43 +0100)]
conf: Fix invalid free at parse_args()
The previous fix for memory leaks introduced a few regression.
The major one is the assert hit in the error path reaching with NULL
or uninitialized sub object. Also, in other code paths, it's possible
that an already released sub object gets freed again.
Fix those bugs by initializing the sub object properly and add a NULL
check before calling snd_config_delete().
Fixes:
ad5f255b4767 ("conf: fix memory leak on the error path in parse_args()")
Reported-and-tested-by: Mark Hills <mark@xwax.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Jaroslav Kysela [Thu, 18 Mar 2021 11:33:10 +0000 (12:33 +0100)]
control: fix the subdevice fields comparison in snd_ctl_elem_id_compare()
Jaroslav Kysela [Wed, 10 Mar 2021 17:10:57 +0000 (18:10 +0100)]
conf: fix memory leak on the error path in parse_args()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Tue, 9 Mar 2021 19:02:57 +0000 (20:02 +0100)]
ucm: warn about unknown sequence commands
Signed-off-by: Jaroslav Kysela <perex@perex.cz>