summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Hernberg2017-12-23 18:26:20 +0100
committerJoakim Hernberg2017-12-23 18:26:20 +0100
commit80d0ef919275877bcaf63a851140e112241cb495 (patch)
tree09eb06bff1517dd78fd6c7b0eed78cd31917e02a
parenteb93c4e030127bb484c6f3ff130f44b48028a0c7 (diff)
downloadaur-80d0ef919275877bcaf63a851140e112241cb495.tar.gz
add a usb audio fix and clean up the script a bit
-rw-r--r--.SRCINFO6
-rw-r--r--0001-ALSA-usb-audio-Fix-the-missing-ctl-name-suffix-at-pa.patch76
-rw-r--r--PKGBUILD9
3 files changed, 87 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 56f357382012..83fb36fd8fb7 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,8 @@
# Generated by makepkg 5.0.2
-# Fri Dec 22 20:37:16 UTC 2017
+# Sat Dec 23 14:06:31 UTC 2017
pkgbase = linux-rt
pkgver = 4.14.8_rt9
- pkgrel = 1
+ pkgrel = 2
url = https://www.kernel.org/
arch = x86_64
license = GPL2
@@ -26,6 +26,7 @@ pkgbase = linux-rt
source = 0001-e1000e-Fix-e1000_check_for_copper_link_ich8lan-retur.patch
source = 0002-dccp-CVE-2017-8824-use-after-free-in-DCCP-code.patch
source = 0001-drm-i915-Avoid-PPS-HW-SW-state-mismatch-due-to-rounding.patch
+ source = 0001-ALSA-usb-audio-Fix-the-missing-ctl-name-suffix-at-pa.patch
source = fix-race-in-PRT-wait-for-completion-simple-wait-code_Nvidia-RT-160319.patch
validpgpkeys = ABAF11C65A2970B130ABE3C479BE3E4300411886
validpgpkeys = 647F28654894E3BD457199BE38DBBDC86092693E
@@ -46,6 +47,7 @@ pkgbase = linux-rt
sha256sums = ac203ad289f4b0782fe94487450863aaf796cf06e60a09ee097bd8c4338c9572
sha256sums = 93f08a383189664579b07b1d7da2a54a8b758bcf03926bf4947484bb4bf4fb4c
sha256sums = b0396825ecd293499907ad86a0eb642cd5e82e534619f95658438ee6ecff10eb
+ sha256sums = cbf586270595a89835dc02602983028f4cea80c40a43be3d4871dae4fdb46b84
sha256sums = 85f7612edfa129210343d6a4fe4ba2a4ac3542d98b7e28c8896738e7e6541c06
pkgname = linux-rt
diff --git a/0001-ALSA-usb-audio-Fix-the-missing-ctl-name-suffix-at-pa.patch b/0001-ALSA-usb-audio-Fix-the-missing-ctl-name-suffix-at-pa.patch
new file mode 100644
index 000000000000..f661032ab6fa
--- /dev/null
+++ b/0001-ALSA-usb-audio-Fix-the-missing-ctl-name-suffix-at-pa.patch
@@ -0,0 +1,76 @@
+From 5a15f289ee87eaf33f13f08a4909ec99d837ec5f Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Mon, 18 Dec 2017 23:36:57 +0100
+Subject: [PATCH] ALSA: usb-audio: Fix the missing ctl name suffix at parsing
+ SU
+
+The commit 89b89d121ffc ("ALSA: usb-audio: Add check return value for
+usb_string()") added the check of the return value from
+snd_usb_copy_string_desc(), which is correct per se, but it introduced
+a regression. In the original code, either the "Clock Source",
+"Playback Source" or "Capture Source" suffix is added after the
+terminal string, while the commit changed it to add the suffix only
+when get_term_name() is failing. It ended up with an incorrect ctl
+name like "PCM" instead of "PCM Capture Source".
+
+Also, even the original code has a similar bug: when the ctl name is
+generated from snd_usb_copy_string_desc() for the given iSelector, it
+also doesn't put the suffix.
+
+This patch addresses these issues: the suffix is added always when no
+static mapping is found. Also the patch tries to put more comments
+and cleans up the if/else block for better readability in order to
+avoid the same pitfall again.
+
+Fixes: 89b89d121ffc ("ALSA: usb-audio: Add check return value for usb_string()")
+Reported-and-tested-by: Mauro Santos <registo.mailling@gmail.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+---
+ sound/usb/mixer.c | 27 ++++++++++++++++-----------
+ 1 file changed, 16 insertions(+), 11 deletions(-)
+
+diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
+index afc208e1c756..60ebc99ae323 100644
+--- a/sound/usb/mixer.c
++++ b/sound/usb/mixer.c
+@@ -2173,20 +2173,25 @@ static int parse_audio_selector_unit(struct mixer_build *state, int unitid,
+ kctl->private_value = (unsigned long)namelist;
+ kctl->private_free = usb_mixer_selector_elem_free;
+
+- nameid = uac_selector_unit_iSelector(desc);
++ /* check the static mapping table at first */
+ len = check_mapped_name(map, kctl->id.name, sizeof(kctl->id.name));
+- if (len)
+- ;
+- else if (nameid)
+- len = snd_usb_copy_string_desc(state, nameid, kctl->id.name,
+- sizeof(kctl->id.name));
+- else
+- len = get_term_name(state, &state->oterm,
+- kctl->id.name, sizeof(kctl->id.name), 0);
+-
+ if (!len) {
+- strlcpy(kctl->id.name, "USB", sizeof(kctl->id.name));
++ /* no mapping ? */
++ /* if iSelector is given, use it */
++ nameid = uac_selector_unit_iSelector(desc);
++ if (nameid)
++ len = snd_usb_copy_string_desc(state, nameid,
++ kctl->id.name,
++ sizeof(kctl->id.name));
++ /* ... or pick up the terminal name at next */
++ if (!len)
++ len = get_term_name(state, &state->oterm,
++ kctl->id.name, sizeof(kctl->id.name), 0);
++ /* ... or use the fixed string "USB" as the last resort */
++ if (!len)
++ strlcpy(kctl->id.name, "USB", sizeof(kctl->id.name));
+
++ /* and add the proper suffix */
+ if (desc->bDescriptorSubtype == UAC2_CLOCK_SELECTOR)
+ append_ctl_name(kctl, " Clock Source");
+ else if ((state->oterm.type & 0xff00) == 0x0100)
+--
+2.15.1
+
diff --git a/PKGBUILD b/PKGBUILD
index c90d0cd9935b..f37288b5aaed 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -11,7 +11,7 @@ _srcname=linux-4.14
_pkgver=4.14.8
_rtpatchver=rt9
pkgver=${_pkgver}_${_rtpatchver}
-pkgrel=1
+pkgrel=2
arch=('x86_64')
url="https://www.kernel.org/"
license=('GPL2')
@@ -27,12 +27,12 @@ source=(
'config' # the main kernel config file
'60-linux-rt.hook' # pacman hook for depmod
'90-linux-rt.hook' # pacman hook for initramfs regeneration
-# "${pkgbase}.preset"
'linux-rt.preset' # standard config files for mkinitcpio ramdisk
0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch
0001-e1000e-Fix-e1000_check_for_copper_link_ich8lan-retur.patch
0002-dccp-CVE-2017-8824-use-after-free-in-DCCP-code.patch
0001-drm-i915-Avoid-PPS-HW-SW-state-mismatch-due-to-rounding.patch
+ 0001-ALSA-usb-audio-Fix-the-missing-ctl-name-suffix-at-pa.patch
fix-race-in-PRT-wait-for-completion-simple-wait-code_Nvidia-RT-160319.patch
)
validpgpkeys=(
@@ -56,6 +56,7 @@ sha256sums=('f81d59477e90a130857ce18dc02f4fbe5725854911db1e7ba770c7cd350f96a7'
'ac203ad289f4b0782fe94487450863aaf796cf06e60a09ee097bd8c4338c9572'
'93f08a383189664579b07b1d7da2a54a8b758bcf03926bf4947484bb4bf4fb4c'
'b0396825ecd293499907ad86a0eb642cd5e82e534619f95658438ee6ecff10eb'
+ 'cbf586270595a89835dc02602983028f4cea80c40a43be3d4871dae4fdb46b84'
'85f7612edfa129210343d6a4fe4ba2a4ac3542d98b7e28c8896738e7e6541c06')
_kernelname=${pkgbase#linux}
@@ -84,6 +85,10 @@ prepare() {
msg "applying 0001-drm-i915-Avoid-PPS-HW-SW-state-mismatch-due-to-rounding.patch"
patch -Np1 -i ../0001-drm-i915-Avoid-PPS-HW-SW-state-mismatch-due-to-rounding.patch
+ # fix a problem with USB audio
+ msg "0001-ALSA-usb-audio-Fix-the-missing-ctl-name-suffix-at-pa.patch"
+ patch -Np1 -i ../0001-ALSA-usb-audio-Fix-the-missing-ctl-name-suffix-at-pa.patch
+
# add realtime patch
msg "applying patch-${_pkgver}-${_rtpatchver}.patch"
patch -Np1 -i ../patch-${_pkgver}-${_rtpatchver}.patch