Skip to content
Snippets Groups Projects
Commit 791f6ec2 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #30143: alsa: cleanup

parent a3e5f4f7
No related branches found
No related tags found
No related merge requests found
...@@ -474,8 +474,8 @@ AlsaLayer::write(void* buffer, int length, snd_pcm_t * handle) ...@@ -474,8 +474,8 @@ AlsaLayer::write(void* buffer, int length, snd_pcm_t * handle)
// Detect when something is going wrong. This can be caused by alsa bugs or // Detect when something is going wrong. This can be caused by alsa bugs or
// faulty encoder on the other side // faulty encoder on the other side
// TODO do something useful instead of just warning and flushing buffers // TODO do something useful instead of just warning and flushing buffers
if (watchdogTotalErr_ > 0 && watchdogTotalCount_ / watchdogTotalErr_ >=4 && watchdogTotalCount_ > 50) { if (watchdogTotalErr_ > 0 && watchdogTotalCount_ / watchdogTotalErr_ >= 4 and watchdogTotalCount_ > 50) {
ERROR("Alsa: too many errors (%d error on %d frame)",watchdogTotalErr_,watchdogTotalCount_); ERROR("%d errors out of %d frames", watchdogTotalErr_, watchdogTotalCount_);
flushUrgent(); flushUrgent();
flushMain(); flushMain();
} }
...@@ -606,6 +606,7 @@ AlsaLayer::getAudioDeviceIndexMap(bool getCapture) const ...@@ -606,6 +606,7 @@ AlsaLayer::getAudioDeviceIndexMap(bool getCapture) const
snd_pcm_info_set_stream(pcminfo, getCapture ? SND_PCM_STREAM_CAPTURE : SND_PCM_STREAM_PLAYBACK); snd_pcm_info_set_stream(pcminfo, getCapture ? SND_PCM_STREAM_CAPTURE : SND_PCM_STREAM_PLAYBACK);
int err; int err;
if ((err = snd_ctl_pcm_info(handle , pcminfo)) < 0) { if ((err = snd_ctl_pcm_info(handle , pcminfo)) < 0) {
WARN("Cannot get info: %s", snd_strerror(err)); WARN("Cannot get info: %s", snd_strerror(err));
} else { } else {
...@@ -824,6 +825,7 @@ void AlsaLayer::audioCallback() ...@@ -824,6 +825,7 @@ void AlsaLayer::audioCallback()
if (not safeUpdate(ringtoneHandle_, ringtoneAvailSmpl)) if (not safeUpdate(ringtoneHandle_, ringtoneAvailSmpl))
return; return;
int ringtoneAvailBytes = ringtoneAvailSmpl * sizeof(SFLAudioSample); int ringtoneAvailBytes = ringtoneAvailSmpl * sizeof(SFLAudioSample);
AudioBuffer out(ringtoneAvailSmpl); AudioBuffer out(ringtoneAvailSmpl);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment