High CPU utilization with audio encoding

Tobias abue.gst.dev at googlemail.com
Thu Apr 12 04:17:55 PDT 2012


To check if the alsasrc element of GStreamer is the problem, I used
"arecord -r 8000 -c 1 -f S16_LE --period-time=10000 --buffer-time=200000
> /dev/null" for comparison, and I also could see a similar problem:
after some (more) seconds the CPU usage raises to >90% and drops to 0%
afterwards again (but it stays at >90% for only ca. 33s vs ca. 78s when
using gstreamer pipe ). I just monitored the problem with top and vmstat
- vmstat log for arecord example can be seen at http://pastebin.com/H3LRtyPg

When using direct hw access by starting the command "arecord -D hw:0 -r
8000 -c 2 -f S16_LE --period-time=10000 --buffer-time=200000 >
/dev/null" I also can reproduce the problem, but it seems to be not that
hard: http://pastebin.com/a5xaP049

The fact that the problem also occurs when using arecord tells me, that
there might be also a problem in the ALSA driver or in the ALSA library.
What I can't really understand is, why it has a more critical effect
when using gstreamer pipe, especially why a pipe with udpsink keeps CPU
usage at >90% whereas a gstreamer pipe with fakesink lets CPU usage drop
down again after a while?



More information about the gstreamer-devel mailing list