public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
From: Bogdan Veringioiu <bogdan.veringioiu@amano.eu>
To: Clemens Ladisch <clemens@ladisch.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: Problems with usb soundcard in kernels > 3.3
Date: Thu, 13 Nov 2014 15:29:24 +0100	[thread overview]
Message-ID: <5464C044.3070209@amano.eu> (raw)
In-Reply-To: <5463705C.8060808@ladisch.de>

Thank you very much.
Your insight was helpful.
Indeed the wait is caused by the timeout in control messages.
The timeout is now (kernels 3.15, 3.16) set according with the global 
timeout defined in usb.h (5 seconds):

-->linux/usb.h
#define USB_CTRL_GET_TIMEOUT  5000
#define USB_CTRL_SET_TIMEOUT  5000

-->sound/usb/helper.c
   if (requesttype & USB_DIR_IN)
     timeout = USB_CTRL_GET_TIMEOUT;
   else
     timeout = USB_CTRL_SET_TIMEOUT;
   err = usb_control_msg(dev, pipe, request, requesttype,
             value, index, buf, size, timeout);

so, this explains the 5 seconds delay.

In kernel 3.2, the timeout in helper.c was 1 second (hardcoded):

-->sound/usb/helper.c
   err = usb_control_msg(dev, pipe, request, requesttype,
             value, index, buf, size, 1000);

this explains the faster response in older kernels.

The timeout is received when reading the sample rate from the device,
and then the error message "cannot get freq..." is displayed in syslog.

I have modified the timeout (reverted to 1 second) as a test in the new 
kernel and recompiled the module, the result was as expected, faster 
response.

I will contact the manufacturer to ask about this problem.

Thank you again.
Bogdan



On 11/12/2014 03:36 PM, Clemens Ladisch wrote:
> Bogdan Veringioiu wrote:
> > There is one message that appears in syslog, but it is always
> > displayed when I test with aplay, unregarding the kernel version.
> >
> > --> with kernel 3.2.0-4-686-pae
> > kernel: [ 2829.369380] 2:1:1: cannot get freq at ep 0x2
> >
> > --> with kernel 3.16-0.bpo.2-686-pae
> > kernel: [  199.353227] usb 2-1: 1:1: cannot get freq at ep 0x2
>
> This indicates a bug in the device's firmware.
>
> The timeout for control messages was increased from 100 ms to 1000 ms
> in kernel 3.3.
>
>
> Regards,
> Clemens
>

      reply	other threads:[~2014-11-13 14:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-11 11:14 Problems with usb soundcard in kernels > 3.3 Bogdan Veringioiu
2014-11-11 13:32 ` Clemens Ladisch
2014-11-11 14:06   ` Bogdan Veringioiu
2014-11-12 11:22     ` Bogdan Veringioiu
2014-11-12 14:36     ` Clemens Ladisch
2014-11-13 14:29       ` Bogdan Veringioiu [this message]

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=5464C044.3070209@amano.eu \
    --to=bogdan.veringioiu@amano.eu \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox