Reply
Thread Tools
Benson's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#31
Originally Posted by Mara View Post
Since it uses DSP does it also lock the ARM core speed to 330MHz? (Since with that ARM core speed the DSP can run at full clock speed.)
It will that, unless you tweak stuff (writing files in /sys/*, or in the kernel) to permit running at 400/133 rather than capping at 330/220; if the DSP task can run smoothly at 133, that would increase the available CPU cycles.

(I've heard a rumor that the voltages are the same for 400 and 330, and that 400/133 is actually lower power consumption because of the lower clock on the DSP... I don't know how true that is.)

The /sys/ tweak, unfortunately, can't simply remove that cap; it just locks it in 400/133 regardless, until you set it back to automatic control. By tweaking the kernel (and recompiling), though, it can be set to scale without the DSP-usage cap. I think qwerty12 has done this, to name one...


Oh, BTW, Igor's slides on this. Slide 15 has the OP table, but the whole thing makes for a good read.

Last edited by Benson; 2008-07-07 at 23:07. Reason: Added link & info
 
Posts: 2,102 | Thanked: 1,309 times | Joined on Sep 2006
#32
With regard to the quality of A2DP/SBC, I'm still not sold on it. I do wonder if this is because the Linux implementation is not optimal though (e.g. I can't see that it does variable bitpool size between frames, which is allowed for by the spec). It has some odd aural artifacts, some songs sound odd (they go faster and slower, only very slight but can be heard), I don't know where this problem stems from, but I'd like to fix it if I can work out how.

On to the DSP task. I've no idea of DSP power consumption, it would be nice to see some Nokia documents about this... anyone...?

My hope it that we can either:
1) reduce power consumption while just listening to mp3s by using a hopefully more efficient DSP task to take load off the ARM (and drop the ARM speed). It will take testing to see if this is the case
2) Reduce the load on the ARM so it can do more useful things (like XVid decoding). This really requires that we push the ARM back up to full speed, and the DSP down to 133MHz. I'll do myself a patched kernel asap and see whether the task can run at this speed. If not, then I'll try to make it run faster. Patches and help welcome of course

And last but not least, I did it just for the hell of it
 

The Following 3 Users Say Thank You to lardman For This Useful Post:
Mara's Avatar
Posts: 1,310 | Thanked: 820 times | Joined on Mar 2006 @ Irving, TX
#33
Thanks Benson for some insights.

I was wondering what tasks the DSP (or ARM core) needs to do when supporting A2DP? THe MP3 (or whatever) decoding from file to audio is done with DSP in "normal" mode (headphones or speakers). With A2DP, does it need to encode it again into "A2DP compatible" stream? Or is it so that if the output is not going to speakers or headphones it is not supported function, and therefore it has to be done using its own decoder using "raw CPU horsepower"?

I propably could have found some answers by googling around... but thought this is easier...
 
Posts: 2,102 | Thanked: 1,309 times | Joined on Sep 2006
#34
Yes, in theory. In practise it depends how well it is implemented. There may still be a lot of work left for the CPU...
The ARM only has to copy data to and from a buffer, all of the SBC encoding is done on the DSP. Bluez and probably mplayer + mad decoder do of course still run on the ARM so it's not left twiddling its thumbs

or if the DSP coding is not well optimized it has to work hard and use about as much power than the ARM core would...
I don't have access to power consumption figures, so this may be the case. No idea.

P.S. I'm thinking of converting the current SBC encoder (the ARM one) to use floating point (i.e. VFP) and see how fast that works. I'll keep you informed as I progress.
 

The Following 2 Users Say Thank You to lardman For This Useful Post:
Posts: 2,102 | Thanked: 1,309 times | Joined on Sep 2006
#35
I was wondering what tasks the DSP (or ARM core) needs to do when supporting A2DP? THe MP3 (or whatever) decoding from file to audio is done with DSP in "normal" mode (headphones or speakers). With A2DP, does it need to encode it again into "A2DP compatible" stream?
Yes, the PCM stream (which comes from the MAD decoder built into mplayer) feeds it with PCM data which it converts into an SBC stream for output to the headset.

Note that we, unfortunately, can't do mp3 decoding on the DSP and then use those data (as they are fed straight to the audio codec for output). There is hope for the future with OpenMAX, but for the time being we need to use an ARM-based MP3 decoder (or write ourselves a DSP-based one which passes the data back to the ARM side for re-use.
 

The Following User Says Thank You to lardman For This Useful Post:
Benson's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#36
Ah... good point WRT mp3 on DSP; I'm used to mp3 on ARM (mpd is libMAD, too), so I didn't even think of that. I hadn't even realized that the DSP MP3 codec didn't send it back to ARM anyway.
(I had assumed it did, and that the ARM was responsible for routing it to whichever output(s)...)
So I learned something today.
 
Posts: 1,097 | Thanked: 650 times | Joined on Nov 2007
#37
Originally Posted by lardman View Post
Install Johnx's a2dp deb (which is a bunch of scripts to save you the hassle of tweaking the config files yourself. Many thanks Johnx, I definitely use them), you will then be able to use a2dp (with the encoding done by the main ARM processor).

If you want the encoding to be done by the DSP rather than the ARM, then (i.e. as well as Johnx's a2dp deb) install my sbcenc "package" (tarball + deb + installation script) and this will install the DSP task, config data and a patched version of bluez-utils which uses the DSP rather than doing the SBC (the codec used for a2dp audio) encoding on the ARM.

Hope that makes sense
Thanks for the explanation lardman - I had the same query as tz1 - what happens after I install your package ? Now thats clear.

Another question though - so A2DP will still be limited using mplayer as the output program - just as Johnx's hack was applicable for ...
Its not as if any audio program will now be able to support a2dp.

Is that right ?
 
Posts: 2,102 | Thanked: 1,309 times | Joined on Sep 2006
#38
Any program which uses Bluez to perform the SBC encoding will use the DSP if you install the packages from dsp-sbc. So mplayer will work, as will any other program which supports A2DP (i.e. most of the 3rd party media players - Canola, UKMP, etc.)

Iirc, there is also a GStreamer component in there to do SBC encoding, so this should be useable with the media player (will need some fiddling with the media player conf settings, I've no idea how), or you could make your own pipeline in a terminal.
 
Posts: 207 | Thanked: 31 times | Joined on Apr 2008
#39
Do anybody know to use headphone buttons?
Line from my syslog when I press pause:
Jul 8 12:28:03 Nokia-N810-23-14 audio[9546]: Received AT+CKPD=200

Last edited by svs57; 2008-07-08 at 08:31.
 
Benson's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#40
Any program that can do alsa output, I think...
 
Reply


 
Forum Jump


All times are GMT. The time now is 13:38.