Always prepare the ALSA PCM handle before starting capture
Draining the ALSA device via stopping puts it into a setup state, which requires re-preparing before playback can start again. Preparing it prior to the first start seems to cause no harm, so just always do it before starting.
This commit is contained in:
+9
-2
@@ -1153,10 +1153,17 @@ error2:
|
||||
|
||||
static ALCboolean ALCcaptureAlsa_start(ALCcaptureAlsa *self)
|
||||
{
|
||||
int err = snd_pcm_start(self->pcmHandle);
|
||||
int err = snd_pcm_prepare(self->pcmHandle);
|
||||
if(err < 0)
|
||||
ERR("prepare failed: %s\n", snd_strerror(err));
|
||||
else
|
||||
{
|
||||
err = snd_pcm_start(self->pcmHandle);
|
||||
if(err < 0)
|
||||
ERR("start failed: %s\n", snd_strerror(err));
|
||||
}
|
||||
if(err < 0)
|
||||
{
|
||||
ERR("start failed: %s\n", snd_strerror(err));
|
||||
aluHandleDisconnect(STATIC_CAST(ALCbackend, self)->mDevice, "Capture state failure: %s",
|
||||
snd_strerror(err));
|
||||
return ALC_FALSE;
|
||||
|
||||
Reference in New Issue
Block a user