[jitsi-dev] 100% CPU usage without PulseAudio


#1

Hi there,

I noticed recently that Jitsi showed 100% CPU usage. Just now I
could narrow it down. It does that on my system (Arch Linux) whenever
PulseAudio is not running. It does not matter what is set in the
preferences, probably because in case PulseAudio is set and not
available jitsi falls back to PortAudio.

This is at least present with nightly builds I've done on 20140112 and
on 20140119. The later doesn't even start up properly (I think someone
else reported this already) but this problem is there anyway.

At the end of the mail is what jitsi wrote to STDOUT in one such
session.
If any particular dev is willing to look into this I'd be happy to send
him the logs privately.

Regards,
Philipp

$ jitsi
i686
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM
cards.pcm.center_lfe ALSA lib pcm.c:2239:(snd_pcm_open_noupdate)
Unknown PCM cards.pcm.side ALSA lib confmisc.c:1286:(snd_func_refer)
Unable to find definition
'cards.USB-Audio.pcm.hdmi.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2' ALSA
lib conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned
error: No such file or directory ALSA lib
conf.c:4727:(snd_config_expand) Evaluate error: No such file or
directory ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM hdmi
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition
'cards.USB-Audio.pcm.hdmi.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2' ALSA
lib conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned
error: No such file or directory ALSA lib
conf.c:4727:(snd_config_expand) Evaluate error: No such file or
directory ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM hdmi
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition
'cards.USB-Audio.pcm.modem.0:CARD=0' ALSA lib
conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned
error: No such file or directory ALSA lib
conf.c:4727:(snd_config_expand) Evaluate error: No such file or
directory ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM
cards.pcm.phoneline:CARD=0,DEV=0 ALSA lib
confmisc.c:1286:(snd_func_refer) Unable to find definition
'cards.USB-Audio.pcm.modem.0:CARD=0' ALSA lib
conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned
error: No such file or directory ALSA lib
conf.c:4727:(snd_config_expand) Evaluate error: No such file or
directory ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM
cards.pcm.phoneline:CARD=0,DEV=0 ALSA lib
confmisc.c:1286:(snd_func_refer) Unable to find definition
'cards.USB-Audio.pcm.modem.0:CARD=0' ALSA lib
conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned
error: No such file or directory ALSA lib
conf.c:4727:(snd_config_expand) Evaluate error: No such file or
directory ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM
phoneline ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find
definition 'cards.USB-Audio.pcm.modem.0:CARD=0' ALSA lib
conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned
error: No such file or directory ALSA lib
conf.c:4727:(snd_config_expand) Evaluate error: No such file or
directory ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM
phoneline ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to
connect: Connection refused

ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect:
Connection refused

