[pulseaudio-discuss] High CPU usage of the pulseaudio process when module-ladspa-sink is loaded

Mikhail Morfikov mmorfikov at gmail.com
Sun Nov 22 06:48:21 PST 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

I experience a really weird behavior of PulseAudio, and it looks like I'm
able to reproduce the issue, so I thought I can share this problem with
you here.

First of all, I'm using debian sid, and the version of PulseAudio is 7.1.
When all of the settings are the default ones, everything seems to work
just fine. The problem concerns one of the modules: module-ladspa-sink ,
and I'm not sure whether it's because of the module or something else.
When the module is loaded by adding the following code to the
/etc/pulse/default.pa file:

.ifexists module-ladspa-sink.so
.nofail
load-module module-ladspa-sink sink_name=compressor plugin=sc4m_1916 label=sc4m control=1,1.5,401,-30,20,5,12
.fail
.endif

Nothing really happens, I mean there's no problem when I start an audio or
video application, and I play a song or a movie. The problem starts when I
switch in pavucontrol the output of the stream so it would point to
LADSPA. It looks like this problem affects only video players. I've tested
smplayer, mpv and vlc. All of them has the issue, which is high CPU usage.
Normally the CPU utilization while playing music or movies is ~1% (2x2GHz)
in the case of PulseAudio process. But when I watch a movie with this
module on, it could be ~20% all the time the movie is being played.

1. To see the problem, add the code above to the /etc/pulse/default.pa and
restart the PulseAudio daemon. Then start an audio or/and video player.
One of them has to be video player because you have to play a movie.

2. Take two files. One has only an audio track, and the other has audio
and video tracks. Play both files in the players. There shouldn't be any
problem with CPU usage.

3. Now play an audio file, and in pavucontrol change the output of the
stream of this app to LADSPA. There also shouldn't be any problem.

4. Play the movie in the player. Nothing happens now, but try to change
the output of the stream of this app to LADSPA. Now the PulseAudio process
should utilize the CPU in around 20%, at least in my case.

5. Stop the movie, everything should back to normal, at least when there's
only one audio or video app started. In that case when the app is closed,
the PulseAudio process stops to utilize so much CPU. In the case you have
multiple audio and video applications started (they don't have to play
anything at the moment), you have to close them all because if you don't,
the PulseAudio process will eat CPU all the time. Only closing all of the
apps can fix the problem.

6. Start the audio player again and play the audio file once more.
7. Start the video player again and play the video file once more.

8. In the case of 6 and 7 the output of the streams in pavucontrol should
point to LADSPA automatically. Only in 7 there should be high CPU usage of
the PulseAudio process.

9. You won't fix the problem by changing the output of the stream in
pavucontrol or restarting the PulseAudio daemon (or both). You have to
comment out the added code in /etc/pulse/default.pa and then restart the
PuleAudio daemon. Only in that case you can get rid of the high CPU usage
when you play a movie. You can add the code again and restart the
PulseAudio daemon once more, and in that case you won't experience the
problem anymore, at least to the moment when you switch the output of the
stream of the video player in pavucontrol . When you switch the output of
audio players, there shouldn't be any issues with that.

I hope I've described the problem so you can easily reproduce it because
the module is really useful for me, especially in the case of movies, and I
wanted to fix the problems as soon as possible.
-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJWUdWoAAoJEM0EaBB3G2Ug8GsQALOEa7K0XuoD4Gxq8yqQjT4B
XsLv8xHUM87l04J5DBomtLz6by45lzjdgi8RU0PJMqwf84cSFWmNsoSj5mfOet4x
y6NT++CSkrq1msrlSd5yeTbhWestB0sq0Ow37WvuGsxGLg+U57AvVDeNP1IV/rQA
X7GL/dK4BRggxcCSG4yhJfJPqRhk6rAnBLuR9c35RMzJAOLrbd5Y7hSnr5wvm7/2
KqIn382FBk+VYfD76bXIJPtTuLw4qguZCJejM8doRyJS/VBVgq+FRsxBT0hRf6j8
bmrNJaUM0hKyXPO9tteaeQU9xZCefZIpk01ghcYqXWaZ21QGzLMld9WVJ0oEWCco
a6kIsX2fgrNALLqvukH800FjXQNbBDvZcduqlh/W9RdR2CBGjTxFaMlIKvX97XPs
JKF87zdE5lVlI4jQeCDXWkkHigxSKWRCuXfoFVm8+T1xF4elboDAKA1Zmwaf8MF1
4pLbofjBOsF4FII57xewgBNOkOT9C0yxcfoIbGTrB+IvJ08LXusPBQIhXRyob4aH
ugHbR9EQGbkUXKj0bo99Eada0XPYY+V5IqG6l+r2zVxcrqBcCq6qiXv9Ve+um5L0
va+FK0pKu5EiVvQuW9DfdjQx1E3/iyiVCn5srMxA3VZm8CekvFZHbXinnOXJDFTA
xfXEKkrs2CAL5fABaY0P
=TPwd
-----END PGP SIGNATURE-----


More information about the pulseaudio-discuss mailing list