Exemplo n.º 1
0
/**
 * @ingroup dac_source
 *
 *  Writes the received samples to the dac output buffer
 *
 */
int work(void **inp, void **out) {
	int n;

	if (!stream_started) {
		rtdal_dac_start_rx_stream(dac);
		stream_started=1;
	}
	if (process_params()) {
		return -1;
	}
	if (!nsamples) {
		return 0;
	}
	if (!out[0]) {
		moderror("Output interface not ready\n");
		return -1;
	}
	if (cnt<wait_packets) {
		cnt++;
		modinfo_msg("not receiving ts=%d\n",oesr_tstamp(ctx));
		return 0;
	}
	n = rtdal_dac_recv(dac,out[0],nsamples,blocking);
	modinfo_msg("ts=%d, recv %d samples\n",oesr_tstamp(ctx),n);
	if (n != nsamples) {
		moderror_msg("Recv %d/%d samples\n",n,nsamples);
		return -1;
	}

	return nsamples;
}
Exemplo n.º 2
0
Arquivo: source.c Projeto: alring/aloe
int work(void **inp, void **out) {
	int block_length, type;
	int i,j;
	int snd_samples;

	period_cnt++;
	if (period_cnt>=period) {
		period_cnt=0;
	}
	if (period_cnt) {
		return 0;
	}

	block_length = 0;
	if (param_get_int(blen_id,&block_length) != 1) {
		moderror("Getting integer parameter block_length\n");
		return -1;
	}
	type = 0;
	if (param_get_int(gen_id,&type) != 1) {
		moderror("Getting integer parameter type\n");
		return -1;
	}

	for(i=0;i<NOF_GENERATORS;i++) {
		if (generators[i].key == type) {
			break;
		}
	}
	if (i == NOF_GENERATORS) {
		moderror_msg("Generator type %d not implemented\n", type);
		return -1;
	}
	if (type != last_type) {
		moddebug("Select generator: %s\n",generators[i].desc);
		last_type = type;
	}

	if (block_length > OUTPUT_MAX_SAMPLES/generators[i].samp_sz) {
		moderror_msg("block_length %d too large. Maximum is %d for this generator\n",block_length,
				OUTPUT_MAX_SAMPLES/generators[i].samp_sz);
		return -1;
	}

#ifdef _COMPILE_ALOE
	if (block_length != last_block_length) {
		moddebug("Select block_length: block_length=%d at tslot=%d\n",block_length,oesr_tstamp(ctx));
		last_block_length = block_length;
	}
#endif

	snd_samples = generators[i].work(out[0],block_length);

#ifdef _COMPILE_ALOE
	moddebug("Sent %d samples at ts=%d\n",snd_samples,oesr_tstamp(ctx));
#endif
	return snd_samples;
}
Exemplo n.º 3
0
int Init(void *_ctx) {
	int n;
	ctx = _ctx;

	moddebug("enter ts=%d\n",oesr_tstamp(ctx));

	if (!mem_ok) {
		init_memory();
		mem_ok = 1;
	}

	if (!log_ok) {
		mlog = NULL;
		if (USE_LOG) {
			if (init_log(ctx)) {
				return -1;
			}
		}
		log_ok = 1;
	}

	if (!check_ok) {
		if (check_configuration(ctx)) {
			return -1;
		}
		check_ok = 1;
	}

	if (init_variables(ctx)) {
		return -1;
	}

	if (init_counter(ctx)) {
		return -1;
	}

	moddebug("calling initialize, ts=%d\n",oesr_tstamp(ctx));

	/* this is the module initialize function */
	if (initialize()) {
		moddebug("error initializing module\n",oesr_tstamp(ctx));
		return -1;
	}

	n = init_interfaces(ctx);
	if (n == -1) {
		return -1;
	} else if (n == 0) {
		return 0;
	}

	moddebug("exit ts=%d\n",oesr_tstamp(ctx));
	return 1;
}
Exemplo n.º 4
0
int process_ctrl_packets(void *ctx) {
	int n, nof_packets;
	int i;

	do {
		moddebug("receiving control\n",0);
		n = oesr_itf_read(ctrl_in, ctrl_in_buffer,
				sizeof(struct ctrl_in_pkt)*MAX_INPUT_PACKETS,oesr_tstamp(ctx));
		if (n == -1) {
			oesr_perror("oesr_itf_read");
			return -1;
		} else if (n>0) {
			if (n % sizeof(struct ctrl_in_pkt)) {
				moderror_msg("Received %d bytes but packet size is %d\n", n,
						sizeof(struct ctrl_in_pkt));
			}
			nof_packets = n / sizeof(struct ctrl_in_pkt);
			for (i=0;i<nof_packets;i++) {
				if (process_ctrl_packet(ctx, &ctrl_in_buffer[i])) {
					moderror_msg("Error processing control packet %d/%d\n",i,nof_packets);
					return -1;
				}
			}
		}
	} while(n>0);
	return 0;
}
Exemplo n.º 5
0
int Run(void *_ctx) {
	int tslot;
	ctx = _ctx;

	tslot = oesr_tstamp(ctx);
	if (ctrl_in) {
		if (process_ctrl_packets(ctx)) {
			rtdal_printf("error processing ctrl packets\n");
			return -1;
		}
	}

	if (local_parameters_update(ctx)) {
		rtdal_printf("error uploading local parameters\n");
		return -1;
	}

	if (ctrl_work(tslot)) {
		rtdal_printf("error running\n");
		return -1;
	}

	if (ctrl_send_always) {
		if (remote_parameters_sendall(ctx)) {
/*			rtdal_printf("error sending parameters\n");
*/			return -1;
		}
	}

	return 0;
}
Exemplo n.º 6
0
/**
 * @ingroup file_sink
 *
 *  Writes the received samples to the dac output buffer
 *
 */
