All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geraldo Nascimento <geraldogabriel@gmail.com>
To: alsa-devel@alsa-project.org, Takashi Iwai <tiwai@suse.de>
Subject: [PATCH v2] Behringer UFX1604 / UFX1204: get rid of unneeded implicit feedback and pops and clicks while on 96000hz
Date: Fri, 9 Apr 2021 22:36:14 -0300	[thread overview]
Message-ID: <CAEsQvcvF7LnO8PxyyCxuRCx=7jNeSCvFAd-+dE0g_rd1rOxxdw@mail.gmail.com> (raw)

More complete patch disabling unneeded implicit feedback and setting
clock selector to default clock on rate change for UFX1604

After re-reading https://bugzilla.kernel.org/show_bug.cgi?id=199327 it
is even more clear to me that implicit feedback for the
UFX1604/UFX1204 needs to be disabled.

This is a more complete patch that disables that and for the UFX1604
only sets the clock selector to its pin 1 default clock synced to the
USB SOF upon rate change. This is needed because apparently the
endpoints are hardwired to the clock selector and after we change the
rate on the main USB SOF synced clock the clock selector is left in a
halfway state in regards to the sampling rate.

That's why the pops and clicks aren't evident at stock 48000Hz, become
slightly audible at 44100Hz and detestable at 96000Hz. Seems the clock
selector needs a nudge or it will screw up the sync.

Unfortunately I don't have access to the lsusb -v of the UFX1204 soI'm
waiting for someone to share it here in the list or in the bugzilla
thread. This patch needs some more love from the community.

---

This one has been bugging me for quite a while. I went deep hard in
the guts of ALSA to try to solve it, and it turned out to be a minor
thing apparently. The problem is old, and every UFX1604 Linux user can
attest that it's impossible to use 96000hz in DUPLEX mode without
annoying pops and clicks on the capture stream.

The fix is simple: after we alter the CLOCK_SOURCE to match our sample
rate, let's tell the CLOCK_SELECTOR we want CLOCK_SOURCE 212 (synced
to USB SOF) on pin 1. Solves the problem for me, no more pops and
clicks while on 96000hz.

---

Signed-off-by: Geraldo Nascimento <geraldogabriel@gmail.com>

--- implicit.c  2021-04-04 20:51:57.226754632 -0300
+++ implicit.c  2021-04-09 21:55:19.593994214 -0300
@@ -50,8 +50,6 @@ static const struct snd_usb_implicit_fb_

        /* Fixed EP */
        /* FIXME: check the availability of generic matching */
-       IMPLICIT_FB_FIXED_DEV(0x1397, 0x0001, 0x81, 1), /* Behringer UFX1604 */
-       IMPLICIT_FB_FIXED_DEV(0x1397, 0x0002, 0x81, 1), /* Behringer UFX1204 */
        IMPLICIT_FB_FIXED_DEV(0x2466, 0x8010, 0x81, 2), /* Fractal
Audio Axe-Fx III */
        IMPLICIT_FB_FIXED_DEV(0x31e9, 0x0001, 0x81, 2), /* Solid State
Logic SSL2 */
        IMPLICIT_FB_FIXED_DEV(0x31e9, 0x0002, 0x81, 2), /* Solid State
Logic SSL2+ */
--- clock.c     2021-04-09 22:01:08.234001611 -0300
+++ clock.c     2021-04-09 22:01:53.640669243 -0300
@@ -610,6 +610,14 @@ int snd_usb_set_sample_rate_v2v3(struct
        if (err < 0)
                return err;

+        if (chip->usb_id == USB_ID(0x1397, 0x0001)) { /* Behringer UFX1604 */
+                printk(KERN_WARNING "Setting clock selector for UFX1604");
+                err = uac_clock_selector_set_val(chip, 211, 1);
+                if (err < 0)
+                    return err;
+       }
+
+
        return get_sample_rate_v2v3(chip, fmt->iface, fmt->altsetting, clock);
 }

             reply	other threads:[~2021-04-10  1:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-10  1:36 Geraldo Nascimento [this message]
2021-04-10  8:59 ` [PATCH v2] Behringer UFX1604 / UFX1204: get rid of unneeded implicit feedback and pops and clicks while on 96000hz Takashi Iwai
2021-04-10 20:27   ` Geraldo Nascimento
2021-04-12 10:14     ` Takashi Iwai
2021-04-12 23:09       ` 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='CAEsQvcvF7LnO8PxyyCxuRCx=7jNeSCvFAd-+dE0g_rd1rOxxdw@mail.gmail.com' \
    --to=geraldogabriel@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.