LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware - ARM (https://www.linuxquestions.org/questions/slackware-arm-108/)
-   -   High MPlayer CPU usage on Raspi Pi (https://www.linuxquestions.org/questions/slackware-arm-108/high-mplayer-cpu-usage-on-raspi-pi-4175507186/)

dive 06-05-2014 07:45 PM

High MPlayer CPU usage on Raspi Pi
 
I'm finding mplayer using 20-40 % CPU when playing back most audio formats, streaming or local files, on my Rasp Pi.

ffplay is even worse (only tested local files).

The situation is the same when setting output device to 'null' so it doesn't seem to be hardware/soundcard related.

Any ideas?

frushiyama 06-05-2014 08:23 PM

If you use another player can be an answer to take into consideration, try using a lighter as mocp.

dive 06-05-2014 08:32 PM

That works for local files, but not for streams.

rokytnji 06-05-2014 10:05 PM

Quote:

Originally Posted by dive (Post 5183242)
That works for local files, but not for streams.

http://s17.postimg.org/ibe7sgmjz/screenshot1.jpg

works for me on .pls streaming radio.

My installed files if that helps.

Code:

/usr/bin/mocp
/usr/lib
/usr/lib/moc
/usr/lib/moc/decoder_plugins
/usr/lib/moc/decoder_plugins/libaac_decoder.so
/usr/lib/moc/decoder_plugins/libflac_decoder.so
/usr/lib/moc/decoder_plugins/libmodplug_decoder.so
/usr/lib/moc/decoder_plugins/libmp3_decoder.so
/usr/lib/moc/decoder_plugins/libmusepack_decoder.so
/usr/lib/moc/decoder_plugins/libsidplay2_decoder.so
/usr/lib/moc/decoder_plugins/libsndfile_decoder.so
/usr/lib/moc/decoder_plugins/libspeex_decoder.so
/usr/lib/moc/decoder_plugins/libvorbis_decoder.so
/usr/lib/moc/decoder_plugins/libwavpack_decoder.so
/usr/share
/usr/share/doc
/usr/share/doc/moc
/usr/share/doc/moc/AUTHORS
/usr/share/doc/moc/README.Debian
/usr/share/doc/moc/README.gz
/usr/share/doc/moc/README_equalizer.gz
/usr/share/doc/moc/THANKS
/usr/share/doc/moc/TODO.gz
/usr/share/doc/moc/changelog.Debian.gz
/usr/share/doc/moc/changelog.gz
/usr/share/doc/moc/copyright
/usr/share/doc/moc/examples
/usr/share/doc/moc/examples/config.example.gz
/usr/share/doc/moc/examples/keymap.example
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/mocp.1.gz
/usr/share/menu
/usr/share/menu/moc
/usr/share/moc
/usr/share/moc/themes
/usr/share/moc/themes/black_theme
/usr/share/moc/themes/darkdot_theme
/usr/share/moc/themes/example_theme
/usr/share/moc/themes/green_theme
/usr/share/moc/themes/moca_theme
/usr/share/moc/themes/nightly_theme
/usr/share/moc/themes/red_theme
/usr/share/moc/themes/transparent-background
/usr/share/moc/themes/yellow_red_theme


dive 06-05-2014 10:10 PM

That image is very small. I tried it on a .asx and it didn't show the file in the browser.

rokytnji 06-05-2014 10:26 PM

Quote:

Originally Posted by dive (Post 5183295)
That image is very small. I tried it on a .asx and it didn't show the file in the browser.

Not small on my Iceweasel browser screen at all.

Everything I stream in mocp is .pls, not .asx.

dive 06-05-2014 10:29 PM

When I opened it again it's normal size. strange.

Currently compiling omxplayer to see if that's an improvement.

mocp wouldn#t really be useful for me as I'm looking for a better Pi alternative to mplayer for use with soma.

dive 06-06-2014 02:18 AM

Well, omxplayer doesn't even support alsa so that's out.

I've noticed that for local files the cpu usage is ~= 10% which is better, but streaming goes way up.

franzen 06-06-2014 05:31 AM

Quote:

Originally Posted by dive (Post 5183370)
Well, omxplayer doesn't even support alsa so that's out.

Sound is coming out somehow:
http://mike632t.wordpress.com/2013/0...-raspberry-pi/

dive 06-06-2014 07:19 AM

Yeah that's fine, but my Wolfson Audio Card SPDIF is alsa...

---------- Post added 06-06-14 at 12:20 PM ----------

Here's the first reply I had from mplayer mailing list:

Quote:

Did you try capturing with -dumpstream and then playing that file?
I doubt your local files are in WMA format, in which case the comparison
doesn't make sense.
Also cpu frequency scaling unless you have disabled it will result in
CPU usage numbers being completely misleading.
The commands "perf record mplayer ..." and then after it is finished
"perf report" will tell where all the CPU time is used.
Also, which MPlayer version you are using would be helpful information.
However with the ridiculously outdated CPU of the Pi that kind of CPU
usage is most likely as expected, as it doesn't even include NEON,
which causes issues for the data conversions required.
In addition if whatever distribution you uses uses "softfloat" instead
of "hardfloat" that is likely to cost you a significant amount of
performance, as well as if your MPlayer isn't compiled specifically
for it (runtime CPU detection is a mess and basically does not work
on ARM, as a result generic distribution binaries a generally useless
performance-wise).

rokytnji 06-06-2014 10:30 AM

Quote:

mocp wouldn#t really be useful for me as I'm looking for a better Pi alternative to mplayer for use with soma.
OK. As I listen to the live stream today using the

Quote:

MP3: 128k
saved as SBSW.pls

in mocp

dive 06-06-2014 10:32 AM

Yes but mocp has a gui. I need a simple player with no gui. By soma I mean the soma player that comes with slackware, not the radio station.

drmozes 06-06-2014 01:45 PM

Quote:

Originally Posted by dive (Post 5183208)
I'm finding mplayer using 20-40 % CPU when playing back most audio formats, streaming or local files, on my Rasp Pi.

ffplay is even worse (only tested local files).

The situation is the same when setting output device to 'null' so it doesn't seem to be hardware/soundcard related.

Any ideas?

I think this is to be expected since all of the maths is done in software rather than being offloaded to a FPU.

dive 06-06-2014 02:03 PM

Quote:

Originally Posted by drmozes (Post 5183670)
I think this is to be expected since all of the maths is done in software rather than being offloaded to a FPU.

Stuart, I guess that that is what was meant by the hard float/soft float issue that was mentioned in the reply from the mplayer mailing list?

I'm guessing that it is using soft, since when I tried compiling omxplayer I had to specifically set it to 'soft'. Is it something that is set in gcc and all compiled apps have to follow that, or can some apps be made to use a hard float? Does a Pi even have a math co-processor?

*Edit: well it seems that the Pi does have an FPU, question is how to use it: http://stackoverflow.com/questions/1...-compatibility

*Edit 2: I came across this on the forum: http://mindplusplus.wordpress.com/20...-raspberry-pi/

I may give that a shot or just put up with soft float...

gus3 06-23-2014 06:06 PM

Two questions, dive:

1. Did you get a VFP-enabled glibc/libm?

2. If so, did it help?


All times are GMT -5. The time now is 09:36 AM.