All of lore.kernel.org
 help / color / mirror / Atom feed
From: news@aboehler.at
To: alsa-devel@alsa-project.org
Cc: "Andreas Böhler" <dev@aboehler.at>, "Andreas Böhler" <news@aboehler.at>
Subject: [RFC] ALSA: Add a static keep_iface quirk for two known devices
Date: Thu, 30 Aug 2018 21:57:17 +0200	[thread overview]
Message-ID: <20180830195717.29474-1-news@aboehler.at> (raw)

From: Andreas Böhler <news@aboehler.at>

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 <dev@aboehler.at>

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
-- 
2.18.0

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

             reply	other threads:[~2018-08-30 19:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-30 19:57 news [this message]
2018-08-31  2:49 ` [RFC] ALSA: Add a static keep_iface quirk for two known devices Takashi Sakamoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180830195717.29474-1-news@aboehler.at \
    --to=news@aboehler.at \
    --cc=alsa-devel@alsa-project.org \
    --cc=dev@aboehler.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.