if (PA_UNLIKELY(n_bytes <= u->hwbuf_unused)) {
- if (polled && pa_log_ratelimit())
- pa_log(_("ALSA woke us up to write new data to the device, but there was actually nothing to write! "
- "Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers. "
- "We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail_update() returned 0."));
+ if (polled)
+ PA_ONCE_BEGIN {
+ pa_log(_("ALSA woke us up to write new data to the device, but there was actually nothing to write! "
+ "Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers. "
+ "We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail_update() returned 0."));
+ } PA_ONCE_END;
#ifdef DEBUG_TIMING
pa_log_debug("Not filling up, because not necessary.");
if (PA_UNLIKELY(n_bytes <= u->hwbuf_unused)) {
- if (polled && pa_log_ratelimit())
- pa_log(_("ALSA woke us up to write new data to the device, but there was actually nothing to write! "
- "Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers. "
- "We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail_update() returned 0."));
+ if (polled)
+ PA_ONCE_BEGIN {
+ pa_log(_("ALSA woke us up to write new data to the device, but there was actually nothing to write! "
+ "Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers. "
+ "We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail_update() returned 0."));
+ } PA_ONCE_END;
break;
}
if (PA_UNLIKELY(n_bytes <= 0)) {
- if (polled && pa_log_ratelimit())
- pa_log(_("ALSA woke us up to read new data from the device, but there was actually nothing to read! "
- "Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers. "
- "We were woken up with POLLIN set -- however a subsequent snd_pcm_avail_update() returned 0."));
+ if (polled)
+ PA_ONCE_BEGIN {
+ pa_log(_("ALSA woke us up to read new data from the device, but there was actually nothing to read! "
+ "Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers. "
+ "We were woken up with POLLIN set -- however a subsequent snd_pcm_avail_update() returned 0."));
+ } PA_ONCE_END;
#ifdef DEBUG_TIMING
pa_log_debug("Not reading, because not necessary.");
if (PA_UNLIKELY(n_bytes <= 0)) {
- if (polled && pa_log_ratelimit())
- pa_log(_("ALSA woke us up to read new data from the device, but there was actually nothing to read! "
- "Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers. "
- "We were woken up with POLLIN set -- however a subsequent snd_pcm_avail_update() returned 0."));
+ if (polled)
+ PA_ONCE_BEGIN {
+ pa_log(_("ALSA woke us up to read new data from the device, but there was actually nothing to read! "
+ "Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers. "
+ "We were woken up with POLLIN set -- however a subsequent snd_pcm_avail_update() returned 0."));
+ } PA_ONCE_END;
break;
}
#include <pulsecore/core-util.h>
#include <pulsecore/atomic.h>
#include <pulsecore/core-error.h>
+#include <pulsecore/once.h>
#include "alsa-util.h"
if (k >= hwbuf_size * 3 ||
k >= pa_bytes_per_second(ss)*10)
- pa_log(_("snd_pcm_avail_update() returned a value that is exceptionally large: %lu bytes (%lu ms). "
- "Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers."),
- (unsigned long) k, (unsigned long) (pa_bytes_to_usec(k, ss) / PA_USEC_PER_MSEC));
+
+ PA_ONCE_BEGIN {
+ pa_log(_("snd_pcm_avail_update() returned a value that is exceptionally large: %lu bytes (%lu ms). "
+ "Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers."),
+ (unsigned long) k, (unsigned long) (pa_bytes_to_usec(k, ss) / PA_USEC_PER_MSEC));
+ } PA_ONCE_END;
return n;
}
k >= hwbuf_size * 3 ||
k >= pa_bytes_per_second(ss)*10)
- pa_log(_("snd_pcm_mmap_begin() returned a value that is exceptionally large: %lu bytes (%lu ms). "
- "Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers."),
- (unsigned long) k, (unsigned long) (pa_bytes_to_usec(k, ss) / PA_USEC_PER_MSEC));
+ PA_ONCE_BEGIN {
+ pa_log(_("snd_pcm_mmap_begin() returned a value that is exceptionally large: %lu bytes (%lu ms). "
+ "Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers."),
+ (unsigned long) k, (unsigned long) (pa_bytes_to_usec(k, ss) / PA_USEC_PER_MSEC));
+ } PA_ONCE_END;
return r;
}