int work(void **inp, void **out) {
	int rcv_samples;
	input_t *buffer = inp[0];

	rcv_samples = get_input_samples(0);

#ifdef _COMPILE_ALOE
	if (rcv_samples != last_rcv_samples) {
		last_rcv_samples = rcv_samples;
		modinfo_msg("Receiving %d samples at tslot %d\n",
				rcv_samples,oesr_tstamp(ctx));
	}
#endif

	if (!rcv_samples) {
		return 0;
	}
	switch(data_type) {
	case 0:
		rtdal_datafile_write_real(fd,(float*) buffer,rcv_samples);
		break;
	case 1:
		rtdal_datafile_write_complex(fd,
				(_Complex float*) buffer,rcv_samples);
		break;
	case 2:
		rtdal_datafile_write_complex_short(fd,
				(_Complex short*) buffer,rcv_samples);
		break;
	case -1:
		rtdal_datafile_write_bin(fd,buffer,rcv_samples);
	}

	return 0;
}
Exemplo n.º 7
0
/**
 * @ingroup lte_resource_mapper
 *
 *  Main DSP function
 *
 * This function allocates the data symbols of one slot (0.5 ms) in the corresponding place
 * of the LTE frame grid. During initialization phase CRS, PSS and SSS signals has been
 * incorporated and will no be modified during run phase.
 * PBCH (Physical Broadcast Channel), PCFICH (Physical Control Format Indicator Channel) &
 * PDCCH (Physical Downlink Control Channel) will be incorporated.
 *
 */
int work(void **inp, void **out) {

	if (subframe_idx_id) {
		param_get_int(subframe_idx_id, &subframe_idx);
	}
#ifdef CHECK_RCV_SAMPLES
	int n;
	n=check_received_samples_mapper();
	if (n < 1) {
		return n;
	}
#endif

#ifdef _COMPILE_ALOE
	moddebug("subframe_idx=%d tstamp=%d rcv=%d\n",subframe_idx,oesr_tstamp(ctx),get_input_samples(0));
#endif

	if (allocate_all_channels(inp,out[0])) {
		moderror("Error allocating channels\n");
		return 0;
	}

	subframe_idx++;
	if (subframe_idx==NOF_SUBFRAMES_X_FRAME) {
		subframe_idx=0;
	}

	return 0;
}
Exemplo n.º 8
0
/**
 * @ingroup file_source
 *
 *  Writes the received samples to the dac output buffer
 *
 */
