rem: int ix;
add: int ix, i, first_record_channel; echo_stream *stream = NULL;
context: echo_open(const char *name, uint32 flags, void** cookie){	echo_dev *card = NULL;	int ix;		LOG(("echo_open()\n"));		for (ix=0; ix<num_cards; ix++) {		if (!strcmp(cards[ix].name, name)) {			card = &cards[ix];		}	}		if(card == NULL) {		LOG(("open() card not found %s\n", name));		for (ix=0; ix<num_cards; ix++) {			LOG(("open() card available %s\n", cards[ix].name)); 		}		return B_ERROR;	}			LOG(("open() got card\n"));		if (card->pstream != NULL)		return B_ERROR;	if (card->rstream != NULL)		return B_ERROR;	if (card->pstream2 != NULL)		return B_ERROR;				*cookie = card;	card->multi.card = card;			LOG(("stream_new\n"));			card->rstream = echo_stream_new(card, ECHO_USE_RECORD, BUFFER_FRAMES, BUFFER_COUNT);	card->pstream2= echo_stream_new(card, ECHO_USE_PLAY, BUFFER_FRAMES, BUFFER_COUNT);	card->pstream = echo_stream_new(card, ECHO_USE_PLAY, BUFFER_FRAMES, BUFFER_COUNT);		card->buffer_ready_sem = create_sem(0, "pbuffer ready");			LOG(("stream_setaudio\n"));		echo_stream_set_audioparms(card->pstream, 2, 16, 48000, 0);	echo_stream_set_audioparms(card->pstream2, 2, 16, 48000, 2);	echo_stream_set_audioparms(card->rstream, 2, 16, 48000, 0);			card->pstream->first_channel = 0;	card->pstream2->first_channel = 2;	card->rstream->first_channel = 4;		echo_create_channels_list(&card->multi);	return B_OK;}