Fwd: Pioneer DJ DDJ-SR2 sound degradation

Geraldo geraldogabriel at gmail.com
Sun Mar 21 16:47:32 CET 2021


Good news: my JACK transport has been rolling for more than 2 hours
without sound degradation. I'll leave it overnight just to be sure
sound degradation has been fixed and not just postponed.

But yes, I think I managed to engage implicit feedback sync for the
playback on my Pioneer DJ DDJ-SR2.

Dr. Iwai, my initial assesment was ALSA not honoring .ep_attr on
quirks-table.h was the culprit for the Incompatible EP Setup messages.

Turns out that for implicit feedback sync the EP is opened twice, and
the ep->opened refcount prevents that.

Once I commented out ep->opened++; inside snd_usb_endpoint_open on
endpoint.c the kernel was able to open the EP twice(one time for data,
second time for sync).

I could use some help in coding an elegant way of going around the
ep->opened refcount instead of simpy disabling it!

Once that particular problem is sorted out I'll be able to provide a
proper PATCH for all users of Pioneer gear to test implicit feedback
sync.

Here's the relevant dyndbg info for the success case:

[35084.131891] usb 3-2: 0:1: added playback implicit_fb sync_ep 82, iface 0:1
[35084.131905] usb 3-2: Creating new data endpoint #1
[35084.131911] usb 3-2: Creating new data endpoint #82
[35084.131917] xhci_hcd 0000:00:14.0: xhci_check_bandwidth called for
udev 0000000052e95692
[35084.132102] usb 3-2: 0:1 Set sample rate 44100, clock 0
[35084.132116] xhci_hcd 0000:00:14.0: xhci_check_bandwidth called for
udev 0000000052e95692
[35084.132163] usb 3-2: 0:1 Set sample rate 44100, clock 0
[35084.132592] usbcore: registered new interface driver snd-usb-audio
[35096.805245] usb 3-2: Open EP 0x82, iface=0:1, idx=1
[35096.805254] usb 3-2:   channels=6, rate=44100, format=S24_3LE,
period_bytes=9216, periods=2, implicit_fb=0
[35096.805259] usb 3-2: Setting usb interface 0:0 for EP 0x82
[35096.805264] xhci_hcd 0000:00:14.0: xhci_check_bandwidth called for
udev 0000000052e95692
[35096.805475] usb 3-2: Setting usb interface 0:1 for EP 0x82
[35096.805486] xhci_hcd 0000:00:14.0: add ep 0x1, slot id 32, new drop
flags = 0x0, new add flags = 0x5
[35096.805492] xhci_hcd 0000:00:14.0: add ep 0x82, slot id 32, new
drop flags = 0x0, new add flags = 0x25
[35096.805495] xhci_hcd 0000:00:14.0: xhci_check_bandwidth called for
udev 0000000052e95692
[35096.805499] xhci_hcd 0000:00:14.0: Adding 2 ep ctxs, 6 now active.
[35096.805503] xhci_hcd 0000:00:14.0: Recalculating BW for rootport 2
[35096.805505] xhci_hcd 0000:00:14.0: Final bandwidth: 282, Limit:
1607, Reserved: 322, Available: 62 percent
[35096.805510] xhci_hcd 0000:00:14.0: // Ding dong!
[35096.805652] xhci_hcd 0000:00:14.0: Successful Endpoint Configure command
[35096.805895] usb 3-2: 0:1 Set sample rate 44100, clock 0
[35096.805902] usb 3-2: Setting params for data EP 0x82, pipe 0x14180
[35096.805910] usb 3-2: Set up 12 URBS, ret=0
[35096.805996] usb 3-2: Open EP 0x1, iface=0:1, idx=0
[35096.806000] usb 3-2:   channels=4, rate=44100, format=S24_3LE,
period_bytes=6144, periods=2, implicit_fb=1
[35096.806003] usb 3-2: Open EP 0x82, iface=0:1, idx=1
[35096.806005] usb 3-2:   channels=6, rate=44100, format=S24_3LE,
period_bytes=9216, periods=2, implicit_fb=0
[35096.806008] usb 3-2: 0:1 Set sample rate 44100, clock 0
[35096.806011] usb 3-2: Setting params for data EP 0x1, pipe 0xc100
[35096.806018] usb 3-2: Set up 12 URBS, ret=0
[35096.806021] usb 3-2: 0:1 Set sample rate 44100, clock 0
[35096.806025] usb 3-2: Setting params for data EP 0x82, pipe 0x14180
[35096.806029] usb 3-2: Set up 12 URBS, ret=0
[35096.806048] usb 3-2: Starting data EP 0x1 (running 0)
[35096.806051] usb 3-2: No URB submission due to implicit fb sync
[35096.806053] usb 3-2: Starting data EP 0x82 (running 0)
[35096.806076] usb 3-2: 12 URBs submitted for EP 0x82
[35096.807337] usb 3-2: Starting data EP 0x82 (running 1)
[35096.807343] usb 3-2: 0:1 Start Capture PCM
[35096.807346] usb 3-2: 0:1 Start Playback PCM