ALSA lib pcm_dmix.c:961:(snd_pcm_dmix_open) The dmix plugin supports
only playback stream 21:51:08.405 SEVERE: [12]
org.jitsi.impl.neomedia.device.DeviceConfiguration.error() Failed to
register custom Renderer
org.jitsi.impl.neomedia.jmfext.media.renderer.audio.PulseAudioRenderer
with JMF. java.lang.IllegalStateException: audioSystem at
org.jitsi.impl.neomedia.jmfext.media.renderer.audio.PulseAudioRenderer.<init>(PulseAudioRenderer.java:105)
at
org.jitsi.impl.neomedia.jmfext.media.renderer.audio.PulseAudioRenderer.<init>(PulseAudioRenderer.java:85)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method) at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at
java.lang.Class.newInstance(Class.java:374) at
org.jitsi.impl.neomedia.device.DeviceConfiguration.registerCustomRenderers(DeviceConfiguration.java:1028)
at
org.jitsi.impl.neomedia.device.DeviceConfiguration.<init>(DeviceConfiguration.java:355)
at
org.jitsi.impl.neomedia.MediaServiceImpl.<init>(MediaServiceImpl.java:141)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method) at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at
java.lang.Class.newInstance(Class.java:374) at
org.jitsi.impl.libjitsi.LibJitsiImpl.getService(LibJitsiImpl.java:133)
at
org.jitsi.impl.libjitsi.LibJitsiOSGiImpl.getService(LibJitsiOSGiImpl.java:86)
at
org.jitsi.service.libjitsi.LibJitsi.invokeGetServiceOnImpl(LibJitsi.java:163)
at
org.jitsi.service.libjitsi.LibJitsi.getMediaService(LibJitsi.java:115)
at
net.java.sip.communicator.impl.neomedia.NeomediaActivator.start(NeomediaActivator.java:380)
at
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:629)
at org.apache.felix.framework.Felix.activateBundle(Felix.java:1904) at
org.apache.felix.framework.Felix.startBundle(Felix.java:1822) at
org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1192)
at
org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:266)
at java.lang.Thread.run(Thread.java:744) 21:51:08.893 SEVERE: [31]
impl.protocol.jabber.OperationSetPersistentPresenceJabberImpl.initializePriorities().1810
Wrong value for resource priority java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:454) at
java.lang.Integer.parseInt(Integer.java:527) at
net.java.sip.communicator.impl.protocol.jabber.OperationSetPersistentPresenceJabberImpl.initializePriorities(OperationSetPersistentPresenceJabberImpl.java:1803)
at
net.java.sip.communicator.impl.protocol.jabber.OperationSetPersistentPresenceJabberImpl.<init>(OperationSetPersistentPresenceJabberImpl.java:129)
at
net.java.sip.communicator.impl.protocol.jabber.ProtocolProviderServiceJabberImpl.initialize(ProtocolProviderServiceJabberImpl.java:1551)
at
net.java.sip.communicator.impl.protocol.jabber.ProtocolProviderFactoryJabberImpl.createService(ProtocolProviderFactoryJabberImpl.java:137)
at
net.java.sip.communicator.service.protocol.ProtocolProviderFactory.loadAccount(ProtocolProviderFactory.java:967)
at
net.java.sip.communicator.service.protocol.AccountManager.doLoadStoredAccounts(AccountManager.java:199)
at
net.java.sip.communicator.service.protocol.AccountManager.loadStoredAccounts(AccountManager.java:460)
at
net.java.sip.communicator.service.protocol.AccountManager.runInLoadStoredAccountsThread(AccountManager.java:576)
at
net.java.sip.communicator.service.protocol.AccountManager.access$100(AccountManager.java:25)
at
net.java.sip.communicator.service.protocol.AccountManager$2.run(AccountManager.java:501)
21:51:09.140 SEVERE: [31]
impl.protocol.jabber.OperationSetPersistentPresenceJabberImpl.initializePriorities().1810
Wrong value for resource priority java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:454) at
java.lang.Integer.parseInt(Integer.java:527) at
net.java.sip.communicator.impl.protocol.jabber.OperationSetPersistentPresenceJabberImpl.initializePriorities(OperationSetPersistentPresenceJabberImpl.java:1803)
at
net.java.sip.communicator.impl.protocol.jabber.OperationSetPersistentPresenceJabberImpl.<init>(OperationSetPersistentPresenceJabberImpl.java:129)
at
net.java.sip.communicator.impl.protocol.jabber.ProtocolProviderServiceJabberImpl.initialize(ProtocolProviderServiceJabberImpl.java:1551)
at
net.java.sip.communicator.impl.protocol.jabber.ProtocolProviderFactoryJabberImpl.createService(ProtocolProviderFactoryJabberImpl.java:137)
at
net.java.sip.communicator.service.protocol.ProtocolProviderFactory.loadAccount(ProtocolProviderFactory.java:967)
at
net.java.sip.communicator.service.protocol.AccountManager.doLoadStoredAccounts(AccountManager.java:199)
at
net.java.sip.communicator.service.protocol.AccountManager.loadStoredAccounts(AccountManager.java:460)
at
net.java.sip.communicator.service.protocol.AccountManager.runInLoadStoredAccountsThread(AccountManager.java:576)
at
net.java.sip.communicator.service.protocol.AccountManager.access$100(AccountManager.java:25)
at
net.java.sip.communicator.service.protocol.AccountManager$2.run(AccountManager.java:501)
21:51:13.048 SEVERE: [52]
impl.protocol.jabber.ProtocolProviderServiceJabberImpl.connectUsingSRVRecords().897
No SRV addresses found for _xmpp-client._tcp.jabber.linuxlovers.at
...

