During web radio playback and no other (concious) activity with the system, upmpdcli uses up a lot of CPU cycles.The load depicted in the screenshot hovers pretty constantly around 21%:
Afaik, upmpdcli is only responsible for UPNP and OpenHome related activities.
Is there a reason for this even if there is no media transfer going on via upnp?
Now I think about it I did notice that upmdcli was sending a surprising number of mpd status commands. I had meant to look into that. I would have assumed it would use idle.
upmpdcli does not use the MPD idle command currently. upmpdcli normally consumes around 0.6% to 1% CPU on a Raspberry PI with one control point connected and monitoring a playing song, so, there is relatively little to optimize, and using idle would make the program a little more complicated (one more thread probably).
But 21% CPU is far too much, and, yes, a first guess might be that upmpdcli is looping on MPD status commands for some reason. We would probably see this in the log.
Thanks for the response. It was some time ago that I noticed the status commands and I can’t remember if they actually resulted in a high CPU load as originally reported here, they may be totally harmless. I need to go back and verify what I see before I lead anyone down the wrong path.
The higher the loglevel the more it spilled out. There is no trace of an error in it though.
It keeps repeating the following block during web radio playback:
If you use tail -f on the output log, the normal “rythm” of things would be one Time event every second, and a bigger bunch of output every 10 S (approximately). Does this look like you are seeing ?
Nothing looks out of place. I guess I’ll have to install PIMusicbox and give it a try. What control point are you using ? This could also be a factor.
Other question: does mpd have a big playlist loaded ? Or just the radio ?
Hi,
watching the tail output the rhythm you’re talking about seems about right. There seems to be even a larger pause between the large block and the time events.
To answer the further questions:
Mopidy has only one stream in the playlist.
Also, the web radio is not played via UPNP. it is played directly by mopidy.
As control point software I use bubbleUPNP on several android devices, but not actively (also no widget showing the currently played song etc.). On my PC there’s also Kazoo installed but not started typically.
Ever since the CPU consumption is around 20% controlling the thing with bubbleUpnp becomes pretty useless. it takes very long to add stuff to the playlist and generally lags quite badly in all actions.
In addition to the standard musicbox image I installed several further packages not music-related.
Also I tried to get Songcast working (without success) which would be attached to upmpdcli. But I do not have it running.
The short version is that libupnp (on which upmpdcli is based) can become unresponsive when it loses contact with a subscribed control point. This can happen in a varietey of ways. In your case, it does not obviously apply, but the symptoms are curiously similar.
Does the problem persist if you kill and restart upmpdcli while the radio is playing ? You may have to kill -9 when it’s stuck like this.
I installed Pi Musicbox to give the issue a try, and I see nothing special in upmpdcli CPU usage while playing a radio stream. This is one more indication that you are actually experiencing the libupnp problem. I have a fix for this, and I can easily build a raspbian package. Please get in touch with me by email if you want to pursue this: jf at dockes.org
Yes, the problem persists across restarts of both the whole system and the upmpdcli service (via “service upmpdcli restart” or the kill -9 you suggested).
I’ve disabled the Airplay feature using the musicbox web interface.
After a restart the cpu usage seems to be back to normal (for now).
Will monitor it a little tomorrow when the raspi runs a bit longer…
Do Airplay and Upnp have conflicting parts?
UPDATE: False alarm, it did just take a bit longer to reappear this time.
Hi,
As an aside to this discussion, I just added a Raspberry Pi package for sc2mpd (the songcast receiver) to the debian repository on the upmpdcli web site. As far as I can see, this works fine. Just in case you want to try it again…