[Minor] CPU usage
Bug #734400 reported by
FM33
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Audio Recorder |
Fix Committed
|
Undecided
|
Moma |
Bug Description
When timer is active, even if there is no sound detection (and even if all lines are commented), the program uses 6% CPU permanently.
Changed in audio-recorder: | |
status: | Confirmed → Fix Committed |
To post a comment you must log in.
Hello,
Very good observation.
The listener process is still running even the timer has no conditions (the timer has no commands, it's empty).
The listener (in gst-listener.c) is started by the timer (in timer.c). And the listener collects signal level (audio level decibel) values.
I have now modified the code so it switches the listener off when the timer is empty.
Notice that the listener creates a recorder process for the selected devices. It is an ordinary GStreamer recorder that outputs to a "fakesink" element. GStreamer delivers the signal values (decibel level values) via listener_ message_ handler( ...) callback.
The listener process is a quite heavy and CPU intensive. However I haven't found a better way to gather the signal/level values.
Please see: bazaar. launchpad. net/~osmoma/ audio-recorder/ trunk/view/ head:/src/ gst-listener. c
http://
Functions: create_ pipeline( gchar *audio_source, GList *dev_list) {
static GstElement *listener_
...
}
And message_ handler( GstBus * bus, GstMessage * message, gpointer data) {
static gboolean listener_
...
}