View Single Post
Tomaszd's Avatar
Posts: 284 | Thanked: 498 times | Joined on Jun 2009 @ Poland
#333
Originally Posted by Serge View Post
Hello,

Regarding A2DP performance on N800/N810. Using the latest diablo firmware, a2dp-support_0.9_all.deb package and nothing else, we get the following profiling statistics (Signed 16 bit Little Endian, Rate 44100 Hz, Stereo WAV file played with aplay for 100 seconds), the results are consistent across multiple runs, CPU was set to run at 400MHz:



CPU usage is split between kernel and bluez SBC encoder more or less evenly and the bluetooth driver consumes quite a noticeable share of cpu time. Applying attached patch (tweak of UART FIFO buffer settings) to the kernel reduces CPU usage in the bluetooth driver. The fix for UART FIFO stuff for the bluetooth is available in pre-alpha fremantle kernel which was released to the public. I just did some tweaks which should work better on N800/N810, but of course somebody else can probably improve it more (reading OMAP1 and OMAP3 documentation about UART and "interpolating" it for OMAP2). Even better optimization would be to try using DMA in the bluetooth driver, but that may be a bit harder.

With the patch applied, the profiling statistics changes to the following:


CPU usage in the kernel gets lower and there are less interrupts generated. On the other hand, bluetooth transfer speed may become a little bit smaller.

As for the SBC codec alone, it takes ~7% of CPU on N800/N810. With ARMv6 SIMD optimizations (which are still to be done) and the latest SBC encoder from upstream bluez project, I expect that this time might get halved.

Alternatively, DSP can be used for SBC encoder (port to it is done by lardman). But ARM<->DSP communication overhead is also kind of can of worms and may (or may not) kill the benefits of offloading some work to DSP.
To anyone who wants to know: I've added Serge's patch to kernel-source-diablo of Mer, it's now in N8x0:Testing, should be available in the next release of Mer (0.15).
 

The Following 3 Users Say Thank You to Tomaszd For This Useful Post: