Active Topics

 


Reply
Thread Tools
ace's Avatar
Posts: 296 | Thanked: 80 times | Joined on Dec 2007
#1
I've been trying to optimize video playback on my N800 with OS2008. I noticed mplayer (1.0rc1-maemo.26.n8x0 and now 1.0rc1-maemo.27.n8x0 ) fails to use the dspmp3 audio decoder. It falls back to the libmad mp3 decoder, which runs on the main CPU, instead of the DSP, right?

I've even reflashed, on the chance I broke something, but it still doesn't work.

When I try to play a video with MP3 audio, or a MP3 file with mplayer (and verbose output), I get this:

Code:
==========================================================================
Trying to force audio codec driver family dspmp3...
Opening audio decoder: [dspmp3] MP3 audio pass-through for Nokia 770/N800 (fake decoder)
ADecoder preinit failed :(
ADecoder init failed :(
Trying to force audio codec driver family libmad...
Opening audio decoder: [libmad] libmad mpeg audio decoder
dec_audio: Allocating 4096 bytes for input buffer.
dec_audio: Allocating 9216 + 65536 = 74752 bytes for output buffer.
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [mad] afm: libmad (libMAD MPEG layer 1-2-3)
==========================================================================
Am I missing a package, or what?
 
Posts: 503 | Thanked: 267 times | Joined on Jul 2006 @ Helsinki
#2
Originally Posted by ace View Post
I've been trying to optimize video playback on my N800 with OS2008. I noticed mplayer (1.0rc1-maemo.26.n8x0 and now 1.0rc1-maemo.27.n8x0 ) fails to use the dspmp3 audio decoder. It falls back to the libmad mp3 decoder, which runs on the main CPU, instead of the DSP, right?
Right. That's because libmad is faster in OS2008. Any usage of dynamic DSP tasks (such as dspmp3) forces cpu frequency drop from 400MHz to 330MHz in the default kernel from OS2008. This is bad for performance. It is possible to modify and recompile kernel to keep cpu running at 400/133 (DSP is restricted to 133MHz only, but ARM core can run at full speed), but that's a solution for hackers

In addition, dspmp3 does not work well in OS2008 (seeking is unreliable).
 

The Following User Says Thank You to Serge For This Useful Post:
ace's Avatar
Posts: 296 | Thanked: 80 times | Joined on Dec 2007
#3
That makes sense. It's unfortunate that there's no easy fix.
 
Benson's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#4
Any usage? That seems decidedly suboptimal; oughtta be a way to weight both DSP and CPU usage in the scaling governor.
 
ace's Avatar
Posts: 296 | Thanked: 80 times | Joined on Dec 2007
#5
I've played around with this further, and I think I was able to get MP3 playback on the DSP while still running the main CPU at full speed.

I had to set the CPU frequency scaling strategy to null, though. (via "echo null > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor") It somewhat of a crude solution, but it's easier than compiling a kernel.
__________________
[SIGPIC][/SIGPIC]
 
Benson's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#6
I would have tried performance; I didn't know null was an option. (And it might be that performance also has the "cleverness" to drop down for DSP, but I think it just locks in the maximum frequency.) But either way, that's crude indeed. Someone ought to make an enhanced governor that figures out what's best at the moment; in some cases (provided adequate buffering), switching back and forth between 333 and 400 would really be the best option.

Still, it could work, for playing videos, where it'll be ramped up anyway, to ramp it up, run dspmp3 on the DSP, and then restore automatic control when done... Bundyo's build, at least, has dspmp3 support, sou you could do this:
Code:
echo null > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
mplayer -ac dspmp3 <other options>
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Don't leave that one paused, though!
 
ace's Avatar
Posts: 296 | Thanked: 80 times | Joined on Dec 2007
#7
Originally Posted by Benson View Post
I would have tried performance; I didn't know null was an option.
"performance" doesn't work.

Even when the scaling governor was set to "null", it still wanted to limit the CPU speed. When playing a MP3 on the DSP, "scaling_max_freq" drops to 330000 (330Mhz), but "scaling_cur_freq" remains at 400000 (400Mhz). "null" is disobedient
__________________
[SIGPIC][/SIGPIC]
 

The Following User Says Thank You to ace For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 03:28.