From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Pete Barnard" Subject: Broken pipe mystery Date: Sat, 8 Feb 2003 10:21:23 -0000 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: <058801c2cf5b$d4f1dfb0$0100a8c0@Pblaptop> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0585_01C2CF5B.D463D080" Return-path: Errors-To: alsa-devel-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: To: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org This is a multi-part message in MIME format. ------=_NextPart_000_0585_01C2CF5B.D463D080 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I am using ALSA 0.9.0rc7 and Red Hat Linux 7.2. My sound card is a = CS461x. My computer is a reasonably powerful beast with 512M of RAM and 1Gig = clock speed. I have written a simple capture program which reads interleaved samples = from the sound card and goes around in a continuous while(1) loop. My = program works perfectly - until it crashes after several hours with the message: "read from audio interface failed: broken pipe". I have narrowed it down to the following piece of code. The size of buf = is 256 (shorts). Why would the snd_pcm_readi suddenly (randomly?) fail = with a broken pipe??? Any ideas or suggestions would be greatly = appreciated as I'm struggling with this annoying (and difficult to debug) problem. Regards, Pete while (1) { if ((err =3D snd_pcm_readi(capture_handle,buf,128)) !=3D 128 { // this is where it fails after several hours of working successfully cout << "read from audio interface failed: " << = snd_strerror(err) << endl; exit(1); } } ------=_NextPart_000_0585_01C2CF5B.D463D080 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I am using ALSA=20 0.9.0rc7 and Red Hat Linux 7.2.  My sound card is a CS461x.
My = computer=20 is a reasonably powerful beast with 512M of RAM and 1Gig = clock
speed.
I=20 have written a simple capture program which reads interleaved samples=20 from
the sound card and goes around in a continuous while(1) = loop.  My=20 program
works perfectly - until it crashes after several hours with = the=20 message:

"read from audio interface failed: broken = pipe".

I have=20 narrowed it down to the following piece of code.  The size of buf = is 256=20 (shorts). Why would the snd_pcm_readi suddenly (randomly?) fail with a = broken=20 pipe???  Any ideas or suggestions would be greatly appreciated as = I'm=20 struggling with this
annoying (and difficult to debug) =20 problem.

Regards,

Pete

while = (1)
{
   =20 if ((err =3D snd_pcm_readi(capture_handle,buf,128)) !=3D = 128
   =20 {
        // this is where it = fails after=20 several hours of=20 working
successfully
        = cout=20 << "read from audio interface failed: " << snd_strerror(err) = <<
endl;
       =20 exit(1);
    = }
}

------=_NextPart_000_0585_01C2CF5B.D463D080-- ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com