int work(void **inp, void **out) {
	int n;
	output_t *output = out[0];

	switch(data_type) {
	case 0:
		n = rtdal_datafile_read_real(fd,(float*) output,block_length);
		break;
	case 1:
		n = rtdal_datafile_read_complex(fd,
				(_Complex float*) output,block_length);
		break;
	case 2:
		n = rtdal_datafile_read_complex_short(fd,
				(_Complex short*) output,block_length);
		break;
	case -1:
		n = rtdal_datafile_read_bin(fd,output,block_length);
	}

#ifdef _COMPILE_ALOE
	if (n != last_snd_samples) {
		last_snd_samples = n;
		modinfo_msg("Sending %d samples at tslot %d\n",
				n,oesr_tstamp(ctx));
	}
#endif

	return n;
}
Exemplo n.º 9
0
int Stop(void *_ctx) {
	ctx = _ctx;

	moddebug("enter ts=%d\n",oesr_tstamp(ctx));

	stop();

	moddebug("module stoped ok ts=%d\n",oesr_tstamp(ctx));

	close_counter(ctx);
	close_variables(ctx);
	close_interfaces(ctx);

	moddebug("exit ts=%d\n",oesr_tstamp(ctx));
	oesr_exit(ctx);
	return 0;
}
Exemplo n.º 10
0
int remote_parameters_sendall(void *ctx) {
	int i;
	for (i=0;i<nof_remote_variables;i++) {

		if (ctrl_skeleton_send_idx(i, remote_params_db[i].value, remote_params_db[i].size,
				oesr_tstamp(ctx))) {
/*			rtdal_printf("sending ctrl packet to %s:%s\n",
					remote_params_db[i].module_name,remote_params_db[i].variable_name);
*/			return -1;
		}
	}

	return 0;
}
Exemplo n.º 11
0
int send_dci(char *output) {
	struct dci_format1 dci; /* Only format1 is currently supported */
	int len;
	int i;
	int rbg_mask,enable;

	memset(&dci,0,sizeof(struct dci_format1));
	enable=0;
	param_get_int_name("enable",&enable);
	if (!enable) {
		return 0;
	}
	if (param_get_int_name("mcs",&dci.mcs)) {
		modinfo("could not get parameter mcs\n");
	}
	if (param_get_int_name("nof_rbg",&dci.nof_rbg)) {
		modinfo("could not get parameter nof_rbg\n");
	}
	rbg_mask=0;
	if (param_get_int_name("rbg_mask",&rbg_mask)) {
		modinfo("could not get parameter rbg_mask\n");
	}
	for (i=0;i<MAX_RBG_SET;i++) {
		if (rbg_mask & (0x1<<i)) {
			dci.rbg_mask[i] = 1;
		} else {
			dci.rbg_mask[i] = 0;
		}
	}
	dci.ra_type = NA; /* means type0 because nrb<10 */
	dci.harq_pnum_len = 3;
	dci.carrier_indicator_len=2; /* this is to make it divisible by 3 */

	len = dci_format1_pack(output,&dci);
	if (len < 0) {
		moderror("Building DCI Format 1 packet\n");
		return -1;
	}

#ifdef _COMPILE_ALOE
	moddebug("ts=%d transmitted mcs=%d, nof_rbg=%d, rbgmask=0x%x\n",oesr_tstamp(ctx),dci.mcs,dci.nof_rbg,rbg_mask);
#endif
	return len;
}
Exemplo n.º 12
0
/**
 * @ingroup lte_resource_mapper
 *
 *  Main DSP function
 *
 * This function allocates the data symbols of one slot (0.5 ms) in the corresponding place
 * of the LTE frame grid. During initialization phase CRS, PSS and SSS signals has been
 * incorporated and will no be modified during run phase.
 * PBCH (Physical Broadcast Channel), PCFICH (Physical Control Format Indicator Channel) &
 * PDCCH (Physical Downlink Control Channel) will be incorporated.
 *
 */
int work(void **inp, void **out) {
	int n;

	subframe_idx=-1;
	if (subframe_idx_id) {
		param_get_int(subframe_idx_id, &subframe_idx);
	}

#ifdef _COMPILE_ALOE
	moddebug("subframe_idx=%d tstamp=%d rcv_len=%d cfi=%d\n",subframe_idx,oesr_tstamp(ctx),
		get_input_samples(0),grid.cfi);
#endif

	if (subframe_idx==-1) {
		return 0;
	}

	n=check_received_samples_demapper();
	if (n < 1) {
		return n;
	}

	if (channels_init_grid(channel_ids, nof_channels)) {
		moderror("Initiating resource grid\n");
		return 0;
	}

	if (deallocate_all_channels(channel_ids, nof_channels, inp[0],out)) {
		return -1;
	}
	if (extract_refsig(inp[0],out)) {
		return -1;
	}

	if (copy_signal(inp[0],out)) {
		return -1;
	}

	return 0;
}
Exemplo n.º 13
0
/** Sets up to size bytes of the value of the parameter to the value of the
 * buffer pointed by ptr to the
 *
 * \param context OESR context pointer
 * \param idx Index of the parameter in the local database
 * \param value Pointer to the user memory where the parameter value will be stored
 * \param size Size of user memory buffer
 *
 * \return On success, returns a non-negative integer indicating the number of bytes written to value.
 * On error returns -1
 */
