MusicPlayerDaemon / MPD

Music Player Daemon
https://www.musicpd.org/
GNU General Public License v2.0
2.18k stars 352 forks source link

High CPU usage on raspberry with new version #1259

Closed SummerSeaSun closed 3 years ago

SummerSeaSun commented 3 years ago

Bug report

Describe the bug

Just upgraded Raspberry OS and mpd to latest stable versions, getting an high CPU usage from MPD. Hardware: Model : Raspberry Pi Model B Plus Rev 1.2

Expected Behavior

bring back normal CPU use like it was on this version:

Model       : Raspberry Pi Model B Plus Rev 1.2

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND 
 534 mpd       20   0  215920  28100  21508 S   3,9  3,0   3008:26 /usr/bin/mpd --no-daemon   

ii  mpd                                   0.19.21-1                         armhf        Music Player Daemon

Linux thepi 4.14.62-v7+ #1134 SMP Tue Aug 14 17:10:10 BST 2018 armv7l GNU/Linux

Actual Behavior

 Model      : Raspberry Pi Model B Plus Rev 1.2

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND 
 1573 mpd       20   0  226976  35716  27212 S  37.5   8.1  12:12.66 /usr/bin/mpd --no-daemon  
Linux thenewpi 5.10.60+ #1449 Wed Aug 25 14:59:20 BST 2021 armv6l GNU/Linux

The same SD on new hardware show this:

Model       : Raspberry Pi 4 Model B Rev 1.2

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND 
 mpd       20   0  229416  33900  26368 S   1.7   0.9   0:02.87 /usr/bin/mpd --no-daemon    

MPD Version:

ii  mpd                              0.21.5-3                            armhf        Music Player Daemon

This cpu use is while playing the same internet radio stream. Please let me know if you need some log and how to get it or the support of the older hardware will be removed.

Thanks, BR

MaxKellermann commented 3 years ago

Your MPD version is very old and unsupported.

SummerSeaSun commented 3 years ago

@MaxKellermann Thank you for your reply, I've upgraded to last stable version:

Linux thenewpi 5.10.60+ #1449 Wed Aug 25 14:59:20 BST 2021 armv6l GNU/Linux
ii  mpd                              0.22.6-1                         armhf        Music Player Daemon

it seems that still the CPU use on old hardware Model : Raspberry Pi Model B Plus Rev 1.2 is high.

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                   
  389 mpd       20   0  259476  36592  28596 S  31.8   9.7   0:37.04 /usr/bin/mpd --no-daemon 

Should I upgrade to 0.22.10-1 (main) [bookworm, sid] ? Thanks, BR

MaxKellermann commented 3 years ago

There's a repository with latest MPD for stable: https://www.musicpd.org/download-unoff-debian/

SummerSeaSun commented 3 years ago

thanks for the informations, I'm trying to install unofficial version, but face this issue during install:

mpd : Depend: libadplug-2.2.1-0v5 (>= 2.2.1-0) not installable Depend: libcdio18 (>= 2.0.0) not installable Depend: libfluidsynth1 (>= 1.1.6-4~) not installable Depend: libicu63 (>= 63.1-1~) not installable Depend: libnfs12 (>= 1.9.7) not installable Depend: libsidplayfp4 not installable

this package is already installed, the others aren't found in repo: ii libadplug-2.3.3-0 2.3.3+dfsg-2 armhf free AdLib sound library

MaxKellermann commented 3 years ago

Even if this were on-topic here, I would be unable to help because I do not have any information about what you did.

SummerSeaSun commented 3 years ago

I've updated raspbian to latest version, then followed what is reported at https://www.musicpd.org/download-unoff-debian/ :

Setting up the repo (as root)
First, get the signing key in apt keyring.
Add the key 0x065FE53932DC551D to /etc/apt/trusted.gpg.d/ :

wget -O /etc/apt/trusted.gpg.d/deb.kaliko.me.gpg https://media.kaliko.me/kaliko.gpg
Or, for Raspbian (armhf only)
# Add this line in /etc/apt/sources.list.d/deb.kaliko.me.list
deb https://deb.kaliko.me/raspbian-backports/ stable-backports main

then I've done:

apt update
apt install mpd/stable-backports

and ended with result:


mpd : Depend: libadplug-2.2.1-0v5 (>= 2.2.1-0) not installable
Depend: libcdio18 (>= 2.0.0) not installable
Depend: libfluidsynth1 (>= 1.1.6-4~) not installable
Depend: libicu63 (>= 63.1-1~) not installable
Depend: libnfs12 (>= 1.9.7) not installable
Depend: libsidplayfp4 not installable

Hope this help:

Linux pi 5.10.63-v7l+ #1457 SMP Tue Sep 28 11:26:14 BST 2021 armv7l GNU/Linux

maxmitti commented 3 years ago

Just for information purposes: My Raspberry Pi B non-plus runs a custom built git version of MPD 937da63ba6792df3300d5e982078fee771e12370 with CPU usage between 1 and 10 % on Arch Linux. However, an unoptimized build has significantly higher CPU usage. So it should really not be an issue from MPD’s side.

mxjeff commented 3 years ago

Hi Summer88

I've updated raspbian to latest version, then followed what is reported at https://www.musicpd.org/download-unoff-debian/ : […] and ended with result:

mpd : Depend: libadplug-2.2.1-0v5 (>= 2.2.1-0) not installable
Depend: libcdio18 (>= 2.0.0) not installable
Depend: libfluidsynth1 (>= 1.1.6-4~) not installable
Depend: libicu63 (>= 63.1-1~) not installable
Depend: libnfs12 (>= 1.9.7) not installable
Depend: libsidplayfp4 not installable

The current stable version of raspbian in this unofficial repository is still Buster, I think you're trying to install this mpd/stable-backports on Bullseye. Is that right?