From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@alsa-project.org
Cc: "František Kučera" <konference@frantovo.cz>,
Geraldo <geraldogabriel@gmail.com>
Subject: [PATCH v5 2/5] ALSA: usb-audio: Choose audioformat of a counter-part substream
Date: Fri, 8 Jan 2021 08:52:16 +0100 [thread overview]
Message-ID: <20210108075219.21463-3-tiwai@suse.de> (raw)
In-Reply-To: <20210108075219.21463-1-tiwai@suse.de>
The implicit feedback mode needs to handle two endpoints and the
choice of the audioformat object for the sync EP is important since
this determines the compatibility of the hw_params. The current code
uses the same audioformat object if both the main EP and the sync EP
point to the same iface/altsetting. This was done in consideration of
the non-implicit-fb sync EP handling, and it doesn't match well with
the cases where actually to endpoints are defined in the sameiface /
altsetting like a few Pioneer devices.
Modify snd_usb_find_implicit_fb_sync_format() to pick up the
audioformat that is assigned in the counter-part substreams primarily,
so that the actual capture stream can be opened properly. We keep the
same audioformat object only as a fallback in case nothing found,
though.
Fixes: 9fddc15e8039 ("ALSA: usb-audio: Factor out the implicit feedback quirk code")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
sound/usb/implicit.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/sound/usb/implicit.c b/sound/usb/implicit.c
index 931042a6a051..9724efe1cdce 100644
--- a/sound/usb/implicit.c
+++ b/sound/usb/implicit.c
@@ -378,20 +378,19 @@ snd_usb_find_implicit_fb_sync_format(struct snd_usb_audio *chip,
int stream)
{
struct snd_usb_substream *subs;
- const struct audioformat *fp, *sync_fmt;
+ const struct audioformat *fp, *sync_fmt = NULL;
int score, high_score;
- /* When sharing the same altset, use the original audioformat */
+ /* Use the original audioformat as fallback for the shared altset */
if (target->iface == target->sync_iface &&
target->altsetting == target->sync_altsetting)
- return target;
+ sync_fmt = target;
subs = find_matching_substream(chip, stream, target->sync_ep,
target->fmt_type);
if (!subs)
- return NULL;
+ return sync_fmt;
- sync_fmt = NULL;
high_score = 0;
list_for_each_entry(fp, &subs->fmt_list, list) {
score = match_endpoint_audioformats(subs, fp,
--
2.26.2
next prev parent reply other threads:[~2021-01-08 7:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-08 7:52 [PATCH v5 0/5] ALSA: usb-audio: Fixes for Pioneer devices Takashi Iwai
2021-01-08 7:52 ` [PATCH v5 1/5] ALSA: usb-audio: Fix the missing endpoints creations for quirks Takashi Iwai
2021-01-08 7:52 ` Takashi Iwai [this message]
2021-01-08 7:52 ` [PATCH v5 3/5] ALSA: usb-audio: Avoid unnecessary interface re-setup Takashi Iwai
2021-02-04 21:44 ` Pierre-Louis Bossart
2021-02-05 8:09 ` Takashi Iwai
2021-01-08 7:52 ` [PATCH v5 4/5] ALSA: usb-audio: Annotate the endpoint index in audioformat Takashi Iwai
2021-01-08 7:52 ` [PATCH v5 5/5] ALSA: usb-audio: Fix implicit feedback sync setup for Pioneer devices Takashi Iwai
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=20210108075219.21463-3-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=geraldogabriel@gmail.com \
--cc=konference@frantovo.cz \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).