int oesr_var_param_set_value_idx(void *context, int idx, void* value, int size) {
	int cpy_sz;

	cast(ctx,context);

	sdebug("%s: set_value_idx idx=%d, value 0x%x size=%d\n",oesr_module_name(ctx),idx,value,size);
	OESR_ASSERT_PARAM(idx>=0);
	OESR_ASSERT_PARAM(value);
	OESR_ASSERT_PARAM(size>0);

	nod_module_t *module = (nod_module_t*) ctx->module;
	variable_t *variable = (variable_t*) &module->parent.variables[idx];

	sdebug("%s: %d:%s: set variable %s value %d\n",oesr_module_name(ctx),oesr_tstamp(context),
				module->parent.name,variable->name,*((int*) value));

	cpy_sz = (size > variable->size)?variable->size:size;

	memcpy(variable->init_value[module->parent.mode.cur_mode], value, (size_t) cpy_sz);
	sdebug("id=0x%x, copied=%d\n", variable, cpy_sz);
	return cpy_sz;
}
Exemplo n.º 14
0
int ctrl_skeleton_send_idx(int dest_idx, void *value, int size,int tstamp) {
	int n;
	if (dest_idx<0 || dest_idx>nof_remote_variables) {
		rtdal_printf("invalid dest_idx=%d\n",dest_idx);
		return -1;
	}

	ctrl_out_buffer.pm_idx = remote_variables[dest_idx].variable_idx;
	ctrl_out_buffer.size = size;
	memcpy(ctrl_out_buffer.value,value,size);

	n=oesr_itf_write(remote_variables[dest_idx].addr->itf,
			&ctrl_out_buffer,size + CTRL_PKT_HEADER_SZ,tstamp);
	if (n == -1) {
		rtdal_printf("error writting\n");
		return -1;
	} else if (!n) {
		rtdal_printf("Buffer full while sending control packet to %s:%s at %d\n",remote_params_db[dest_idx].module_name,
				remote_params_db[dest_idx].variable_name, oesr_tstamp(ctx));
		return -1;
	}
	return 0;
}
Exemplo n.º 15
0
int Run(void *_ctx) {
	ctx = _ctx;
	int tstamp = oesr_tstamp(ctx);
	moddebug("enter ts=%d\n",oesr_tstamp(ctx));
	int i;
	int n;

	if (ctrl_in) {
		do {
			n = oesr_itf_read(ctrl_in, &ctrl_in_buffer, CTRL_IN_BUFFER);
			if (n == -1) {
				oesr_perror("oesr_itf_read");
				return -1;
			} else if (n>0) {
				if (process_ctrl_packet()) {
					moderror("Error processing control packet\n");
					return -1;
				}
			}
		} while(n>0);
	}

	for (i=0;i<nof_input_itf;i++) {
		if (!inputs[i]) {
			input_ptr[i] = NULL;
			rcv_len[i] = 0;
		} else {
			n = oesr_itf_ptr_get(inputs[i], &input_ptr[i], &rcv_len[i], tstamp);
			if (n == 0) {
				itfdebug("[ts=%d] received no input from %d\n",rtdal_time_slot(),i);
			} else if (n == -1) {
				oesr_perror("oesr_itf_get");
				return -1;
			} else {
				itfdebug("[ts=%d] received %d bytes\n",rtdal_time_slot(),rcv_len[i]);
				rcv_len[i] /= input_sample_sz;
			}
		}
	}
	for (i=0;i<nof_output_itf;i++) {
		if (!outputs[i]) {
			output_ptr[i] = NULL;
		} else {
			n = oesr_itf_ptr_request(outputs[i], &output_ptr[i]);
			if (n == 0) {
/*				moderror_msg("[ts=%d] no packets available in output interface %d\n",rtdal_time_slot(),i);
*/			} else if (n == -1) {
				oesr_perror("oesr_itf_request");
				return -1;
			}
		}
	}

	memset(snd_len,0,sizeof(int)*nof_output_itf);

#if MOD_DEBUG==1
	oesr_counter_start(counter);
#endif
	n = work(input_ptr,output_ptr);
#if MOD_DEBUG==1
	oesr_counter_stop(counter);
	moddebug("work exec time: %d us\n",oesr_counter_usec(counter));
#endif
	if (n<0) {
		return -1;
	}

	memset(rcv_len,0,sizeof(int)*nof_input_itf);

	for (i=0;i<nof_output_itf;i++) {
		if (!snd_len[i] && output_ptr[i]) {
			snd_len[i] = n*output_sample_sz;
		}
	}

	for (i=0;i<nof_input_itf;i++) {
		if (input_ptr[i]) {
			n = oesr_itf_ptr_release(inputs[i]);
			if (n == 0) {
				itfdebug("[ts=%d] packet from interface %d not released\n",rtdal_time_slot(),i);
			} else if (n == -1) {
				oesr_perror("oesr_itf_ptr_release\n");
				return -1;
			}
		}
	}
	for (i=0;i<nof_output_itf;i++) {
		if (output_ptr[i] && snd_len[i]) {
			n = oesr_itf_ptr_put(outputs[i],snd_len[i],tstamp);
			if (n == 0) {
				itfdebug("[ts=%d] no space left in output interface %d\n",rtdal_time_slot(),i);
			} else if (n == -1) {
				oesr_perror("oesr_itf_ptr_put\n");
				return -1;
			}
		}
	}

	moddebug("exit ts=%d\n",oesr_tstamp(ctx));
	return 0;
}
Exemplo n.º 16
0
/**
 * @ingroup dac_sink
 *
 *  Writes the received samples to the dac output buffer
 *
 */
