diff options
author | Robin Gareus <robin@gareus.org> | 2019-08-23 04:39:51 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-08-23 04:39:51 +0200 |
commit | e5927d689cb8800b4663aef29521f79b72c74d71 (patch) | |
tree | b179cfccbed1f2a62e9b65bc0d02fc3af2aadddc /libs/backends | |
parent | 8fadf44978c7116a6e6714a42ba141f61ab1b128 (diff) |
Fix for half-duplex ALSA-slave devices
Diffstat (limited to 'libs/backends')
-rw-r--r-- | libs/backends/alsa/alsa_slave.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libs/backends/alsa/alsa_slave.cc b/libs/backends/alsa/alsa_slave.cc index e4f17256de..c10e206230 100644 --- a/libs/backends/alsa/alsa_slave.cc +++ b/libs/backends/alsa/alsa_slave.cc @@ -210,7 +210,7 @@ AlsaAudioSlave::process_thread () no_proc_errors = 0; _pcmi.capt_init (spp); - if (drain) { + if (drain || _pcmi.ncapt () == 0) { /* do nothing */ } else if (_rb_capture.write_space () >= _pcmi.ncapt () * spp) { #if 0 // failsafe: write interleave sample by sample @@ -267,7 +267,10 @@ AlsaAudioSlave::process_thread () } _pcmi.play_init (spp); - if (_rb_playback.read_space () >= _pcmi.nplay () * spp) { + if (_pcmi.nplay () == 0) { + /* relax */ + } + else if (_rb_playback.read_space () >= _pcmi.nplay () * spp) { #if 0 // failsafe: read sample by sample de-interleave for (uint32_t s = 0; s < spp; ++s) { for (uint32_t c = 0; c < _pcmi.nplay (); ++c) { |