* need help understanding overrun/underrun
@ 2010-08-20 9:44 Harsha, Priya
2010-08-20 9:49 ` Jaroslav Kysela
0 siblings, 1 reply; 4+ messages in thread
From: Harsha, Priya @ 2010-08-20 9:44 UTC (permalink / raw)
To: alsa-devel
Hi
I had modified the arecord application to call snd_pcm_writei() with the output of snd_pcm_readi(). Basically a loopback.
When we execute, I see the calls return EPIPE (lot of overruns and a few underruns). Can anyone help me understand why there are underrun/overrun being printed? Is it because of the serial call of reads and writes? Is there any issue with the driver I am using? Can you suggest some ways to overcome these messages?
Thanks,
Harsha
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: need help understanding overrun/underrun
2010-08-20 9:44 need help understanding overrun/underrun Harsha, Priya
@ 2010-08-20 9:49 ` Jaroslav Kysela
2010-08-24 10:53 ` Harsha, Priya
0 siblings, 1 reply; 4+ messages in thread
From: Jaroslav Kysela @ 2010-08-20 9:49 UTC (permalink / raw)
To: Harsha, Priya; +Cc: alsa-devel
On Fri, 20 Aug 2010, Harsha, Priya wrote:
> Hi
>
> I had modified the arecord application to call snd_pcm_writei() with the
> output of snd_pcm_readi(). Basically a loopback.
>
> When we execute, I see the calls return EPIPE (lot of overruns and a few
> underruns). Can anyone help me understand why there are underrun/overrun
> being printed? Is it because of the serial call of reads and writes? Is
> there any issue with the driver I am using? Can you suggest some ways to
> overcome these messages?
You must queue playback with more samples at the beginning (to
setup the output latency) otherwise you get the output underrun
immediatelly. See alsa-lib/test/latency.c for an example.
Jaroslav
-----
Jaroslav Kysela <perex@perex.cz>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: need help understanding overrun/underrun
2010-08-20 9:49 ` Jaroslav Kysela
@ 2010-08-24 10:53 ` Harsha, Priya
2010-08-24 12:12 ` Jaroslav Kysela
0 siblings, 1 reply; 4+ messages in thread
From: Harsha, Priya @ 2010-08-24 10:53 UTC (permalink / raw)
To: Jaroslav Kysela; +Cc: alsa-devel
> -----Original Message-----
> From: Jaroslav Kysela [mailto:perex@perex.cz]
> Sent: Friday, August 20, 2010 3:20 PM
> To: Harsha, Priya
> Cc: alsa-devel@alsa-project.org
> Subject: Re: [alsa-devel] need help understanding overrun/underrun
>
> On Fri, 20 Aug 2010, Harsha, Priya wrote:
>
> > Hi
> >
> > I had modified the arecord application to call snd_pcm_writei() with the
> > output of snd_pcm_readi(). Basically a loopback.
> >
> > When we execute, I see the calls return EPIPE (lot of overruns and a few
> > underruns). Can anyone help me understand why there are underrun/overrun
> > being printed? Is it because of the serial call of reads and writes? Is
> > there any issue with the driver I am using? Can you suggest some ways to
> > overcome these messages?
>
> You must queue playback with more samples at the beginning (to
> setup the output latency) otherwise you get the output underrun
> immediatelly. See alsa-lib/test/latency.c for an example.
If I do that, initially I don't see underrun. But I see a lot of overrun.
I am doing readi() followed by writei() in a loop of small buffer sizes,
Is that an expected behavior to see such overrun?
>
> Jaroslav
>
> -----
> Jaroslav Kysela <perex@perex.cz>
> Linux Kernel Sound Maintainer
> ALSA Project, Red Hat, Inc.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: need help understanding overrun/underrun
2010-08-24 10:53 ` Harsha, Priya
@ 2010-08-24 12:12 ` Jaroslav Kysela
0 siblings, 0 replies; 4+ messages in thread
From: Jaroslav Kysela @ 2010-08-24 12:12 UTC (permalink / raw)
To: Harsha, Priya; +Cc: alsa-devel
On Tue, 24 Aug 2010, Harsha, Priya wrote:
>
>> -----Original Message-----
>> From: Jaroslav Kysela [mailto:perex@perex.cz]
>> Sent: Friday, August 20, 2010 3:20 PM
>> To: Harsha, Priya
>> Cc: alsa-devel@alsa-project.org
>> Subject: Re: [alsa-devel] need help understanding overrun/underrun
>>
>> On Fri, 20 Aug 2010, Harsha, Priya wrote:
>>
>>> Hi
>>>
>>> I had modified the arecord application to call snd_pcm_writei() with the
>>> output of snd_pcm_readi(). Basically a loopback.
>>>
>>> When we execute, I see the calls return EPIPE (lot of overruns and a few
>>> underruns). Can anyone help me understand why there are underrun/overrun
>>> being printed? Is it because of the serial call of reads and writes? Is
>>> there any issue with the driver I am using? Can you suggest some ways to
>>> overcome these messages?
>>
>> You must queue playback with more samples at the beginning (to
>> setup the output latency) otherwise you get the output underrun
>> immediatelly. See alsa-lib/test/latency.c for an example.
> If I do that, initially I don't see underrun. But I see a lot of overrun.
> I am doing readi() followed by writei() in a loop of small buffer sizes,
> Is that an expected behavior to see such overrun?
Overrun means that the application did not empty the capture ring bufqfer
in time. Try to run your program as root with realtime scheduler settings
(see the latency.c how to do it) or increase the capture buffer size.
Jaroslav
-----
Jaroslav Kysela <perex@perex.cz>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-08-24 12:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-20 9:44 need help understanding overrun/underrun Harsha, Priya
2010-08-20 9:49 ` Jaroslav Kysela
2010-08-24 10:53 ` Harsha, Priya
2010-08-24 12:12 ` Jaroslav Kysela
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.