From 34e4c13f82e37252f6adf60ef61efc73224bb02d Mon Sep 17 00:00:00 2001 From: Lars Bisballe Jensen Date: Thu, 2 Oct 2014 10:35:37 +0200 Subject: Various tries to fix stutter and white noise --- src/audiobackend-pulse.cc | 5 ++++- src/audiobackend-pulse.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/audiobackend-pulse.cc b/src/audiobackend-pulse.cc index 5ec4865..a74377d 100644 --- a/src/audiobackend-pulse.cc +++ b/src/audiobackend-pulse.cc @@ -98,7 +98,10 @@ void AudioBackendPulse::run() int AudioBackendPulse::read(char *pcm, size_t maxsize) { // Wait until enough audio data has been read by the thread. - while((pread + maxsize) < pwrite) { + if(pread == 0) pread = pwrite; + + while((pread + maxsize) > pwrite) { + printf("sleeping\n"); usleep(1000); } diff --git a/src/audiobackend-pulse.h b/src/audiobackend-pulse.h index b375a4f..01a8a68 100644 --- a/src/audiobackend-pulse.h +++ b/src/audiobackend-pulse.h @@ -50,7 +50,7 @@ private: volatile bool running; - char read_buffer[4096]; + char read_buffer[16000]; volatile unsigned int pread; volatile unsigned int pwrite; }; -- cgit v1.2.3