···

--
JID: murks@jit.si


#2

Hey Philipp,

That one bugged us for quite a while in the past and became the primary reason for implementing pulse audio support.

Emil

···

On 19.01.14, 22:06, Philipp Überbacher wrote:

Hi there,

I noticed recently that Jitsi showed 100% CPU usage. Just now I
could narrow it down. It does that on my system (Arch Linux) whenever
PulseAudio is not running. It does not matter what is set in the
preferences, probably because in case PulseAudio is set and not
available jitsi falls back to PortAudio.

This is at least present with nightly builds I've done on 20140112 and
on 20140119. The later doesn't even start up properly (I think someone
else reported this already) but this problem is there anyway.

At the end of the mail is what jitsi wrote to STDOUT in one such
session.
If any particular dev is willing to look into this I'd be happy to send
him the logs privately.

Regards,
Philipp

$ jitsi
i686
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM
cards.pcm.center_lfe ALSA lib pcm.c:2239:(snd_pcm_open_noupdate)
Unknown PCM cards.pcm.side ALSA lib confmisc.c:1286:(snd_func_refer)
Unable to find definition
'cards.USB-Audio.pcm.hdmi.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2' ALSA
lib conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned
error: No such file or directory ALSA lib
conf.c:4727:(snd_config_expand) Evaluate error: No such file or
directory ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM hdmi
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition
'cards.USB-Audio.pcm.hdmi.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2' ALSA
lib conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned
error: No such file or directory ALSA lib
conf.c:4727:(snd_config_expand) Evaluate error: No such file or
directory ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM hdmi
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition
'cards.USB-Audio.pcm.modem.0:CARD=0' ALSA lib
conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned
error: No such file or directory ALSA lib
conf.c:4727:(snd_config_expand) Evaluate error: No such file or
directory ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM
cards.pcm.phoneline:CARD=0,DEV=0 ALSA lib
confmisc.c:1286:(snd_func_refer) Unable to find definition
'cards.USB-Audio.pcm.modem.0:CARD=0' ALSA lib
conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned
error: No such file or directory ALSA lib
conf.c:4727:(snd_config_expand) Evaluate error: No such file or
directory ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM
cards.pcm.phoneline:CARD=0,DEV=0 ALSA lib
confmisc.c:1286:(snd_func_refer) Unable to find definition
'cards.USB-Audio.pcm.modem.0:CARD=0' ALSA lib
conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned
error: No such file or directory ALSA lib
conf.c:4727:(snd_config_expand) Evaluate error: No such file or
directory ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM
phoneline ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find
definition 'cards.USB-Audio.pcm.modem.0:CARD=0' ALSA lib
conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned
error: No such file or directory ALSA lib
conf.c:4727:(snd_config_expand) Evaluate error: No such file or
directory ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM
phoneline ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to
connect: Connection refused

ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect:
Connection refused

