ALSA: usb-audio: Pass JOINT_DUPLEX info flag for implicit fb streams
authorTakashi Iwai <tiwai@suse.de>
Thu, 7 Oct 2021 08:35:28 +0000 (10:35 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 7 Oct 2021 10:25:21 +0000 (12:25 +0200)
When a stream is in the implicit feedback mode, it's more or less tied
with a capture stream.  Passing SNDRV_PCM_INFO_JOINT_DUPLEX may help
for user-space to understand the situation.

Link: https://lore.kernel.org/r/20211007083528.4184-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/pcm.c

index f09c738..3bb095a 100644 (file)
@@ -1080,6 +1080,13 @@ static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substre
        if (err < 0)
                return err;
 
+       list_for_each_entry(fp, &subs->fmt_list, list) {
+               if (fp->implicit_fb) {
+                       runtime->hw.info |= SNDRV_PCM_INFO_JOINT_DUPLEX;
+                       break;
+               }
+       }
+
        return 0;
 }