On Sun, Mar 21, 2021 at 5:22 AM Takashi Iwai <tiwai at suse.de> wrote:
>
> On Sun, 21 Mar 2021 05:31:11 +0100,
> Geraldo wrote:
> >
> > Until we manage to engage implicit feedback sync for Pioneer gear I'm
> > afraid the clock will drift on DUPLEX mode.
> >
> > I reread the Pioneer related source code and implicit feedback sync was
> > disabled because it gave Incompatible EP Setup messages. I should know, I
> > was a reporter on that regression.
> >
> > Only those messages are fake. They arise because our ALSA code it's not
> > honoring .ep_attr on quirks-table.h specifically in regards to
> > USB_ENDPOINT_USAGE_IMPLICIT_FB.
>
> That's right.  The parser reads from the original descriptor, not the
> one from the quirk table.  That is, the implicit fb quirk has to be
> declared explicitly in another quirk table.  And, the implicit fb is
> skipped for those devices because they didn't work; see
> sound/usb/implicit.c.
>
> > In fact the new improved implicit feedback sync code inside pcm.c that sets
> > sync upon probe is failing to set implicit_fb to 1. I commented the
> > conditional for testing and I told endpoint_compatible to always return
> > true.
> >
> > Voilà, JACK started in duplex mode without nasty Incompatible EP Setup
> > problems and supposedly with implicit feedback sync on. We are not setting
> > bits 5..7 of bmAttributes, at least that's what I get from the missing
> > Usage field in lsusb.
> >
> > My JACK transport has been rolling for 17 minutes and if it goes for two
> > complete hours without distortion passing-thru vinyl on Mixxxx I'll provide
> > the list with a more elegant PATCH and not this gambiarra as we say on
> > Brazil.
> >
> > Hopefully their will be implicit feedback sync for Pioneer :-)
>
> I know there are quite a few users with Pioneer devices around here,
> so let's hope that they can test the implicit feedback things and find
> the culprit of the buggy behavior.  Unfortunately it's quite hard to
> debug such a thing remotely without the hardware from my side.
>
>
> Takashi
>
>
> >
> >
> > On Thu, Mar 18, 2021 at 7:41 PM Geraldo <geraldogabriel at gmail.com> wrote:
> > >
> > > Hi everyone,
> > >
> > > I'm running stable kernel 5.11.6 together with my Pioneer DJ DDJ-SR2 and
> > JACK. Mixxx is running on top of JACK.
> > >
> > >
> > > After I start JACK I have about 40 minutes of good sound quality from the
> > inputs. After this period the sound will begin to degrade slowly until it
> > is almost pure distortion.
> > >
> > > The issue is gone if I restart the JACK server, no need to reboot the
> > hardware. The description I gave above sounds a lot like soundcard clock
> > drift (which happens to those using more than one soundcard. You know)
> > which motivates me to believe we missed a bug somewhere around the recent
> > changes introduced in implicit feedback sync for Pioneer devices
> > >
> > > Dyndbg shows nothing useful I guess. No xruns reported.
> > >
> > > I've recorded a 1KHz tone and after 50+ minutes the sound degradation
> > kicks in. Only problem is even after cutting and encoding to mp3 128kbps
> > it's still a 10 megabytes file. I suppose I could post it to Soundcloud or
> > Mixcloud if anyone is interested.
> > >
> > > Is anyone else experiencing these symptoms with Pioneer hardware? Note
> > that the sound degradation kicks in after about an hour, more or less, and
> > it's for the inputs only. Outputs continue to operate fine without the need
> > to restart the JACK server every hour.
> > >
> > > Thanks everybody,
> > > Geraldo
> >


More information about the Alsa-devel mailing list