- Backport upstream fixes: surround41/50 chmap fix, UCM documents, config string fix, PCM timestamp query API, replacement of list.h with LGPL: 0023-surround41-50.conf-Use-chmap-syntax-for-better-flexi.patch 0024-ucm-docs-fix-doxygen-exclude-patch-for-UCM-local-hea.patch 0025-ucm-docs-Fix-doxygen-formatting-for-UCM-main-page.patch 0026-docs-Add-UCM-link-to-main-doxygen-page.patch 0027-Replace-unsafe-characters-with-_-in-card-name.patch 0028-pcm-add-helper-functions-to-query-timestamping-capab.patch 0029-pcm-add-support-for-get-set_audio_htstamp_config.patch 0030-pcm-add-support-for-new-STATUS_EXT-ioctl.patch 0031-test-fix-audio_time-with-new-get-set-audio_tstamp_co.patch 0032-test-audio_time-show-report-validity-and-accuracy.patch 0033-pcm-restore-hw-params-on-set-latency-failed.patch 0034-Replace-list.h-with-its-own-version.patch - Backport topology API addition patches: 0035-topology-uapi-Add-UAPI-headers-for-topology-ABI.patch 0036-topology-Add-topology-core-parser.patch 0037-topology-Add-text-section-parser.patch 0038-topology-Add-PCM-parser.patch 0039-topology-Add-operations-parser.patch 0040-topology-Add-private-data-parser.patch 0041-topology-Add-DAPM-object-parser.patch 0042-topology-Add-CTL-parser.patch 0043-topology-Add-Channel-map-parser.patch 0044-topology-Add-binary-file-builder.patch 0045-topology-autotools-Add-build-support-for-topology-co.patch 0046-topology-doxygen-Add-doxygen-support-for-topology-co.patch 0047-conf-topology-Add-topology-file-for-broadwell-audio-.patch 0048-topology-Fix-missing-inclusion-of-ctype.h.patch OBS-URL: https://build.opensuse.org/request/show/320429 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa?expand=0&rev=186
106 lines
3.4 KiB
Diff
106 lines
3.4 KiB
Diff
From 4dc44bb34aab2b23ab45c8e61e4b17bf2cf58959 Mon Sep 17 00:00:00 2001
|
|
From: "Alexander E. Patrakov" <patrakov@gmail.com>
|
|
Date: Mon, 29 Jun 2015 22:53:53 +0500
|
|
Subject: [PATCH 27/49] Replace unsafe characters with _ in card name
|
|
|
|
Otherwise, they get misinterpreted as argument separators
|
|
in USB-Audio PCM definitions, and thus prevent SPDIF blacklist entries
|
|
from working.
|
|
|
|
While at it, add my Logitec C910 webcam to the SPDIF blacklist.
|
|
|
|
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
|
|
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
---
|
|
include/conf.h | 1 +
|
|
src/conf.c | 32 ++++++++++++++++++++++++++++++++
|
|
src/conf/cards/USB-Audio.conf | 3 ++-
|
|
src/confmisc.c | 2 +-
|
|
4 files changed, 36 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/include/conf.h b/include/conf.h
|
|
index ff270f617383..087c05dc6bcf 100644
|
|
--- a/include/conf.h
|
|
+++ b/include/conf.h
|
|
@@ -126,6 +126,7 @@ int snd_config_imake_integer(snd_config_t **config, const char *key, const long
|
|
int snd_config_imake_integer64(snd_config_t **config, const char *key, const long long value);
|
|
int snd_config_imake_real(snd_config_t **config, const char *key, const double value);
|
|
int snd_config_imake_string(snd_config_t **config, const char *key, const char *ascii);
|
|
+int snd_config_imake_safe_string(snd_config_t **config, const char *key, const char *ascii);
|
|
int snd_config_imake_pointer(snd_config_t **config, const char *key, const void *ptr);
|
|
|
|
snd_config_type_t snd_config_get_type(const snd_config_t *config);
|
|
diff --git a/src/conf.c b/src/conf.c
|
|
index bb256e7ae443..c6a83eef7d2f 100644
|
|
--- a/src/conf.c
|
|
+++ b/src/conf.c
|
|
@@ -2228,6 +2228,38 @@ int snd_config_imake_string(snd_config_t **config, const char *id, const char *v
|
|
return 0;
|
|
}
|
|
|
|
+int snd_config_imake_safe_string(snd_config_t **config, const char *id, const char *value)
|
|
+{
|
|
+ int err;
|
|
+ snd_config_t *tmp;
|
|
+ char *c;
|
|
+
|
|
+ err = snd_config_make(&tmp, id, SND_CONFIG_TYPE_STRING);
|
|
+ if (err < 0)
|
|
+ return err;
|
|
+ if (value) {
|
|
+ tmp->u.string = strdup(value);
|
|
+ if (!tmp->u.string) {
|
|
+ snd_config_delete(tmp);
|
|
+ return -ENOMEM;
|
|
+ }
|
|
+
|
|
+ for (c = tmp->u.string; *c; c++) {
|
|
+ if (*c == ' ' || *c == '-' || *c == '_' ||
|
|
+ (*c >= '0' && *c <= '9') ||
|
|
+ (*c >= 'a' && *c <= 'z') ||
|
|
+ (*c >= 'A' && *c <= 'Z'))
|
|
+ continue;
|
|
+ *c = '_';
|
|
+ }
|
|
+ } else {
|
|
+ tmp->u.string = NULL;
|
|
+ }
|
|
+ *config = tmp;
|
|
+ return 0;
|
|
+}
|
|
+
|
|
+
|
|
/**
|
|
* \brief Creates a pointer configuration node with the given initial value.
|
|
* \param[out] config The function puts the handle to the new node at
|
|
diff --git a/src/conf/cards/USB-Audio.conf b/src/conf/cards/USB-Audio.conf
|
|
index 031bee0d86fd..e365f2979e6a 100644
|
|
--- a/src/conf/cards/USB-Audio.conf
|
|
+++ b/src/conf/cards/USB-Audio.conf
|
|
@@ -57,7 +57,8 @@ USB-Audio.pcm.iec958_device {
|
|
"Scarlett 2i4 USB" 999
|
|
"Sennheiser USB headset" 999
|
|
"SWTOR Gaming Headset by Razer" 999
|
|
- "USB Device 0x46d:0x992" 999
|
|
+ "USB Device 0x46d_0x821" 999
|
|
+ "USB Device 0x46d_0x992" 999
|
|
}
|
|
|
|
# Second iec958 device number, if any.
|
|
diff --git a/src/confmisc.c b/src/confmisc.c
|
|
index 1fb4f282217e..ae0275ff4de3 100644
|
|
--- a/src/confmisc.c
|
|
+++ b/src/confmisc.c
|
|
@@ -935,7 +935,7 @@ int snd_func_card_name(snd_config_t **dst, snd_config_t *root,
|
|
}
|
|
err = snd_config_get_id(src, &id);
|
|
if (err >= 0)
|
|
- err = snd_config_imake_string(dst, id,
|
|
+ err = snd_config_imake_safe_string(dst, id,
|
|
snd_ctl_card_info_get_name(info));
|
|
__error:
|
|
if (ctl)
|
|
--
|
|
2.5.0
|
|
|