Nokia 770/N800

Main Page

Sharp Zaurus

Nokia 770/N800

Furrow's Law

Rockets

 

Right, I've decided a bit of a tidy-up is in order (prompted by this of course: http://maemo.org/news/announcements/view/1192708879.html  :-) )

My main interest is in DSP programming for the Nokia tablets. I taught myself as I thought it might be interesting, and you never know someone might even pay me money one day :).

I do also have some side interests, one of which is Jazelle. Basically everything I'm interested in is to do with optimisation (of available resources, etc.) on the 770/N800. To this end I do also have an interest in the IVA and the PowerVR MBX.

 

DSP Programming

Here's the Maemo wiki page I wrote a fair bit of about DSP Programming:  Some DSP notes here

If you're interested in having a go, then follow the instructions and get your toolchain setup.

I've also sent a fair few posts to the maemo-developers mailing list regarding the DSP and its use on the 770/N800. A search of the mailing list is probably your best bet as there are lots.


All of my code is located here: http://people.bath.ac.uk/enpsgp/nokia770/dsp/
This is mainly for the N800, but (with a recompile of the DSP modules as they need to be linked against the DSP kernel, which is different) they should work fine on the 770.

I started with a proof of concept G.711 decoder. This works, after a fashion - the start of the output is correct, but then goes wrong. I wasn't too bothered about this (I think it's down to the fact that the buffer on the DSP side will be padded as the DSP uses 16bit bytes) as it proved that one could compile and use a dsp task which actually does something.

I should add here that the big issue before this, was trying to figure out the DSP gateway and how to use it. The docs are ok, but could do with improvement - if anyone from Nokia is interested I'd be happy to add my input. Regarding the docs, don't try to use the "dspctl start/load" business to debug as it only works for static tasks. The tasks on the Nokia machines are linked against the DSP kernel and are dynamically loaded. Instead, you should do some or all of the following:

Find the PID of dsp_dld and kill it, quickly (if you're not quick you'll get a reset of the tablet) start it again in a terminal window using the -p switch so you can see its output (i.e. dsp_dld -p). You probably should be able to see some output is you run syslogd, but I find this is a bit hit and miss (possibly because of the way mu syslog.conf is setup). Actually you can probably just run "dsp_dld -p" in a terminal and it will stop the existing one and restart with output for you to see.

The other thing to look at is the dmesg output. Preferably after recompiling your kernel to manually enable one entry in  .config - CONFIG_OMAP_DSP_MBCMD_VERBOSE=y

Some more recent bits and bobs I've done:

Show how memory can be shared between the DSP and ARM.

Show how to use the framebuffer on the 770 

(there is a demo_fb program, but this doesn't work on the 770 as the framebuffer has already been exported).

Things I'm doing at the moment

Tremor (OGG Vorbis) decoder DSP task

I was sent some old Neuros code for the C54 (I think I can distribute this, but would prefer a clean-room implementation really). I decided to base my task on this, and set about chopping it up so the DSP asks for a packet and the ARM reads and packages it up out of the OGG stream. This code is pretty complete (i.e. it compiles and it's about how I think it should look structure-wise), however it segfaults the DSP kernel. Debugging is a bit hard on the DSP, so I'm planning to compile both sides on the ARM and debug it on there with some glue to emulate the DSP gateway.

With that said, the MP3 task below uses a different method and so I've started writing a version to use this a single thread and semaphores using the Tremor-lowmem-nobyte code (this has the advantages that I can certainly distribute the code and it's also cleaner than the Neuros-specific code)

MP3 decoder task

Siarhei Siamashka/Serge/ssvb of MPlayer fame contacted me and sent me a copy of this DSP code he'd found. He's interested in producing an mp3 decoder task that doesn't have some of the issues of the Nokia supplied one and its requirement to use GStreamer (e.g. this and this).

I said I'd take a look at it and I have done so. It uses an interesting strategy that I'd thought would not work. All of the examples (except for the demo_fb I now see) are setup to accept data in a wdsnd() or bksnd() function which is called when data are available for the DSP to handle. This looked to me like cooperative multitasking. Add to that the fact that the DSP is polled every 10s or so and if any task doesn't respond the DSP seems to be reset, and I thought we were dealing with a single threaded process that ran each task sequentially.

But this mp3 task starts a thread to do the processing and then sits there in the usual way waiting for data to be provided by the ARM. The usual task and the decoder thread synchronise and ask for data using semaphores. This all sounds wonderful - should mean that the decoder thread can be reasonably similar to the usual ARM-side code. Except it doesn't want to run atm. I'm in the process of stripping the code away to work out what exactly is causing the problems. Should be reasonably simple to do, just time consuming.

Scaling and colourspace conversion task (for testing with Mplayer)

This is a recent thing, which was why I did the framebuffer proof of concept. The plan is to produce a task that does colourspace conversion and arbitrary scaling encapsulated in a library so Siarhei can use it in MPlayer.

Things I'd like to do

Some Octave functions - things like FFT for example in an OCT function. This was the first thing I wanted to do and I've never got round to it.

JPEG acceleration (this may be DSP, or perhaps ARM asm)

SBC (A2DP) encoder for use with Bluetooth Stereo headphones - are you doing this Nokia...?

Jazelle


Some Jazelle notes here

(these may be out of data now)

and lots of posts to the Maemo developer's list too.

Some more bits and bobs going on here behind the scenes, need to get it written up...

Python Calculator FrontendpyCalc

Octave


Link to vfp compiled file.
Note about ATLAS (CPU transparency)

 gnuplot


Link to vfp compiled file
I'd quite like to create a maemo 'terminal' for gnuplot. All in the fullness of time....

Yacas

 


 Link to file

 Benchmarking


Link to dir

Some floating point and other numerical benchmarking

Note that from the results is can be seen that libm is probably not compiled with vfp enabled.