From 11d2e258e5f69338154f657c2a3efa1358b921a8 Mon Sep 17 00:00:00 2001 From: bruceperens Date: Wed, 23 Apr 2014 23:15:19 +0000 Subject: [PATCH] SSB output mode works. git-svn-id: https://svn.code.sf.net/p/freetel/code@1549 01035d8c-6547-0410-b346-abe4f91aad63 --- freedv-server/source/platform/linux/audio_in_alsa.cpp | 2 -- freedv-server/source/platform/linux/audio_out_alsa.cpp | 10 +++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/freedv-server/source/platform/linux/audio_in_alsa.cpp b/freedv-server/source/platform/linux/audio_in_alsa.cpp index 76de58f6..2a805302 100644 --- a/freedv-server/source/platform/linux/audio_in_alsa.cpp +++ b/freedv-server/source/platform/linux/audio_in_alsa.cpp @@ -201,7 +201,6 @@ namespace FreeDV { void AudioInALSA::start() { - std::cerr << "Input start " << parameters << std::endl; snd_pcm_drop(handle); snd_pcm_prepare(handle); snd_pcm_start(handle); @@ -211,7 +210,6 @@ namespace FreeDV { void AudioInALSA::stop() { - std::cerr << "Input stop " << parameters << std::endl; snd_pcm_drop(handle); snd_pcm_prepare(handle); snd_pcm_pause(handle, 1); diff --git a/freedv-server/source/platform/linux/audio_out_alsa.cpp b/freedv-server/source/platform/linux/audio_out_alsa.cpp index f061e9f4..bbeb2c49 100644 --- a/freedv-server/source/platform/linux/audio_out_alsa.cpp +++ b/freedv-server/source/platform/linux/audio_out_alsa.cpp @@ -111,10 +111,10 @@ namespace FreeDV { AudioOutALSA::write16(const std::int16_t * array, std::size_t length) { if ( !started ) { - // Preload the audio output queue with two frames of silence. This makes - // underruns less likely. This delays the output from where we would - // otherwise have started it. Otherwise we tend to underrun repeatedly - // at startup time. + // Preload the audio output queue with a fraction of a frame of silence. + // This makes underruns less likely. + // This delays the output from where we would otherwise have started it. + // Otherwise we tend to underrun repeatedly at startup time. // // Note that all inputs and outputs of the typical user do not run on // a shared clock. There is the potential for overruns or underruns @@ -122,7 +122,7 @@ namespace FreeDV { // a shared clock, and the more expensive equipment that supports it, // to avoid this problem. // - int16_t buf[AudioFrameSamples * 2]; + int16_t buf[AudioFrameSamples / 100]; memset(buf, 0, sizeof(buf)); snd_pcm_writei(handle, buf, sizeof(buf) / sizeof(*buf)); } -- 2.25.1