Re: Behringer UMC202HD issues and a partial solution
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; }
I feel like I'm doing something wrong with the build and install process. Maybe it's been the case for the last couple of days, in which case I'm terribly sorry for the incorrect test results.
The problem is, I don't get any printk() outputs at all. I'd given `echo "7" > /proc/sys/kernel/printk`, and I even added a usb_audio_dbg() line, which didn't get printed either.
Then I saw this:
$ find /lib/modules/ -name 'snd-usb-audio.ko'|xargs ls ... /lib/modules/5.15.13/extra/usb/snd-usb-audio.ko /lib/modules/5.15.13/kernel/sound/usb/snd-usb-audio.ko ...
modprobe is using the kernel/ version while my commands were installing the extra/ version.
Then I used the following, which also installed the extra/ version: sudo make -C /lib/modules/5.15.13/build M=sound modules_install
Are these two versions supposed to exist? What is the solution? Telling the kernel build system to choose the correct location or configuring modprobe or depmod or something? I tried to look it up, but didn't find any official recommendation.
Anyway, I ran this:
# Because I have space constraints # find /lib/modules/5.15.13/ -name '*.ko' -exec strip --strip-unneeded {} + # update-initramfs -u -k 5.15.13
That updated the extra/ version of snd-usb-audio. But even after a reboot, this is what I get:
# modprobe -r -v snd-usb-audio rmmod snd_usb_audio rmmod snd_usbmidi_lib # modprobe -v snd_usb_audio dyndbg==p insmod /lib/modules/5.15.13/kernel/sound/usb/snd-usbmidi-lib.ko insmod /lib/modules/5.15.13/kernel/sound/usb/snd-usb-audio.ko index=-2 index=-2 index=-2 dyndbg==p # dmesg |grep 'implicit:'
Another thing is, even though I'd commented out my clock workaround, I'm not getting any clock-related warning at all (I'm sure those went away after I edited clock.c, and then performed a build+install).
On Tue, Jan 18, 2022 at 04:50:12PM +0530, Nandakumar Edamana wrote:
I feel like I'm doing something wrong with the build and install process. Maybe it's been the case for the last couple of days, in which case I'm terribly sorry for the incorrect test results.
The problem is, I don't get any printk() outputs at all. I'd given `echo "7" > /proc/sys/kernel/printk`, and I even added a usb_audio_dbg() line, which didn't get printed either.
Then I saw this:
$ find /lib/modules/ -name 'snd-usb-audio.ko'|xargs ls ... /lib/modules/5.15.13/extra/usb/snd-usb-audio.ko /lib/modules/5.15.13/kernel/sound/usb/snd-usb-audio.ko ...
modprobe is using the kernel/ version while my commands were installing the extra/ version.
Then I used the following, which also installed the extra/ version: sudo make -C /lib/modules/5.15.13/build M=sound modules_install
Are these two versions supposed to exist? What is the solution? Telling the kernel build system to choose the correct location or configuring modprobe or depmod or something? I tried to look it up, but didn't find any official recommendation.
Yes, it will install on extra/ if you are building with the M=sound/usb option. I guess the 'official' solution is to use the INSTALL_MOD_PATH environment variable.
But what I do instead is I overwrite /lib/modules/<kernel_version>/kernel/sound/usb/snd-usb-audio.ko with the newly built one, and then I run depmod.
Anyway, I ran this:
# Because I have space constraints # find /lib/modules/5.15.13/ -name '*.ko' -exec strip --strip-unneeded {} + # update-initramfs -u -k 5.15.13
That updated the extra/ version of snd-usb-audio. But even after a reboot, this is what I get:
# modprobe -r -v snd-usb-audio rmmod snd_usb_audio rmmod snd_usbmidi_lib # modprobe -v snd_usb_audio dyndbg==p insmod /lib/modules/5.15.13/kernel/sound/usb/snd-usbmidi-lib.ko insmod /lib/modules/5.15.13/kernel/sound/usb/snd-usb-audio.ko index=-2 index=-2 index=-2 dyndbg==p # dmesg |grep 'implicit:'
Another thing is, even though I'd commented out my clock workaround, I'm not getting any clock-related warning at all (I'm sure those went away after I edited clock.c, and then performed a build+install).
I noticed that on your dmesg logs, that the warning was nowhere to be found.
Thank you, Geraldo Nascimento
-- Nandakumar Edamana https://nandakumar.org
participants (2)
-
Geraldo Nascimento
-
Nandakumar Edamana