[Alsaplayer-devel] Problems with CPU use, realtime privileges and polling

Kevin Day thekevinday at gmail.com
Tue Oct 27 02:09:39 GMT 2009


On Sat, Oct 24, 2009 at 2:40 PM, Frank Baumgart <frank.baumgart at gmx.net> wrote:
>> I would specifically like to interact with the developers who are
>> responsible for the code relating to
>>
>> 1) The --realtime switch and the code which set up the SCHED_FIFO
>> priorities
>> and memory locking.
>>
>> 2) The excessive CPU use by alsaplayer (which may be in part due to
>> improper
>> "polling" of various file handles).
>
> Hi Robert,
>
> first, alsaplayer is (almost) dead.
> Almost means: I still use it in an embedded environment and spent quite some time several years ago to make it work without any stuttering or long latencies on low-end embedded machines. At that time, it was way ahead of mplayer and any other remote controlable multi-format player on resource usage but I never used the alsaplayer internal GUI nor do I have anything to do with the realtime work.
> I integrated those parts of my patches that were of common interest but the "rest" is very specific to my needs and eliminates some features of alsaplayer that cost too much CPU cycles. Software mixer, volume and floating point elimination come to my mind.
>
> Still, text mode should be quite fast, please try for comparison.
>
> "dead", among missing contributions also means that I fixed several exploits in my private sandbox only. Merging those with the repository would require regaining my account/access and separating the stuff. I never found the time to do this but if there is real interest I might think about that again.
>
> If I had to start today I would consider MPD which is similar in concept to alsaplayer although its design is not more "sound" to me and has its own deficiencies. YMMV.
> Last time I looked it still lacked a proper asynchronous notification scheme and clear separation between Database and Player. I would recommend to check the current status though.
>
> Regards
>
> Frank
>


I use both alsaplayer and mpd on my systems.
I tend to use alsaplayer for a quick and simple way of playing things
from a GUI.

My experiences with alsaplayer seem to be different than yours.
Alsaplayer seems to be idling at 3% cpu (empty playlist).

I have three songs, an mp3, an ogg, and a flac.
The mp3 is at 160kbit/s constant bitrate
-  there are three active processes, one always at 3%, the other two
are somewhere between 0% and 1%.

The ogg is ~400kbit/s variable bitrate
- there are three active processes, one always at 3%, the other two
are somewhere between 1% and 2%.

The flac is at 843kbit/s constant bitrate (well, I am not sure if this
is CBR or VBR..)
-  there are three active processes, one always at 3%, the other two
are somewhere between 0% and 1%.


Comparing with MPD:
MPD idles at 0% cpu.

I have three songs, an mp3, an ogg, and a flac.
The mp3 is at 160kbit/s constant bitrate
-  there are two active processes, one somewhere between 2% and 3%,
the other somewhere between 0% and 1%.

The ogg is ~400kbit/s variable bitrate
-  there are two active processes, one somewhere between 5% and 7%,
the other somewhere between 1% and 2%.

The flac is at 843kbit/s constant bitrate (well, I am not sure if this
is CBR or VBR..)
-  there are two active processes, one somewhere between 6% and 9%,
the other somewhere between 0% and 1%.

MPD appears to have more overhead, in my case.

Of course MPD can play much more than alsaplayer can, here are all of
the formats my system can play:
Supported decoders:
[mad] mp3 mp2
[vorbis] ogg oga
[oggflac] ogg oga
[flac] flac
[audiofile] wav au aiff aif
[faad] aac
[mp4] m4a mp4
[mpcdec] mpc
[wavpack] wv
[mikmod] amf dsm far gdm imf it med mod mtm s3m stm stx ult uni xm
[ffmpeg] 16sv 3g2 3gp 4xm 8svx aa3 aac ac3 afc aif aifc aiff al alaw
amr anim apc ape asf atrac au aud avi avm2 avs bap bfi c93 cak cin cmv
cpk daud dct divx dts dv dvd dxa eac3 film flac flc fli fll flx flv
g726 gsm gxf iss m1v m2v m2t m2ts m4a m4v mad mj2 mjpeg mjpg mka mkv
mlp mm mmf mov mp+ mp1 mp2 mp3 mp4 mpc mpeg mpg mpga mpp mpu mve mvi
mxf nc nsv nut nuv oga ogm ogv ogx oma ogg omg psp pva qcp qt r3d ra
ram rl2 rm rmvb roq rpl rvc shn smk snd sol son spx str swf tgi tgq
tgv thp ts tsp tta xa xvid uv uv2 vb vid vob voc vp6 vmd wav wma wmv
wsaud wsvga wv wve

Supported outputs:
shout null fifo pipe alsa ao oss mvp jack httpd

Supported archives:
bz2 iso

Supported protocols:
file:// http:// lastfm:// mms:// mmsh:// mmst:// mmsu://

I am using the latest stable versions of all software.


This my my cpu information:
Architecture:          i686
CPU(s):                2
Thread(s) per core:    1
Core(s) per socket:    2
CPU socket(s):         1
Vendor ID:             AuthenticAMD
CPU family:            15
Model:                 107
Stepping:              1
CPU MHz:               2606.043
Virtualization:        AMD-V
L1d cache:             64K
L1i cache:             64K
L2 cache:              512K



Keep in mind that this is only a single test case.
There are advantages and disadvantages of both, but it is most
certainly true that MPD is more active in development and maintenance
than is alsaplayer.

Nevertheless, I still like and enjoy alsaplayer and it makes me sad to
see alsaplayer not being maintained much anymore. After all, if it is
so close to version 1.0 why not attempt to get some bug fixes done and
release a version 1.0 as the last and final release? Might as well die
well.

-- 
Kevin Day



More information about the alsaplayer-devel mailing list