audacity/audacity-1.3.12-playback_underrun.patch

41 lines
1.7 KiB
Diff

=== modified file 'lib-src/portaudio-v19/src/hostapi/alsa/pa_linux_alsa.c'
--- old/lib-src/portaudio-v19/src/hostapi/alsa/pa_linux_alsa.c 2010-04-04 17:54:47 +0000
+++ new/lib-src/portaudio-v19/src/hostapi/alsa/pa_linux_alsa.c 2010-12-04 15:15:45 +0000
@@ -2383,6 +2383,7 @@
/* Atomic restart of stream (we don't want the intermediate state visible) */
static PaError AlsaRestart( PaAlsaStream *stream )
{
+ puts("AlsaRestart");
PaError result = paNoError;
PA_ENSURE( PaUnixMutex_Lock( &stream->stateMtx ) );
@@ -2415,9 +2416,11 @@
snd_pcm_status( self->playback.pcm, st );
if( snd_pcm_status_get_state( st ) == SND_PCM_STATE_XRUN )
{
+ puts("playback xrun");
snd_pcm_status_get_trigger_tstamp( st, &t );
self->underrun = now * 1000 - ((PaTime) t.tv_sec * 1000 + (PaTime) t.tv_usec / 1000);
- errplayback = snd_pcm_recover( self->playback.pcm, -EPIPE, 0 );
+ errplayback = 1;
+ /* does not work: snd_pcm_recover( self->playback.pcm, -EPIPE, 0 ); */
}
}
if( self->capture.pcm )
@@ -2425,9 +2428,13 @@
snd_pcm_status( self->capture.pcm, st );
if( snd_pcm_status_get_state( st ) == SND_PCM_STATE_XRUN )
{
+ puts("capture xrun");
snd_pcm_status_get_trigger_tstamp( st, &t );
self->overrun = now * 1000 - ((PaTime) t.tv_sec * 1000 + (PaTime) t.tv_usec / 1000);
- errcapture = snd_pcm_recover( self->capture.pcm, -EPIPE, 0 );
+ if(! errplayback)
+ {
+ errcapture = snd_pcm_recover( self->capture.pcm, -EPIPE, 0 );
+ }
}
}