diff --git a/stream.c b/stream.c index 5b8e7e0..f0a4ccc 100644 --- a/stream.c +++ b/stream.c @@ -2552,13 +2552,16 @@ static void preconfigure_microphone() { log_debug("cannot use mono audio; trying stereo\n"); } audio_channels = 2; - } else { + } else if (audio_channels == 2) { if (is_audio_channels_specified) { log_info("cannot use stereo audio; trying mono\n"); } else { log_debug("cannot use stereo audio; trying mono\n"); } audio_channels = 1; + } else { // user has specified audio channels + log_info("cannot use %d channels audio; trying mono\n", audio_channels); + audio_channels = 1; } err = snd_pcm_hw_params_set_channels(capture_handle, alsa_hw_params, audio_channels); if (err < 0) { @@ -5715,10 +5718,6 @@ int main(int argc, char **argv) { print_usage(); return EXIT_FAILURE; } - if (value != 1 && value != 2) { - log_fatal("error: invalid channels: %ld (must be 1 or 2)\n", value); - return EXIT_FAILURE; - } audio_channels = value; is_audio_channels_specified = 1; break;