summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Bisballe Jensen <larsbisballe@gmail.com>2014-10-02 10:35:37 +0200
committerLars Bisballe Jensen <larsbisballe@gmail.com>2014-10-02 10:35:37 +0200
commit34e4c13f82e37252f6adf60ef61efc73224bb02d (patch)
tree07522b157e50d9f1112320d9eb8396906110349e
parent07e16be3b801b9df2ce3b2ce2b265a5299543e78 (diff)
Various tries to fix stutter and white noiseHEADmaster
-rw-r--r--src/audiobackend-pulse.cc5
-rw-r--r--src/audiobackend-pulse.h2
2 files changed, 5 insertions, 2 deletions
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;
};