ALSA lib pcm_dmix.c:961:(snd_pcm_dmix_open) The dmix plugin supports
only playback stream 21:51:08.405 SEVERE: [12]
org.jitsi.impl.neomedia.device.DeviceConfiguration.error() Failed to
register custom Renderer
org.jitsi.impl.neomedia.jmfext.media.renderer.audio.PulseAudioRenderer
with JMF. java.lang.IllegalStateException: audioSystem at
org.jitsi.impl.neomedia.jmfext.media.renderer.audio.PulseAudioRenderer.<init>(PulseAudioRenderer.java:105)
at
org.jitsi.impl.neomedia.jmfext.media.renderer.audio.PulseAudioRenderer.<init>(PulseAudioRenderer.java:85)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method) at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at
java.lang.Class.newInstance(Class.java:374) at
org.jitsi.impl.neomedia.device.DeviceConfiguration.registerCustomRenderers(DeviceConfiguration.java:1028)
at
org.jitsi.impl.neomedia.device.DeviceConfiguration.<init>(DeviceConfiguration.java:355)
at
org.jitsi.impl.neomedia.MediaServiceImpl.<init>(MediaServiceImpl.java:141)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method) at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at
java.lang.Class.newInstance(Class.java:374) at
org.jitsi.impl.libjitsi.LibJitsiImpl.getService(LibJitsiImpl.java:133)
at
org.jitsi.impl.libjitsi.LibJitsiOSGiImpl.getService(LibJitsiOSGiImpl.java:86)
at
org.jitsi.service.libjitsi.LibJitsi.invokeGetServiceOnImpl(LibJitsi.java:163)
at
org.jitsi.service.libjitsi.LibJitsi.getMediaService(LibJitsi.java:115)
at
net.java.sip.communicator.impl.neomedia.NeomediaActivator.start(NeomediaActivator.java:380)
at
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:629)
at org.apache.felix.framework.Felix.activateBundle(Felix.java:1904) at
org.apache.felix.framework.Felix.startBundle(Felix.java:1822) at
org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1192)
at
org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:266)
at java.lang.Thread.run(Thread.java:744) 21:51:08.893 SEVERE: [31]
impl.protocol.jabber.OperationSetPersistentPresenceJabberImpl.initializePriorities().1810
Wrong value for resource priority java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:454) at
java.lang.Integer.parseInt(Integer.java:527) at
net.java.sip.communicator.impl.protocol.jabber.OperationSetPersistentPresenceJabberImpl.initializePriorities(OperationSetPersistentPresenceJabberImpl.java:1803)
at
net.java.sip.communicator.impl.protocol.jabber.OperationSetPersistentPresenceJabberImpl.<init>(OperationSetPersistentPresenceJabberImpl.java:129)
at
net.java.sip.communicator.impl.protocol.jabber.ProtocolProviderServiceJabberImpl.initialize(ProtocolProviderServiceJabberImpl.java:1551)
at
net.java.sip.communicator.impl.protocol.jabber.ProtocolProviderFactoryJabberImpl.createService(ProtocolProviderFactoryJabberImpl.java:137)
at
net.java.sip.communicator.service.protocol.ProtocolProviderFactory.loadAccount(ProtocolProviderFactory.java:967)
at
net.java.sip.communicator.service.protocol.AccountManager.doLoadStoredAccounts(AccountManager.java:199)
at
net.java.sip.communicator.service.protocol.AccountManager.loadStoredAccounts(AccountManager.java:460)
at
net.java.sip.communicator.service.protocol.AccountManager.runInLoadStoredAccountsThread(AccountManager.java:576)
at
net.java.sip.communicator.service.protocol.AccountManager.access$100(AccountManager.java:25)
at
net.java.sip.communicator.service.protocol.AccountManager$2.run(AccountManager.java:501)
21:51:09.140 SEVERE: [31]
impl.protocol.jabber.OperationSetPersistentPresenceJabberImpl.initializePriorities().1810
Wrong value for resource priority java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:454) at
java.lang.Integer.parseInt(Integer.java:527) at
net.java.sip.communicator.impl.protocol.jabber.OperationSetPersistentPresenceJabberImpl.initializePriorities(OperationSetPersistentPresenceJabberImpl.java:1803)
at
net.java.sip.communicator.impl.protocol.jabber.OperationSetPersistentPresenceJabberImpl.<init>(OperationSetPersistentPresenceJabberImpl.java:129)
at
net.java.sip.communicator.impl.protocol.jabber.ProtocolProviderServiceJabberImpl.initialize(ProtocolProviderServiceJabberImpl.java:1551)
at
net.java.sip.communicator.impl.protocol.jabber.ProtocolProviderFactoryJabberImpl.createService(ProtocolProviderFactoryJabberImpl.java:137)
at
net.java.sip.communicator.service.protocol.ProtocolProviderFactory.loadAccount(ProtocolProviderFactory.java:967)
at
net.java.sip.communicator.service.protocol.AccountManager.doLoadStoredAccounts(AccountManager.java:199)
at
net.java.sip.communicator.service.protocol.AccountManager.loadStoredAccounts(AccountManager.java:460)
at
net.java.sip.communicator.service.protocol.AccountManager.runInLoadStoredAccountsThread(AccountManager.java:576)
at
net.java.sip.communicator.service.protocol.AccountManager.access$100(AccountManager.java:25)
at
net.java.sip.communicator.service.protocol.AccountManager$2.run(AccountManager.java:501)
21:51:13.048 SEVERE: [52]
impl.protocol.jabber.ProtocolProviderServiceJabberImpl.connectUsingSRVRecords().897
No SRV addresses found for _xmpp-client._tcp.jabber.linuxlovers.at
...