int work(void **inp, void **out) {
	int rcv_samples;
	float *input_rf;
	_Complex float *input_f;
	_Complex short *input_s;
	int i,j;
	float freq;
	float gain;
	float x=0;
	float *buffer_rf = buffer;
	_Complex float *buffer_f = buffer;
	_Complex short *buffer_s = buffer;

	if (param_get_float(freq_id,&freq) != 1) {
		moderror("Getting parameter freq_samp\n");
		return -1;
	}

	if (gain_id) {
		if (param_get_float(gain_id,&gain) != 1) {
			moderror("Getting parameter gain\n");
			return -1;
		}
	} else {
		gain = 1.0;
	}

#ifdef _COMPILE_ALOE
	if (freq != last_freq) {
		modinfo_msg("Set sampling frequency to %.2f MHz at tslot %d\n", freq/1000000,oesr_tstamp(ctx));
		last_freq = freq;
	}
#endif

	rtdal_uhd_set_freq(freq);

	for (i=0;i<NOF_INPUT_ITF;i++) {
		input_s = inp[i];
		input_f = inp[i];
		input_rf = inp[i];

		rcv_samples = get_input_samples(i);

#ifdef _COMPILE_ALOE
		if (rcv_samples != last_rcv_samples) {
			last_rcv_samples = rcv_samples;
			modinfo_msg("Receiving %d samples at tslot %d\n",rcv_samples,oesr_tstamp(ctx));
		}
#endif

		rtdal_uhd_set_block_len(rcv_samples);
		x=0;
		for (j=0;j<rcv_samples;j++) {
			switch(data_type) {
			case 0:
				buffer_rf[j] = gain*input_rf[j];
				break;
			case 1:
				buffer_f[j] = gain*input_f[j];
				break;
			case 2:
				buffer_s[j] = gain*input_s[j];
				break;
			}
		}
	}

	return 0;
}
Exemplo n.º 17
0
/**@ingroup plp_sink
 * Prints or displays the signal according to the selected mode.
 */
int work(void **inp, void **out) {
	int n,i,j;
	int mode;
	float *r_input;
	_Complex float *c_input;
	dft_plan_t *plan;

	strdef(xlabel);

	if (mode_id != NULL) {
		if (param_get_int(mode_id,&mode) != 1) {
			mode = 0;
		}
	} else {
		mode = 0;
	}
	memset(signal_lengths,0,sizeof(int)*2*NOF_INPUT_ITF);
	for (n=0;n<NOF_INPUT_ITF;n++) {
		if (is_complex && mode != MODE_PSD) {
			signal_lengths[2*n] = get_input_samples(n)/2;
			signal_lengths[2*n+1] = signal_lengths[2*n];
		} else {
			signal_lengths[n] = get_input_samples(n);
		}
		if (get_input_samples(n) != last_rcv_samples) {
			last_rcv_samples = get_input_samples(n);
#ifdef _COMPILE_ALOE
			modinfo_msg("Receiving %d samples at tslot %d\n",last_rcv_samples,
					oesr_tstamp(ctx));
#endif
		}
	}

#ifdef _COMPILE_ALOE
	if (print_not_received) {
		for (n=0;n<NOF_INPUT_ITF;n++) {
			if (MOD_DEBUG) {
				ainfo_msg("ts=%d, rcv_len=%d\n",oesr_tstamp(ctx),get_input_samples(n));
			}
			if (!get_input_samples(n)) {
				printf("ts=%d. Data not received from interface %d\n",oesr_tstamp(ctx),n);
			}

		}
	}
#endif


#ifdef _COMPILE_ALOE
	if (oesr_tstamp(ctx)-last_tstamp < interval_ts) {
		return 0;
	}
	last_tstamp = interval_ts;
#endif


	switch(mode) {
	case MODE_SILENT:
		break;
	case MODE_PRINT:
		for (n=0;n<NOF_INPUT_ITF;n++) {
			if (inp[n]) {
				print_signal(inp[n],get_input_samples(n));
			}
		}
	break;
	case MODE_SCOPE:
#ifdef _COMPILE_ALOE
		snprintf(xlabel,STR_LEN,"# sample (ts=%d)",oesr_tstamp(ctx));
#else
		snprintf(xlabel,STR_LEN,"# sample");
#endif
		if (is_complex) {
			set_legend(c_legends,2*NOF_INPUT_ITF);
		} else {
			set_legend(r_legends,NOF_INPUT_ITF);
		}
		set_labels(xlabel,"amp");

		for (n=0;n<NOF_INPUT_ITF;n++) {
			if (inp[n]) {
				if (is_complex) {
					c_input = inp[n];
					for (i=0;i<signal_lengths[2*n];i++) {
						pl_signals[2*n*INPUT_MAX_SAMPLES+i] = (double) __real__ c_input[i];
						pl_signals[(2*n+1)*INPUT_MAX_SAMPLES+i] = (double) __imag__ c_input[i];
					}
				} else {
					r_input = inp[n];
					for (i=0;i<signal_lengths[n];i++) {
						pl_signals[n*INPUT_MAX_SAMPLES+i] = (double) r_input[i];
					}
				}
			}

		}

		plp_draw(pl_signals,signal_lengths,0);
	break;
	case MODE_PSD:
#ifdef _COMPILE_ALOE
		snprintf(xlabel,STR_LEN,"freq. idx (ts=%d)",oesr_tstamp(ctx));
#else
		snprintf(xlabel,STR_LEN,"freq. idx");
#endif

		set_labels(xlabel,"PSD (dB/Hz)");

		set_legend(fft_legends,NOF_INPUT_ITF);

		for (i=0;i<NOF_INPUT_ITF;i++) {
			if (signal_lengths[i]) {
				if (fft_size) {
					signal_lengths[i] = signal_lengths[i]>fft_size?fft_size:signal_lengths[i];
				}
				plan = find_plan(signal_lengths[i]);
				c_input = inp[i];
				r_input = inp[i];
				if (!plan) {
					if ((plan = generate_new_plan(signal_lengths[i])) == NULL) {
						moderror("Generating plan.\n");
						return -1;
					}
				}
				if (is_complex) {
					dft_run_c2r(plan, c_input, &f_pl_signals[i*INPUT_MAX_SAMPLES]);
				} else {
					dft_run_r2r(plan, r_input, &f_pl_signals[i*INPUT_MAX_SAMPLES]);
				}
				/*if (!is_complex) {
					signal_lengths[i] = signal_lengths[i]/2;
				}*/
				for (j=0;j<signal_lengths[i];j++) {
					pl_signals[i*INPUT_MAX_SAMPLES+j] = (double) f_pl_signals[i*INPUT_MAX_SAMPLES+j];
				}
			}
		}
		for (i=NOF_INPUT_ITF;i<2*NOF_INPUT_ITF;i++) {
			signal_lengths[i] = 0;
		}
		plp_draw(pl_signals,signal_lengths,0);

	break;
	default:
		moderror_msg("Unknown mode %d\n",mode);
		return -1;

	}
	return 0;
}