[Bug 698960] High CPU load with alsa

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Mon Apr 29 01:33:54 PDT 2013


https://bugzilla.gnome.org/show_bug.cgi?id=698960
  GStreamer | gst-plugins-base | 1.0.6

Sebastian Dröge <slomo> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #242584|none                        |needs-work
             status|                            |

--- Comment #1 from Sebastian Dröge <slomo at circular-chaos.org> 2013-04-29 08:33:50 UTC ---
Review of attachment 242584:
 --> (https://bugzilla.gnome.org/review?bug=698960&attachment=242584)

I'm not sure of the general implications of always rounding up to the next
power of 2 for platforms where this doesn't make a real difference. Also maybe
we should instead round to the nearest power of two?

::: ext/alsa/gstalsa.c
@@ +659,3 @@
+/*
+ * Round up to the next highest power of 2
+ * From "Hacker's Delight", Henry S. Warren, Jr.'s

Nice trick, I didn't know this one yet :)

::: ext/alsa/gstalsasink.c
@@ -429,3 @@
-  period_time = alsa->period_time;
-
-retry:

With your changes we never retry if setting one of these fails and instead just
error out. Doesn't seem optimal

@@ +475,3 @@
+  /* now try to configure the buffer size and period size */
+  if (alsa->buffer_time != -1 && !alsa->iec958) {
+    alsa->buffer_size = alsa->buffer_time / 1e6 * alsa->rate;

Use gst_util_uint64_scale() or the _int() variant of this here, and instead of
1e6 use GST_MSECOND.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list