All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Overrun buffer
@ 2005-04-02  2:22 Laurielle LEA
  2005-04-02  4:18 ` Lee Revell
  0 siblings, 1 reply; 6+ messages in thread
From: Laurielle LEA @ 2005-04-02  2:22 UTC (permalink / raw)
  To: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 822 bytes --]

The code is in attached file.

Thanks.



--- Lee Revell <rlrevell@joe-job.com> wrote:
> On Sat, 2005-04-02 at 00:43 +0200, Laurielle LEA
> wrote:
> > Hi, 
> > 
> > I have now a problem of overrun buffer during
> capture.
> > But it's not occured all the time. Sometimes i
> have
> > -EPIPE for snd_pcm_readi
> > I tried to use  snd_pcm_prepare(), snd_pcm_drop()
> or
> > snd_pcm_drain() calls but I have still -EPIPE.
> > 
> > Do you know how can I solve this ?
> 
> Please post the problematic code to this mailing
> list (don't mail it to
> me privately).
> 
> Lee
> 
> 


	

	
		
__________________________________________________________________
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! 
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/

[-- Attachment #2: alsa.cpp --]
[-- Type: application/octet-stream, Size: 678 bytes --]

int
AudioDriversALSA::readBuffer (void *ptr, int bytes) {
    if( devstate != DeviceOpened ) {
        printf ("ALSA: readBuffer(): Device Not Open\n");
        return -1;
    }
                                                                                
    ssize_t count = bytes;
    ssize_t rc;
    do {
        rc = snd_pcm_readi(audio_hdl, (short*)ptr, count);
    } while (rc == -EAGAIN);
    if (rc == -EPIPE) {
            printf ("ALSA: read EPIPE = %d\n",rc);
            snd_pcm_prepare(audio_hdl);
    }
    if (rc > 0 && rc != count) {
        printf("Read: warning: asked microphone for %d frames but got %d\n",
            count, rc);
    }
    return rc;
}


^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: Overrun buffer
@ 2005-04-04 19:39 Laurielle LEA
  0 siblings, 0 replies; 6+ messages in thread
From: Laurielle LEA @ 2005-04-04 19:39 UTC (permalink / raw)
  To: alsa-devel

To solve the overrun buffer, I found I can use
threshold:

snd_pcm_hw_params_free (hw_params);
if ((err = snd_pcm_sw_params_malloc (&sw_params)) < 0)
{
  fprintf (stderr, "cannot allocate software parameter
structure (%s)\n", snd_strerror (err));
  exit (1);
}
if ((err = snd_pcm_sw_params_current (audio_hdl,
sw_params)) < 0) {
  fprintf (stderr, "Unable to determine current
swparams (%s)\n", snd_strerror (err));
  exit (1);
}	
if ((err = snd_pcm_sw_params_set_stop_threshold
(audio_hdl, sw_params, 0x7fffffff)) < 0) 
{
  fprintf (stderr, "Unable to set stop threshold mode
(%s)\n", snd_strerror (err));
  exit (1);
}
if ((err = snd_pcm_sw_params (audio_hdl, sw_params)) <
0) 
{
  fprintf (stderr, "cannot set sw-parameters (%s)\n",
snd_strerror (err));
  exit (1);
} 
snd_pcm_sw_params_free (sw_params);


But now, I have a endless loop when I use DTMF, it
looks like the sound stay in card and it plays in
loop.
I would like to remove this sound in order to when I
press on one key it plays just this sound ?

Do you see what I mean?

Thanks.
Laurielle.


	

	
		
__________________________________________________________________
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! 
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: Overrun buffer
@ 2005-04-02 16:07 Laurielle LEA
  0 siblings, 0 replies; 6+ messages in thread
From: Laurielle LEA @ 2005-04-02 16:07 UTC (permalink / raw)
  To: Lee Revell; +Cc: alsa-devel


--- Lee Revell <rlrevell@joe-job.com> wrote:
> On Sat, 2005-04-02 at 04:22 +0200, Laurielle LEA
> wrote:
> > The code is in attached file.
> > 
> > Thanks.
> 
> You are mixing up bytes and frames.
> 
> Lee
> 
> 
I need more explanation please.

Laurielle


	

	
		
__________________________________________________________________
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! 
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Overrun buffer
@ 2005-04-01 22:43 Laurielle LEA
  2005-04-02  1:47 ` Lee Revell
  0 siblings, 1 reply; 6+ messages in thread
From: Laurielle LEA @ 2005-04-01 22:43 UTC (permalink / raw)
  To: alsa-devel

Hi, 

I have now a problem of overrun buffer during capture.
But it's not occured all the time. Sometimes i have
-EPIPE for snd_pcm_readi
I tried to use  snd_pcm_prepare(), snd_pcm_drop() or
snd_pcm_drain() calls but I have still -EPIPE.

Do you know how can I solve this ?

Thanks a lot.
Laurielle LEA.


	

	
		
__________________________________________________________________
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! 
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-04-04 19:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-02  2:22 Overrun buffer Laurielle LEA
2005-04-02  4:18 ` Lee Revell
  -- strict thread matches above, loose matches on Subject: below --
2005-04-04 19:39 Laurielle LEA
2005-04-02 16:07 Laurielle LEA
2005-04-01 22:43 Laurielle LEA
2005-04-02  1:47 ` Lee Revell

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.