[Icecast] Broken pipe of stdinpcm on asterisk-ices.xml

Zen Kato zenkato at pis.bekkoame.ne.jp
Fri Aug 26 22:19:22 UTC 2005


I installed icecast-2.2.0.tar.gz and ices-2.0.1.tar.gz on Fedora3
linux-2.6.12-1.1372_FC3). It works fine for playlist.ogg from
the other CPU, such as 'xmms'.

But when I use 'stdinpcm' like 'asterisk-ices.xml' which send 
voip's voice udp packets to 'asterisk-ices.xml' such as;


        <!-- metadata used for stream listing -->
            <name>Example stream name</name>
            <genre>Example genre</genre>
            <description>A short description of your stream</description>

        <!--    Input module.

            This example uses the 'oss' module. It takes input from the
            OSS audio device (e.g. line-in), and processes it for live
            encoding.  -->
            <param name="rate">8000</param>
            <param name="channels">1</param>
            <!-- Read metadata (from stdin by default, or -->
            <!-- filename defined below (if the latter, only on SIGUSR1)
            <param name="metadata">1</param>
            <param name="metadatafilename">test</param> -->

It always says" WARING[5929]: app_ices.c:152 ices_exec: Write failed to pipe: Broken pipe" from "app_ices.c" of asterisk. and then hangup, never start 

The part of "app_ices.c" is as follows:
static int ices_exec(struct ast_channel *chan, void *data)
	int res=0;
	struct localuser *u;
	int fds[2];
	int ms = -1;
	int pid = -1;
	int flags;
	int oreadformat;
	struct timeval last;
	struct ast_frame *f;
	char filename[256]="";
	char *c;
	last.tv_usec = 0;
	last.tv_sec = 0;
	res = icesencode(filename, fds[0]);
	if (res >= 0) {
		pid = res;
		for (;;) {
			/* Wait for audio, and stream */
			ms = ast_waitfor(chan, -1);
			if (ms < 0) {
				ast_log(LOG_DEBUG, "Hangup detected\n");
				res = -1;
			f = ast_read(chan);
			if (!f) {
				ast_log(LOG_DEBUG, "Null frame == hangup() detected\n");
				res = -1;
			if (f->frametype == AST_FRAME_VOICE) {
				res = write(fds[1], f->data, f->datalen);
				if (res < 0) {
					if (errno != EAGAIN) {
						ast_log(LOG_WARNING, "Write failed to pipe: %s\n", strerror(errno));
						res = -1;
	if (pid > -1)
		kill(pid, SIGKILL);
	if (!res && oreadformat)
		ast_set_read_format(chan, oreadformat);
	return res;

int unload_module(void)
	return ast_unregister_application(app);

int load_module(void)
	return ast_register_application(app, ices_exec, synopsis, descrip);

char *description(void)
	return tdesc;

int usecount(void)
	int res;
	return res;

char *key()


Is this "broken pipe" means that I don't have "stdinpcim" on /dev?

My system has "stdin" but no "stdinpcm".

[zenkato at p4c8 dev]$ ls -al|grep stdin
lrwxrwxrwx   1 root    root         15  8 27  2005 stdin -> /proc/self/fd/0

Sorry I posted this on 'asterisk-users' ml, but there is no response there.
So, I posted this on this ml.


Zen Kato

More information about the Icecast mailing list