I wrote:
> P Z wrote:
>> The distortion characteristics on arm changed slightly, which points to a 
>> firmware issue.
>
> I suspect that the DMA of the frequency feedback data is not handled 
> correctly.

Please try the patch below.


Regards,
Clemens


--- a/sound/usb/card.h
+++ b/sound/usb/card.h
@@ -76,8 +76,6 @@ struct snd_usb_endpoint {
        unsigned int nurbs;             /* # urbs */
        unsigned long active_mask;      /* bitmask of active urbs */
        unsigned long unlink_mask;      /* bitmask of unlinked urbs */
-       char *syncbuf;                  /* sync buffer for all sync URBs */
-       dma_addr_t sync_dma;            /* DMA address of syncbuf */

        unsigned int pipe;              /* the data i/o pipe */
        unsigned int freqn;             /* nominal sampling rate in fs/fps in 
Q16.16 format */
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
index 7b1cb36..c9817ca 100644
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -593,11 +593,6 @@ static void release_urbs(struct snd_usb_endpoint *ep, int 
force)
        for (i = 0; i < ep->nurbs; i++)
                release_urb_ctx(&ep->urb[i]);

-       if (ep->syncbuf)
-               usb_free_coherent(ep->chip->dev, SYNC_URBS * 4,
-                                 ep->syncbuf, ep->sync_dma);
-
-       ep->syncbuf = NULL;
        ep->nurbs = 0;
 }

@@ -789,22 +784,21 @@ static int sync_ep_set_params(struct snd_usb_endpoint *ep)
 {
        int i;

-       ep->syncbuf = usb_alloc_coherent(ep->chip->dev, SYNC_URBS * 4,
-                                        GFP_KERNEL, &ep->sync_dma);
-       if (!ep->syncbuf)
-               return -ENOMEM;
-
        for (i = 0; i < SYNC_URBS; i++) {
                struct snd_urb_ctx *u = &ep->urb[i];
                u->index = i;
                u->ep = ep;
                u->packets = 1;
+               u->buffer_size = 4;
                u->urb = usb_alloc_urb(1, GFP_KERNEL);
                if (!u->urb)
                        goto out_of_memory;
-               u->urb->transfer_buffer = ep->syncbuf + i * 4;
-               u->urb->transfer_dma = ep->sync_dma + i * 4;
-               u->urb->transfer_buffer_length = 4;
+               u->urb->transfer_buffer =
+                       usb_alloc_coherent(ep->chip->dev, u->buffer_size,
+                                          GFP_KERNEL, &u->urb->transfer_dma);
+               if (!u->urb->transfer_buffer)
+                       goto out_of_memory;
+               u->urb->transfer_buffer_length = u->buffer_size;
                u->urb->pipe = ep->pipe;
                u->urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
                u->urb->number_of_packets = 1;

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user

Reply via email to