All of lore.kernel.org
 help / color / mirror / Atom feed
* Problem with: Broken Pipe
@ 2003-07-24 13:48 Holger Rostalski
  2003-07-24 19:35 ` Paul Davis
  0 siblings, 1 reply; 2+ messages in thread
From: Holger Rostalski @ 2003-07-24 13:48 UTC (permalink / raw)
  To: alsa-devel

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

moin.
i have a problem with development of a soundapplication for Linux 8.2 
with ALSA 0.9.0


if i take the "Minimal Interrupt Driven -Program" from the tutorial (in 
attachments) and changed a little bit the
play_callback-methode, i got at start a
"broken Pipe" error.

what means it?

my changes:
================
       int
	playback_callback (snd_pcm_sframes_t nframes)
	{
		int err;
	
		printf ("playback callback called with %u frames\n", nframes);
		unsigned char data[4*4096];
		for (int x=0; x<4096; x++)
		{
			buf[x]=10*x;
				data[4*x]=(unsigned char) buf[x];
				data[4*x+1]=buf[x] >> 8;
				data[4*x+2]=(unsigned char) buf[x];
				data[4*x+3]=buf[x] >> 8;
			cout << "test" << x;

			
		};
	
		if ((err = snd_pcm_writei (playback_handle, data, 4096)) < 0) {
			fprintf (stderr, "write failed (%s)\n", 	snd_strerror (err));
		}
	
		return err;
	}




-> if i delete the cout-command, the programm works fine...but with cout 
(or with fprint ) i got "broken pipe". ...

 >>>>>>>>>   this is only the simplest way to reproduce the error. my 
programm has much more code. <<<<<<<<<<<<<<<<<<<<<





greetz
Holger

[-- Attachment #2: alsa-audio--docu.html --]
[-- Type: text/html, Size: 25402 bytes --]

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

* Re: Problem with: Broken Pipe
  2003-07-24 13:48 Problem with: Broken Pipe Holger Rostalski
@ 2003-07-24 19:35 ` Paul Davis
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Davis @ 2003-07-24 19:35 UTC (permalink / raw)
  To: Holger Rostalski; +Cc: alsa-devel

>i have a problem with development of a soundapplication for Linux 8.2 
>with ALSA 0.9.0
>
>
>if i take the "Minimal Interrupt Driven -Program" from the tutorial (in 
>attachments) and changed a little bit the
>play_callback-methode, i got at start a
>"broken Pipe" error.

how many channels are you configuring? you are telling writei() that
you are supplying 4096 *frames* of data, yet from what i can tell, you
are actually trying to write data for, well, i don't know. could be 2
16 bit channels, or 1 32 bit channel, or 4 8 bit channels. i suspect
that is the source of the problem: you are not supplying enough data
to keep up with the card.

please remember that the arguments to almost every ALSA function that
measures "an amount of audio" are in units of *frames*, not bytes and
not samples.

--p


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01

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

end of thread, other threads:[~2003-07-24 19:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-24 13:48 Problem with: Broken Pipe Holger Rostalski
2003-07-24 19:35 ` Paul Davis

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.