Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Geraldo Nascimento <geraldogabriel@gmail.com>
To: Nandakumar Edamana <nandakumar@nandakumar.co.in>
Cc: ALSA-devel <alsa-devel@alsa-project.org>
Subject: Re: Behringer UMC202HD issues and a partial solution
Date: Sat, 15 Jan 2022 22:00:58 -0300	[thread overview]
Message-ID: <YeNuSip2RcH4DlV+@geday> (raw)
In-Reply-To: <5fba3e63-6fd2-de1c-1564-ac6b8870e730@nandakumar.co.in>

On Sat, Jan 15, 2022 at 12:29:18PM +0530, Nandakumar Edamana wrote:
> Could compile and reload the module successfully, but the stuttering is 
> still there.

Hi Nandakumar,

OK, my mistake, scratch that patch.

The codepath that activates Implicit Feedback when implicit_fb=1 is
passed to the module as an option is the same that should activate when
the quirk is in place.

Like I said, it's very strange that your device skips implicit feedback
when the quirk is in place, but can pick implicit feedback when
implicit_fb=1 is passed to the module as an option.

I've prepared some printk's hooked up to every codepath I can think of
that will skip implicit feedback. Please test and share your results,
always with dyndbg on.

--- implicit.c	2022-01-14 16:41:53.946606013 -0300
+++ implicit.c	2022-01-15 21:45:15.108655890 -0300
@@ -90,8 +90,10 @@ static int add_implicit_fb_sync_ep(struc
 
 	if (!alts) {
 		iface = usb_ifnum_to_if(chip->dev, ifnum);
-		if (!iface || iface->num_altsetting < 2)
+		if (!iface || iface->num_altsetting < 2) {
+			printk(KERN_WARNING "implicit: add_implicit_fb_sync_ep(): not a usb_host_interface or less than 2 altsettings");
 			return 0;
+		}
 		alts = &iface->altsetting[1];
 	}
 
@@ -242,17 +244,23 @@ static int __add_generic_implicit_fb(str
 	struct usb_endpoint_descriptor *epd;
 
 	alts = snd_usb_get_host_interface(chip, iface, altset);
-	if (!alts)
+	if (!alts) {
+		printk(KERN_WARNING "implicit: __add_generic_implicit_fb(): not a usb_host_interface");
 		return 0;
+	}
 
 	if ((alts->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC &&
 	     alts->desc.bInterfaceClass != USB_CLASS_AUDIO) ||
-	    alts->desc.bNumEndpoints < 1)
+	    alts->desc.bNumEndpoints < 1) {
+		printk(KERN_WARNING "implicit: __add_generic_implicit_fb(): no endpoints or wrong Interface Class");
 		return 0;
+	}
 	epd = get_endpoint(alts, 0);
 	if (!usb_endpoint_is_isoc_in(epd) ||
-	    (epd->bmAttributes & USB_ENDPOINT_SYNCTYPE) != USB_ENDPOINT_SYNC_ASYNC)
+	    (epd->bmAttributes & USB_ENDPOINT_SYNCTYPE) != USB_ENDPOINT_SYNC_ASYNC) {
+		printk(KERN_WARNING "implicit: __add_generic_implicit_fb(): not Isochronous IN or not Asynchronous");
 		return 0;
+	}
 	return add_implicit_fb_sync_ep(chip, fmt, epd->bEndpointAddress, 0,
 				       iface, alts);
 }
@@ -262,8 +270,10 @@ static int add_generic_implicit_fb(struc
 				   struct audioformat *fmt,
 				   struct usb_host_interface *alts)
 {
-	if ((fmt->ep_attr & USB_ENDPOINT_SYNCTYPE) != USB_ENDPOINT_SYNC_ASYNC)
+	if ((fmt->ep_attr & USB_ENDPOINT_SYNCTYPE) != USB_ENDPOINT_SYNC_ASYNC) {
+		printk(KERN_WARNING "implicit: add_generic_implicit_fb(): not Asynchronous");
 		return 0;
+	}
 
 	if (__add_generic_implicit_fb(chip, fmt,
 				      alts->desc.bInterfaceNumber + 1,
@@ -302,8 +312,10 @@ static int audioformat_implicit_fb_quirk
 	if (p) {
 		switch (p->type) {
 		case IMPLICIT_FB_GENERIC:
+			printk(KERN_WARNING "implicit: audioformat_implicit_fb_quirk(): matched GENERIC inside playback_implicit_fb_quirks[]");
 			return add_generic_implicit_fb(chip, fmt, alts);
 		case IMPLICIT_FB_NONE:
+			printk(KERN_WARNING "implicit: audioformat_implicit_fb_quirk(): matched SKIP_DEV inside playback_implicit_fb_quirks[]");
 			return 0; /* No quirk */
 		case IMPLICIT_FB_FIXED:
 			return add_implicit_fb_sync_ep(chip, fmt, p->ep_num, 0,
@@ -311,6 +323,10 @@ static int audioformat_implicit_fb_quirk
 		}
 	}
 
+	else {
+		printk(KERN_WARNING "implicit: audioformat_implicit_fb_quirk(): no matches found inside playback_implicit_fb_quirks[]");
+	}
+
 	/* Special handling for devices with capture quirks */
 	p = find_implicit_fb_entry(chip, capture_implicit_fb_quirks, alts);
 	if (p) {
@@ -354,6 +370,7 @@ static int audioformat_implicit_fb_quirk
 		return add_generic_implicit_fb(chip, fmt, alts);
 
 	/* No quirk */
+	printk(KERN_WARNING "implicit: audioformat_implicit_fb_quirk(): returning 0 because no quirk was found");
 	return 0;
 }
 

  parent reply	other threads:[~2022-01-16  1:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-13 14:37 Behringer UMC202HD issues and a partial solution Nandakumar Edamana
2022-01-13 19:00 ` Geraldo Nascimento
2022-01-14  2:34   ` Nandakumar Edamana
2022-01-14  3:41     ` Geraldo Nascimento
2022-01-14  4:36       ` Nandakumar Edamana
2022-01-14  7:44         ` Geraldo Nascimento
2022-01-14 13:39           ` Nandakumar Edamana
2022-01-14 22:28             ` Geraldo Nascimento
     [not found]               ` <5fba3e63-6fd2-de1c-1564-ac6b8870e730@nandakumar.co.in>
2022-01-16  1:00                 ` Geraldo Nascimento [this message]
2022-01-18 11:20                   ` Nandakumar Edamana
2022-01-18 19:20                     ` Geraldo Nascimento

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=YeNuSip2RcH4DlV+@geday \
    --to=geraldogabriel@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=nandakumar@nandakumar.co.in \
    /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