Pandora [Solved] Audio players + NEON / DSP ?


Magic Sam

Forever Homebrew
Joined
Aug 10, 2007
Messages
2,544
Age
42
Location
Yuzu onsen
Hi all :)

I bought a new music album some days ago, which is encoded in 96 KHz FLAC. I just tried to listen to it with @canseco 's QMMP, and CPU usage immediately went up to ~85%, leaving very little resources available for anything else. Music started to stutter a lot when I tried to browse the web with @ptitSeb 's Otter or read my emails with @canseco 's (again ;)) Claws Mail, so I stopped doing that and focused on listening to the music, which is not the definition I have of a multi-tasking system :p

I know this is a rather silly question, and that's always easier said than done, but couldn't audio players take advantage of NEON and / or DSP in order to off-load part of their burden from the CPU ?

Cheers, Magic Sam
[doublepost=1481054873,1481054103][/doublepost]Hi again,

From FLAC webpage:
Also, there are several places in the libFLAC code with comments marked with "OPT:" where a #define can be changed to enable code that might be faster on a specific platform. Experimenting with these can yield faster binaries.

Is it worth a look ?

Cheers, Magic Sam
 
Try to profile a bit at least first. Launching a "sudo perf top" on a ssh terminal while some music is playing can gives a few hint...
 
If it's that slow it's probably using floating point for samples, where both Cortex-A8 and the DSP aren't that great.
You could 'nice' the other processes (can be done with top) to give the audio player priority.

Edit: I've downloaded random 96kHz sample from http://www.2l.no/hires/index.html and mplayer uses ~8% CPU while QMMP ~18%.
 
Last edited:
Hi @ptitSeb :)
Try to profile a bit at least first. Launching a "sudo perf top" on a ssh terminal while some music is playing can gives a few hint...
Yes, that's what I'm planning to do ASAP. I created this thread in a hurry yesterday, and didn't have time to perform any tests yet.

Cheers, Magic Sam
 
Hi all :)

@ptitSeb : sorry for the late reply...
49.30% libqmmp.so.1.1.5 [.] iir
4.11% libFLAC.so.8 [.] 0xa8bc
3.60% libm-2.9.so [.] lrintf
2.87% libqmmp.so.1.1.5 [.] AudioConverter::fromFloat(float co
2.42% libqmmp.so.1.1.5 [.] ReplayGain::applyEffect(Buffer*)
2.34% libasound.so.2.0.0 [.] 0xa97b4
2.14% perf [.] 0x37630
2.06% libQt5Gui.so.5 [.] 0x2b2504
1.85% libskinned.so [.] fft_perform
1.67% libc-2.9.so [.] memcpy
1.18% libc-2.9.so [.] 0x663c4
1.14% libqmmp.so.1.1.5 [.] AudioConverter::toFloat(unsigned c
1.03% [kernel] [k] __schedule
0.73% [kernel] [k] __do_softirq
0.68% [unknown] [.] 0xffff0fe4
0.66% libbfd-2.21.1.so [.] 0x74fd0
0.57% [kernel] [k] omap3_enter_idle
0.49% libflac.so [.] flac_callback_write(FLAC__StreamDecoder co
0.44% Xorg [.] 0x14f524
0.37% libQt5Widgets.so.5 [.] 0xe7704

Cheers, Magic Sam
 
Well, as you can see, QMMP itself take 50% of the CPU, with the "iir" function alone. Do you have an active Equalizer or something like that?
 
@ptitSeb : I don't think so, but I'll double check.

Does IIR mean Infinite Impulse Response ?

I thought libFLAC would have been more resource intensive, and would have benefited from NEON / DSP optimizations.

I guess I was wrong (again...).

Cheers, Magic Sam
[doublepost=1481468208,1481467924][/doublepost]@ptitSeb : equalizer was indeed ON... :oops: :$

With it turned off, CPU usage is down to ~40%.

Sorry for the noise...

Cheers, Magic Sam
 
Back
Top