From patchwork Thu Aug 30 19:57:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: news@aboehler.at X-Patchwork-Id: 10582773 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 191D114BD for ; Thu, 30 Aug 2018 19:58:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 089E12BE3D for ; Thu, 30 Aug 2018 19:58:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F11032C085; Thu, 30 Aug 2018 19:58:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 163B72BE3D for ; Thu, 30 Aug 2018 19:58:04 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 86E7726792C; Thu, 30 Aug 2018 21:58:02 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 36DB926792D; Thu, 30 Aug 2018 21:58:00 +0200 (CEST) Received: from mail.aboehler.at (mail.aboehler.at [176.9.113.11]) by alsa0.perex.cz (Postfix) with ESMTP id 34D83267668 for ; Thu, 30 Aug 2018 21:57:56 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.aboehler.at (Postfix) with ESMTP id D324C6180211 for ; Thu, 30 Aug 2018 21:57:53 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aboehler.at Received: from mail.aboehler.at ([127.0.0.1]) by localhost (aboehler.at [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RdBHu-HutpgO; Thu, 30 Aug 2018 21:57:52 +0200 (CEST) Received: from t470.home (62-46-214-47.adsl.highway.telekom.at [62.46.214.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: andreas@aboehler.at) by mail.aboehler.at (Postfix) with ESMTPSA id 54A006180207; Thu, 30 Aug 2018 21:57:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aboehler.at; s=default; t=1535659072; bh=BHhAvXk9FplQdcs91Fi7NiZ+yMGJuPJklskvbNWgnqE=; h=From:To:Cc:Subject:Date:From; b=ExoXY5DEzxfUAIoJOs+NeQMT1Cfm40Z5ejfwPyrL+hwpAJKLS7Top6JDHlfviv/0E DnEU4q5A1/ActtIL+QmhZFZ3O2S5fjVMWzzXWqc2nqj+VtRRXZvdd5tZ4kGFz00t/b pAmWqWYPP3jNXHH7hwj3aPxy8BJIwKzEDb/YeIa8= From: news@aboehler.at To: alsa-devel@alsa-project.org Date: Thu, 30 Aug 2018 21:57:17 +0200 Message-Id: <20180830195717.29474-1-news@aboehler.at> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Cc: =?utf-8?q?Andreas_B=C3=B6hler?= , =?utf-8?q?Andreas_B?= =?utf-8?q?=C3=B6hler?= Subject: [alsa-devel] [RFC] ALSA: Add a static keep_iface quirk for two known devices X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andreas Böhler Hi, I own a Phonic Helix Board 12 Universal USB sound mixer that I couldn't get to work properly on my box. After some debugging, it turned out that the playback stream is muted when the capture interface is brought down. Since I was on 4.14, I implemented a quirk there and wanted to port it to 4.18 before submitting it - just to find out that the keep_iface control is very much the same approach. This patch adds a mixer quirk for known devices such as the Phonic Helix Board 12 Universal and the Behringer FCA610 (tested and reported by Takashi Sakamoto). For these devices, the control is not created and keep_iface is simply set to true. Signed-off-by: Andreas Böhler diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index c63c84b54969..f11208fb4e58 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -3474,9 +3474,15 @@ int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif, if (err < 0) goto _error; - err = create_keep_iface_ctl(mixer); - if (err < 0) - goto _error; + /* For known cards, make the keep_iface quirk static + * otherwiese, add a mixer control */ + if(snd_usb_mixer_keep_iface_static_quirk(mixer)) { + mixer->chip->keep_iface = true; + } else { + err = create_keep_iface_ctl(mixer); + if (err < 0) + goto _error; + } snd_usb_mixer_apply_create_quirk(mixer); diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c index cbfb48bdea51..414aa1f3a170 100644 --- a/sound/usb/mixer_quirks.c +++ b/sound/usb/mixer_quirks.c @@ -2000,3 +2000,13 @@ void snd_usb_mixer_fu_apply_quirk(struct usb_mixer_interface *mixer, } } +bool snd_usb_mixer_keep_iface_static_quirk(struct usb_mixer_interface *mixer) +{ + switch (mixer->chip->usb_id) { + case USB_ID(0x170b, 0x0015): /* Phonic Helix Board 12 Universal */ + case USB_ID(0x1397, 0x0003): /* Behringer FCA 610 */ + return true; + } + + return false; +} diff --git a/sound/usb/mixer_quirks.h b/sound/usb/mixer_quirks.h index 52be26db558f..5853e86adffd 100644 --- a/sound/usb/mixer_quirks.h +++ b/sound/usb/mixer_quirks.h @@ -14,6 +14,8 @@ void snd_usb_mixer_fu_apply_quirk(struct usb_mixer_interface *mixer, struct usb_mixer_elem_info *cval, int unitid, struct snd_kcontrol *kctl); +bool snd_usb_mixer_keep_iface_static_quirk(struct usb_mixer_interface *mixer); + #ifdef CONFIG_PM void snd_usb_mixer_resume_quirk(struct usb_mixer_interface *mixer); #endif