mirror of https://github.com/wb2osz/direwolf.git
Better error messages.
This commit is contained in:
parent
95c302566a
commit
5e9d67834b
17
audio.c
17
audio.c
|
@ -921,11 +921,22 @@ int audio_get (int a)
|
||||||
/* Error */
|
/* Error */
|
||||||
// TODO: Needs more study and testing.
|
// TODO: Needs more study and testing.
|
||||||
|
|
||||||
// TODO: print n. should snd_strerror use n or errno?
|
// Only expected error conditions:
|
||||||
// Audio input device error: Unknown error
|
// -EBADFD PCM is not in the right state (SND_PCM_STATE_PREPARED or SND_PCM_STATE_RUNNING)
|
||||||
|
// -EPIPE an overrun occurred
|
||||||
|
// -ESTRPIPE a suspend event occurred (stream is suspended and waiting for an application recovery)
|
||||||
|
|
||||||
|
// Data overrun is displayed as "broken pipe" which seems a little misleading.
|
||||||
|
// Add our own message which says something about CPU being too slow.
|
||||||
|
|
||||||
text_color_set(DW_COLOR_ERROR);
|
text_color_set(DW_COLOR_ERROR);
|
||||||
dw_printf ("Audio input device %d error: %s\n", a, snd_strerror(n));
|
dw_printf ("Audio input device %d error code %d: %s\n", a, n, snd_strerror(n));
|
||||||
|
|
||||||
|
if (n == (-EPIPE)) {
|
||||||
|
dw_printf ("This is most likely caused by the CPU being too slow to keep up with the audio stream.\n");
|
||||||
|
dw_printf ("Use the \"top\" command, in another command window, to look at CPU usage.\n");
|
||||||
|
dw_printf ("This might be a temporary condition so we will attempt to recover a few times before giving up.\n");
|
||||||
|
}
|
||||||
|
|
||||||
audio_stats (a,
|
audio_stats (a,
|
||||||
save_audio_config_p->adev[a].num_channels,
|
save_audio_config_p->adev[a].num_channels,
|
||||||
|
|
|
@ -708,6 +708,9 @@ void kiss_process_msg (unsigned char *kiss_msg, int kiss_len, int debug, int cli
|
||||||
dw_printf ("\n");
|
dw_printf ("\n");
|
||||||
dw_printf ("It looks like you are trying to use the \"XKISS\" protocol which is not supported.\n");
|
dw_printf ("It looks like you are trying to use the \"XKISS\" protocol which is not supported.\n");
|
||||||
dw_printf ("Change your application settings to use standard \"KISS\" rather than some other variant.\n");
|
dw_printf ("Change your application settings to use standard \"KISS\" rather than some other variant.\n");
|
||||||
|
dw_printf ("If you are using Winlink Express, configure like this:\n");
|
||||||
|
dw_printf (" Packet TNC Type: KISS\n");
|
||||||
|
dw_printf (" Packet TNC Model: NORMAL -- Using ACKMODE will cause this error.\n");
|
||||||
dw_printf ("\n");
|
dw_printf ("\n");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -314,11 +314,22 @@ void multi_modem_process_sample (int chan, int audio_sample)
|
||||||
dc_average[chan] = dc_average[chan] * 0.999f + (float)audio_sample * 0.001f;
|
dc_average[chan] = dc_average[chan] * 0.999f + (float)audio_sample * 0.001f;
|
||||||
|
|
||||||
|
|
||||||
// TODO: temp debug, remove this.
|
// Issue 128. Someone ran into this.
|
||||||
|
|
||||||
assert (save_audio_config_p->achan[chan].num_subchan > 0 && save_audio_config_p->achan[chan].num_subchan <= MAX_SUBCHANS);
|
//assert (save_audio_config_p->achan[chan].num_subchan > 0 && save_audio_config_p->achan[chan].num_subchan <= MAX_SUBCHANS);
|
||||||
assert (save_audio_config_p->achan[chan].num_slicers > 0 && save_audio_config_p->achan[chan].num_slicers <= MAX_SLICERS);
|
//assert (save_audio_config_p->achan[chan].num_slicers > 0 && save_audio_config_p->achan[chan].num_slicers <= MAX_SLICERS);
|
||||||
|
|
||||||
|
if (save_audio_config_p->achan[chan].num_subchan <= 0 || save_audio_config_p->achan[chan].num_subchan > MAX_SUBCHANS ||
|
||||||
|
save_audio_config_p->achan[chan].num_slicers <= 0 || save_audio_config_p->achan[chan].num_slicers > MAX_SLICERS) {
|
||||||
|
|
||||||
|
text_color_set(DW_COLOR_ERROR);
|
||||||
|
dw_printf ("ERROR! Something is seriously wrong in %s %s.\n", __FILE__, __func__);
|
||||||
|
dw_printf ("chan = %d, num_subchan = %d [max %d], num_slicers = %d [max %d]\n", chan,
|
||||||
|
save_audio_config_p->achan[chan].num_subchan, MAX_SUBCHANS,
|
||||||
|
save_audio_config_p->achan[chan].num_slicers, MAX_SLICERS);
|
||||||
|
dw_printf ("Please report this message and include a copy of your configuration file.\n");
|
||||||
|
exit (EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
/* Formerly one loop. */
|
/* Formerly one loop. */
|
||||||
/* 1.2: We can feed one demodulator but end up with multiple outputs. */
|
/* 1.2: We can feed one demodulator but end up with multiple outputs. */
|
||||||
|
|
Loading…
Reference in New Issue