Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream underflow detection failed on Ubuntu 16.04 LTS #84

Open
napent opened this issue Feb 6, 2017 · 4 comments
Open

Stream underflow detection failed on Ubuntu 16.04 LTS #84

napent opened this issue Feb 6, 2017 · 4 comments

Comments

@napent
Copy link

napent commented Feb 6, 2017

Hi, I found that there is no way, to detect stream underflow under Ubuntu 16.04 using librtaudio4v5 from apt repositories and ALSA. Use following 'use case':

diff --git a/tests/playsaw.cpp b/tests/playsaw.cpp
index d1953b6..f9193fe 100644
--- a/tests/playsaw.cpp
+++ b/tests/playsaw.cpp
@@ -102,6 +102,7 @@ int saw( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames,
       *buffer++ = (MY_TYPE) (lastValues[j] * SCALE * 0.5);
       lastValues[j] += BASE_RATE * (j+1+(j*0.1));
       if ( lastValues[j] >= 1.0 ) lastValues[j] -= 2.0;
+      usleep(1);
     }
   }

Unfortunately no errors about underflow gets printed.

@garyscavone
Copy link
Contributor

garyscavone commented Feb 6, 2017 via email

@napent
Copy link
Author

napent commented Feb 6, 2017

Thanks for fast response!
In my case even 1 microsecond is causing audible glitch. In a minute I will check behavior with jack as back-end.

Same thing with jack,

RtAudioStreamStatus status

is always 0

@garyscavone
Copy link
Contributor

garyscavone commented Feb 6, 2017 via email

@radarsat1
Copy link
Contributor

I can confirm that no underflow message is printed (ubuntu 16.10, macbook pro), even though usleep(1) is enough to cause glitches.

I looked into it a bit and snd_pcm_writei always returns 512 and if I force a call to snd_pcm_state it always returns SND_PCM_STATE_RUNNING. In otherwords, ALSA is not returning an error. I don't have more ideas at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants