CPU usage spikes to 30% regularly during playback, no PulseAudio involved, just ALSA
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mpd (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: mpd
Opening another bug report for this, because none of the stuff in #221951 applies.
I've got Ubuntu running headless on a 1GHz M10000. It was fine with 8.04 and 8.10, but since upgrading to 9.04 MPD is chewing CPU. Every few seconds it spikes to 30% CPU usage.
I'm not running PulseAudio, so it's not that. (I have libpulse0 installed because MPD demands it, but no other packages matching *pulse*.)
I've tried explicitly stating that I want ALSA output in /etc/mpd.conf, and that doesn't help. Right now it's:
audio_output {
type "alsa"
format 44100:16:2
name "audio out"
}
The MP3 files are sourced from 44.1kHz 16 bit rips of CDs, so it's not a sample rate issue.
/var/log/
Apr 27 13:17 : problems opening audio device while playing "meta/Orchestra
Apr 27 13:17 : problems opening audio device while playing "meta/Orchestra
Apr 27 13:17 : problems opening audio device while playing "meta/Orchestra
etc.
The CPU usage peaks so badly that the audio is glitching. I upped the audio_buffer_size to 16384 to get something listenable. Suggestions?
[Update]
Also:
# cat pcm0p/sub0/
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 2048
buffer_size: 16384
while playing, so it's not a 44.1->48kHz conversion problem.
description: | updated |
Changed in mpd (Ubuntu): | |
status: | New → Fix Released |
Did some more research. /etc/mpd.conf now reads
audio_output {
type "alsa"
format 44100:16:2
name "audio out"
period_time 50000
auto_resample "no"
use_mmap "yes"
device "hw:0,0"
}
i.e. lock sample rate at native value bypass dmix according to http:// mpd.wikia. com/wiki/ Tuning
This has gotten the CPU usage down to around 20%, and made it less spiky. I've been able to drop audio_buffer_size to 4192 and max_output_ buffer_ size back to the default.
Might try OSS as a regrettable workaround.