diff --git a/audio.c b/audio.c index a27bc39..f66971d 100644 --- a/audio.c +++ b/audio.c @@ -921,11 +921,22 @@ int audio_get (int a) /* Error */ // TODO: Needs more study and testing. - // TODO: print n. should snd_strerror use n or errno? - // Audio input device error: Unknown error + // Only expected error conditions: + // -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); - 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, save_audio_config_p->adev[a].num_channels, diff --git a/kiss_frame.c b/kiss_frame.c index d2dcdb3..44d01e8 100644 --- a/kiss_frame.c +++ b/kiss_frame.c @@ -708,6 +708,9 @@ void kiss_process_msg (unsigned char *kiss_msg, int kiss_len, int debug, int cli dw_printf ("\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 ("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"); } break; diff --git a/multi_modem.c b/multi_modem.c index 2d50f90..5d96c79 100644 --- a/multi_modem.c +++ b/multi_modem.c @@ -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; -// 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_slicers > 0 && save_audio_config_p->achan[chan].num_slicers <= MAX_SLICERS); + //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); + 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. */ /* 1.2: We can feed one demodulator but end up with multiple outputs. */