Start alsa PCM

This commit is contained in:
badaix 2020-12-01 17:49:12 +01:00
parent 7981b6c5c8
commit 273ad96228

View file

@ -381,6 +381,12 @@ void AlsaPlayer::initAlsa()
// snd_pcm_sw_params_set_stop_threshold(pcm_handle, swparams, frames_);
snd_pcm_sw_params(handle_, swparams);
if (snd_pcm_state(handle_) == SND_PCM_STATE_PREPARED)
{
if ((err = snd_pcm_start(handle_)) < 0)
throw SnapException("Failed to start PCM: " + string(snd_strerror(err)));
}
if (ctl_ == nullptr)
initMixer();
}