Skip to content

Commit 5d15f1e

Browse files
committed
ALSA: usb-audio: Choose audioformat of a counter-part substream
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: 9fddc15 ("ALSA: usb-audio: Factor out the implicit feedback quirk code") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent b2345a8 commit 5d15f1e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

sound/usb/implicit.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -378,20 +378,19 @@ snd_usb_find_implicit_fb_sync_format(struct snd_usb_audio *chip,
378378
int stream)
379379
{
380380
struct snd_usb_substream *subs;
381-
const struct audioformat *fp, *sync_fmt;
381+
const struct audioformat *fp, *sync_fmt = NULL;
382382
int score, high_score;
383383

384-
/* When sharing the same altset, use the original audioformat */
384+
/* Use the original audioformat as fallback for the shared altset */
385385
if (target->iface == target->sync_iface &&
386386
target->altsetting == target->sync_altsetting)
387-
return target;
387+
sync_fmt = target;
388388

389389
subs = find_matching_substream(chip, stream, target->sync_ep,
390390
target->fmt_type);
391391
if (!subs)
392-
return NULL;
392+
return sync_fmt;
393393

394-
sync_fmt = NULL;
395394
high_score = 0;
396395
list_for_each_entry(fp, &subs->fmt_list, list) {
397396
score = match_endpoint_audioformats(subs, fp,

0 commit comments

Comments
 (0)