Thanks to Joni Valtanen the Media Player should now play Oggs without restarting the device.
As another minor change I added NoDisplay to ogg-support’s MP’s .desktop file to prevent it from showing in the menus.
Maemo related projects
Thanks to Joni Valtanen the Media Player should now play Oggs without restarting the device.
As another minor change I added NoDisplay to ogg-support’s MP’s .desktop file to prevent it from showing in the menus.
I added initial support for the built-in Media Player. It’s untrivial to get everything working properly as the FileManager, the Metalayer Crawler, and the Media Player are all close source applications and their behaviour is not really documented anywhere.
The change log:
Known issues:
The Crawler did fill in the artist etc. for my ogg files at one point, but I don’t know why. If you have any hints for these issues, I’m all ears :)
PS. The MP now plays oggs with Theora video and Vorbis audio too :)
I’ve been wanting to run things on OMAP‘s DSP processor since the day I tested an OMAP1510 development board some years ago. Finally after a Proof of concept G.711 dsptask mail by Simon Pickering I decided to cut’n’paste that and try.
I knew the Speex had already been ported to the DSP (TMS320C55) used by OMAP1 (770) and OMAP2 (n800) so I started porting it to the DSP Gateway to be able to use it in my n800.
The DSP Gateway’s DSP tasks are seen as /dev/dsptask/<taskname>
devices on ARM side and are interacted with read, write, and ioctl calls. Very linux stylish and convenient in my opinion. On the DSP code one struct defines callbacks for these calls. The code overhead on DSP side is some tens of lines.
Speex has speex_alloc
functions that can be overwritten if the default memory allocation is not suitable. In the existing DSP port these were overwritten with functions using preallocated global char arrays that are used for all allocations, freeing is not possible. The DSP char is 16 bits as is int. The long is 32 bits and a pointer is 23 bits. Long long is 40 bits. I had some problems with calculating with pointers (casting a pointer to long didn’t produce valid looking value) in the existing implementation so I rewrote the allocation functions to use arrays and indexes. Also the existing implementation printed pointer values as %x which seemed to print completely different values than %p. I did use dbg() however, not fprintf.
The dbg() prints will be shown in dmesg or syslog on the ARM side if the kernel is compiled with mbox debug. The n800 stock kernel is not, but it’s almost trivial to compile a kernel of your own. My kernel with mbox debugs and built-in ext3 is here.
Other than the allocation functions there was not much to port, couple of functions calling the speex’ init and encode functions. I did have an odd problem though: the DSP seemed to jam after some tens of seconds and the DSP kernel was rebooted. After I added poll_disable(task)
in my encoding callback function, the jamming was gone. The function will disable the polling for 10 seconds. Afaik, that should be called only if the completion of the function takes more that 10 seconds, which it doesn’t.
My speex patch against the git head is available, if somebody wants to test it. There can be some weirdness as this is my first test with the DSP stuff and I don’t even know how to use the git ;)
If my measurements are correct it takes roughly 40 ms to encode one 20 ms frame without compiler optimizations. With -o3 it takes a bit over 20 ms. The speex is meant to be portable and has a header defining some math functions. The functions are ported to different CPUs like ARMv5 and Blackfin. Maybe some DSP guru quickly ports those to the TMS320C55 too? :)
I think the best place for DSP information for the tablets is in maemo.org wiki as I hope it will be kept up to date with the latest projects and tweaks. One thing to be added there would be a note about the skeleton page. I used the Active Block Receiving and Active Block Sending.
The Navigator application menu has a new big look. I’m sure some people will love it and some hate it, as usual. The menu behaviour seems a bit odd, like it remembers my last position in the menu when I reopen it, but is buggy.
Some of the old apps work, some not. I could get screen shots with my screen grabber, I could play OGGs with kilikali but although evince started up, it just jammed there. Mirage didn’t even start. And I couldn’t find File Manager from anywhere. Opera works OK when started from the application menu but the Hildon Desktop crashes when I try to open the Browser menu from Navigator. The most important app, osso-xterm, luckily works :)
Connectivity (wlan, bt, usbnet) seems to work.
Power saving, on the other hand, does not. Or at least for some reason the battery didn’t last even for a day when it lasts easily several days on the latest official release. I might have had the usbnet running though which can affect the situation.
I tried Sardine long time ago on my n800 and didn’t get it running. Now Maemo 4.0 Chinook alpha SDK is released and I decided to try again. I want to have a working n800 always with me, so I put the Chinook on the second partition of external mmc (first one is still a normal vfat for OGGs etc).
I started by creating a new rootfs on mmc based on my current flash rootfs. I roughly followed the info in HowToBootRootFSFromMMC in Maemo wiki.
I installed wget, downloaded and extracted gnu tar and used it to create a copy to mmc.
apt-get install wget
wget http://repository.maemo.org/pool/maemo3.2/free/binary/tar_1.14-2.1osso_armel.deb
dpkg -x tar_1.14-2.1osso_armel.deb /root/tar
mkdir /mnt/dev-rootfs/
mount /dev/mmcblk1p2 dev-rootfs/
mount -t jffs2 /dev/mtdblock4 /mnt/rootfs/
/root/tar/bin/tar cf - -C /mnt/rootfs/ . | /root/tar/bin/tar xvf - -C /mnt/dev-rootfs/
Next thing was to upgrade the mmc rootfs to Sardine. This time I followed SardineGettingStarted in Maemo wiki.
I chrooted to new rootfs since upgrading a running rootfs would be next to impossible:
chroot /mnt/dev-rootfs/ /bin/sh
mount -t proc proc /proc
mount -t sysfs sysfs /sys/
First I upgraded my current stuff. I had some problems with fmradio package, so I just removed it:
apt-get remove fmradio
apt-get update
apt-get upgrade
I had to export osso-af-startup version 1.46-2 from svn, compile and install it manually because the version in Sardine repo had a dependency to non-existent osso-product-info package. It’s downloadable from here.
I added the Sardine repo to my sources.list:
#maemo:name Sardine
deb http://repository.maemo.org/sardine unstable main non-free
Then I upgraded to Sardine nicely with apt-get (dbus tried to install /var/run directory conflicting with ssh..):
apt-get update
apt-get install hildon-application-framework
apt-get upgrade
dpkg --force-overwrite -i /var/cache/apt/archives/dbus_1.0.2-0osso10_armel.deb
The current Sardine repo seems still to have the same issue with maemo-launcher (see bug 952) that failed my first test with Sardine, but this time it’s already fixed in svn. So I exported maemo-launcher version 0.23-1 from svn, compiled and installed (downloadable from here). I installed the new missing dependencies with apt-get -f install
.
Clean up and exit:
umount /proc/
umount /sys/
exit
Bootmenu is a must to conveniently choose which rootfs to boot.
Installation is pretty straightforward:
cd /root
wget http://fanoush.wz.cz/maemo/initfs_flasher.tgz
tar zxf initfs_flasher.tgz
cd initfs_flasher
./initfs_flash
Before the flashing part, I created a bootmenu.conf to include my chinook rootfs and my third rootfs. The default bootmenu is normally sufficient.
Reboot.
I had trouble getting the Chinook to boot up. I got the Nokia logo and then a reboot. I booted to my flash rootfs, chrooted to mmc and installed syslog. Then I rebooted to mmc and then back to flash rootfs and examined the /var/log/syslog
on mmc. It revealed the maemo-launcher bug.
Lesson learned again: syslog is a must to have in n800 for debugging different issues.
Now I got the Chinook booting, without a theme though. After I said twice no to “Restore backup from mmc?” question and cancelled the phone wizard, I got an ugly desktop without theme. Selecting the Plankton theme fixed this issue.
Now I have working Chinook with my WLAN APs configured and my extra apps installed. Kilikali still plays my OGGs without problems :)
The 0.2 release includes dependency to the Speex (libspeex1 and the corresponding gst plugin in gstreamer0.10-plugins-good-kulve). The Speex is compiled from SVN trunk.
I made some light (just looked the numbers, no playback) performance tests. The two tables below show how much time in seconds it took to encode a 60 second audio clip (8000Hz, mono, 16bit). The first column shows the complexity used (scale is 0-10) and the rest of the columns show the encoding time with different qualities (0-10).
no VBR, no DTX, no VAD:
c/q 1 2 3 5 7 0 12 8 10 14 11 1 12 9 10 15 11 2 13 8 12 16 16 3 13 10 15 22 19 4 13 10 16 23 20
VBR, DTX, VAD:
c/q 1 2 3 5 7 0 10 10 11 14 16 1 9 10 13 14 16 2 10 12 13 15 18 3 11 13 15 19 22 4 11 13 17 20 24
The next table shows the difference between fixed point and floating point versions.
c fixed float 0 11 17 1 11 18 2 13 20 3 19 29
So, use the fixed point Speex API, if possible (the gst doesn’t use it). If using the floating point API, the libspeex will make the conversion.
For VoIP a good quality setting could be quality 7, complexity 2 and VBR, VAD, and DTX on.
The Internet Tablets don’t support Ogg natively, so there has been some open source projects to add it. I made yet another one.
Features:
See project page, home page or install it (conflicts with kilikali-codecs-meta).
For an open source player, see kilikali.
Playing audio on n800 on ARM side gets easily interrupted when doing other tasks at the same time. With Maemo nicer you can give your application any nice value. Running audio player with near maximum priority removes most of the annoying hickups, not all though. This works nicely for processes requiring certain constant amount of cpu time (like decoding real-time audio), but for processes taking all the cpu they can take, this is probably a bad idea.
NOTE! Maemo nicer installs a suid root binary for renicing any process.
For usage example, see kilikali‘s startup script.
Click here for single click install.
We released a beta version of kilikali, since it finally played a whole album without crashing ;) Kilikali plays e.g. oggs, but since the n800 doesn’t support oggs natively there’s a separate package set to add ogg support as well.
Transcode DVB-T with VLC on mediaserver (low resolution because of low(?) CPU):
vlc --program=241 dvb: --dvb-frequency=674000000
--dvb-srate=6900000 --dvb-transmission=8
--dvb-guard=8 --dvb-hierarchy=-1
--dvb-bandwidth=8 --sout #transcode{width=128, height=96, vcodec=theora, vb=300, acodec=vorb, ab=96}: std{access=http, mux=ogg, url=example.server.fi:8000}
Watch stream on N800:
gst-launch-0.10 gnomevfssrc location=http://example.server.fi:8000 ! oggdemux name=demuxer ! {queue ! theoradec ! xvimagesink} {demuxer.!queue ! vorbisdec ! audioconvert ! dsppcmsink}
Tested with VLC 0.9.0 and self compiled theora, ogg, vorbis libs. The transcoding parameters are just the ones I got first working :)
EDIT: It seems that I almost reinvented the wheel again. See MoRpHeUz’s blog (especially this) for more details.