LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Broken Pipe with ALSA (https://www.linuxquestions.org/questions/linux-software-2/broken-pipe-with-alsa-381415/)

MatesL 11-09-2005 07:24 AM

Broken Pipe with ALSA
 
Dear forum,

i've created a programm for audio streaming via network. But there's a problem with audio playback. Sometimes (~70%) when i start my application the writei() call returns the "broken pipe" error code. Can anybody tell me, what this is about? And what does "broken pipe" mean anyway?

thanks in advance

Michael

Matir 11-09-2005 09:09 AM

Broken Pipe usually indicates that the connection between the two ends has been lost.

MatesL 11-09-2005 01:22 PM

Ok, thats plausible.

But I'm wondering why this happens.

Is it possible I'm not writing new data fast enough, so that the buffer gets empty?

foo_bar_foo 11-09-2005 08:17 PM

not that i know alot about it but that errno is EPIPE
when sockets were introduced in 4.2BSD, pipes were reimplemented as sockets.
A process tried to read or write to a pipe where the other end of the pipe no longer exists.

you might want to try send() it's a little easier to controll than write.

generally i think read() will block until there is some data to return so you have to syncronize in some way

MatesL 11-10-2005 03:44 AM

I don't get it, let's see if you mean the same thing.

my code looks like:

Code:

while (1) {
  udp->receive(buf1);
  decode(buf1,buf2);
  err = snd_pcm_writei(handle, buf2, length);
  if (err == -EAGAIN)
      xrun_recovery(handle);
}


here snd_pcm_writei returns EAGAIN ("Broken Pipe").


All times are GMT -5. The time now is 07:44 PM.