LKML Archive on
help / color / mirror / Atom feed
From: "Zengtao (B)" <>
To: Takashi Iwai <>
Cc: "" <>,
	"" <>,
	"" <>,
	"" <>
Subject: RE: [alsa-devel] Timeout issues in wait_for_avail function
Date: Thu, 31 May 2018 07:43:10 +0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Hi Takashi:

Thank you for your reply.

>-----Original Message-----
>From: Takashi Iwai []
>Sent: Sunday, May 13, 2018 6:40 PM
>To: Zengtao (B) <>
>Subject: Re: [alsa-devel] Timeout issues in wait_for_avail function
>On Mon, 07 May 2018 12:49:34 +0200,
>Zengtao (B) wrote:
>> Hi perex and tiwai:
>> I have met a timeout case when capture audio from snd-usb-audio
>> device, when the host call the pcm_read and get into the wait_for_avail
>> The following happends
>> 1.  No available data for capture(maybe because of the late response
>> audio data by the uac device)
>Hrm, in the case of capture, the data must be available.
>If it's not the case, something is wrong.
>> 2.  The current thread falls into sleep state and no one wakes up it.
>> 3.  The current thread will sleep 10s(schedule_timeout(1000)) and then
>> I have two question about the wait_for_avail:
>> 1. The timeout value too long, is it a reasonable value?
>> 2. Is there any mechanism to wake up the thread if there is data from the
>The scenario above shouldn't happen, so no need for discussion.
>Rather we should check why it's woken up even though no data is available.

It really happens on my platform, and anyway 10 seconds timeout seems
not a reasonable value. And I don't there is any guarantee that there must be avail
data when we reach wait_for_avail, in fact, inside the wait_for_avail, there is branch
when no data is available.

>You can check the tracepoints to see the action of PCM stream, and confirm
>whether it's really no data, or it's just lost by some reason (or looks as if so).
I trace the data flow, we reach the wait_for_avail function before the usb snd data arrives, 
so we wait until 10 seconds timeout. 



  reply	other threads:[~2018-05-31  7:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-07 10:49 Zengtao (B)
2018-05-13 10:40 ` [alsa-devel] " Takashi Iwai
2018-05-31  7:43   ` Zengtao (B) [this message]
2018-05-31  8:06     ` Takashi Iwai

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \
    --subject='RE: [alsa-devel] Timeout issues in wait_for_avail function' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).