--
https://jitsi.org


#3

Ah, I see. I guess I simply didn't notice it back when I tried
PortAudio.

Thanks Emil. I still intend to write the ALSA backend at some point,
but I'll likely need some help to figure out how the things fit
together and what is required to get eclipse set up so I can actually
test what I'm writing.

Regards,
Philipp

···

On Sun, 19 Jan 2014 22:28:17 +0100 Emil Ivov <emcho@jitsi.org> wrote:

Hey Philipp,

That one bugged us for quite a while in the past and became the
primary reason for implementing pulse audio support.

Emil

--
JID: murks@jit.si


#4

Hey Philipp,

That one bugged us for quite a while in the past and became the
primary reason for implementing pulse audio support.

Emil

Ah, I see. I guess I simply didn't notice it back when I tried
PortAudio.

It didn't always appear too.

Thanks Emil. I still intend to write the ALSA backend at some point,
but I'll likely need some help to figure out how the things fit
together and what is required to get eclipse set up so I can actually
test what I'm writing.

Most of the developer documentation on our site is still relevant (even if a bit dated at times) so that would be a logical first step. Let us know if you have questions!

Cheers,
Emil

···

On 20.01.14, 18:33, Philipp Überbacher wrote:

On Sun, 19 Jan 2014 22:28:17 +0100 > Emil Ivov <emcho@jitsi.org> wrote:

--
https://jitsi.org


#5

I've updated the Eclipse setup a couple of days ago.

Some howtos for native development with an IDE for the various jn*.so would be nice though...

Freundliche Grüsse,
Ingo Bauersachs

-- sent from my mobile

···

Le 20.01.2014 à 18:39, "Emil Ivov" <emcho@jitsi.org> a écrit :

On 20.01.14, 18:33, Philipp Überbacher wrote:
On Sun, 19 Jan 2014 22:28:17 +0100 >> Emil Ivov <emcho@jitsi.org> wrote:

Hey Philipp,

That one bugged us for quite a while in the past and became the
primary reason for implementing pulse audio support.

Emil

Ah, I see. I guess I simply didn't notice it back when I tried
PortAudio.

It didn't always appear too.

Thanks Emil. I still intend to write the ALSA backend at some point,
but I'll likely need some help to figure out how the things fit
together and what is required to get eclipse set up so I can actually
test what I'm writing.

Most of the developer documentation on our site is still relevant (even if a bit dated at times) so that would be a logical first step. Let us know if you have questions!

Cheers,
Emil

--
https://jitsi.org

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev