Refactor global variables for signal processing
These are: device, sample rate, buffer, latency Called now: dsp_device, dsp_samplerate, dsp_buffer, dsp_latency Call audio device: call_device, call_samplerate, call_buffer
This commit is contained in:
@@ -195,9 +195,9 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
if (num_kanal == 1 && num_audiodev == 0)
|
||||
num_audiodev = 1; /* use default */
|
||||
if (num_kanal != num_audiodev) {
|
||||
if (num_kanal == 1 && num_device == 0)
|
||||
num_device = 1; /* use default */
|
||||
if (num_kanal != num_device) {
|
||||
fprintf(stderr, "You need to specify as many sound devices as you have channels.\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -231,7 +231,7 @@ int main(int argc, char *argv[])
|
||||
fm_init(fast_math);
|
||||
|
||||
for (i = 0; i < num_kanal; i++) {
|
||||
rc = fuvst_create(kanal[i], chan_type[i], audiodev[i], samplerate, rx_gain, tx_gain, write_rx_wave, write_tx_wave, read_rx_wave, read_tx_wave, loopback, ignore_link_monitor, sio, uele_pc, fuko_pc);
|
||||
rc = fuvst_create(kanal[i], chan_type[i], dsp_device[i], dsp_samplerate, rx_gain, tx_gain, write_rx_wave, write_tx_wave, read_rx_wave, read_tx_wave, loopback, ignore_link_monitor, sio, uele_pc, fuko_pc);
|
||||
if (rc < 0) {
|
||||
fprintf(stderr, "Failed to create \"Kanal\" instance. Quitting!\n");
|
||||
goto fail;
|
||||
@@ -270,7 +270,7 @@ int main(int argc, char *argv[])
|
||||
if (config_loaded)
|
||||
printf("BS-Config: %s\n", config_name);
|
||||
|
||||
main_mobile("fuvst", &quit, latency, interval, NULL, station_id, 7);
|
||||
main_mobile("fuvst", &quit, NULL, station_id, 7);
|
||||
fail:
|
||||
|
||||
/* destroy transceiver instance */
|
||||
|
@@ -198,17 +198,17 @@ int main(int argc, char *argv[])
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (num_audiodev <= 1)
|
||||
audiodev[1] = audiodev[0];
|
||||
if (num_device <= 1)
|
||||
dsp_device[1] = dsp_device[0];
|
||||
for (i = 0; i < num_kanal; i++) {
|
||||
PDEBUG(DCNETZ, DEBUG_DEBUG, "Creating 'Sniffer' instance for 'Kanal' = %s (sample rate %d).\n", kanal[i], samplerate);
|
||||
PDEBUG(DCNETZ, DEBUG_DEBUG, "Creating 'Sniffer' instance for 'Kanal' = %s (sample rate %d).\n", kanal[i], dsp_samplerate);
|
||||
|
||||
sniffer = calloc(1, sizeof(sniffer_t));
|
||||
if (!sniffer) {
|
||||
PDEBUG(DCNETZ, DEBUG_ERROR, "No memory!\n");
|
||||
goto fail;
|
||||
}
|
||||
rc = sender_create(&sniffer->sender, kanal[i], 131, 131, audiodev[i], 0, samplerate, rx_gain, tx_gain, 0, 0, write_rx_wave, write_tx_wave, read_rx_wave, read_tx_wave, loopback, PAGING_SIGNAL_NONE);
|
||||
rc = sender_create(&sniffer->sender, kanal[i], 131, 131, dsp_device[i], 0, dsp_samplerate, rx_gain, tx_gain, 0, 0, write_rx_wave, write_tx_wave, read_rx_wave, read_tx_wave, loopback, PAGING_SIGNAL_NONE);
|
||||
if (rc < 0) {
|
||||
fprintf(stderr, "Failed to create \"Sniffer\" instance. Quitting!\n");
|
||||
goto fail;
|
||||
@@ -220,12 +220,12 @@ int main(int argc, char *argv[])
|
||||
|
||||
sender_set_fm(&sniffer->sender, 1.0, 4000.0, 1.0, 1.0);
|
||||
|
||||
rc = v27_modem_init(&sniffer->modem, sniffer, send_bit, receive_bit, samplerate, 1);
|
||||
rc = v27_modem_init(&sniffer->modem, sniffer, send_bit, receive_bit, dsp_samplerate, 1);
|
||||
if (rc < 0)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
main_mobile(NULL, &quit, latency, interval, NULL, NULL, 0);
|
||||
main_mobile(NULL, &quit, NULL, NULL, 0);
|
||||
|
||||
fail:
|
||||
/* destroy transceiver instance */
|
||||
|
Reference in New Issue
Block a user